|
@@ -105,11 +105,12 @@ public class DismissService {
|
|
|
final String inpatientNo = param.getInpatientNo();
|
|
|
final Integer admissTimes = param.getAdmissTimes();
|
|
|
if (param.getDismissFlag() == 1) {
|
|
|
- int disActOrderCount;
|
|
|
- if ("zy_actpatient".equals(param.getTable())) {
|
|
|
- disActOrderCount = dao.countDisActOrders(inpatientNo, admissTimes);
|
|
|
- } else {
|
|
|
+ Integer disActOrderCount = dao.countDisActOrders(inpatientNo, admissTimes);
|
|
|
+ if (null == disActOrderCount || disActOrderCount == 0) {
|
|
|
disActOrderCount = dao.countDisActOrders2(inpatientNo, admissTimes);
|
|
|
+ if (null == disActOrderCount) {
|
|
|
+ disActOrderCount = 0;
|
|
|
+ }
|
|
|
}
|
|
|
if (disActOrderCount < 1) {
|
|
|
ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
|
|
@@ -127,7 +128,7 @@ public class DismissService {
|
|
|
exception.setMessage("没有找到入院时间,请重新获取病人信息。");
|
|
|
throw new BizException(exception);
|
|
|
}
|
|
|
- Date actOrderDisDate = getDismissDate(param.getTable(), param.getDismissFlag(), inpatientNo, admissTimes, param.getZjdzDatetime());
|
|
|
+ Date actOrderDisDate = getDismissDate(param.getDismissFlag(), inpatientNo, admissTimes, param.getZjdzDatetime());
|
|
|
final int ledgerSn = dao.getLedgerSn(inpatientNo, admissTimes);
|
|
|
if (dao.hasUnsettledStepOne(inpatientNo, admissTimes, ledgerSn) < 0) {
|
|
|
ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
|
|
@@ -352,8 +353,9 @@ public class DismissService {
|
|
|
}
|
|
|
final int infantFlag = dao.selectInfantFlag(indata.getInpatientNo(), indata.getAdmissTimes(),
|
|
|
indata.getLedgerSn()); // =0 无婴儿,>0 有婴儿
|
|
|
- final Date dismissDate = getDismissDate(indata.getTable(), indata.getFlag(), indata.getInpatientNo(), indata.getAdmissTimes(),
|
|
|
+ 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(),
|
|
@@ -403,15 +405,15 @@ public class DismissService {
|
|
|
return totalCharge;
|
|
|
}
|
|
|
|
|
|
- private Date getDismissDate(String table, Integer flag, String inpatientNo, Integer admissTimes, Date zjdzDate) {
|
|
|
+ private Date getDismissDate(Integer flag, String inpatientNo, Integer admissTimes, Date zjdzDate) {
|
|
|
if (flag == 2) {
|
|
|
return zjdzDate;
|
|
|
}
|
|
|
- if ("zy_actpatient".equals(table)) {
|
|
|
- return dao.selectActOrderDisDate(inpatientNo, admissTimes);
|
|
|
- } else {
|
|
|
- return dao.selectActOrderDisDate2(inpatientNo, admissTimes);
|
|
|
+ Date disdate = dao.selectActOrderDisDate(inpatientNo, admissTimes);
|
|
|
+ if (null == disdate) {
|
|
|
+ disdate = dao.selectActOrderDisDate2(inpatientNo, admissTimes);;
|
|
|
}
|
|
|
+ return disdate;
|
|
|
}
|
|
|
|
|
|
private int updateCostStatusToSettled(YbSettleFee param) {
|