Bläddra i källkod

预交金优化

lihong 1 år sedan
förälder
incheckning
f2d3caf103

+ 20 - 0
src/main/java/cn/hnthyy/thmz/controller/zy/ZyDepositFileController.java

@@ -26,6 +26,7 @@ import cn.hnthyy.thmz.service.his.zy.ZyLedgerFileService;
 import cn.hnthyy.thmz.service.thmz.TransactionService;
 import cn.hnthyy.thmz.service.thmz.WindowsService;
 import cn.hnthyy.thmz.vo.ZyDepositFileVo;
+import cn.hutool.core.collection.CollUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.json.JSONObject;
@@ -92,6 +93,25 @@ public class ZyDepositFileController {
             resultMap.put("code", 0);
             resultMap.put("message", "根据住院号和次数查询缴费记录成功");
             List<ZyDepositFile> zyDepositFiles = zyDepositFileService.queryZyDepositFileBYInpatientNoAndTimes(zyDepositFile);
+            if(CollUtil.isNotEmpty(zyDepositFiles)){
+                Map<String, Boolean> rePrintMap = new HashMap<>();
+                Map<String, List<ZyDepositFile>> collect = zyDepositFiles.stream().collect(Collectors.groupingBy(item -> item.getReceiptNo()));
+                for(String key :collect.keySet()){
+                    boolean rePrintFlag =collect.get(key).stream().anyMatch(item -> item.getStatus().equals(ZyDepositFileStatusEnum.STRAIGHT_BACK.code));
+                    if(rePrintFlag){
+                        rePrintMap.put(key, false);
+                    }else {
+                        rePrintMap.put(key, true);
+                    }
+                }
+                zyDepositFiles.forEach(item->{
+                    if(rePrintMap.get(item.getReceiptNo())){
+                        item.setRePrintFlag(true);
+                    }else {
+                        item.setRePrintFlag(false);
+                    }
+                });
+            }
             //总支付金额
             BigDecimal totalPay = BigDecimal.ZERO;
             //总退费金额

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/zy/ZyDepositFile.java

@@ -100,6 +100,8 @@ public class ZyDepositFile {
 
     //金额字符串
     private String amountStr;
+    //重打显示标识
+    private Boolean rePrintFlag;
 
     public void setDepoAmount(BigDecimal depoAmount) {
         this.depoAmount = depoAmount;

+ 8 - 2
src/main/resources/static/js/zy/accepting.js

@@ -7,6 +7,12 @@ var inpatientNoFull;
 var admissTimesFull;
 
 $(function () {
+    var zyh =  localStorage.getItem("hos_zyh")
+    if(zyh){
+        $("#admissionNumber").val(zyh)
+        getZyActpatientByInpatientNoOrMzNO('admissionNumber')
+        localStorage.removeItem("hos_zyh")
+    }
     /**
      * 清空
      */
@@ -458,9 +464,9 @@ function listDepositFile() {
                             str += '<button type="button" class="btn btn-primary  btn-sm" onclick="refundZyFee(\'' + row.receiptNo + '\',\'' + row.depoAmount + '\',\'' + row.depoType + '\')">退费</button>';
                         }
                         if (row.deleted != 1) {
-                            if (row.printed == 0 && row.status == 1) {
+                            if (row.printed == 0 && row.status == 1 && row.rePrintFlag) {
                                 str += '<button type="button" class="btn btn-primary  btn-sm" onclick="prn1Print(\'' + row.inpatientNo + '\',\'' + row.receiptNo + '\',false)">打印收据</button>';
-                            } else if (row.printed == 1) {
+                            } else if (row.printed == 1 && row.rePrintFlag) {
                                 str += '<button type="button" class="btn btn-primary  btn-sm" onclick="prn1Print(\'' + row.inpatientNo + '\',\'' + row.receiptNo + '\',true)">重打收据</button>';
                             }
                         }

+ 2 - 0
src/main/resources/static/js/zy/hospitalized.js

@@ -675,6 +675,8 @@ function saveZyActpatient() {
                 printWristStrap();
                 clearInput();
                 if(confirm("是否跳转预交金处理页面?")){
+                    var zyh = $("#admissionNumber").val()
+                    localStorage.setItem("hos_zyh",zyh)
                     changeContent("/thmz/accepting")
                 }
             } else {