|
|
@@ -357,6 +357,26 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
BigDecimal byjzAmount=totalPayable.subtract(mzReceiptSerial.getTotalCharge());
|
|
|
if(byjzAmount.compareTo(BigDecimal.ZERO)==1){
|
|
|
MzReceiptSerial jzMzReceiptSerial=CloneUtil.clone(mzReceiptSerial);
|
|
|
+ jzMzReceiptSerial.setCharge1(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge2(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge3(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge4(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge5(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge6(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge7(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge8(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge9(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge10(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge11(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge12(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge13(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge14(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge15(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge16(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge17(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge18(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge19(BigDecimal.ZERO);
|
|
|
+ jzMzReceiptSerial.setCharge20(BigDecimal.ZERO);
|
|
|
jzMzReceiptSerial.setTotalCharge(byjzAmount);
|
|
|
jzMzReceiptSerial.setChequeType(Constants.BYJZ);
|
|
|
mzReceiptSerialMapper.insertMzReceiptSerial(jzMzReceiptSerial);
|
|
|
@@ -1087,7 +1107,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
chequeType=m.getChequeType();
|
|
|
}
|
|
|
}
|
|
|
- hadPayable.setScale(1, BigDecimal.ROUND_FLOOR);
|
|
|
+ hadPayable.setScale(2, BigDecimal.ROUND_FLOOR);
|
|
|
setMzReceiptSerial(opId, mzDepositFileVo.getPatientId(), mzDepositFileVo.getTimes(), windows, mzPatientMi.getResponseType(), feeMap, now, serialNo, mzReceiptSerial, chequeType, isBenYuanJiZhang?hadPayable:excludeByjzPay);
|
|
|
return hadPayable;
|
|
|
}
|
|
|
@@ -1113,26 +1133,26 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
mzReceiptSerial.setReceiptNo(1);
|
|
|
mzReceiptSerial.setSerialNo(serialNo);
|
|
|
mzReceiptSerial.setOperatorId(opId);
|
|
|
- mzReceiptSerial.setCharge1(feeMap.get(Constants.GHF) == null ? BigDecimal.ZERO : feeMap.get(Constants.GHF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge2(feeMap.get(Constants.CWF) == null ? BigDecimal.ZERO : feeMap.get(Constants.CWF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge3(feeMap.get(Constants.ZCF) == null ? BigDecimal.ZERO : feeMap.get(Constants.ZCF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge4(feeMap.get(Constants.JCF) == null ? BigDecimal.ZERO : feeMap.get(Constants.JCF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge5(feeMap.get(Constants.ZLF) == null ? BigDecimal.ZERO : feeMap.get(Constants.ZLF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge6(feeMap.get(Constants.HLF) == null ? BigDecimal.ZERO : feeMap.get(Constants.HLF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge7(feeMap.get(Constants.SSF) == null ? BigDecimal.ZERO : feeMap.get(Constants.SSF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge8(feeMap.get(Constants.HYF) == null ? BigDecimal.ZERO : feeMap.get(Constants.HYF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge9(feeMap.get(Constants.QTF) == null ? BigDecimal.ZERO : feeMap.get(Constants.QTF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge10(feeMap.get(Constants.XYF) == null ? BigDecimal.ZERO : feeMap.get(Constants.XYF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge11(feeMap.get(Constants.ZCYF) == null ? BigDecimal.ZERO : feeMap.get(Constants.ZCYF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge12(feeMap.get(Constants.CYF) == null ? BigDecimal.ZERO : feeMap.get(Constants.CYF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge13(feeMap.get(Constants.TSCLF) == null ? BigDecimal.ZERO : feeMap.get(Constants.TSCLF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge14(feeMap.get(Constants.SXF) == null ? BigDecimal.ZERO : feeMap.get(Constants.SXF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge15(feeMap.get(Constants.JDF) == null ? BigDecimal.ZERO : feeMap.get(Constants.JDF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge16(feeMap.get(Constants.XDF) == null ? BigDecimal.ZERO : feeMap.get(Constants.XDF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge17(feeMap.get(Constants.SSQXSSF) == null ? BigDecimal.ZERO : feeMap.get(Constants.SSQXSSF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge18(feeMap.get(Constants.CLF) == null ? BigDecimal.ZERO : feeMap.get(Constants.CLF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge19(feeMap.get(Constants.MZF) == null ? BigDecimal.ZERO : feeMap.get(Constants.MZF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
- mzReceiptSerial.setCharge20(feeMap.get(Constants.SSWRF) == null ? BigDecimal.ZERO : feeMap.get(Constants.SSWRF).setScale(1, BigDecimal.ROUND_FLOOR));
|
|
|
+ mzReceiptSerial.setCharge1(feeMap.get(Constants.GHF) == null ? BigDecimal.ZERO : feeMap.get(Constants.GHF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge2(feeMap.get(Constants.CWF) == null ? BigDecimal.ZERO : feeMap.get(Constants.CWF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge3(feeMap.get(Constants.ZCF) == null ? BigDecimal.ZERO : feeMap.get(Constants.ZCF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge4(feeMap.get(Constants.JCF) == null ? BigDecimal.ZERO : feeMap.get(Constants.JCF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge5(feeMap.get(Constants.ZLF) == null ? BigDecimal.ZERO : feeMap.get(Constants.ZLF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge6(feeMap.get(Constants.HLF) == null ? BigDecimal.ZERO : feeMap.get(Constants.HLF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge7(feeMap.get(Constants.SSF) == null ? BigDecimal.ZERO : feeMap.get(Constants.SSF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge8(feeMap.get(Constants.HYF) == null ? BigDecimal.ZERO : feeMap.get(Constants.HYF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge9(feeMap.get(Constants.QTF) == null ? BigDecimal.ZERO : feeMap.get(Constants.QTF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge10(feeMap.get(Constants.XYF) == null ? BigDecimal.ZERO : feeMap.get(Constants.XYF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge11(feeMap.get(Constants.ZCYF) == null ? BigDecimal.ZERO : feeMap.get(Constants.ZCYF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge12(feeMap.get(Constants.CYF) == null ? BigDecimal.ZERO : feeMap.get(Constants.CYF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge13(feeMap.get(Constants.TSCLF) == null ? BigDecimal.ZERO : feeMap.get(Constants.TSCLF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge14(feeMap.get(Constants.SXF) == null ? BigDecimal.ZERO : feeMap.get(Constants.SXF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge15(feeMap.get(Constants.JDF) == null ? BigDecimal.ZERO : feeMap.get(Constants.JDF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge16(feeMap.get(Constants.XDF) == null ? BigDecimal.ZERO : feeMap.get(Constants.XDF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge17(feeMap.get(Constants.SSQXSSF) == null ? BigDecimal.ZERO : feeMap.get(Constants.SSQXSSF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge18(feeMap.get(Constants.CLF) == null ? BigDecimal.ZERO : feeMap.get(Constants.CLF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge19(feeMap.get(Constants.MZF) == null ? BigDecimal.ZERO : feeMap.get(Constants.MZF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ mzReceiptSerial.setCharge20(feeMap.get(Constants.SSWRF) == null ? BigDecimal.ZERO : feeMap.get(Constants.SSWRF).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
mzReceiptSerial.setPayMark(PayMarkEnum.CHARGED.code);
|
|
|
mzReceiptSerial.setTotalCharge(hadPayable);
|
|
|
mzReceiptSerial.setChargeDate(now);
|
|
|
@@ -1190,6 +1210,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
MzReceiptSerial newMzReceiptSerial = CloneUtil.clone(j);
|
|
|
if (newMzReceiptSerial != null) {
|
|
|
newMzReceiptSerial.setReceiptNo(newMzReceiptSerial.getReceiptNo() + 1);
|
|
|
+ newMzReceiptSerial.setDcountNo(YesNoEnum.NO.code);
|
|
|
+ newMzReceiptSerial.setDcountDate(null);
|
|
|
newMzReceiptSerial.setChargeDate(now);
|
|
|
newMzReceiptSerial.setSerialNo(serialNo);
|
|
|
newMzReceiptSerial.setOperatorId(opId);
|
|
|
@@ -1249,6 +1271,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
MzDepositFile newMzDepositFile = CloneUtil.clone(j);
|
|
|
if (newMzDepositFile != null) {
|
|
|
newMzDepositFile.setReceiptNo(newMzDepositFile.getReceiptNo() + 1);
|
|
|
+ newMzDepositFile.setDcountNo(YesNoEnum.NO.code);
|
|
|
+ newMzDepositFile.setDcountDate(null);
|
|
|
newMzDepositFile.setChargeDate(now);
|
|
|
newMzDepositFile.setSerialNo(serialNo);
|
|
|
newMzDepositFile.setReceiptSn(serialNo);
|
|
|
@@ -1334,7 +1358,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
feeMap.put(billItemCode, temp);
|
|
|
}
|
|
|
}
|
|
|
- return totalPayable.setScale(1, BigDecimal.ROUND_FLOOR);
|
|
|
+ return totalPayable.setScale(2, BigDecimal.ROUND_FLOOR);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1353,8 +1377,13 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
temp.addAll(mzChargeDetails);
|
|
|
if (temp != null && temp.size() > 0) {
|
|
|
BigDecimal totalFee = BigDecimal.ZERO;
|
|
|
- for (MzChargeDetail md : mzChargeDetailList) {
|
|
|
- totalFee = totalFee.add(BigDecimal.valueOf(md.getQuantity()).multiply(md.getUnitPrice()).multiply(md.getDrugWin() == null ? BigDecimal.ONE : BigDecimal.valueOf(md.getDrugWin())));
|
|
|
+ //所有应收费用的明细 将所有费用按照类型归类
|
|
|
+ Map<String, BigDecimal> feeMap = new HashMap<>();
|
|
|
+ //实际应付金额
|
|
|
+ getTotalPayable(temp, feeMap);
|
|
|
+ for (String key : feeMap.keySet()) {
|
|
|
+ BigDecimal amount =feeMap.get(key).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ totalFee = totalFee.add(amount);
|
|
|
}
|
|
|
totalFee = totalFee.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
BigDecimal realTotal = totalFee.setScale(1, BigDecimal.ROUND_HALF_UP);
|