|
@@ -16,6 +16,7 @@ import thyyxxk.webserver.entity.yibao.patient.Patient;
|
|
|
import thyyxxk.webserver.service.externalhttp.SiZySrvc;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -286,32 +287,35 @@ public class DismissService {
|
|
|
}
|
|
|
|
|
|
private ReceiptEntity dismissFeeAnalyse(String patNo, int times, int ledgerSn, Date begntime, Date endtime) {
|
|
|
+ Map<String, String> ledgerMap = initReceiptMap();
|
|
|
+ Map<String, String> infantMap = initReceiptMap();
|
|
|
+ Map<String, String> adultMap = initReceiptMap();
|
|
|
+
|
|
|
+ List<ReceiptFee> ledgerFees = dao.selectLedgerFees(patNo, times, ledgerSn, begntime, endtime);
|
|
|
+ if (null == ledgerFees) {
|
|
|
+ ledgerFees = new ArrayList<>();
|
|
|
+ }
|
|
|
+ for (ReceiptFee fee : ledgerFees) {
|
|
|
+ ledgerMap.replace(fee.getBillCode(), fee.getLedgerFee());
|
|
|
+ ledgerMap.replace("total", DecimalUtil.add(ledgerMap.get("total"), fee.getLedgerFee()));
|
|
|
+
|
|
|
+ infantMap.replace(fee.getBillCode(), fee.getInfantFee());
|
|
|
+ infantMap.replace("total", DecimalUtil.add(infantMap.get("total"), fee.getInfantFee()));
|
|
|
+
|
|
|
+ adultMap.replace(fee.getBillCode(), fee.getAdultFee());
|
|
|
+ adultMap.replace("total", DecimalUtil.add(ledgerMap.get("total"), fee.getAdultFee()));
|
|
|
+
|
|
|
+ }
|
|
|
+ dao.updateZyLedgerFileCharges(patNo, times, ledgerSn, ledgerMap);
|
|
|
+
|
|
|
ReceiptEntity entity = new ReceiptEntity();
|
|
|
- String infantfee = dao.selectInfantFee(patNo, times, ledgerSn, begntime, endtime);
|
|
|
- if (StringUtil.notBlank(infantfee) && DecimalUtil.compare(infantfee, "0") == 1) {
|
|
|
- Map<String, String> infantMap = initReceiptMap();
|
|
|
- List<ReceiptFee> infantReceipts = dao.selectInfantReceiptFees(patNo, times, ledgerSn, begntime, endtime);
|
|
|
- for (ReceiptFee fee : infantReceipts) {
|
|
|
- infantMap.replace(fee.getBillCode(), fee.getLedgerFee());
|
|
|
- }
|
|
|
- infantMap.replace("total", infantfee);
|
|
|
+ if (DecimalUtil.compare(infantMap.get("total"), "0") == 1) {
|
|
|
String patNo1 = patNo + "$1";
|
|
|
String patNo6 = patNo + "$6";
|
|
|
dao.updateInfantfee(patNo1, patNo6, times, infantMap);
|
|
|
entity.setInfant(infantMap);
|
|
|
}
|
|
|
|
|
|
- Map<String, String> adultMap = initReceiptMap();
|
|
|
- String adultfee = dao.selectAdultFee(patNo, times, ledgerSn, begntime, endtime);
|
|
|
- List<ReceiptFee> adultReceipts = dao.selectAdultReceiptFees(patNo, times, ledgerSn, begntime, endtime);
|
|
|
- if (null == adultReceipts) {
|
|
|
- adultReceipts = new ArrayList<>();
|
|
|
- }
|
|
|
- for (ReceiptFee fee : adultReceipts) {
|
|
|
- adultMap.replace(fee.getBillCode(), fee.getLedgerFee());
|
|
|
- }
|
|
|
- adultMap.replace("total", adultfee);
|
|
|
- dao.updateZyLedgerFileCharges(patNo, times, ledgerSn, adultMap);
|
|
|
String balance = dao.selectBalance(patNo, times, ledgerSn);
|
|
|
dao.updateZyActpatientCharges(patNo, balance, adultMap);
|
|
|
entity.setAdult(adultMap);
|