Explorar el Código

功能优化,医剂划价后无法收费

hurugang hace 5 años
padre
commit
e641a48277

+ 5 - 3
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -340,13 +340,15 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         Map<String, BigDecimal> feeMap = new HashMap<>();
         //实际应付金额
         BigDecimal totalPayable = getTotalPayable(mzChargeDetailList, feeMap);
+        //实际应付金额  四舍五入后的值 收费员收的钱小数点后只有一位有效值
+        BigDecimal totalPayableRound = totalPayable.setScale(1, BigDecimal.ROUND_HALF_UP);
         Date now = new Date();
         int serialNo = mzSerialNoService.getSerialNo();
         MzReceiptSerial mzReceiptSerial = new MzReceiptSerial();
         //实际支付金额 收银员收的钱
         BigDecimal hadPayable = getHadPayable(opId, mzDepositFileVo, windows, mzPatientMi, feeMap, now, serialNo, mzReceiptSerial, receiptNo);
-        if (hadPayable.compareTo(totalPayable) != 0) {
-            throw new MzException("收款金额有误,实际应付" + totalPayable.toString() + "元,实收" + hadPayable.toString() + "元,患者处方有修改,请重新刷当前病人收费数据");
+        if (hadPayable.compareTo(totalPayableRound) != 0) {
+            throw new MzException("收款金额有误,实际应付" + totalPayableRound.toString() + "元,实收" + hadPayable.toString() + "元,患者处方有修改,请重新刷当前病人收费数据");
         }
         getMzChargeDetailService().updateChargeFlag(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzPatientMi.getName(), mzChargeDetailList, now, serialNo, mzReceiptSerial.getChequeType(), null);
         getMzChargeDetailService().afterChargeFee(mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), mzDepositFileVo.getMzDepositFiles(), now, serialNo, mzReceiptSerial, totalPayable);
@@ -1781,7 +1783,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
      */
     private Integer formatSupplyFee(List<MzChargeDetail> mzChargeDetails, List<MzChargeDetail> mzChargeDetailList, Integer itemNo, Integer receiptNo) throws MzException {
         for (MzChargeDetail mcd : mzChargeDetailList) {
-            if (mcd.getSupplyAmount() == null) {
+            if (!Constants.YJ_GROUP_NO.equals(mcd.getGroupNo()) && mcd.getSupplyAmount() == null) {
                 throw new MzException("当前处方药品给药方式执行次数为空,请联系医生修改处方!");
             }
             //非口服用药方式,需要写入收费记录