|
@@ -195,7 +195,6 @@ public class DismissService {
|
|
|
throw new BizException(exception);
|
|
|
}
|
|
|
dao.deleteTemporaryTable(patNo, times);
|
|
|
-
|
|
|
String mdtrtId = dao.selectMdtrtId(patNo, times, ledgerSn);
|
|
|
if (StringUtil.notBlank(mdtrtId)) {
|
|
|
Overview o = new Overview();
|
|
@@ -249,7 +248,12 @@ public class DismissService {
|
|
|
exception.setMessage("写发票表失败。");
|
|
|
throw new BizException(exception);
|
|
|
}
|
|
|
- int code = settleFee.getMidSetl() ? setHisStatusOut(settleFee) : hisMiddleSettle(settleFee);
|
|
|
+ int code;
|
|
|
+ if (settleFee.getMidSetl()) {
|
|
|
+ code = hisMiddleSettle(settleFee);
|
|
|
+ } else {
|
|
|
+ code = setHisStatusOut(settleFee);
|
|
|
+ }
|
|
|
if (updateCostStatusToSettled(settleFee, StringUtil.notBlank(mdtrtId)) < 1) {
|
|
|
ExceptionEnum exception = ExceptionEnum.LOGICAL_ERROR;
|
|
|
exception.setMessage("更新费用状态失败。");
|
|
@@ -361,37 +365,37 @@ public class DismissService {
|
|
|
return dao.updateZyDetailCharge(param.getInpatientNo(), param.getAdmissTimes(), param.getLedgerSn());
|
|
|
}
|
|
|
|
|
|
- private int setHisStatusOut(YbSettleFee param) {
|
|
|
+ private int setHisStatusOut(YbSettleFee settle) {
|
|
|
final Date disDate;
|
|
|
- if ("zy_actpatient".equals(param.getTable())) {
|
|
|
- disDate = dao.selectActOrderDisDate(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
+ if ("zy_actpatient".equals(settle.getTable())) {
|
|
|
+ disDate = dao.selectActOrderDisDate(settle.getInpatientNo(), settle.getAdmissTimes());
|
|
|
} else {
|
|
|
- disDate = dao.selectActOrderDisDate2(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
+ disDate = dao.selectActOrderDisDate2(settle.getInpatientNo(), settle.getAdmissTimes());
|
|
|
}
|
|
|
- if (dao.updateZyActpatient(param.getInpatientNo(), param.getAdmissTimes(),
|
|
|
- disDate, param.getStaffId(), param.getTable()) < 1) {
|
|
|
+ if (dao.updateZyActpatient(settle.getInpatientNo(), settle.getAdmissTimes(),
|
|
|
+ disDate, settle.getStaffId(), settle.getTable()) < 1) {
|
|
|
return -1;
|
|
|
}
|
|
|
- if ("zy_actpatient".equals(param.getTable())) {
|
|
|
- dao.deleteZyInactpatient(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
- if (dao.insertZyInactpatient(param.getInpatientNo(), param.getAdmissTimes()) < 1) {
|
|
|
+ if ("zy_actpatient".equals(settle.getTable())) {
|
|
|
+ dao.deleteZyInactpatient(settle.getInpatientNo(), settle.getAdmissTimes());
|
|
|
+ if (dao.insertZyInactpatient(settle.getInpatientNo(), settle.getAdmissTimes()) < 1) {
|
|
|
return -2;
|
|
|
}
|
|
|
}
|
|
|
- final String patNo1 = param.getInpatientNo() + "$1";
|
|
|
- final String patNo6 = param.getInpatientNo() + "$6";
|
|
|
- dao.updateZyActpatientAgain(patNo1, patNo6, param.getAdmissTimes(), disDate, param.getTable());
|
|
|
- if ("zy_actpatient".equals(param.getTable())) {
|
|
|
- dao.insertZyInactpatientAgain(patNo1, patNo6, param.getAdmissTimes());
|
|
|
+ final String patNo1 = settle.getInpatientNo() + "$1";
|
|
|
+ final String patNo6 = settle.getInpatientNo() + "$6";
|
|
|
+ dao.updateZyActpatientAgain(patNo1, patNo6, settle.getAdmissTimes(), disDate, settle.getTable());
|
|
|
+ if ("zy_actpatient".equals(settle.getTable())) {
|
|
|
+ dao.insertZyInactpatientAgain(patNo1, patNo6, settle.getAdmissTimes());
|
|
|
}
|
|
|
- if (dao.updateZyAdt(param.getInpatientNo(), param.getAdmissTimes(), param.getWardCode(), param.getDeptCode(),
|
|
|
- param.getBedNo(), disDate) < 1) {
|
|
|
+ if (dao.updateZyAdt(settle.getInpatientNo(), settle.getAdmissTimes(), settle.getWardCode(), settle.getDeptCode(),
|
|
|
+ settle.getBedNo(), disDate) < 1) {
|
|
|
return -3;
|
|
|
}
|
|
|
- dao.updateZyBedMi(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
- dao.deleteZyActpatient(param.getInpatientNo());
|
|
|
- dao.deleteZyActpatientAgain(patNo1, patNo6, param.getAdmissTimes());
|
|
|
- return insertNewZyWorkLog(param);
|
|
|
+ dao.updateZyBedMi(settle.getInpatientNo(), settle.getAdmissTimes());
|
|
|
+ dao.deleteZyActpatient(settle.getInpatientNo());
|
|
|
+ dao.deleteZyActpatientAgain(patNo1, patNo6, settle.getAdmissTimes());
|
|
|
+ return insertNewZyWorkLog(settle);
|
|
|
}
|
|
|
|
|
|
private int insertNewZyWorkLog(YbSettleFee param) {
|