Selaa lähdekoodia

后台刀具功能处理

oyq28 3 kuukautta sitten
vanhempi
commit
ad7e7bf052

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

@@ -556,8 +556,8 @@ public class TaskWorkNode {
 
                                             //动态调用接口和新增指令执行时间
                                             log.setZoneId(zZone.getId()).setMethod(method).setExecuteTime(new Date());
-                                            //String instructionUrl = conMap.get("instructionUrl") + "/api/" + conMap.get("method").toString();
-                                            String instructionUrl = "http://localhost:8089" + "/api/" + conMap.get("method").toString();
+                                            String instructionUrl = conMap.get("instructionUrl") + "/api/" + conMap.get("method").toString();
+                                            //String instructionUrl = "http://localhost:8089" + "/api/" + conMap.get("method").toString();
                                             logger.info("instructionUrl={}", instructionUrl);
                                             logger.info("[ECS指令发送]节点传参={}", jsonParam);
 
@@ -582,8 +582,8 @@ public class TaskWorkNode {
                                                         setRequestAddress(instructionUrl).setRequestParameter(jsonParam).
                                                         setTaskNodeName(taskNode.getNodeName());
                                                 HttpEntity<String> formEntity = new HttpEntity<String>(rfidObj.toJSONString(), headers);
-                                                //returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
-                                                returnData = "{\"result\": \"true\"}";
+                                                returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
+                                                //returnData = "{\"result\": \"true\"}";
                                             } else {
 
                                                 //起点、终点缓存。

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

@@ -291,7 +291,7 @@ public class OrderTaskServiceImpl extends SuperServiceImpl<OrderTaskMapper, Orde
             BeanUtil.copyProperties(node, taskNode, "id");
             taskNode.setProcedureId(simpleTask.getProcedureId()).setTaskId(simpleTask.getId()).setExeStatus("1").setExeResult(null).setStartTime(null).setEndTime(null).setFeedback("").setNodeType("0").setCreateTime(simpleTask.getCreateTime());
             taskNode.setCompleteBatchSort(taskNode.getCompleteBatchSort()+1);
-            if(taskNode.getPrority().equals(2)){
+            if(taskNode.getPrority().equals(1)){
                 //线边库区分处理
                 taskNode.setTargetResourceId(endResourceId);
             }

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

@@ -3377,7 +3377,7 @@ planId));
                                 taskNode.setTargetResourceId(null);
                             }
                         } */
-                        taskNode.setTargetResourceId(t.getResourceId());
+                        taskNode.setTargetResourceId(null);
                     }
 
                     if (null != autoCode.getResourceId()) {

+ 3 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl2.java

@@ -214,6 +214,7 @@ public class RobotNodeServiceImpl2 implements NodeOperationService {
         zoneId = zoneProductionresource.getZoneId();
         zZone = zoneService.getById(zoneId);
         zoneName = zZone.getName();
+        instructionUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(zZone.getNo() + "_plc").toString());
 
         Productionresource productionresource = productionresourceBizMapper.selectById(taskNode.getResourceId());
         if(productionresource.getCode().contains("jqr2")){
@@ -225,6 +226,7 @@ public class RobotNodeServiceImpl2 implements NodeOperationService {
 
         robotInfo = robotStrategy.robotInfo(taskNode, zoneName);
         bomzZone = zoneService.getById(zoneId);
+
         /*
         String moduleName = dataMap.get("moduleName") == null ? "" : dataMap.get("moduleName").toString();
         String robotType = dataMap.get("robotType") == null ? "" : dataMap.get("robotType").toString();
@@ -442,8 +444,7 @@ public class RobotNodeServiceImpl2 implements NodeOperationService {
         }
 
         // 需要节点所使用的设备,先从数据库查询,如果没有则取map中的数据
-        robotList = productionresourcePositionService.list(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, taskNode.getResourceId()));
-
+        robotList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{taskNode.getResourceId().toString()});
         ProductionresourcePosition po = logical(robotList,flikustockInfos,taskNode);
         if(po == null) {
             dataMap.put("result", false);

+ 4 - 4
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/strategy/impl/ToolRobotStrategy.java

@@ -129,7 +129,6 @@ public class ToolRobotStrategy implements RobotStrategy {
 
         //CCS判断取条件是否满足getCutterDeviceIsTake
         boolean bool = true;
-        boolean flag = true;
         if(pointId.contains(DemoLineConstant.DEMOLINE_CUT_TOOL_TYPE_CNCT)){
             //从机床刀具库取需要预置处理
             Object cutToolAction = msgUtil.redis_get(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION);
@@ -140,9 +139,9 @@ public class ToolRobotStrategy implements RobotStrategy {
             }
         }
         //todo $需要换地址$
-        //bool = this.cutToolActionCondition("/api/getCutterDeviceIsTake", taskNode,pointId);
+        bool = this.cutToolActionCondition("/api/getCutterDeviceIsTake", taskNode,pointId);
 
-        if(!bool || !flag){
+        if(!bool){
             msgUtil.createWarnLog("刀具节点起始位取条件不满足","DataException");
             dataMap.put("result", false);
             dataMap.put("resultmsg","刀具节点起始位取条件不满足");
@@ -239,7 +238,8 @@ public class ToolRobotStrategy implements RobotStrategy {
         //按类型获取目标库位
         Storge targetStorge = null;
         if(StringUtil.isNotEmpty(orderTask.getGoal())){
-            List<ProductionresourcePosition> positionList = targetList.stream().filter(item->item.getPointId().equals(orderTask.getGoal())).collect(Collectors.toList());
+            String pointId = orderTask.getGoal().replace("CT_", "");
+            List<ProductionresourcePosition> positionList = targetList.stream().filter(item->item.getPointId().equals(pointId)).collect(Collectors.toList());
             targetStorge = storgeService.getById(positionList.get(0).getStorgeId());
         }else{
             targetStorge = storgeService.getById(targetList.get(0).getStorgeId());

+ 1 - 1
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/StationUserController.java

@@ -222,7 +222,7 @@ public class StationUserController extends SuperController<StationUserService, L
         //String goal = model.containsKey("goal")? model.get("goal").toString() : "BZ_367";
         OrderTask orderTask = OrderTask.builder().orderId(order.getId())
                 .hasMaterial("0").isMachine("0").isXbk("1").start(model.get("start").toString()).goal(model.get("goal").toString())
-                .cutStartNo(model.get("cutStartNo").toString()).cutGoalNo(model.get("cutStartNo").toString())
+                .cutStartNo(model.get("cutStartNo").toString()).cutGoalNo(model.get("cutGoalNo").toString())
                 .build();
         orderTaskService.save(orderTask);
         OrderUpdateDTO orderUpdateDTO = OrderUpdateDTO.builder().ids(Arrays.asList(order.getId())).auditStatus("1").build();