|
@@ -20,6 +20,7 @@ import com.github.zuihou.business.operationManagementCenter.service.TaskNodeServ
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.TaskService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
|
|
|
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.productionResourceCenter.dao.ProductionresourceBizMapper;
|
|
@@ -40,6 +41,7 @@ import com.github.zuihou.exception.BizException;
|
|
|
import com.github.zuihou.tenant.service.ProductionresourceService;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -95,6 +97,9 @@ public class CacheRobotStrategy implements RobotStrategy {
|
|
|
@Autowired
|
|
|
private StorgeTypeService storgeTypeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BomProcedureMapper bomProcedureMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public Map robotInfo(TaskNode taskNode, String zoneName) {
|
|
|
Map<String, Object> robotInfo = Maps.newConcurrentMap();
|
|
@@ -145,7 +150,7 @@ public class CacheRobotStrategy implements RobotStrategy {
|
|
|
|
|
|
List<ProductionresourcePosition> xbkList = productionresourcePositionService.getFreeProductionresourcePositionByNos(DictionaryKey.YJ_ZONE_XBK.get(zoneName).split(","));
|
|
|
//处理目标库位
|
|
|
- this.robotTarget(taskNode, robotInfo, xbkList, bomProcedure,returnMap);
|
|
|
+ returnMap = this.robotTarget(taskNode, robotInfo, xbkList, bomProcedure,returnMap);
|
|
|
|
|
|
Storge targetStorge = !returnMap.containsKey("store") ? null : (Storge) returnMap.get("store");
|
|
|
Long targetStorgeResourceId = !returnMap.containsKey("storeResourceId") ? null : Long.valueOf(returnMap.get("storeResourceId").toString());
|
|
@@ -283,8 +288,27 @@ public class CacheRobotStrategy implements RobotStrategy {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map robotXbk(TaskNode taskNode, Storge startStorge, Storge endStorge) {
|
|
|
- return null;
|
|
|
+ public Map robotXbk(Map dataMap, Map robotInfo, TaskNode taskNode, Storge startStorge, Storge goalStorge, List<ProductionresourcePosition> robotList) {
|
|
|
+ //暂存位线边库处理
|
|
|
+ Object targetHcwXbk = msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_HCW_XBK_FLAG + taskNode.getId());
|
|
|
+ if(ObjectUtil.isNotEmpty(targetHcwXbk)){
|
|
|
+ Object jqrHcwPartPriotyExec = (null == msgUtil.redis_get(DemoLineConstant.JQR_HCW_PART_PRIOTY_EXEC_FLAG + taskNode.getId())) ? null : msgUtil.redis_get(DemoLineConstant.JQR_HCW_PART_PRIOTY_EXEC_FLAG + taskNode.getId());
|
|
|
+ if(ObjectUtil.isNotEmpty(jqrHcwPartPriotyExec)){
|
|
|
+ robotList = robotList.stream().filter(item->item.getPointId().equals(DemoLineConstant.DEMOLINE_RJQR_ZS) && item.getStatus().equals("0")).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(robotList.size() == 0 ) {
|
|
|
+ dataMap.put("result", false);
|
|
|
+ return dataMap;
|
|
|
+ }
|
|
|
+ TTask task = taskService.getById(taskNode.getTaskId());
|
|
|
+ BomProcedure bomProcedure = bomProcedureMapper.selectOne(Wraps.<BomProcedure>lbQ().eq(BomProcedure::getId,task.getProcedureId()));
|
|
|
+ String zoneName = robotInfo.get("zoneName").toString();
|
|
|
+ List<ProductionresourcePosition> xbkList = productionresourcePositionService.getFreeProductionresourcePositionByNos(DictionaryKey.YJ_ZONE_XBK.get(zoneName).split(","));
|
|
|
+
|
|
|
+ Map returnMap = this.robotTarget(taskNode, robotInfo, xbkList, bomProcedure, dataMap);
|
|
|
+ //线边库处理
|
|
|
+ return returnMap;
|
|
|
}
|
|
|
|
|
|
public Map robotTarget(TaskNode taskNode, Map robotInfo, List<ProductionresourcePosition> xbkList, BomProcedure bomProcedure, Map<String, Object> returnMap) {
|