瀏覽代碼

挂号优化

hurugang 6 年之前
父節點
當前提交
0401c683d0

+ 5 - 6
src/main/java/cn/hnthyy/thmz/controller/ChargeFeeVoController.java

@@ -351,7 +351,7 @@ public class ChargeFeeVoController {
             MzReceiptSerial mzReceiptSerial = chargeFeeVoService.queryMzReceiptSerial(tokenUser.getUserIdCode(), null, null, null).get(0);
             resultMap.put("mzReceiptSerial", mzReceiptSerial);
             ChargeCountVo chargeCountVo = chargeFeeVoService.queryChargeCountVo(tokenUser.getUserIdCode(), null, null, null).get(0);
-            chargeCountVo.fomartChargeCountVo(mzReceiptSerial.getTotalCharge());
+            chargeCountVo.fomartChargeCountVo();
             resultMap.put("chargeCountVo", chargeCountVo);
             //收费所用票号
             List<String> sfReceiptBills = getStrings(chargeFeeVoService.querySfReceiptBillVoUnAccount(tokenUser.getUserIdCode()));
@@ -422,7 +422,7 @@ public class ChargeFeeVoController {
             MzReceiptSerial mzReceiptSerial = chargeFeeVoService.queryMzReceiptSerial(chargeFeeParamsVo.getOpId(), chargeFeeParamsVo.getDcountDate(), null, null).get(0);
             resultMap.put("mzReceiptSerial", mzReceiptSerial);
             ChargeCountVo chargeCountVo = chargeFeeVoService.queryChargeCountVo(chargeFeeParamsVo.getOpId(), chargeFeeParamsVo.getDcountDate(), null, null).get(0);
-            chargeCountVo.fomartChargeCountVo(mzReceiptSerial.getTotalCharge());
+            chargeCountVo.fomartChargeCountVo();
             resultMap.put("chargeCountVo", chargeCountVo);
             //收费所用票号
             List<String> sfReceiptBills = getStrings(chargeFeeVoService.querySfReceiptBillVoReprint(chargeFeeParamsVo.getOpId(), chargeFeeParamsVo.getDcountDate()));
@@ -490,7 +490,7 @@ public class ChargeFeeVoController {
             MzReceiptSerial mzReceiptSerial = chargeFeeVoService.queryMzReceiptSerial(chargeFeeParamsVo.getOpId(), null, chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate()).get(0);
             resultMap.put("mzReceiptSerial", mzReceiptSerial);
             ChargeCountVo chargeCountVo = chargeFeeVoService.queryChargeCountVo(chargeFeeParamsVo.getOpId(), null, chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate()).get(0);
-            chargeCountVo.fomartChargeCountVo(mzReceiptSerial.getTotalCharge());
+            chargeCountVo.fomartChargeCountVo();
             resultMap.put("chargeCountVo", chargeCountVo);
             //挂号发票张数
             resultMap.put("ghfps", chargeFeeVoService.countReqrecReceipt(null, YesNoEnum.NO.code.toString(), null, chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate()));
@@ -641,9 +641,8 @@ public class ChargeFeeVoController {
                 resultMap.put("message", "存在退费后发票未重打的发票信息,请 处理后再结账!");
                 return resultMap;
             }
-            //Date dcountDate = chargeFeeVoService.dcountCharge(tokenUser.getUserIdCode());
-            //resultMap.put("dcountDate", dcountDate);
-            resultMap.put("dcountDate", new Date());
+            Date dcountDate = chargeFeeVoService.dcountCharge(tokenUser.getUserIdCode());
+            resultMap.put("dcountDate", dcountDate);
             resultMap.put("code", 0);
             resultMap.put("message", "费用结算成功");
             return resultMap;

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

@@ -235,7 +235,7 @@ public class MzChargeDetailController {
     private List<MzChargeDetail> getMzChargeDetails(List<MzChargeDetail> mzChargeDetailList) {
         if (mzChargeDetailList != null) {
             for (MzChargeDetail md : mzChargeDetailList) {
-                md.setAmount((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())));
+                md.setAmount((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())).setScale(2, BigDecimal.ROUND_HALF_UP));
                 if (!Constants.YJ_GROUP_NO.equals(md.getGroupNo())) {
                     YpZdDict ypZdDict = ypZdDictService.queryYpZdDictByCode(md.getChargeItemCode(), md.getSerial());
                     if (ypZdDict != null) {

+ 6 - 0
src/main/java/cn/hnthyy/thmz/controller/MzyReqrecController.java

@@ -356,6 +356,12 @@ public class MzyReqrecController {
                     String chargeType=mzyZdChargeTypeMap.get(mzyReqrec.getChargeType());
                     mzyReqrec.setChargeType(chargeType==null?"":chargeType);
                 }
+                //傻b们写的医生接诊逻辑不设置visitedMark 字段  挂号的时候还设置成已接诊
+                if(mzyReqrec.getVisitDate()!=null){
+                    mzyReqrec.setVisitedMark(YesNoEnum.YES.code);
+                }else {
+                    mzyReqrec.setVisitedMark(YesNoEnum.NO.code);
+                }
                 MzyReqrecVo mzyReqrecVo = new MzyReqrecVo();
                 mzyReqrecVo.setMzyReqrec(mzyReqrec);
                 if(mzPatientMiMap!=null){

+ 9 - 1
src/main/java/cn/hnthyy/thmz/entity/his/MzDepositFile.java

@@ -51,11 +51,19 @@ public class MzDepositFile implements Serializable {
     private String agtordnum;
     //HIS返回流水号
     private String hisrefundnum;
-
+    //金额字符串
+    private String amountStr;
     public MzDepositFile() {
     }
     public MzDepositFile(String patientId, Integer times) {
         this.patientId = patientId;
         this.times = times;
     }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+        if(amount!=null){
+            this.amountStr = amount.toString();
+        }
+    }
 }

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/MzDepositFileMapper.java

@@ -19,7 +19,7 @@ public interface MzDepositFileMapper {
     @Insert("INSERT INTO  mz_deposit_file(patient_id,times,receipt_no,pay_mark,cheque_type,cheque_no,amount,charge_date,dcount_date,dcount_no," +
             "op_id,receipt_sn,serial_no,responce_type,yb_jlh,yb_ywh,dept_no,psordnum,agtordnum,hisrefundnum) VALUES (#{patientId,jdbcType=CHAR}," +
             "#{times,jdbcType=INTEGER},#{receiptNo,jdbcType=SMALLINT},#{payMark,jdbcType=CHAR},#{chequeType,jdbcType=CHAR},#{chequeNo,jdbcType=CHAR}" +
-            ",#{amount,jdbcType=DECIMAL},#{chargeDate,jdbcType=TIMESTAMP},#{dcountDate,jdbcType=TIMESTAMP},#{dcountNo,jdbcType=CHAR},#{opId,jdbcType=CHAR}," +
+            ",#{amountStr,jdbcType=DECIMAL},#{chargeDate,jdbcType=TIMESTAMP},#{dcountDate,jdbcType=TIMESTAMP},#{dcountNo,jdbcType=CHAR},#{opId,jdbcType=CHAR}," +
             "#{receiptSn,jdbcType=INTEGER},#{serialNo,jdbcType=INTEGER},#{responceType,jdbcType=CHAR},#{ybJlh,jdbcType=VARCHAR},#{ybYwh,jdbcType=VARCHAR}," +
             "#{deptNo,jdbcType=VARCHAR},#{psordnum,jdbcType=VARCHAR},#{agtordnum,jdbcType=VARCHAR},#{hisrefundnum,jdbcType=VARCHAR})")
     int insertMzDepositFile(MzDepositFile mzDepositFile);
@@ -37,7 +37,7 @@ public interface MzDepositFileMapper {
             "op_id,receipt_sn,serial_no,responce_type,yb_jlh,yb_ywh,dept_no,psordnum,agtordnum,hisrefundnum) VALUES ",
             "<foreach collection='mzDepositFileList' item='item' index='index' separator=','>",
             " (#{item.patientId,jdbcType=CHAR},#{item.times,jdbcType=INTEGER},#{item.receiptNo,jdbcType=SMALLINT},#{item.payMark,jdbcType=CHAR},#{item.chequeType,jdbcType=CHAR},#{item.chequeNo,jdbcType=CHAR}",
-            ",#{item.amount,jdbcType=DECIMAL},#{item.chargeDate,jdbcType=TIMESTAMP},#{item.dcountDate,jdbcType=TIMESTAMP},#{item.dcountNo,jdbcType=CHAR},#{item.opId,jdbcType=CHAR},",
+            ",#{item.amountStr,jdbcType=DECIMAL},#{item.chargeDate,jdbcType=TIMESTAMP},#{item.dcountDate,jdbcType=TIMESTAMP},#{item.dcountNo,jdbcType=CHAR},#{item.opId,jdbcType=CHAR},",
             "#{item.receiptSn,jdbcType=INTEGER},#{item.serialNo,jdbcType=INTEGER},#{item.responceType,jdbcType=CHAR},#{item.ybJlh,jdbcType=VARCHAR},#{item.ybYwh,jdbcType=VARCHAR},",
             "#{item.deptNo,jdbcType=VARCHAR},#{item.psordnum,jdbcType=VARCHAR},#{item.agtordnum,jdbcType=VARCHAR},#{item.hisrefundnum,jdbcType=VARCHAR}) ",
             "</foreach>",

+ 16 - 4
src/main/java/cn/hnthyy/thmz/mapper/his/MzyReqrecMapper.java

@@ -56,9 +56,15 @@ public interface MzyReqrecMapper {
             "<when test='mzyReqrec.name!=null'>",
             " and (name like #{mzyReqrec.name,jdbcType=CHAR} or patient_id like #{mzyReqrec.name,jdbcType=CHAR})",
             "</when>",
-            "<when test='mzyReqrec.visitedMark!=null'>",
-            " and visited_mark =#{mzyReqrec.visitedMark,jdbcType=CHAR}",
+
+            "<when test='mzyReqrec.visitedMark!=null and mzyReqrec.visitedMark == 0'>",
+            " and visit_date is null ",
+            "</when>",
+
+            "<when test='mzyReqrec.visitedMark!=null and mzyReqrec.visitedMark == 1'>",
+            " and visit_date is not null ",
             "</when>",
+
             "<when test='mzyReqrec.cancelMark!=null'>",
             " and cancel_mark =#{mzyReqrec.cancelMark,jdbcType=CHAR}",
             "</when>",
@@ -99,9 +105,15 @@ public interface MzyReqrecMapper {
             "<when test='mzyReqrec.name!=null'>",
             " and (name like #{mzyReqrec.name,jdbcType=CHAR} or patient_id like #{mzyReqrec.name,jdbcType=CHAR}) ",
             "</when>",
-            "<when test='mzyReqrec.visitedMark!=null'>",
-            " and visited_mark =#{mzyReqrec.visitedMark,jdbcType=CHAR}",
+
+            "<when test='mzyReqrec.visitedMark!=null and mzyReqrec.visitedMark == 0'>",
+            " and visit_date is null ",
+            "</when>",
+
+            "<when test='mzyReqrec.visitedMark!=null and mzyReqrec.visitedMark == 1'>",
+            " and visit_date is not null ",
             "</when>",
+
             "<when test='mzyReqrec.cancelMark!=null'>",
             " and cancel_mark =#{mzyReqrec.cancelMark,jdbcType=CHAR}",
             "</when>",

+ 53 - 24
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -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);

+ 5 - 2
src/main/java/cn/hnthyy/thmz/vo/ChargeCountVo.java

@@ -114,7 +114,7 @@ public class ChargeCountVo {
     /**
      * 设置实收笔数
      */
-    public void fomartChargeCountVo(BigDecimal zj){
+    public void fomartChargeCountVo(){
         if(xjbs==null){
             xjbs=0;
         }
@@ -159,8 +159,11 @@ public class ChargeCountVo {
         if(zfss==null){
             zfss=BigDecimal.ZERO;
         }
+        if(zjss==null){
+            zjss=BigDecimal.ZERO;
+        }
         zfbssbs=zfbbs-zfbtfbs;
-        this.zj=zj.setScale(2, BigDecimal.ROUND_HALF_UP);
+        this.zj=zjss.setScale(2, BigDecimal.ROUND_HALF_UP);
         zjdx=NumberToCN.number2CNMontrayUnit(zj);
         zfdx=NumberToCN.number2CNMontrayUnit(zfss.setScale(2, BigDecimal.ROUND_HALF_UP));
         if(zfsk==null){