Browse Source

处方门诊指引单金额修复

hurugang 3 years ago
parent
commit
e44f06ef60

+ 17 - 19
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -1589,6 +1589,8 @@ public class MzChargeDetailController {
                 Map<String, Object> map = tempMap.get(mz.getBillItemCode());
                 Map<String, Object> map = tempMap.get(mz.getBillItemCode());
                 if (map == null) {
                 if (map == null) {
                     map = new HashMap<>();
                     map = new HashMap<>();
+                    tempMap.put(mz.getBillItemCode(), map);
+                    returnList.add(map);
                     if (mzBillItemMap != null) {
                     if (mzBillItemMap != null) {
                         map.put("itemType", mzBillItemMap.get(mz.getBillItemCode()));
                         map.put("itemType", mzBillItemMap.get(mz.getBillItemCode()));
                     }
                     }
@@ -1599,30 +1601,26 @@ public class MzChargeDetailController {
                     }
                     }
                     map.put("execDeptName", unitCode == null ? "" : unitCode.getName());
                     map.put("execDeptName", unitCode == null ? "" : unitCode.getName());
                     map.put("execDeptAddress", (unitCode == null || unitCode.getOfficePos() == null) ? "" : unitCode.getOfficePos());
                     map.put("execDeptAddress", (unitCode == null || unitCode.getOfficePos() == null) ? "" : unitCode.getOfficePos());
-
-
-                    BigDecimal unitPrice = mz.getUnitPrice().setScale(2, BigDecimal.ROUND_HALF_UP);
-                    if (BigDecimal.ZERO.equals(unitPrice)) {
-                        unitPrice = BigDecimal.valueOf(0.01D);
-                    }
-                    unitPrice = unitPrice.multiply(BigDecimal.valueOf(100));
-                    BigDecimal quantity = mz.getQuantity() == null ? BigDecimal.ONE : BigDecimal.valueOf(mz.getQuantity());
-                    BigDecimal drugWin = mz.getDrugWin() == null ? BigDecimal.ONE : BigDecimal.valueOf(mz.getDrugWin());
-                    BigDecimal amount = (BigDecimal) map.get("itemTotalFee");
-                    if (amount == null) {
-                        amount = BigDecimal.ZERO;
-                    }
-                    BigDecimal tempAmount = unitPrice.multiply(quantity).multiply(drugWin);
-                    totalAmount = totalAmount.add(tempAmount);
-                    map.put("itemTotalFee", amount.add(tempAmount));
-                    tempMap.put(mz.getBillItemCode(), map);
-                    returnList.add(map);
                 }
                 }
+                BigDecimal unitPrice = mz.getUnitPrice().setScale(2, BigDecimal.ROUND_HALF_UP);
+                if (BigDecimal.ZERO.equals(unitPrice)) {
+                    unitPrice = BigDecimal.valueOf(0.01D);
+                }
+                unitPrice = unitPrice.multiply(BigDecimal.valueOf(100));
+                BigDecimal quantity = mz.getQuantity() == null ? BigDecimal.ONE : BigDecimal.valueOf(mz.getQuantity());
+                BigDecimal drugWin = mz.getDrugWin() == null ? BigDecimal.ONE : BigDecimal.valueOf(mz.getDrugWin());
+                BigDecimal amount = (BigDecimal) map.get("itemTotalFee");
+                if (amount == null) {
+                    amount = BigDecimal.ZERO;
+                }
+                BigDecimal tempAmount = unitPrice.multiply(quantity).multiply(drugWin);
+                totalAmount = totalAmount.add(tempAmount);
+                map.put("itemTotalFee", amount.add(tempAmount));
             }
             }
             String payQrcode = haiCiAdapterService.genMzPayQrcode(totalAmount.intValue(), patientId, patientId + "_" + times + "_1");
             String payQrcode = haiCiAdapterService.genMzPayQrcode(totalAmount.intValue(), patientId, patientId + "_" + times + "_1");
             results.put("code", 0);
             results.put("code", 0);
             results.put("message", "门诊缴费指引单查询成功");
             results.put("message", "门诊缴费指引单查询成功");
-            results.put("totalAmount", totalAmount.divide(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP));
+            results.put("totalAmount", totalAmount.divide(BigDecimal.valueOf(100)).setScale(1, BigDecimal.ROUND_HALF_UP));
             results.put("data", returnList);
             results.put("data", returnList);
             if(payQrcode!=null){
             if(payQrcode!=null){
                 results.put("payQrcode", payQrcode);
                 results.put("payQrcode", payQrcode);

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

@@ -3778,6 +3778,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                         } else {
                         } else {
                             newMzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount().multiply(zdChargeItem.getPercentag1()));
                             newMzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount().multiply(zdChargeItem.getPercentag1()));
                         }
                         }
+                        newMzChargeDetail.setExecDept(zdChargeItem.getExecUnit());
                         newMzChargeDetail.setReceiptNo(receiptNo);
                         newMzChargeDetail.setReceiptNo(receiptNo);
                         newMzChargeDetail.setSerial("");
                         newMzChargeDetail.setSerial("");
                         newMzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
                         newMzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
@@ -3847,6 +3848,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                         } else {
                         } else {
                             newMzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount().multiply(zdChargeItem.getPercentag1()));
                             newMzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount().multiply(zdChargeItem.getPercentag1()));
                         }
                         }
+                        newMzChargeDetail.setExecDept(zdChargeItem.getExecUnit());
                         newMzChargeDetail.setReceiptNo(receiptNo);
                         newMzChargeDetail.setReceiptNo(receiptNo);
                         newMzChargeDetail.setSerial("");
                         newMzChargeDetail.setSerial("");
                         newMzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
                         newMzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
@@ -3911,6 +3913,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                         } else {
                         } else {
                             newMzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount().multiply(zdChargeItem.getPercentag1()));
                             newMzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount().multiply(zdChargeItem.getPercentag1()));
                         }
                         }
+                        newMzChargeDetail.setExecDept(zdChargeItem.getExecUnit());
                         newMzChargeDetail.setReceiptNo(receiptNo);
                         newMzChargeDetail.setReceiptNo(receiptNo);
                         newMzChargeDetail.setSerial("");
                         newMzChargeDetail.setSerial("");
                         newMzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
                         newMzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);