Ver código fonte

修改药品按处方号打印

WANGJIALIANG 4 anos atrás
pai
commit
5b84fc6896

+ 6 - 12
src/main/java/cn/hnthyy/thmz/service/impl/thmz/DispensingSocketServiceImpl.java

@@ -10,10 +10,8 @@ import cn.hnthyy.thmz.socket.PrescriptionPrintSocket;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class DispensingSocketServiceImpl implements DispensingSocketService {
@@ -55,20 +53,16 @@ public class DispensingSocketServiceImpl implements DispensingSocketService {
         MzChargeDetail mzChargeDetail = new MzChargeDetail();
         mzChargeDetail.setPatientId(patientId);
         mzChargeDetail.setTimes(times);
+        mzChargeDetail.setGroupNo("71");
         List<MzChargeDetail> chargeDetail = mzChargeDetailService.getMzChargeDetailList(mzChargeDetail);
-        boolean flag = false;
-        for (MzChargeDetail detail : chargeDetail) {
-            if(detail.getGroupNo().equals("71")){
-                flag = true;
-                break;
-            }
-        }
-        if(flag){
+        if(chargeDetail.size() > 0){
+            Set<Integer> orderNos = chargeDetail.stream().map(MzChargeDetail::getOrderNo).collect(Collectors.toSet());
             Map<String,Object> msgMap = new HashMap();
             msgMap.put("patient_id",patientId);
             MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientId);
             msgMap.put("name",mzPatientMi.getName());
             msgMap.put("times",times);
+            msgMap.put("orderNos",orderNos);
             msgMap.put("type",SocketSenderTypeEnum.PAY.code);
             List<String> objTypes = new ArrayList<>();
             objTypes.add(SocketSenderTypeEnum.CALL_NUMBER.code);

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

@@ -71,7 +71,9 @@ function dispensingMessage(data) {
             initTable();
         }
         if ($("#aotuPrint").is(':checked')) {//自动打印
-            printPrescription(data.patient_id, data.times);
+            for (let i = 0; i < data.orderNos.length; i++) {
+                printPrescription(data.patient_id, data.times,data.orderNos[i]);
+            }
         }
     }
 }

+ 3 - 2
src/main/resources/static/js/mz/west_pharmacy_dispensing.js

@@ -126,7 +126,7 @@ function initTable() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    var str = '<button type="button" class="registration-no-color-foot-button" title="打印" onclick="printPrescription(\'' + row.patientId + '\',\'' + row.times + '\')"  style="color: #35D082;"><i class="fa fa-print"></i></button>';
+                    var str = '<button type="button" class="registration-no-color-foot-button" title="打印" onclick="printPrescription(\'' + row.patientId + '\',\'' + row.times+ '\',\'' + row.orderNo + '\')"  style="color: #35D082;"><i class="fa fa-print"></i></button>';
                     str += '<button type="button" class="registration-no-color-foot-button" title="配药完成" onclick="dispensingDispose(\'' + row.patientId + '\',\'' + row.orderNo + '\',\'' + row.name + '\',\'' + row.realNo + '\',\'' + row.chargeDate + '\')"><i class="fa fa-check-square-o"></i></button>';
                     return str;
                 }
@@ -225,10 +225,11 @@ function dispensingDispose(patientId, orderNo, name, realNo, chargeDate) {
 /**
  * 打印处方
  */
-function printPrescription(patientId, times) {
+function printPrescription(patientId, times, orderNo) {
     var tem = {
         patientId: patientId,
         times: times,
+        orderNo: orderNo,
         groupNo: 71
     };
     $.ajax({

+ 2 - 2
src/main/resources/static/js/mz/west_pharmacy_send.js

@@ -360,9 +360,9 @@ function printInjectionOralMedicine(patientId, orderNo, realNo, times, receiptNo
                 var injections = new Array();//注射液
                 var drugs = new Array();//普通药品
                 for (let i = 0; i < res.data.length; i++) {
-                    if (res.data[i].classCode == 2 || res.data[i].classCode == 7) {
+                    if (res.data[i].classCode == 2 || res.data[i].classCode == 7) {//给药方式 2:输液、雾化吸入、副药等等 7:注射、皮试、副药等等
                         injections[injections.length] = res.data[i];
-                    } else if (res.data[i].classCode != 6 && res.data[i].classCode != 9) {
+                    } else if (res.data[i].classCode != 6) {//给药方式 6:领药 9:外用、局麻、喷用等等
                         drugs[drugs.length] = res.data[i];
                     }
                 }