|
@@ -190,26 +190,6 @@ public class DismissService {
|
|
|
exception.setMessage("费用计算失败。执行zy_cngl_fyjs过程出错。");
|
|
|
throw new BizException(exception);
|
|
|
}
|
|
|
-// String[] receipts = getReceiptFees(receiptFees);
|
|
|
-// String adultFee = dao.selectAdultFee(patNo, times, ledgerSn);
|
|
|
-// if (null == adultFee) {
|
|
|
-// adultFee = "0";
|
|
|
-// }
|
|
|
-// log.info("总费用:{},发票计算费用:{}", adultFee, receipts[0]);
|
|
|
-// if (DecimalUtil.compare(receipts[0], adultFee) != 0) {
|
|
|
-// ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
|
|
|
-// exception.setMessage("此患者明细费用与发票费用不一致。");
|
|
|
-// throw new BizException(exception);
|
|
|
-// }
|
|
|
-// String infantFee = dao.selectInfantFee(patNo, times, ledgerSn);
|
|
|
-// if (null == infantFee) {
|
|
|
-// infantFee = "0";
|
|
|
-// }
|
|
|
-// if (DecimalUtil.compare(receipts[1], infantFee) != 0) {
|
|
|
-// ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
|
|
|
-// exception.setMessage("此患者婴儿明细费用与发票婴儿费用不一致。");
|
|
|
-// throw new BizException(exception);
|
|
|
-// }
|
|
|
dao.deleteTemporaryTable(patNo, times);
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
@@ -263,11 +243,10 @@ public class DismissService {
|
|
|
}
|
|
|
final int infantFlag = dao.selectInfantFlag(indata.getInpatientNo(), indata.getAdmissTimes(),
|
|
|
indata.getLedgerSn()); // =0 无婴儿,>0 有婴儿
|
|
|
+ final Date admissDate = getAdmissDate(indata.getInpatientNo(), indata.getAdmissTimes(), indata.getTable());
|
|
|
final Date dismissDate = getDismissDate(indata.getFlag(), indata.getInpatientNo(), indata.getAdmissTimes(),
|
|
|
indata.getZjdzDatetime());
|
|
|
-
|
|
|
final Integer transFlag = indata.getFlag() == 1 ? 0 : 2;
|
|
|
- final Date admissDate = dao.selectAdmissDate(indata.getInpatientNo(), indata.getAdmissTimes(), indata.getTable());
|
|
|
final List<ReceiptFee> fees = dao.calculateCost(indata.getInpatientNo(), indata.getAdmissTimes(),
|
|
|
indata.getLedgerSn(), indata.getStaffId(), admissDate, dismissDate, indata.getWardCode(),
|
|
|
indata.getDeptCode(), transFlag);
|
|
@@ -316,6 +295,14 @@ public class DismissService {
|
|
|
return new String[]{adultCharge, infantCharge};
|
|
|
}
|
|
|
|
|
|
+ private Date getAdmissDate(String patNo, int times, String table) {
|
|
|
+ Date admdate = dao.selectAccountDate(patNo, times);
|
|
|
+ if (null == admdate) {
|
|
|
+ admdate = dao.selectAdmissDate(patNo, times, table);
|
|
|
+ }
|
|
|
+ return admdate;
|
|
|
+ }
|
|
|
+
|
|
|
private Date getDismissDate(Integer flag, String patNo, Integer times, Date zjdzDate) {
|
|
|
if (flag == 2) {
|
|
|
return zjdzDate;
|