|
|
@@ -2,6 +2,7 @@ package thyyxxk.simzfeeoprnsystm.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import net.sf.jsqlparser.statement.SetStatement;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import thyyxxk.simzfeeoprnsystm.dao.SiLogDao;
|
|
|
import thyyxxk.simzfeeoprnsystm.dao.SiMzDao;
|
|
|
@@ -113,25 +114,36 @@ public class SiMzFeeService {
|
|
|
if (null == siPatInfo || StringUtil.isBlank(siPatInfo.getMdtrtId())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的医保挂号信息。");
|
|
|
}
|
|
|
+ RevokeRegRequest request = new RevokeRegRequest();
|
|
|
+ request.setInsuplcAdmdvs(siPatInfo.getInsuplcAdmdvs()); ;
|
|
|
+ request.setStaffId(p.getStaffId());
|
|
|
+ request.setPsnNo(siPatInfo.getPsnNo());
|
|
|
+ request.setMdtrtId(siPatInfo.getMdtrtId());
|
|
|
+ request.setPatNo(p.getPatNo());
|
|
|
+ request.setTimes(p.getTimes());
|
|
|
+ return executeOutpatientRegRevoke(request);
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> executeOutpatientRegRevoke(RevokeRegRequest request) {
|
|
|
JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.REVOKE_OUTPATIENT_REGISTRATION,
|
|
|
- siPatInfo.getInsuplcAdmdvs(), p.getStaffId());
|
|
|
+ request.getInsuplcAdmdvs(), request.getStaffId());
|
|
|
JSONObject data = new JSONObject();
|
|
|
- data.put("psn_no", siPatInfo.getPsnNo());
|
|
|
- data.put("mdtrt_id", siPatInfo.getMdtrtId());
|
|
|
- data.put("ipt_otp_no", p.getPatNo());
|
|
|
+ data.put("psn_no", request.getPsnNo());
|
|
|
+ data.put("mdtrt_id", request.getMdtrtId());
|
|
|
+ data.put("ipt_otp_no", request.getPatNo());
|
|
|
input.getJSONObject("input").put("data", data);
|
|
|
JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_OUTPATIENT_REGISTRATION);
|
|
|
- log.info("【操作员:{}】,取消门诊挂号:\n参数:{},\n结果:{}", p.getStaffId(), input, result);
|
|
|
+ log.info("【操作员:{}】,取消门诊挂号:\n参数:{},\n结果:{}", request.getStaffId(), input, result);
|
|
|
if (null == result) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
}
|
|
|
Integer infcode = result.getInteger(RESULT_CODE);
|
|
|
- logDao.insert(new SiLog(input, result, p.getPatNo(), p.getTimes(), infcode, siPatInfo.getPsnNo()));
|
|
|
+ logDao.insert(new SiLog(input, result, request.getPatNo(), request.getTimes(), infcode, request.getPsnNo()));
|
|
|
if (null == infcode) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
if (infcode == 0) {
|
|
|
- mzDao.clearMdtrtIdForMz(p.getPatNo(), p.getTimes(), null);
|
|
|
+ mzDao.clearMdtrtIdForMz(request.getPatNo(), request.getTimes(), null);
|
|
|
return ResultVoUtil.success("取消门诊挂号成功。");
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|