Browse Source

参数修改

姚云青 3 years ago
parent
commit
d754590ce4

+ 1 - 7
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/DemoLine/YunjianConstant.java

@@ -264,13 +264,7 @@ public interface YunjianConstant {
 
 
     //设备采集字段
-    String GATHER_DYN_FILED_QXJ = "";
-
-    String GATHER_DYN_FILED_DBJ = "";
-
-    String GATHER_DYN_FILED_SZB = "";
-
-    String GATHER_DYN_FILED_SMU = "";
+    String YUNJIAN_CALLBACK_PARAM = "YUNJIAN_CALLBACK_PARAM";
 
 
 

+ 6 - 6
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -250,8 +250,8 @@ public class TaskWorkNode {
                     String jsonParam = getRequestParam(conMap);
                     HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
                     //动态调用接口
-                    String instructionUrl = DictionaryKey.INSTRUCTION_URL +"/api/"+ conMap.get("method").toString() ;
-                    returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
+                    //String instructionUrl = DictionaryKey.INSTRUCTION_URL +"/api/"+ conMap.get("method").toString() ;
+//                    returnData = restTemplate.postForObject(url, formEntity, String.class);
                     logger.info("returnData=", returnData);
                 }
             }
@@ -303,7 +303,7 @@ public class TaskWorkNode {
             autoProgramUrl = UrlConfConstant.url;
         }
         //正式调试的时候注释掉
-        //autoProgramUrl = UrlConfConstant.url;
+        autoProgramUrl = UrlConfConstant.url;
         return autoProgramUrl;
     }
 
@@ -363,13 +363,13 @@ public class TaskWorkNode {
         String xbkFlag = conMap.get(DemoLineConstant.DEMOLINE_XBKFLAG) == null ? "" : conMap.get(DemoLineConstant.DEMOLINE_XBKFLAG).toString();
         bizJsonObject.put(DemoLineConstant.DEMOLINE_XBKFLAG, xbkFlag);
 
-        //业务回调数据,传给接口,接口再返回过来。
-        jsonObject.put("bizCallBackData", bizJsonObject.toJSONString());
+        //业务回调数据,传给接口,接口再返回过来。接口不让传多余参数,只能从缓存传
+//        jsonObject.put("bizCallBackData", bizJsonObject.toJSONString());
         //调试得时候打开
         jsonObject.put("code", "1");
         logger.info("节点请求参数" + jsonObject.toJSONString());
         //临时先把请求参数放出来
-        msgUtil.redis_set("testParam", jsonObject.toJSONString(), 1, TimeUnit.DAYS);
+        msgUtil.redis_set(YunjianConstant.YUNJIAN_CALLBACK_PARAM+"_"+taskNode.getId(), bizJsonObject.toJSONString(), 1, TimeUnit.DAYS);
         return jsonObject.toJSONString();
     }
 

+ 5 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -11,6 +11,7 @@ import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperServiceImpl;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
+import com.github.zuihou.business.DemoLine.YunjianConstant;
 import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
 import com.github.zuihou.business.edgeLibrary.dao.StockLogMapper;
 import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
@@ -1268,6 +1269,9 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         String msg = bean.getMsg();
         String taskNodeId = bean.getTaskNodeId() == null ? "" : bean.getTaskNodeId().toString();
 
+        //接口不让传多余参数,只能从缓存传
+        String jsonParam = msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNodeId)==null?"":msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNodeId).toString();
+
 
         Object taskInfoObject = msgUtil.redis_get(taskNodeId);
         if(null != taskInfoObject){
@@ -1283,7 +1287,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         }
 
         String taskId = bean.getTaskId() == null ? "" : bean.getTaskId().toString();
-        String bizCallBackData = bean.getBizCallBackData();
+        String bizCallBackData = jsonParam;
         String uid = bean.getUid() == null ? "" : bean.getUid().toString();
 
         //验证是否重复回调