LIJU 3 هفته پیش
والد
کامیت
ad65d7d207

+ 11 - 0
src/main/java/thyyxxk/sizyfeeoprnsystm/service/ExecService.java

@@ -197,4 +197,15 @@ public class ExecService {
         return template.postForObject(cfg.getApiUrl(),
                 new HttpEntity<>(input, getHttpHeaders(function)), JSONObject.class);
     }
+    
+    /**
+     * 执行工伤接口调用(工伤接口使用不同的请求头格式)
+     */
+    public JSONObject executeWorkInjuryTrade(JSONObject input) {
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("Content-Type", "application/json");
+        // 工伤接口可能不需要医保接口的认证头,直接使用简单的JSON头
+        return template.postForObject(cfg.getApiUrl(),
+                new HttpEntity<>(input, headers), JSONObject.class);
+    }
 }

+ 21 - 12
src/main/java/thyyxxk/sizyfeeoprnsystm/service/SiZyFeeService.java

@@ -631,8 +631,11 @@ public class SiZyFeeService {
             return;
         }
         
-        // 构建工伤撤销请求(使用相同的接口代码,但可能有不同的参数)
-        JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.REVOKE_HOSPITALIZATION_FEE_DETAILS, siPatInfo.getInsuplcAdmdvs(), p.getStaffId());
+        // 构建工伤撤销请求(处方明细撤销)
+        JSONObject input = new JSONObject();
+        input.put("action", "transaction");
+        input.put("transactionName", "2205");
+        input.put("businessParams", new JSONObject());
         JSONArray data = new JSONArray();
         p.getDetailSns().forEach(detailSn -> {
             JSONObject item = new JSONObject();
@@ -641,10 +644,10 @@ public class SiZyFeeService {
             item.put("psn_no", siPatInfo.getPsnNo());
             data.add(item);
         });
-        input.getJSONObject("input").put("data", data);
+        input.getJSONObject("businessParams").put("data", data);
         
         // 调用工伤撤销接口
-        JSONObject result = exec.executeTrade(input, SiFunction.REVOKE_HOSPITALIZATION_FEE_DETAILS);
+        JSONObject result = exec.executeWorkInjuryTrade(input);
         log.info("【操作员:{}】撤销工伤已上传的费用:\n参数:{},\n结果:{}", p.getStaffId(), input, result);
         
         if (null == result || null == result.getInteger(RESULT_CODE)) {
@@ -675,8 +678,11 @@ public class SiZyFeeService {
             return result;
         }
         
-        // 构建工伤费用上传请求头
-        JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.UPLOAD_HOSPITALIZATION_FEE_DETAILS, p.getAdmdvs(), p.getStaffId());
+        // 构建工伤费用上传请求头(处方明细上报)
+        JSONObject input = new JSONObject();
+        input.put("action", "transaction");
+        input.put("transactionName", "2204");
+        input.put("businessParams", new JSONObject());
         List<FeeDtle> tempList = new ArrayList<>();
         
         while (!feeQueue.isEmpty()) {
@@ -751,10 +757,10 @@ public class SiZyFeeService {
      */
     private int[] executeWorkInjuryUploadFees(JSONObject input, List<FeeDtle> fees, ZyPatientInfo p) {
         String ref = JSONArray.toJSONString(fees);
-        input.getJSONObject("input").put("feedetail", JSONArray.parse(ref));
+        input.getJSONObject("businessParams").put("feedetail", JSONArray.parse(ref));
         
         // 调用工伤费用上传接口
-        JSONObject result = exec.executeTrade(input, SiFunction.UPLOAD_HOSPITALIZATION_FEE_DETAILS);
+        JSONObject result = exec.executeWorkInjuryTrade(input);
         int infcode = result.getIntValue(RESULT_CODE);
         String logMsg = infcode + "," + result.getString("inf_refmsgid");
         log.info("【操作员:{}】,工伤费用上传:\n患者:{},\n结果:{}", p.getStaffId(),
@@ -806,13 +812,16 @@ public class SiZyFeeService {
         zyPreSetlmt.setAcctUsedFlag(YesOrNo.NO.getCodeStr());
         zyPreSetlmt.setMidSetlFlag(YesOrNo.NO.getCodeStr());
         
-        // 构建工伤预结算请求
-        JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.HOSPITALIZATION_PRE_SETTLEMENT, zyPreSetlmt.getInsuplcAdmdvs(), p.getStaffId());
+        // 构建工伤预结算请求(费用预结算)
+        JSONObject input = new JSONObject();
+        input.put("action", "transaction");
+        input.put("transactionName", "2206");
+        input.put("businessParams", new JSONObject());
         String ref = JSONObject.toJSONString(zyPreSetlmt);
-        input.getJSONObject("input").put("data", JSONObject.parseObject(ref));
+        input.getJSONObject("businessParams").put("data", JSONObject.parseObject(ref));
         
         // 调用工伤预结算接口
-        JSONObject result = exec.executeTrade(input, SiFunction.HOSPITALIZATION_PRE_SETTLEMENT);
+        JSONObject result = exec.executeWorkInjuryTrade(input);
         log.info("工伤预结算:\n参数:{},\n结果:{}", input, result);
         
         if (null == result) {