|
|
@@ -12,9 +12,6 @@ import thyyxxk.simzfeeoprnsystm.external.WebHisSrvc;
|
|
|
import thyyxxk.simzfeeoprnsystm.pojo.*;
|
|
|
import thyyxxk.simzfeeoprnsystm.pojo.ResultVo;
|
|
|
import thyyxxk.simzfeeoprnsystm.pojo.SiPatInfo;
|
|
|
-import thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.EcTokenParams;
|
|
|
-import thyyxxk.simzfeeoprnsystm.pojo.registration.InsuInfo;
|
|
|
-import thyyxxk.simzfeeoprnsystm.pojo.registration.PsnBaseInfo;
|
|
|
import thyyxxk.simzfeeoprnsystm.utils.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -392,6 +389,14 @@ public class SiMzFeeService {
|
|
|
|
|
|
private ResultVo<FundDetail> getFundDetailResultVo(SiSetlinfo sisetl) {
|
|
|
FundDetail fundDetail = new FundDetail();
|
|
|
+ String insplc = sisetl.getInsuplcAdmdvs();
|
|
|
+ if (insplc.startsWith("4301")) {
|
|
|
+ fundDetail.setCardType(1);
|
|
|
+ } else if (insplc.equals("439900")) {
|
|
|
+ fundDetail.setCardType(2);
|
|
|
+ } else {
|
|
|
+ fundDetail.setCardType(3);
|
|
|
+ }
|
|
|
fundDetail.setTotalCost(String.valueOf(sisetl.getMedfeeSumamt()));
|
|
|
fundDetail.setFundPay(String.valueOf(sisetl.getFundPaySumamt()));
|
|
|
fundDetail.setCashPay(String.valueOf(sisetl.getPsnCashPay()));
|
|
|
@@ -537,24 +542,14 @@ public class SiMzFeeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public ResultVo<FundDetail> directRegistration(EcTokenParams ecpms) {
|
|
|
- // 查询参保信息
|
|
|
+ public ResultVo<FundDetail> directRegistration(DirectionRegParam param) {
|
|
|
+ mzDao.updateMzTimes(param.getPatientId(), param.getTimes());
|
|
|
MzPatientInfo mzptnt = new MzPatientInfo();
|
|
|
- mzptnt.setStaffId(ecpms.getStaffId());
|
|
|
- mzptnt.setPatNo(ecpms.getPatientId());
|
|
|
- mzptnt.setTimes(ecpms.getTimes());
|
|
|
- mzptnt.setAcctUsedFlag(String.valueOf(ecpms.getAcctUsedFlag()));
|
|
|
- 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必不为空,所以无需作非空判断)
|
|
|
+ mzptnt.setStaffId(param.getStaffId());
|
|
|
+ mzptnt.setPatNo(param.getPatientId());
|
|
|
+ mzptnt.setTimes(param.getTimes());
|
|
|
+ mzptnt.setAcctUsedFlag(String.valueOf(param.getAcctUsedFlag()));
|
|
|
+
|
|
|
SiPatInfo siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
|
|
|
mzptnt.setInsuplcAdmdvs(siPatInfo.getInsuplcAdmdvs());
|
|
|
mzptnt.setInsutype(siPatInfo.getInsutype());
|
|
|
@@ -562,10 +557,11 @@ public class SiMzFeeService {
|
|
|
mzptnt.setName(siPatInfo.getPsnName());
|
|
|
mzptnt.setSocialNo(siPatInfo.getCertno());
|
|
|
|
|
|
- if (StringUtil.notBlank(ecpms.getEcIndexNo())) {
|
|
|
- mzptnt.setMdtrtCertType(MdtrtCertType.MEDICAL_INSURANCE_ELECTRONIC_VOUCHER.getLabel());
|
|
|
+ if (StringUtil.notBlank(param.getReadCardResult())) {
|
|
|
+ MdtrtCertType mdtrtCertType = MdtrtCertType.get(param.getReadCardType());
|
|
|
+ mzptnt.setMdtrtCertType(mdtrtCertType.getLabel());
|
|
|
mzptnt.setReadCardBizType(ReadCardBizType.REGISTRATION.getCode());
|
|
|
- mzptnt.setReadCardResult(JSONObject.toJSONString(ecpms));
|
|
|
+ mzptnt.setReadCardResult(param.getReadCardResult());
|
|
|
}
|
|
|
|
|
|
ResultVo<String> regres = outpatientRegistration(mzptnt);
|
|
|
@@ -580,7 +576,8 @@ public class SiMzFeeService {
|
|
|
siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
|
|
|
siPatInfo.setFromDirectReg(true);
|
|
|
SpcChrDiseAcct spcChrDiseAcct = new SpcChrDiseAcct();
|
|
|
- ResultVo<String> upldMdtrtRes = uploadOutpatientInfo(spcChrDiseAcct, siPatInfo, ecpms.getStaffId());
|
|
|
+ ResultVo<String> upldMdtrtRes = uploadOutpatientInfo(spcChrDiseAcct, siPatInfo, param.getStaffId());
|
|
|
+ log.info("上传就诊信息:{}", upldMdtrtRes);
|
|
|
if (null == upldMdtrtRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
@@ -592,6 +589,7 @@ public class SiMzFeeService {
|
|
|
|
|
|
// 上传就诊信息成功后生成门诊医保费用
|
|
|
ResultVo<List<Map<String, Object>>> getMzRcptRes = webHisSrvc.getMzReceipts(webHisUrl, mzptnt);
|
|
|
+ log.info("获取门诊处方:{}", getMzRcptRes);
|
|
|
if (null == getMzRcptRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
@@ -607,7 +605,8 @@ public class SiMzFeeService {
|
|
|
mzReceipts.addAll(entry.getValue());
|
|
|
}
|
|
|
}
|
|
|
- ResultVo<String> insertSiMzFeeRes = webHisSrvc.insertSiMzFees(webHisUrl, mzReceipts);
|
|
|
+ ResultVo<String> insertSiMzFeeRes = webHisSrvc.insertSiMzFeesForThmz(webHisUrl, mzReceipts);
|
|
|
+ log.info("生成医保费用:{}", insertSiMzFeeRes);
|
|
|
if (null == insertSiMzFeeRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
@@ -618,11 +617,12 @@ public class SiMzFeeService {
|
|
|
}
|
|
|
|
|
|
// 生成费用成功后上传到医保
|
|
|
- spcChrDiseAcct.setStaffId(ecpms.getStaffId());
|
|
|
+ spcChrDiseAcct.setStaffId(param.getStaffId());
|
|
|
spcChrDiseAcct.setPatNo(mzptnt.getPatNo());
|
|
|
spcChrDiseAcct.setTimes(mzptnt.getTimes());
|
|
|
spcChrDiseAcct.setFromDirectReg(true);
|
|
|
ResultVo<SiPatInfo> upldFeeRes = uploadOutpatientFeeDetails(spcChrDiseAcct);
|
|
|
+ log.info("上传医保费用:{}", upldFeeRes);
|
|
|
if (null == upldFeeRes) {
|
|
|
revokeOutpatientRegistration(mzptnt);
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
@@ -635,15 +635,6 @@ public class SiMzFeeService {
|
|
|
return outpatientSettlement(mzptnt);
|
|
|
}
|
|
|
|
|
|
- private InsuInfo getEmployeeInsuInfo(List<InsuInfo> list) {
|
|
|
- for (InsuInfo info : list) {
|
|
|
- if (info.getInsutype().equals("310")) {
|
|
|
- return info;
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
// public ResultVo<String> payOnline(EcTokenParams params) {
|
|
|
//
|
|
|
//
|