Browse Source

非订单手动版调试问题修改,ccs对应最新接口修改

yejian 3 years ago
parent
commit
f79992cba9

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

@@ -1675,7 +1675,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
                 //调用接口
                 try {
                     JSONObject returnDataObject = new JSONObject();
-                    returnData = restTemplate.postForObject("http://192.168.10.136:8089", formEntity, String.class);
+                    returnData = restTemplate.postForObject("http://192.168.170.156:8089", formEntity, String.class);
                     returnDataObject = JSONObject.parseObject(returnData);
                     if("0".equals(returnDataObject.get("code"))){
                     }else{

+ 36 - 36
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/util/ManualTaskOperatorUtil.java

@@ -16,18 +16,18 @@ public class ManualTaskOperatorUtil {
      * 上位机系统地址
      */
 //    private static String hostSyetemUrl = "http://192.168.170.240:8090";
-    private static String hostSyetemUrl = "http://192.168.10.155:63570/";
+    private static String hostSyetemUrl = "http://192.168.170.248:8081/";
 
     /**
      * agv运输
      */
     private static String agvURL = "http://localhost:9099/api/authority/mock/mockWms";
     //质量中心
-    private static String ZK_ip_zlzx = "192.168.170.61";
+    private static String ZK_ip_zlzx = "192.168.170.130";
     //柔性
-    private static String ZK_ip_rxx = "192.168.170.71";
-    //智能单元
-    private static String ZK_ip_zndy = "192.168.170.81";
+    private static String ZK_ip_rxx = "192.168.170.170";
+    //智能单元(舱体)
+    private static String ZK_ip_zndy = "192.168.170.150";
 
     // 质量中心PLC端口
     private static String ZK_ip_zlzx_port = "102";
@@ -107,27 +107,27 @@ public class ManualTaskOperatorUtil {
                 // 舱体(智能单元) 代码先写死,6个动作,后续根据resource_code表中获取
                 // 执行第一个任务
                 int currentIndex = 0;
-                String taskType = robotNoMoveTaskNodes.get(currentIndex);
+                String taskType = robotTaskNodes.get(currentIndex);
                 int nextTaskNodeIndex = currentIndex +1;
                 if("move".equals(taskType)){
                     String hostSyetemTaskUrl = hostSyetemUrl + "/api/MoveRobotPosition";
                     String location = manualInfo.getStartpointId();
-                    setProcessInfo(robotNoMoveTaskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
+                    setProcessInfo(robotTaskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                 }
-                if(nextTaskNodeIndex < robotNoMoveTaskNodes.size() -1){
-                    manualInfo.setNextTaskNodeIndex(nextTaskNodeIndex + 1);
+                if(nextTaskNodeIndex < robotTaskNodes.size() -1){
+                    manualInfo.setNextTaskNodeIndex(nextTaskNodeIndex);
                 }
             }else if("framework".equals(unit)){
                 int currentIndex = 0;
-                String taskType = robotNoMoveTaskNodes.get(currentIndex);
+                String taskType = robotTaskNodes.get(currentIndex);
                 int nextTaskNodeIndex = currentIndex +1;
                 if("move".equals(taskType)){
                     String hostSyetemTaskUrl = hostSyetemUrl + "/api/MoveRobotPosition";
                     String location = manualInfo.getStartpointId();
-                    setProcessInfo(robotNoMoveTaskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
+                    setProcessInfo(robotTaskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                 }
-                if(nextTaskNodeIndex < robotNoMoveTaskNodes.size() -1){
-                    manualInfo.setNextTaskNodeIndex(nextTaskNodeIndex + 1);
+                if(nextTaskNodeIndex < robotTaskNodes.size() -1){
+                    manualInfo.setNextTaskNodeIndex(nextTaskNodeIndex);
                 }
             }else if("safeguard".equals(unit)){
                 // 保障平台(质量中心) 代码先写死,6个动作,后续根据resource_code表中获取
@@ -136,7 +136,7 @@ public class ManualTaskOperatorUtil {
                 String taskType = robotNoMoveTaskNodes.get(currentIndex);
                 int nextTaskNodeIndex = currentIndex +1;
                 if("get".equals(taskType)){
-                    String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetIntelligenceUnit";
+                    String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetServoStacker";
                     String location = manualInfo.getStartpointId();
                     setProcessInfo(robotNoMoveTaskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                 }
@@ -211,11 +211,11 @@ public class ManualTaskOperatorUtil {
             deviceUrl = ZK_ip_zndy;
             devicePort = ZK_ip_zndy_port;
         }else if("framework".equals(unit)){
-            deviceUrl = ZK_ip_zndy;
-            devicePort = ZK_ip_zndy_port;
+            deviceUrl = ZK_ip_rxx;
+            devicePort = ZK_ip_rxx_port;
         }else if("safeguard".equals(unit)){
-            deviceUrl = ZK_ip_zndy;
-            devicePort = ZK_ip_zndy_port;
+            deviceUrl = ZK_ip_zlzx;
+            devicePort = ZK_ip_zlzx_port;
         }
 
         if("general".equals(manualType)){
@@ -228,41 +228,41 @@ public class ManualTaskOperatorUtil {
                     // 舱体(柔性线) 代码先写死,6个动作,后续根据resource_code表中获取
                     // 执行第一个任务
                     if("get".equals(taskType) && currentIndex == 1){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetFlexibleWire";
                         String location = manualInfo.getStartpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("put".equals(taskType) && currentIndex == 2){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
-                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId()).collect(toList());
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendFlexibleWire";
+                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId() && "1".equals(p.getLockStatus())).collect(toList());
 
-                        String location = productionresourcePositions.get(0).getStorgeId().toString();
+                        String location = productionresourcePositions.get(0).getPointId().toString();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("move".equals(taskType) && currentIndex == 3){
                         String hostSyetemTaskUrl = hostSyetemUrl + "/api/MoveRobotPosition";
                         // 查找设备机器人
-                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId()).collect(toList());
+                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId() && "1".equals(p.getLockStatus())).collect(toList());
 
                         String location = manualInfo.getEndpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }if("get".equals(taskType) && currentIndex == 4){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetIntelligenceUnit";
-                        productionresourcePositions = productionresourcePositions.stream().filter(p->null != p.getGoodsId()).collect(toList());
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetFlexibleWire";
+                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId()).collect(toList());
 
-                        String location = productionresourcePositions.get(0).getStorgeId().toString();
+                        String location = productionresourcePositions.get(0).getPointId().toString();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("put".equals(taskType) && currentIndex == 5){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendFlexibleWire";
                         String location = manualInfo.getEndpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }
                     manualInfo.setNextTaskNodeIndex(nextTaskNodeIndex);
                 }else if(taskNodes.size() == 3 && currentIndex == 1){
                     if("get".equals(taskType) ){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetFlexibleWire";
                         String location = manualInfo.getStartpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("put".equals(taskType) && currentIndex == 2){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendFlexibleWire";
                         String location = manualInfo.getEndpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }
@@ -276,11 +276,11 @@ public class ManualTaskOperatorUtil {
                     // 舱体(柔性线) 代码先写死,6个动作,后续根据resource_code表中获取
                     // 执行第一个任务
                     if("get".equals(taskType) && currentIndex == 1){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetFlexibleWire";
                         String location = manualInfo.getStartpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("put".equals(taskType) && currentIndex == 2){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendFlexibleWire";
                         String location = manualInfo.getStartpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("move".equals(taskType) && currentIndex == 3){
@@ -288,22 +288,22 @@ public class ManualTaskOperatorUtil {
                         String location = manualInfo.getStartpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }if("get".equals(taskType) && currentIndex == 4){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetFlexibleWire";
                         String location = manualInfo.getStartpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("put".equals(taskType) && currentIndex == 5){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendFlexibleWire";
                         String location = manualInfo.getStartpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }
                     manualInfo.setNextTaskNodeIndex(nextTaskNodeIndex);
                 }else if(taskNodes.size() == 3){
                     if("get".equals(taskType) && currentIndex == 1){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetFlexibleWire";
                         String location = manualInfo.getStartpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("put".equals(taskType) && currentIndex == 2){
-                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
+                        String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendFlexibleWire";
                         String location = manualInfo.getEndpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }
@@ -315,7 +315,7 @@ public class ManualTaskOperatorUtil {
                 // 保障平台(质量中心)
                 // 执行第一个任务
                 if("put".equals(taskType)){
-                    String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
+                    String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendServoStacker";
                     String location = manualInfo.getEndpointId();
                     setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                 }

+ 1 - 3
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/ProductionresourcePositionMapper.xml

@@ -109,10 +109,8 @@
                     itp.name
                   FROM imcs_t_plate itp
                   WHERE itp.id = i.goods_id) END) AS goodsName
-        FROM zuihou_base_yj_0000.imcs_p_productionresource_position p,
-             zuihou_base_yj_0000.imcs_s_storge s left join zuihou_base_yj_0000.imcs_s_stock_info i on (p.storge_id = i.storge_id)
+        FROM zuihou_base_yj_0000.imcs_p_productionresource_position p LEFT JOIN zuihou_base_yj_0000.imcs_s_storge s ON (p.storge_id = s.id) left join zuihou_base_yj_0000.imcs_s_stock_info i on (p.storge_id = i.storge_id)
         WHERE 1=1
-        AND p.storge_id = s.id
         <if test="resourceId != null and resourceId != ''">
             and p.resource_id = #{resourceId}
         </if>

+ 13 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/WorkpieceController.java

@@ -234,6 +234,19 @@ public class WorkpieceController extends SuperController<WorkpieceService, Long,
         manualInfo.setHandModeFlag("1");
         log.info("开始执行手动任务,参数是{}", manualInfo.toString());
         try {
+            String startpointId = manualInfo.getStartpointId()==null?"":manualInfo.getStartpointId().toString();
+            String endpointId = manualInfo.getEndpointId()==null?"":manualInfo.getEndpointId().toString();
+            String startResourceId = manualInfo.getStartResourceId()==null?"":manualInfo.getStartResourceId().toString();
+            String endResourceId = manualInfo.getEndResourceId()==null?"":manualInfo.getEndResourceId().toString();
+            String robotResourceId = manualInfo.getRobotResourceId()==null?"":manualInfo.getRobotResourceId().toString();
+            String manualIdType = manualInfo.getManualIdType()==null?"":manualInfo.getManualIdType().toString();
+            String deviceUnit = manualInfo.getDeviceUnit()==null?"":manualInfo.getDeviceUnit().toString();
+
+            if(StringUtils.isBlank(startpointId) || StringUtils.isBlank(endpointId) || StringUtils.isBlank(startResourceId)
+                || StringUtils.isBlank(endResourceId) || StringUtils.isBlank(robotResourceId) || StringUtils.isBlank(manualIdType)
+                || StringUtils.isBlank(deviceUnit)){
+                return R.fail("请求参数不完整");
+            }
             return baseService.executeManualTask(manualInfo);
         } catch (Exception e) {
             e.printStackTrace();