|
@@ -8,6 +8,7 @@ import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
|
import com.github.zuihou.business.DemoLine.YunjianConstant;
|
|
|
import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
|
|
|
import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
|
+import com.github.zuihou.business.edgeLibrary.service.StockInfoService;
|
|
|
import com.github.zuihou.business.edgeLibrary.service.StorgeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.*;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.*;
|
|
@@ -15,6 +16,8 @@ import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BBom;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.CuttingTool;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.service.CuttingToolService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionresourceMapper;
|
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
|
|
@@ -25,10 +28,12 @@ import com.github.zuihou.business.productionResourceCenter.service.Productionres
|
|
|
import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
|
|
|
import com.github.zuihou.business.productionResourceCenter.strategy.RobotStrategy;
|
|
|
import com.github.zuihou.business.util.MsgUtil;
|
|
|
+import com.github.zuihou.common.constant.CodeRuleModule;
|
|
|
import com.github.zuihou.common.constant.DictionaryKey;
|
|
|
import com.github.zuihou.common.util.StringUtil;
|
|
|
import com.github.zuihou.database.mybatis.conditions.Wraps;
|
|
|
import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
|
|
|
+import com.github.zuihou.tenant.service.CodeRuleService;
|
|
|
import com.github.zuihou.tenant.service.ProductionresourceService;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -85,6 +90,15 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
@Autowired
|
|
|
private OrderTaskService orderTaskService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CuttingToolService cuttingToolService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StockInfoService stockInfoService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CodeRuleService codeRuleService;
|
|
|
+
|
|
|
@Value("${imcs-to-ccs.enabled:true}")
|
|
|
private Boolean imcsTOccsEnable;
|
|
|
|
|
@@ -144,6 +158,10 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
msgUtil.redis_set(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION, taskNode.getId().toString(),10, TimeUnit.MINUTES);
|
|
|
dataMap.put("result", false);
|
|
|
dataMap.put("resultMsg","已下发CNC刀具口请求");
|
|
|
+ //机床内刀具库位信息同步到机床待取位
|
|
|
+ CuttingTool cuttingTool = cuttingToolService.getOne(new LbqWrapper<CuttingTool>().eq(CuttingTool::getCutterNo, orderTask.getCutStartNo()));
|
|
|
+ StockInfo stockInfo = StockInfo.builder().storgeId(startStore.getId()).lockStatus("1").num(1).uniqueCode(codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_UNIQUE)).goodsType("6").specId(cuttingTool.getId()).goodsId(cuttingTool.getId()).build();
|
|
|
+ stockInfoService.save(stockInfo);
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
@@ -344,9 +362,11 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
}
|
|
|
|
|
|
//todo 与ccs联调需要释放 $需要换地址$
|
|
|
- String resultData = this.cutToolActionCondition("/api/getCutterDeviceIsPut", taskNode, pointId);
|
|
|
- JSONObject resultObj = JSONObject.parseObject(resultData);
|
|
|
- bool = resultObj.getBoolean("result");
|
|
|
+ if(imcsTOccsEnable) {
|
|
|
+ String resultData = this.cutToolActionCondition("/api/getCutterDeviceIsPut", taskNode, pointId);
|
|
|
+ JSONObject resultObj = JSONObject.parseObject(resultData);
|
|
|
+ bool = resultObj.getBoolean("result");
|
|
|
+ }
|
|
|
if (!bool) {
|
|
|
msgUtil.createWarnLog("刀具节点目标位放置条件不满足", "DataException");
|
|
|
return null;
|