lighter 2 年 前
コミット
a1f5c0413d

+ 5 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/controller/SiMzFeeController.java

@@ -28,6 +28,11 @@ public class SiMzFeeController {
         return service.revokeOutpatientRegistration(p);
     }
 
+    @PostMapping("/executeOutpatientRegRevoke")
+    public ResultVo<String> executeOutpatientRegRevoke(@RequestBody RevokeRegRequest request) {
+        return service.executeOutpatientRegRevoke(request);
+    }
+
     @PostMapping("/uploadOutpatientFeeDetails")
     public ResultVo<SiPatInfo> uploadOutpatientFeeDetails(@RequestBody SpcChrDiseAcct p) {
         return service.uploadOutpatientFeeDetails(p);

+ 18 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/RevokeRegRequest.java

@@ -0,0 +1,18 @@
+package thyyxxk.simzfeeoprnsystm.pojo;
+
+import lombok.Data;
+
+@Data
+public class RevokeRegRequest {
+    private String insuplcAdmdvs;
+    private String staffId;
+    private String psnNo;
+    private String mdtrtId;
+    private String patNo;
+    private Integer times;
+
+    // -9代表没有次数,是从《就诊信息查询》等页面进行的取消登记操作
+    public Integer getTimes() {
+        return null == times ? -9 : times;
+    }
+}

+ 19 - 7
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

@@ -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));