فهرست منبع

Merge branch 'dev-1.1.1' of https://172.16.32.165/hurugang/thmz_system into dev-1.1.1

hurugang 3 سال پیش
والد
کامیت
397fd22efb

+ 1 - 1
src/main/java/cn/hnthyy/thmz/controller/mz/MzPharmacyController.java

@@ -1095,7 +1095,7 @@ public class MzPharmacyController {
     @UserLoginToken
     @RequestMapping(value = "/getPrintFlag",method = RequestMethod.GET)
     public Map<String,Object> getPrintFlag(@RequestParam("patientId") String patientId,@RequestParam("times") String times
-            ,@RequestParam("orderNo") String orderNo){
+            ,@RequestParam("orderNo") Integer orderNo){
         Map<String, Object> resultMap = new HashMap<>();
         try {
             int printFlag = mzChargeDetailService.queryPrintFlag(patientId, times, orderNo);

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzChargeDetailMapper.java

@@ -1103,5 +1103,5 @@ public interface MzChargeDetailMapper {
      */
     @Select("SELECT max(isnull(print_flag,0)) as print_flag FROM mz_charge_detail WHERE patient_id=#{patientId} and times=#{times} and order_no=#{orderNo} ")
     Integer selectPrintFlag(@Param("patientId") String patientId, @Param("times") String times
-            , @Param("orderNo") String orderNo);
+            , @Param("orderNo") Integer orderNo);
 }

+ 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);
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/his/mz/MzChargeDetailService.java

@@ -437,5 +437,5 @@ public interface MzChargeDetailService {
      * @param orderNo
      * @return
      */
-    Integer queryPrintFlag(String patientId, String times, String orderNo);
+    Integer queryPrintFlag(String patientId, String times, Integer orderNo);
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -2058,7 +2058,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
     }
 
     @Override
-    public Integer queryPrintFlag(String patientId, String times, String orderNo) {
+    public Integer queryPrintFlag(String patientId, String times, Integer orderNo) {
         return mzChargeDetailMapper.selectPrintFlag(patientId,times,orderNo);
     }
 

+ 6 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfWardPrescriptionServiceImpl.java

@@ -242,7 +242,7 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
                 }
                 ypZyPatient.setOrderDate(yzYpZyOrder.getOccTime());
                 ypZyPatient.setSectionCode("");
-                ypZyPatient.setAcctSign(yzYpZyOrder.getAmount()==0?"2":"0");
+                ypZyPatient.setAcctSign(yzYpZyOrder.getAmount()>=0?"2":"0");
                 ypZyPatient.setOutSeri(i+1);
                 ypZyPatient.setKeeper(userCode);
                 ypZyPatient.setTotalFlag("");
@@ -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()))){

+ 5 - 3
src/main/resources/static/js/common/socket-com.js

@@ -87,13 +87,15 @@ function dispensingMessage(data) {
         });
         if (chk_value != '') {//自动打印
             for (var i = 0; i < data.orderNos.length; i++) {
+                var orderNo = data.orderNos[i];
                 if(chk_value == 1){
                     $.ajax({
                         type: "GET",
+                        async: false,
                         data: {
                             patientId: data.patient_id,
                             times: data.times,
-                            orderNo: data.orderNos[i]
+                            orderNo: orderNo
                         },
                         url: '/thmz/getPrintFlag',
                         contentType: "application/json;charset=UTF-8",
@@ -101,12 +103,12 @@ function dispensingMessage(data) {
                         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
                         success: function (res) {
                             if (res.code == 0 && res.printFlag == 0) {
-                                printPrescription(data.patient_id, data.times,data.orderNos[i],1);
+                                printPrescription(data.patient_id, data.times,orderNo,1);
                             }
                         }
                     });
                 }else if(chk_value == 2){
-                    printDrugList(data.patient_id, data.times,data.orderNos[i]);
+                    printDrugList(data.patient_id, data.times,orderNo);
                 }
             }
         }

+ 1 - 0
src/main/resources/static/js/yf/pharmacy_warehouse.js

@@ -217,6 +217,7 @@ function saveDrug(data) {
         url: '/thmz/saveYpInDetlYf',
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
+        async: false,
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         data: JSON.stringify(data),
         success: function (res) {