|
|
@@ -38,6 +38,7 @@ import com.github.zuihou.common.constant.BizConstant;
|
|
|
import com.github.zuihou.common.constant.CacheKey;
|
|
|
import com.github.zuihou.common.constant.DictionaryKey;
|
|
|
import com.github.zuihou.common.constant.UrlConfConstant;
|
|
|
+import com.github.zuihou.common.enums.HandModeTypeEnum;
|
|
|
import com.github.zuihou.common.util.StringUtil;
|
|
|
import com.github.zuihou.context.BaseContextHandler;
|
|
|
import com.github.zuihou.database.mybatis.conditions.Wraps;
|
|
|
@@ -266,26 +267,16 @@ public class TaskWorkNode {
|
|
|
*/
|
|
|
public String getInterfaceUrl(TaskNode taskNode) {
|
|
|
String autoProgrameUrl = "";
|
|
|
-// if (DictionaryKey.INTERFACETYPE_PLC.equals(taskNode.getInterfaceType())) {//总控
|
|
|
-// autoProgrameUrl = UrlConfConstant.plcURL;
|
|
|
-// } else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
|
|
|
-//// autoProgrameUrl = parameterService.getValue(ParameterKey.AUTOPROGRAMEURL, null);
|
|
|
-// autoProgrameUrl = UrlConfConstant.plcURL;
|
|
|
-// } else if (DictionaryKey.INTERFACETYPE_AGV.equals(taskNode.getInterfaceType())) {
|
|
|
-//// autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
|
|
|
-// autoProgrameUrl = UrlConfConstant.agvURL;
|
|
|
-// } else if (DictionaryKey.INTERFACETYPE_WMS.equals(taskNode.getInterfaceType())) {
|
|
|
-//// autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
|
|
|
-// // autoProgrameUrl = agvURL;
|
|
|
-// autoProgrameUrl = UrlConfConstant.url;
|
|
|
-// }
|
|
|
- //根据设备类型关联接口
|
|
|
- if("1".equals(taskNode.getAutoNode().getCategory()) || "3".equals(taskNode.getAutoNode().getCategory())){
|
|
|
+ if (DictionaryKey.INTERFACETYPE_PLC.equals(taskNode.getInterfaceType())) {//总控
|
|
|
+ autoProgrameUrl = UrlConfConstant.plcURL;
|
|
|
+ } else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
|
|
|
+ //autoProgrameUrl = parameterService.getValue(ParameterKey.AUTOPROGRAMEURL, null);
|
|
|
autoProgrameUrl = UrlConfConstant.plcURL;
|
|
|
- }else if("2".equals(taskNode.getAutoNode().getCategory())){
|
|
|
+ } else if (DictionaryKey.INTERFACETYPE_AGV.equals(taskNode.getInterfaceType())) {
|
|
|
+ //autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
|
|
|
autoProgrameUrl = UrlConfConstant.agvURL;
|
|
|
- }else if("4".equals(taskNode.getAutoNode().getCategory())){
|
|
|
- //目前默认是wms
|
|
|
+ } else if (DictionaryKey.INTERFACETYPE_WMS.equals(taskNode.getInterfaceType())) {
|
|
|
+ // autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
|
|
|
autoProgrameUrl = UrlConfConstant.url;
|
|
|
}
|
|
|
//正式调试的时候注释掉
|
|
|
@@ -319,15 +310,28 @@ public class TaskWorkNode {
|
|
|
//jsonObject.put("businessType", taskNode.getAutoNodeCode());
|
|
|
jsonObject.put("taskId", taskNode.getTaskId());
|
|
|
jsonObject.put("taskNodeId", taskNode.getId());
|
|
|
- jsonObject.put("uid", taskNode.getId() + "");
|
|
|
+ jsonObject.put("uid", taskNode.getCreateUser() + "");
|
|
|
+ //jsonParam.put("url",deviceUrl);
|
|
|
+ //jsonParam.put("port",devicePort);
|
|
|
+ jsonObject.put("url", taskNode.getTaskId());
|
|
|
+ jsonObject.put("port", taskNode.getTaskId());
|
|
|
+
|
|
|
//业务回调数据
|
|
|
JSONObject bizJsonObject = new JSONObject();
|
|
|
if (StringUtil.isNotEmpty(stockType)) {
|
|
|
+ //设定出入库类型
|
|
|
bizJsonObject.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, stockType);
|
|
|
}
|
|
|
|
|
|
//机器上下料相关
|
|
|
if (DictionaryKey.INTERFACETYPE_PLC.equals(taskNode.getInterfaceType())) {
|
|
|
+ //String location = conMap.get("location").toString();
|
|
|
+ nodeOperationService = new RobotNodeServiceImpl();
|
|
|
+ Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
|
|
|
+ jsonObject = (JSONObject) map.get("jsonObject");
|
|
|
+ bizJsonObject = (JSONObject) map.get("bizJsonObject");
|
|
|
+
|
|
|
+ /*
|
|
|
String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
|
|
|
: msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
|
|
|
//总控IP
|
|
|
@@ -335,10 +339,7 @@ public class TaskWorkNode {
|
|
|
jsonObject.put("url", zkIp);
|
|
|
jsonObject.put("port", ZK_port);
|
|
|
jsonObject.put("IsCallBackFlag", "1");
|
|
|
-// if (bizType.equals(BizConstant.MQ_TASK_NODE_TYPE_COMMON) ||//线边库轮询搬运
|
|
|
-// DemoLineConstant.DEMOLINE_OP01_03.equals(taskNode.getNodeNo()) || DemoLineConstant.DEMOLINE_OP01_04.equals(taskNode.getNodeNo())//机器人放子盘夹具到上下料站(从子盘到机械手)//机器人放子盘夹具到上下料站(从机械手到上下料站)
|
|
|
-// || DemoLineConstant.DEMOLINE_OP01_06.equals(taskNode.getNodeNo()) || DemoLineConstant.DEMOLINE_OP01_07.equals(taskNode.getNodeNo())
|
|
|
-// || DemoLineConstant.DEMOLINE_OP02_01.equals(taskNode.getNodeNo())|| DemoLineConstant.DEMOLINE_OP02_02.equals(taskNode.getNodeNo())) {//上料
|
|
|
+
|
|
|
Storge fstorge = (Storge) conMap.get("fromStorge");
|
|
|
Storge tstorge = (Storge) conMap.get("toStorge");
|
|
|
//线边库标志
|
|
|
@@ -397,12 +398,12 @@ public class TaskWorkNode {
|
|
|
bizJsonObject.put(DemoLineConstant.DEMOLINE_XBKFLAG, xbkFlag);
|
|
|
bizJsonObject.put(DemoLineConstant.DEMOLINE_XBK_TYPE, xbkType);
|
|
|
bizJsonObject.put(DemoLineConstant.DEMOLINE_XBK_CARRY_TYPE, carryType);
|
|
|
- }
|
|
|
+ } */
|
|
|
+
|
|
|
}
|
|
|
else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
|
|
|
//生产加工
|
|
|
nodeOperationService = new MachineNodeServiceImpl();
|
|
|
- conMap.put("NO_WMS", true);
|
|
|
Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
|
|
|
jsonObject = (JSONObject) map.get("jsonObject");
|
|
|
bizJsonObject = (JSONObject) map.get("bizJsonObject");
|
|
|
@@ -769,6 +770,5 @@ public class TaskWorkNode {
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|