Bläddra i källkod

异常处理功能

oyq28 2 år sedan
förälder
incheckning
7e1f4d644a

+ 5 - 4
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/dispatchRecord/DispatchExceptionController.java

@@ -172,13 +172,14 @@ public class DispatchExceptionController extends SuperSimpleController<AAutoNode
 
     @ApiOperation(value = "重发数据节点", notes = "重发数据节点")
     @PostMapping("/resend")
-    private R<Boolean> resend(@RequestBody Map<String, Long> map){
-        AAutoNodeLog autoNodeLog = aAutoNodeLogService.getById(map.get("id"));
+    public R<Boolean> resend(@RequestBody Map<String, Long> map){
+        Long id = map.get("id");
+        AAutoNodeLog autoNodeLog = aAutoNodeLogService.getById(id);
         Long taskNodeId = autoNodeLog.getTaskNodeId();
         //判断重发节点操作条件(待定)
         Map<String, Object> conMap = msgUtil.redis_get_map(CacheKey.TASK_CURRENT_NODE_CONDITION + "_" + taskNodeId);
         //获取重发执行传参
-        String jsonParam = msgUtil.redis_get(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNodeId).toString();
+        String jsonParam = msgUtil.redis_get(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNodeId)!=null? msgUtil.redis_get(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNodeId).toString(): "";
         if(StringUtils.isEmpty(jsonParam)){
             return R.fail("指令请求不存在");
         }
@@ -213,7 +214,7 @@ public class DispatchExceptionController extends SuperSimpleController<AAutoNode
         String instructionUrl = conMap.get("instructionUrl") +"/api/"+ autoNodeLog.getMethod().toString() ;
         String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
         JSONObject retJson = JSONObject.parseObject(returnData);
-        String code = retJson.getString("code").trim();
+        String code = retJson.getString("result").trim();
         if(code.equals("false")){
             autoNodeLog.setExeResult("0").setManual("1").setFeedback(retJson.getString("msg")).setExecuteTime(new Date());
             aAutoNodeLogService.updateAllById(autoNodeLog);