|
@@ -2,6 +2,7 @@ package thyyxxk.simzfeeoprnsystm.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import thyyxxk.simzfeeoprnsystm.dao.SiLogDao;
|
|
|
import thyyxxk.simzfeeoprnsystm.dao.SiMzDao;
|
|
|
import thyyxxk.simzfeeoprnsystm.dao.SiSetldetailDao;
|
|
@@ -36,7 +37,8 @@ public class SiMzFeeService {
|
|
|
private static final String ERROR_MESSAGE = "err_msg";
|
|
|
private static final String OUTPUT = "output";
|
|
|
private final SiLogDao logDao;
|
|
|
-
|
|
|
+ @Value("${web-his-url}")
|
|
|
+ private String webHisUrl;
|
|
|
|
|
|
@Autowired
|
|
|
public SiMzFeeService(SiMzDao mzDao, SiSetlinfoDao setlinfoDao,
|
|
@@ -542,18 +544,18 @@ public class SiMzFeeService {
|
|
|
mzptnt.setPatNo(ecpms.getPatientId());
|
|
|
mzptnt.setTimes(ecpms.getTimes());
|
|
|
mzptnt.setAcctUsedFlag(String.valueOf(ecpms.getAcctUsedFlag()));
|
|
|
- SiPatInfo siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
|
|
|
- if (null == siPatInfo) {
|
|
|
- Map<String, Object> map = webHisSrvc.queryInsuinfo(ecpms);
|
|
|
+ int hasSiPatInfo = mzDao.updateMzTimes(mzptnt.getPatNo(), mzptnt.getTimes());
|
|
|
+ if (hasSiPatInfo == 0) {
|
|
|
+ Map<String, Object> map = webHisSrvc.queryInsuinfo(webHisUrl, ecpms);
|
|
|
if (null == map) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
}
|
|
|
if ((int) map.get("code") == -1) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, map.get("msg").toString());
|
|
|
}
|
|
|
- siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
|
|
|
}
|
|
|
// 查询到职工参保信息后挂号登记(执行到这一步,siPatInfo必不为空,所以无需作非空判断)
|
|
|
+ SiPatInfo siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
|
|
|
mzptnt.setInsuplcAdmdvs(siPatInfo.getInsuplcAdmdvs());
|
|
|
mzptnt.setInsutype(siPatInfo.getInsutype());
|
|
|
mzptnt.setPsnType(siPatInfo.getPsnType());
|
|
@@ -573,6 +575,7 @@ public class SiMzFeeService {
|
|
|
if (regres.getCode() != ExceptionEnum.SUCCESS.getCode()) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, regres.getMessage());
|
|
|
}
|
|
|
+
|
|
|
// 挂号登记成功后上传就诊信息
|
|
|
siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
|
|
|
siPatInfo.setFromDirectReg(true);
|
|
@@ -588,7 +591,7 @@ public class SiMzFeeService {
|
|
|
}
|
|
|
|
|
|
// 上传就诊信息成功后生成门诊医保费用
|
|
|
- ResultVo<List<Map<String, Object>>> getMzRcptRes = webHisSrvc.getMzReceipts(mzptnt);
|
|
|
+ ResultVo<List<Map<String, Object>>> getMzRcptRes = webHisSrvc.getMzReceipts(webHisUrl, mzptnt);
|
|
|
if (null == getMzRcptRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
@@ -604,7 +607,7 @@ public class SiMzFeeService {
|
|
|
mzReceipts.addAll(entry.getValue());
|
|
|
}
|
|
|
}
|
|
|
- ResultVo<String> insertSiMzFeeRes = webHisSrvc.insertSiMzFees(mzReceipts);
|
|
|
+ ResultVo<String> insertSiMzFeeRes = webHisSrvc.insertSiMzFees(webHisUrl, mzReceipts);
|
|
|
if (null == insertSiMzFeeRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|