ソースを参照

fix:优化对刀参数,以及自动零件生成

wang.sq@aliyun.com 2 ヶ月 前
コミット
c1febeb01a

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

@@ -1936,7 +1936,7 @@ public class TaskWorkNode {
 
         //设备不存在
         if (!checkRobot(robotList, zone.getName(), count)) {
-            dataMap.put("resultMsg","设备不存在或者设备未满足条件");
+            dataMap.put("resultMsg","设备不存在或者设备未满足条件,或者需要交换");
             return null;
         }
 //        //资源临界判断

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

@@ -1493,7 +1493,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
         BBom bom = bBomMapper.selectById(planProduct.getBomId());
         TWorkpiece tWorkpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo, task.getCompleteBatchNo()));
         params.put("id",task.getPlanId());
-        Map<String, String> orderMeterialInfo = planMapper.getFinishPlanPartInfo(params);
+        //Map<String, String> orderMeterialInfo = planMapper.getFinishPlanPartInfo(params);
         String productType = "";
         if("framework".equals(zZone.getNo())){
             productType = "K";
@@ -1663,6 +1663,10 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
         List<Long> stockIds = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().in(StockInfo::getStorgeId,startProductionresourcePositionIds).eq(StockInfo::getGoodsType, "1").eq(StockInfo::getLockStatus, "1")).stream().map(StockInfo::getGoodsId).collect(Collectors.toList());
         //获取可用子盘
         List<Tray> trayList = trayService.list(new LbqWrapper<Tray>().eq(Tray::getCategoryType, tray.getCategoryType()).eq(Tray::getProductionType, tray.getProductionType()).eq(Tray::getFiveAxis, tray.getFiveAxis()).in(Tray::getId, stockIds));
+
+        if(trayList.isEmpty() || trayList.size()==0){
+            throw new RuntimeException("库存没有可用的子盘");
+        }
         return trayList;
     }
 }

+ 10 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/impl/MachineCuttingToolServiceImpl.java

@@ -82,6 +82,9 @@ public class MachineCuttingToolServiceImpl extends SuperCacheServiceImpl<Machine
     @Autowired
     private MachineCuttingToolService machineCuttingToolService;
 
+    @Value("${imcs-to-ccs.enabled:true}")
+    private Boolean imcsTOccsEnable;
+
     @Override
     @InjectionResult
     public IPage<MachineCuttingTool> findPage(IPage<MachineCuttingTool> page, LbqWrapper<MachineCuttingTool> wrapper) {
@@ -124,8 +127,13 @@ public class MachineCuttingToolServiceImpl extends SuperCacheServiceImpl<Machine
 //             instructionUrl = DictionaryKey.INSTRUCTION_URL + "/api/GetTools";
             log.info("================机床刀具数据同步instructionUrl================" + instructionUrl);
             log.info("================机床刀具数据同步jsonParam================" + jsonObject.toJSONString());
-            ResponseEntity<String> postForEntity = restTemplate.postForEntity(instructionUrl, request, String.class);
-            synMachineCuttingTolls = postForEntity.getBody();
+
+            if(imcsTOccsEnable){
+                ResponseEntity<String> postForEntity = restTemplate.postForEntity(instructionUrl, request, String.class);
+                synMachineCuttingTolls = postForEntity.getBody();
+            }else {
+                synMachineCuttingTolls = "[{\"position\":\"1.1\",\"number\":\"1\",\"name\":\"XD-D32R2\",\"warnLife\":\"87\",\"targetLife\":\"2282.88\",\"workPiece\":null,\"workPieceWarn\":null,\"workPieceTarget\":null,\"wear\":null,\"wearWarn\":null,\"wearTarget\":null,\"sisterNo\":null,\"toolEdgeNo\":null,\"toolPosition\":null,\"toolRadius\":null,\"tl\":\"0\",\"doc\":\"HD\"},{\"position\":\"1.2\",\"number\":\"2\",\"name\":\"XD20L68R40-ER32L100\",\"warnLife\":\"0\",\"targetLife\":\"8021.45\",\"workPiece\":null,\"workPieceWarn\":null,\"workPieceTarget\":null,\"wear\":null,\"wearWarn\":null,\"wearTarget\":null,\"sisterNo\":null,\"toolEdgeNo\":null,\"toolPosition\":null,\"toolRadius\":null,\"tl\":\"0\",\"doc\":\"\"}]\n";
+            }
 
             log.info("设备" + productionresource.getName() + "同步刀具返回{},请求参数{}",synMachineCuttingTolls,jsonObject.toString());
             JSONArray upResult = JSONArray.parseArray(synMachineCuttingTolls);

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

@@ -226,7 +226,7 @@ public class CacheRobotStrategy implements RobotStrategy {
         }
         //锁定暂存缓存位库位
         if(startStorge==null){
-            throw new RuntimeException("库位不满足");
+            throw new RuntimeException("库位不满足,没用查询到可用子盘");
         }
         startStorge.setCompleteBatchNo(taskNode.getCompleteBatchNo());
         storgeService.lockStorge(startStorge, taskNode.getId());
@@ -273,12 +273,9 @@ public class CacheRobotStrategy implements RobotStrategy {
             msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + taskNode.getId(), targetStorge, 10, TimeUnit.DAYS);
         } else {
             //暂存位优先级处理判断
-            TaskNode beforeNode = taskNodeService.getNextNTaskNode(taskNode, -1);
-            boolean condition = beforeNode!=null && beforeNode.getNodeName().contains("下料") && "04".equals(beforeNode.getInterfaceType()) && "4".equals(taskNode.getNodeType());
-            //排除回库生成节点
-            if(hcwList.size()==1 && !condition){
-                targetStorge = hcwStorge;
-            }
+//            TaskNode beforeNode = taskNodeService.getNextNTaskNode(taskNode, -1);
+//            boolean condition = beforeNode!=null && beforeNode.getNodeName().contains("下料") && "04".equals(beforeNode.getInterfaceType()) && "4".equals(taskNode.getNodeType());
+
             if (targetXbk.equals("0")) {
                 //目标缓存
                 msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + taskNode.getId(), targetStorge, 10, TimeUnit.DAYS);

+ 3 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/ToolController.java

@@ -21,6 +21,7 @@ import com.github.zuihou.business.productionResourceCenter.service.Productionres
 import com.github.zuihou.business.productionResourceCenter.service.ToolService;
 import com.github.zuihou.business.util.MsgUtil;
 import com.github.zuihou.common.constant.DictionaryKey;
+import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import com.github.zuihou.log.annotation.SysLog;
@@ -36,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -112,6 +114,7 @@ public class ToolController extends SuperController<ToolService, Long, Tool, Too
     @ApiOperation(value = "同步刀具", notes = "同步刀具")
     @PostMapping("/synchronousTool")
     public R<Boolean> synchronousTool() throws Exception {
+        BaseContextHandler.setTenant("0000");
         List<Productionresource> dataList = productionresourceBizService.list(new LbqWrapper<Productionresource>().eq(Productionresource::getStatus, "1").ne(Productionresource::getOnlineStatus,"0").isNotNull(Productionresource::getModeSpecification));
         List<Long> ids = dataList.stream().map(Productionresource::getId).collect(Collectors.toList());
         MachineCuttingTool machineCuttingTool = new MachineCuttingTool();