|
|
|
|
@ -162,6 +162,7 @@ public class ScheduledTasks { |
|
|
|
|
Result<Boolean> booleanResult = rcsUtil.moveByAGV(moveBo); |
|
|
|
|
return booleanResult; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Result<Boolean> callAGV(Long taskId, int taskType, List<String> points, String agvno) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -177,7 +178,6 @@ public class ScheduledTasks { |
|
|
|
|
// @PostConstruct
|
|
|
|
|
// @Scheduled(cron = "0/3 * * * * ? ")
|
|
|
|
|
@Scheduled(fixedRate = 200) |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public void task() { |
|
|
|
|
log.info("开始获取需要执行的任务"); |
|
|
|
|
//获取待下发任务数据
|
|
|
|
|
@ -229,8 +229,15 @@ public class ScheduledTasks { |
|
|
|
|
taskQueryBo.setTaskType("21"); |
|
|
|
|
List<BusinDataTaskVo> businDataTaskVo21 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); |
|
|
|
|
businDataTaskVos.addAll(businDataTaskVo21); |
|
|
|
|
|
|
|
|
|
for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) { |
|
|
|
|
doTask(businDataTaskVo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
void doTask(BusinDataTaskVo businDataTaskVo) { |
|
|
|
|
|
|
|
|
|
String taskType = businDataTaskVo.getTaskType(); |
|
|
|
|
Long taskId = businDataTaskVo.getId(); |
|
|
|
|
Long containerId = businDataTaskVo.getContainerId(); |
|
|
|
|
@ -241,9 +248,9 @@ public class ScheduledTasks { |
|
|
|
|
if (taskType.equals("0") || taskType.equals("7")) { |
|
|
|
|
//获取要出入库的条码信息
|
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTaskVo.getId()); |
|
|
|
|
if(ObjectUtils.isEmpty(businDataTaskGoodsVos)){ |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// if (ObjectUtils.isEmpty(businDataTaskGoodsVos)) {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
BusinDataTaskGoodsVo goodsVo = businDataTaskGoodsVos.get(0); |
|
|
|
|
String vehicheModel = goodsVo.getVehicheModel(); |
|
|
|
|
String color = goodsVo.getColor(); |
|
|
|
|
@ -529,8 +536,7 @@ public class ScheduledTasks { |
|
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
|
iBusinDataTaskService.updateById(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if (taskType.equals("2")) { |
|
|
|
|
} else if (taskType.equals("2")) { |
|
|
|
|
Long plcId = 0L; |
|
|
|
|
Long stkPlcId = 0L; |
|
|
|
|
Boolean NUMBER = true; |
|
|
|
|
@ -614,7 +620,8 @@ public class ScheduledTasks { |
|
|
|
|
// int agvTaskType = Integer.valueOf(basePointDeviceVo.getIsDown());
|
|
|
|
|
System.out.println("中科 测试 需要删除"); |
|
|
|
|
// TODO 中科 测试 需要删除
|
|
|
|
|
String toPointNo = basePointDeviceVo.getPointNo();; |
|
|
|
|
String toPointNo = basePointDeviceVo.getPointNo(); |
|
|
|
|
; |
|
|
|
|
int agvTaskType = 33; |
|
|
|
|
snPointMap.put("3", "XX"); |
|
|
|
|
points.add("XX"); |
|
|
|
|
@ -691,8 +698,7 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
|
} |
|
|
|
|
else if (taskType.equals("1") ) { |
|
|
|
|
} else if (taskType.equals("1")) { |
|
|
|
|
Long plcId = 0L; |
|
|
|
|
Long stkPlcId = 0L; |
|
|
|
|
Boolean NUMBER = true; |
|
|
|
|
@ -875,8 +881,7 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
|
} |
|
|
|
|
else if (taskType.equals("3")) { |
|
|
|
|
} else if (taskType.equals("3")) { |
|
|
|
|
Long plcId = 0L; |
|
|
|
|
Long stkPlcId = 0L; |
|
|
|
|
Boolean NUMBER = true; |
|
|
|
|
@ -1028,8 +1033,7 @@ public class ScheduledTasks { |
|
|
|
|
// }
|
|
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
|
} |
|
|
|
|
else if (taskType.equals("4") || taskType.equals("5")) { |
|
|
|
|
} else if (taskType.equals("4") || taskType.equals("5")) { |
|
|
|
|
String randome = null; |
|
|
|
|
//出库任务(正常出库、紧急出库)
|
|
|
|
|
//获取要出库的物料信息
|
|
|
|
|
@ -1172,8 +1176,7 @@ public class ScheduledTasks { |
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if (taskType.equals("11")||taskType.equals("12")){ |
|
|
|
|
} else if (taskType.equals("11") || taskType.equals("12")) { |
|
|
|
|
String agvno = ""; |
|
|
|
|
int AgvType = 0; |
|
|
|
|
//空治具流向呼叫agv失败后再次呼叫agv
|
|
|
|
|
@ -1244,8 +1247,7 @@ public class ScheduledTasks { |
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (taskType.equals("10")){ |
|
|
|
|
} else if (taskType.equals("10")) { |
|
|
|
|
//先判断补货入库是否是一套,如果是入存货区,否则入异常区
|
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); |
|
|
|
|
Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(businDataTaskVo.getLocationId()); |
|
|
|
|
@ -1266,8 +1268,7 @@ public class ScheduledTasks { |
|
|
|
|
businDataTaskVo.setExceptionMsg("下发堆垛机指令失败"); |
|
|
|
|
businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if(taskType.equals(TaskTypeEnum.abnormal_delivery.getValue())){ |
|
|
|
|
} else if (taskType.equals(TaskTypeEnum.abnormal_delivery.getValue())) { |
|
|
|
|
//异常出库
|
|
|
|
|
//异常区货位
|
|
|
|
|
Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.abnormal_area)); |
|
|
|
|
@ -1389,11 +1390,9 @@ public class ScheduledTasks { |
|
|
|
|
boolean b = iBusinDataTaskGoodsService.saveOrUpdateBatch(goods); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if(taskType.equals(TaskTypeEnum.punching_delivery.getValue())){ |
|
|
|
|
} else if (taskType.equals(TaskTypeEnum.punching_delivery.getValue())) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if(taskType.equals(TaskTypeEnum.replenished_in.getValue())){ |
|
|
|
|
} else if (taskType.equals(TaskTypeEnum.replenished_in.getValue())) { |
|
|
|
|
String agvno = null; |
|
|
|
|
if (businDataTaskVo.getTaskPath().contains("manMade")) { |
|
|
|
|
List agvtaskType = new ArrayList(); |
|
|
|
|
@ -1419,8 +1418,7 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
iBusinDataTaskService.runReplenishIn(businDataTaskVo, agvno); |
|
|
|
|
Result<Boolean> booleanResult = iPutInOutStorageService.reduceInventory(taskId, goodsNoStr); |
|
|
|
|
} |
|
|
|
|
else if (taskType.equals("21")){ |
|
|
|
|
} else if (taskType.equals("21")) { |
|
|
|
|
// 冲孔出库
|
|
|
|
|
//待冲孔区货位
|
|
|
|
|
Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area)); |
|
|
|
|
@ -1547,7 +1545,7 @@ public class ScheduledTasks { |
|
|
|
|
log.info("任务号" + businDataTaskVo.getId() + "任务状态" + businDataTaskVo.getTaskStatus() + "点位信息" + businDataTaskVo.getPoints()); |
|
|
|
|
//统一提交任务数据
|
|
|
|
|
iBusinDataTaskService.saveOrUpdate(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查看堆垛机是否拥堵
|
|
|
|
|
@ -1664,8 +1662,7 @@ public class ScheduledTasks { |
|
|
|
|
//redisTemplate.opsForValue().set("stackerLock", "false");
|
|
|
|
|
return Result.err(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
} else { |
|
|
|
|
return Result.err(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1686,6 +1683,7 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 入库时有对应出库任务,将入库任务改为出库任务,直接将物料运往出库点位 |
|
|
|
|
* |
|
|
|
|
* @param businDataTaskOutVo |
|
|
|
|
* @param businDataTaskVo |
|
|
|
|
*/ |
|
|
|
|
@ -1759,6 +1757,7 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 异常出库 |
|
|
|
|
* |
|
|
|
|
* @author Comair |
|
|
|
|
* @date 2023/8/12 19:32 |
|
|
|
|
*/ |
|
|
|
|
@ -1802,6 +1801,7 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 冲孔出库 |
|
|
|
|
* |
|
|
|
|
* @author Comair |
|
|
|
|
* @date 2023/8/12 19:33 |
|
|
|
|
*/ |
|
|
|
|
@ -1856,10 +1856,11 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 返回任务数最少的巷道号 |
|
|
|
|
* @author Comair |
|
|
|
|
* @date 2023/8/12 20:57 |
|
|
|
|
* |
|
|
|
|
* @param tunnelAll |
|
|
|
|
* @return java.lang.String |
|
|
|
|
* @author Comair |
|
|
|
|
* @date 2023/8/12 20:57 |
|
|
|
|
*/ |
|
|
|
|
public String quickSort(List<String> tunnelAll) { |
|
|
|
|
String tunnel = ""; |
|
|
|
|
|