Browse Source

部分收费退费后无法打印发票问题修复

hurugang 5 years ago
parent
commit
76498ddd26

+ 1 - 0
src/main/java/cn/hnthyy/thmz/controller/MzChargeDetailController.java

@@ -577,6 +577,7 @@ public class MzChargeDetailController {
             }
             returnMzChargeDetail.setAmount(returnMzChargeDetail.getAmount().add((md.getUnitPrice() == null ? BigDecimal.ZERO : md.getUnitPrice()).multiply(BigDecimal.valueOf(md.getQuantity() == null ? 1D : md.getQuantity())).multiply(BigDecimal.valueOf(md.getDrugWin() == null ? 1D : md.getDrugWin()))));
         }
+        returnMzChargeDetail.setAmount(returnMzChargeDetail.getAmount().setScale(1, BigDecimal.ROUND_HALF_UP));
         return returnMzChargeDetail;
     }
 

+ 8 - 7
src/main/java/cn/hnthyy/thmz/controller/MzReceiptSerialController.java

@@ -93,7 +93,7 @@ public class MzReceiptSerialController {
                         if (StringUtils.isNotBlank(name)) {
                             m.setName(name);
                         }
-                    }else {
+                    } else {
                         m.setName(mzPatientMi.getName());
                     }
                 });
@@ -143,7 +143,7 @@ public class MzReceiptSerialController {
                 resultMap.put("message", "缴费失败,用户Token不存在");
                 return resultMap;
             }
-            MzDepositFile mz= new MzDepositFile(patientId, times);
+            MzDepositFile mz = new MzDepositFile(patientId, times);
             mz.setReceiptNo(receiptNo);
             List<MzDepositFile> mzDepositFiles = mzDepositFileService.queryMzDepositFile(mz);
             //非本院记账金额
@@ -158,19 +158,19 @@ public class MzReceiptSerialController {
             if (BigDecimal.ZERO.compareTo(totalPay) == 0) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "当前病人没有实际缴费,暂时不打印发票");
-                log.info("当前病人没有实际缴费,暂时不打印发票,patientId={},time={}", patientId, times);
+                log.info("当前病人没有实际缴费,暂时不打印发票,patientId={},time={},receiptNo={}", patientId, times, receiptNo);
                 return resultMap;
-        }
+            }
             User tokenUser = TokenUtil.getUser(httpServletRequest);
             resultMap.put("code", 0);
             resultMap.put("message", "根据病人编号和就诊次数查询其当次缴费对应的所有发票成功");
             //将打印标志改为已经打印
             //mzChargeDetailService.modifyPrintFlag(patientId,timesList);
-            MzReceiptSerial mzReceiptSerial = mzReceiptSerialService.queryAllSerialForThisTime(patientId, times,receiptNo);
+            MzReceiptSerial mzReceiptSerial = mzReceiptSerialService.queryAllSerialForThisTime(patientId, times, receiptNo);
             if (mzReceiptSerial != null && StringUtils.isBlank(mzReceiptSerial.getChequeType())) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "当前病人发票表中的收费类型为空,无法打印发票,请及时联系管理员");
-                log.info("当前病人发票表中的收费类型为空,无法打印发票,请及时联系管理员,patientId={},time={}", patientId, times);
+                log.info("当前病人发票表中的收费类型为空,无法打印发票,请及时联系管理员,patientId={},time={},receiptNo={}", patientId, times,receiptNo);
                 return resultMap;
             }
             String receipt = mzReceiptSerialService.printReceiptSerial(mzReceiptSerial, tokenUser);
@@ -366,7 +366,8 @@ public class MzReceiptSerialController {
                 resultMap.put("code", -1);
                 resultMap.put("message", "病人就诊次数不能为空");
                 return resultMap;
-            }if (receiptNo == null) {
+            }
+            if (receiptNo == null) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "病人缴费次数不能为空");
                 return resultMap;

+ 1 - 1
src/main/resources/static/js/toll_administration.js

@@ -2026,7 +2026,7 @@ function saveRefundFee() {
                 });
                 $("#refundFeeModal").modal("hide");
                 if (res.times > 0) {
-                    prn1Print(res.patientId, res.times, false,$("#receiptNoRefund").val());
+                    prn1Print(res.patientId, res.times, false,1);
                 } else {
                     initFeeTable();
                 }