Przeglądaj źródła

优化变成思路

java110 5 lat temu
rodzic
commit
e08ff81fe2

+ 20 - 5
Api/src/main/java/com/java110/api/listener/AbstractServiceApiPlusListener.java

@@ -49,19 +49,34 @@ public abstract class AbstractServiceApiPlusListener extends AbstractServiceApiD
 
         validate(event, reqJson);
 
-
         doSoService(event, dataFlowContext, reqJson);
 
         //服务合并处理
-        JSONObject paramIn = mergeService(dataFlowContext);
+//        JSONObject paramIn = mergeService(dataFlowContext);
+//
+//        ResponseEntity<String> responseEntity = this.callOrderService(dataFlowContext, paramIn);
+//
+//        dataFlowContext.setResponseEntity(responseEntity);
 
+        //提交事务
+        commit(dataFlowContext);
 
-        ResponseEntity<String> responseEntity = this.callOrderService(dataFlowContext, paramIn);
+        logger.debug("API服务 --- 返回报文信息:{}", dataFlowContext.getResponseEntity());
 
-        dataFlowContext.setResponseEntity(responseEntity);
+    }
 
-        logger.debug("API服务 --- 返回报文信息:{}", dataFlowContext.getResponseEntity());
+    /**
+     * 提前提交事务
+     * @param dataFlowContext
+     */
+    public void commit(DataFlowContext dataFlowContext) {
+
+        //服务合并处理
+        JSONObject paramIn = mergeService(dataFlowContext);
+
+        ResponseEntity<String> responseEntity = this.callOrderService(dataFlowContext, paramIn);
 
+        dataFlowContext.setResponseEntity(responseEntity);
     }
 
     /**