|
@@ -29,6 +29,7 @@ import com.github.zuihou.database.mybatis.conditions.Wraps;
|
|
|
import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
|
|
|
import com.github.zuihou.tenant.service.ProductionresourceService;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -39,6 +40,7 @@ import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Component("TOOLROBOT")
|
|
|
+@Slf4j
|
|
|
public class ToolRobotStrategy implements RobotStrategy {
|
|
|
|
|
|
@Autowired
|
|
@@ -88,10 +90,10 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
TTask task = taskService.getById(taskNode.getTaskId());
|
|
|
//获取天轨机器人
|
|
|
//com.github.zuihou.business.productionResourceCenter.entity.Productionresource robot = productionresourceBizMapper.selectById(taskNode.getResourceId());
|
|
|
- Productionresource cutToolRobot = productionresourceBizMapper.selectOne(new LbqWrapper<Productionresource>().likeRight(Productionresource::getCode, "jqr2").last("limit 1"));
|
|
|
+ Productionresource cutToolRobot = productionresourceBizMapper.selectOne(new LbqWrapper<Productionresource>().likeLeft(Productionresource::getCode, "jqr2").last("limit 1"));
|
|
|
ZZone zZone = zoneService.getOne(new LbqWrapper<ZZone>().eq(ZZone::getName, zoneName).last("limit 1"));
|
|
|
BBom bom = bBomMapper.selectById(task.getBomId());
|
|
|
- OrderTask orderTask = orderTaskService.getById(task.getOrderId());
|
|
|
+ OrderTask orderTask = orderTaskService.getOne(new LbqWrapper<OrderTask>().eq(OrderTask::getOrderId, task.getOrderId()).last("LIMIT 1"));
|
|
|
|
|
|
Map plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
|
|
@@ -100,7 +102,8 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
robotInfo.put("bom", bom);
|
|
|
robotInfo.put("plcInfo", plcInfo);
|
|
|
robotInfo.put("orderTask", orderTask);
|
|
|
- robotInfo.put("singleRunFlag", "1");
|
|
|
+ robotInfo.put("singleTaskFlag", 1);
|
|
|
+ robotInfo.put("singleRunFlag", 1);
|
|
|
return robotInfo;
|
|
|
}
|
|
|
|
|
@@ -110,13 +113,14 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
dataMap.put(taskNode.getId().toString() + "count", 0);
|
|
|
dataMap.put(YunjianConstant.YUNJIAN_ROBORT_CACHE_FLAG, "0");
|
|
|
Storge startStore = null;
|
|
|
+ TTask task = taskService.getById(taskNode.getTaskId());
|
|
|
OrderTask orderTask = (OrderTask) robotInfo.get("orderTask");
|
|
|
if (CollectionUtil.isNotEmpty(flikustockInfos)) {
|
|
|
//刀具线边库查询
|
|
|
startStore = storgeService.getById(flikustockInfos.get(0).getStorgeId());
|
|
|
}else {
|
|
|
//硬件设备库位
|
|
|
- List<ProductionresourcePosition> storgeList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{taskNode.getResourceId().toString()});
|
|
|
+ List<ProductionresourcePosition> storgeList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{task.getResourceId().toString()});
|
|
|
startStore = storgeService.getById(storgeList.get(0).getStorgeId());
|
|
|
}
|
|
|
//CCS判断取条件是否满足
|
|
@@ -151,7 +155,7 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
public Map robotPut(Map returnMap, TaskNode taskNode, Storge startStorge, Storge targetStorge, List<ProductionresourcePosition> robotList, String targetxbk, Long targetStorgeResourceId) {
|
|
|
Map<String, List<ProductionresourcePosition>> jqrMap = robotList.stream().collect(Collectors.groupingBy(ProductionresourcePosition::getPointId));
|
|
|
Storge jqrStorge = null;
|
|
|
- List<ProductionresourcePosition> jqrList = jqrMap.get(DemoLineConstant.DEMOLINE_RJQR_ZS);
|
|
|
+ List<ProductionresourcePosition> jqrList = jqrMap.get(DemoLineConstant.DEMOLINE_RJQR_TOOL);
|
|
|
if(jqrList.size() == 0){
|
|
|
returnMap.put("result", false);
|
|
|
return returnMap;
|
|
@@ -188,7 +192,6 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
|
|
|
locationMap.put("taskType", DictionaryKey.TASK_TYPE.get("CARRY"));
|
|
|
locationMap.put("carryType", "1");
|
|
|
- returnMap.put(YunjianConstant.YUNJIAN_ROBORT_CACHE_FLAG, "1");
|
|
|
returnMap.put("data", locationMap);
|
|
|
returnMap.put("method", "RobotAction");
|
|
|
returnMap.put("result", true);
|