|
@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import thyyxxk.webserver.config.exception.BizException;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.sidicts.*;
|
|
|
import thyyxxk.webserver.constants.YesOrNo;
|
|
@@ -522,6 +523,13 @@ public class SiZyService {
|
|
|
Date beginTime = dismissService.getBegntime(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), "zy_actpatient");
|
|
|
p.setYbRegisterDate(beginTime);
|
|
|
}
|
|
|
+ if (null == p.getDismissDate()) {
|
|
|
+ Date disdate = dao.selectDisdate(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
|
|
|
+ if (null == disdate) {
|
|
|
+ throw new BizException(ExceptionEnum.LOGICAL_ERROR, "请先提交出院申请!");
|
|
|
+ }
|
|
|
+ p.setDismissDate(disdate);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private ResultVo<String> inpatientSettlement(ZyPatientInfo p) {
|
|
@@ -602,6 +610,7 @@ public class SiZyService {
|
|
|
}
|
|
|
|
|
|
private ResultVo<String> executeHisSettlement(JSONObject output, ZyPatientInfo p) {
|
|
|
+ dao.deleteSetlDetail(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
|
|
|
JSONObject setlinfo = output.getJSONObject("setlinfo");
|
|
|
SiSetlinfo setlinfoEntity = JSONObject.parseObject(setlinfo.toJSONString(), SiSetlinfo.class);
|
|
|
setlinfoEntity.setPatNo(p.getInpatientNo());
|
|
@@ -615,10 +624,19 @@ public class SiZyService {
|
|
|
setlinfoEntity.setEndtime(p.getDismissDate());
|
|
|
setlinfoEntity.setHiPaymtd(CommonUtil.calcHiPaymtd(setlinfoEntity.getInsuplcAdmdvs(),setlinfoEntity.getMedType(),setlinfoEntity.getInsutype(),setlinfoEntity.getSetlTime()));
|
|
|
setlinfoEntity.setMedinsType(MedInsTypeUtil.getMedInsType(setlinfoEntity));
|
|
|
+ if (null == setlinfoEntity.getPsnPartAmt() && null == setlinfoEntity.getPsnCashPay()) {
|
|
|
+ Double psnPay = output.getDouble("psn_pay");
|
|
|
+ if (null != psnPay) {
|
|
|
+ setlinfoEntity.setPsnPartAmt(psnPay);
|
|
|
+ setlinfoEntity.setPsnCashPay(psnPay);
|
|
|
+ }
|
|
|
+ }
|
|
|
JSONArray setldetail = output.getJSONArray("setldetail");
|
|
|
BigDecimal hospitalPart = BigDecimal.ZERO;
|
|
|
for (int i = 0; i < setldetail.size(); i++) {
|
|
|
SiSetldetail setldetailEntity = JSONObject.parseObject(setldetail.getJSONObject(i).toJSONString(), SiSetldetail.class);
|
|
|
+ setldetailEntity.setSetlId(setlinfoEntity.getSetlId());
|
|
|
+ setldetailEntity.setSortNo(i + 1);
|
|
|
setldetailEntity.setPatNo(p.getInpatientNo());
|
|
|
setldetailEntity.setTimes(p.getAdmissTimes());
|
|
|
setldetailEntity.setLedgerSn(p.getLedgerSn());
|