|
@@ -11,6 +11,8 @@ import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
import thyyxxk.webserver.constants.SiFunction;
|
|
|
import thyyxxk.webserver.constants.sidicts.MdtrtCertType;
|
|
|
+import thyyxxk.webserver.dao.his.medicalinsurance.SiSetldetailDao;
|
|
|
+import thyyxxk.webserver.dao.his.medicalinsurance.SiSetlinfoDao;
|
|
|
import thyyxxk.webserver.dao.his.medicalinsurance.SiZyDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.*;
|
|
@@ -47,13 +49,18 @@ public class SiZyService {
|
|
|
private static final String ERROR_MESSAGE = "err_msg";
|
|
|
private static final String OUTPUT = "output";
|
|
|
private final SiZyDao dao;
|
|
|
+ private final SiSetlinfoDao setlinfoDao;
|
|
|
+ private final SiSetldetailDao setldetailDao;
|
|
|
private final ExecService exec;
|
|
|
private final SettleService settleService;
|
|
|
private final DismissService dismissService;
|
|
|
|
|
|
@Autowired
|
|
|
- public SiZyService(SiZyDao dao, ExecService exec, SettleService settleService, DismissService dismissService) {
|
|
|
+ public SiZyService(SiZyDao dao, SiSetlinfoDao setlinfoDao, SiSetldetailDao setldetailDao, ExecService exec,
|
|
|
+ SettleService settleService, DismissService dismissService) {
|
|
|
this.dao = dao;
|
|
|
+ this.setlinfoDao = setlinfoDao;
|
|
|
+ this.setldetailDao = setldetailDao;
|
|
|
this.exec = exec;
|
|
|
this.settleService = settleService;
|
|
|
this.dismissService = dismissService;
|
|
@@ -354,10 +361,23 @@ public class SiZyService {
|
|
|
}
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject setlinfo = result.getJSONObject(OUTPUT).getJSONObject("setlinfo");
|
|
|
- String setlId = setlinfo.getString("setl_id");
|
|
|
- String medinsSetlId = setlinfo.getString("medins_setl_id");
|
|
|
- dao.updateSiZyInfoSetlId(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(), setlId, medinsSetlId);
|
|
|
- // todo 结算
|
|
|
+ SiSetlinfo setlEntity = JSONObject.parseObject(setlinfo.toJSONString(), SiSetlinfo.class);
|
|
|
+ setlEntity.setInpatientNo(p.getInpatientNo());
|
|
|
+ setlEntity.setAdmissTimes(p.getAdmissTimes());
|
|
|
+ setlEntity.setLedgerSn(p.getLedgerSn());
|
|
|
+ setlinfoDao.insert(setlEntity);
|
|
|
+ dao.updateSiZyInfoSetlId(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(),
|
|
|
+ setlEntity.getSetlId(), setlEntity.getMedinsSetlId());
|
|
|
+ JSONArray setldetail = result.getJSONObject(OUTPUT).getJSONArray("setldetail");
|
|
|
+ for (int i = 0; i < setldetail.size(); i++) {
|
|
|
+ SiSetldetail setldetailEntity = JSONObject.parseObject(setldetail.getJSONObject(i).toJSONString(), SiSetldetail.class);
|
|
|
+ setldetailEntity.setInpatientNo(p.getInpatientNo());
|
|
|
+ setldetailEntity.setAdmissTimes(p.getAdmissTimes());
|
|
|
+ setldetailEntity.setLedgerSn(p.getLedgerSn());
|
|
|
+ setldetailDao.insert(setldetailEntity);
|
|
|
+ }
|
|
|
+
|
|
|
+ // todo 结算,需要改造
|
|
|
YbSettleFee settleFee = new YbSettleFee();
|
|
|
if (p.getDismissFlag() == 2) {
|
|
|
settleFee.setZjdzDatetime(p.getMidSetlDate());
|