Browse Source

区分基数药和大输液药单

WANGJIALIANG 3 years ago
parent
commit
37f8d5d59d

+ 10 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/zy/YpZyPatientMapper.java

@@ -4,6 +4,7 @@ import cn.hnthyy.thmz.entity.his.zy.YpZyPatient;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 import java.util.Map;
@@ -67,4 +68,13 @@ public interface YpZyPatientMapper {
             " #{drugFlag} , #{paySelf} , #{groupNo} , #{confirmTime} , #{serial} ," +
             " #{doctorName} , #{zySerialNo} , #{pageType} , #{jyFlag})")
     int insertYpZyPatient(YpZyPatient ypZyPatient);
+
+    /**
+     * 更新住院病人发药记录
+     * @param ypZyPatient
+     * @return
+     */
+    @Update("update yp_zy_patient set page_no=#{pageNo},keeper=#{keeper},confirm_time=#{confirmTime},doctor_name=#{doctorName}" +
+            ",page_type=#{pageType},jy_flag=#{jyFlag} where act_order_no = #{actOrderNo} and charge_code = #{chargeCode} and inpatient_no=#{inpatientNo}")
+    int updateYpZyPatient(YpZyPatient ypZyPatient);
 }

+ 5 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfWardPrescriptionServiceImpl.java

@@ -286,7 +286,11 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
                 }
                 ypZyPatient.setSupplyCode(supplyCode);
                 ypZyPatients.add(ypZyPatient);
-                ypZyPatientMapper.insertYpZyPatient(ypZyPatient);
+                if(yzYpZyOrder.getPageClass().equals("4") || yzYpZyOrder.getPageClass().equals("3")){//基数药和大输液
+                    ypZyPatientMapper.updateYpZyPatient(ypZyPatient);
+                }else{
+                    ypZyPatientMapper.insertYpZyPatient(ypZyPatient);
+                }
                 if(ypZyPatient.getAmount() != 0){
                     if(1 != ypBaseYfMapper.updateStockAmount(ypZyPatient.getChargeCode(), ypZyPatient.getSerial()
                             ,ypZyPatient.getGroupNo(), -ypZyPatient.getAmount(), BigDecimal.valueOf(-ypZyPatient.getAmount() * ypZyPatient.getRetprice()))){