|
|
|
@ -229,6 +229,10 @@ public class ScheduledTasks { |
|
|
|
taskQueryBo.setTaskType("21"); |
|
|
|
taskQueryBo.setTaskType("21"); |
|
|
|
List<BusinDataTaskVo> businDataTaskVo21 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); |
|
|
|
List<BusinDataTaskVo> businDataTaskVo21 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); |
|
|
|
businDataTaskVos.addAll(businDataTaskVo21); |
|
|
|
businDataTaskVos.addAll(businDataTaskVo21); |
|
|
|
|
|
|
|
taskQueryBo.setTaskType("22"); |
|
|
|
|
|
|
|
List<BusinDataTaskVo> businDataTaskVo22 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); |
|
|
|
|
|
|
|
businDataTaskVos.addAll(businDataTaskVo22); |
|
|
|
|
|
|
|
|
|
|
|
for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) { |
|
|
|
for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) { |
|
|
|
doTask(businDataTaskVo); |
|
|
|
doTask(businDataTaskVo); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -536,7 +540,8 @@ public class ScheduledTasks { |
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
iBusinDataTaskService.updateById(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); |
|
|
|
iBusinDataTaskService.updateById(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); |
|
|
|
|
|
|
|
|
|
|
|
} else if (taskType.equals("2")) { |
|
|
|
} |
|
|
|
|
|
|
|
else if (taskType.equals("2")) { |
|
|
|
Long plcId = 0L; |
|
|
|
Long plcId = 0L; |
|
|
|
Long stkPlcId = 0L; |
|
|
|
Long stkPlcId = 0L; |
|
|
|
Boolean NUMBER = true; |
|
|
|
Boolean NUMBER = true; |
|
|
|
@ -698,7 +703,8 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
} else if (taskType.equals("1")) { |
|
|
|
} |
|
|
|
|
|
|
|
else if (taskType.equals("1")) { |
|
|
|
Long plcId = 0L; |
|
|
|
Long plcId = 0L; |
|
|
|
Long stkPlcId = 0L; |
|
|
|
Long stkPlcId = 0L; |
|
|
|
Boolean NUMBER = true; |
|
|
|
Boolean NUMBER = true; |
|
|
|
@ -881,7 +887,8 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
} else if (taskType.equals("3")) { |
|
|
|
} |
|
|
|
|
|
|
|
else if (taskType.equals("3")) { |
|
|
|
Long plcId = 0L; |
|
|
|
Long plcId = 0L; |
|
|
|
Long stkPlcId = 0L; |
|
|
|
Long stkPlcId = 0L; |
|
|
|
Boolean NUMBER = true; |
|
|
|
Boolean NUMBER = true; |
|
|
|
@ -1033,14 +1040,15 @@ public class ScheduledTasks { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
businDataTaskVo.setDpsNoTwo(stkPlcId); |
|
|
|
} else if (taskType.equals("4") || taskType.equals("5")) { |
|
|
|
} |
|
|
|
|
|
|
|
else if (taskType.equals("4") || taskType.equals("5")) { |
|
|
|
String randome = null; |
|
|
|
String randome = null; |
|
|
|
//出库任务(正常出库、紧急出库)
|
|
|
|
//出库任务(正常出库、紧急出库)
|
|
|
|
//获取要出库的物料信息
|
|
|
|
//获取要出库的物料信息
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); |
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); |
|
|
|
|
|
|
|
|
|
|
|
//拿到按比例分配的库区
|
|
|
|
//拿到按比例分配的库区
|
|
|
|
// randome = allocationTasksUtils.randomeout();
|
|
|
|
// randome = allocationTasksUtils.randomeout();
|
|
|
|
//测试时使用
|
|
|
|
//测试时使用
|
|
|
|
randome = "P01"; |
|
|
|
randome = "P01"; |
|
|
|
//TODO 测试注释 要到开
|
|
|
|
//TODO 测试注释 要到开
|
|
|
|
@ -1176,7 +1184,8 @@ public class ScheduledTasks { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else if (taskType.equals("11") || taskType.equals("12")) { |
|
|
|
} |
|
|
|
|
|
|
|
else if (taskType.equals("11") || taskType.equals("12")) { |
|
|
|
String agvno = ""; |
|
|
|
String agvno = ""; |
|
|
|
int AgvType = 0; |
|
|
|
int AgvType = 0; |
|
|
|
//空治具流向呼叫agv失败后再次呼叫agv
|
|
|
|
//空治具流向呼叫agv失败后再次呼叫agv
|
|
|
|
@ -1247,7 +1256,8 @@ public class ScheduledTasks { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (taskType.equals("10")) { |
|
|
|
} |
|
|
|
|
|
|
|
else if (taskType.equals("10")) { |
|
|
|
//先判断补货入库是否是一套,如果是入存货区,否则入异常区
|
|
|
|
//先判断补货入库是否是一套,如果是入存货区,否则入异常区
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); |
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); |
|
|
|
Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(businDataTaskVo.getLocationId()); |
|
|
|
Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(businDataTaskVo.getLocationId()); |
|
|
|
@ -1268,7 +1278,8 @@ public class ScheduledTasks { |
|
|
|
businDataTaskVo.setExceptionMsg("下发堆垛机指令失败"); |
|
|
|
businDataTaskVo.setExceptionMsg("下发堆垛机指令失败"); |
|
|
|
businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); |
|
|
|
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)); |
|
|
|
Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.abnormal_area)); |
|
|
|
@ -1390,9 +1401,9 @@ public class ScheduledTasks { |
|
|
|
boolean b = iBusinDataTaskGoodsService.saveOrUpdateBatch(goods); |
|
|
|
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; |
|
|
|
String agvno = null; |
|
|
|
if (businDataTaskVo.getTaskPath().contains("manMade")) { |
|
|
|
if (businDataTaskVo.getTaskPath().contains("manMade")) { |
|
|
|
List agvtaskType = new ArrayList(); |
|
|
|
List agvtaskType = new ArrayList(); |
|
|
|
@ -1418,7 +1429,8 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
|
|
iBusinDataTaskService.runReplenishIn(businDataTaskVo, agvno); |
|
|
|
iBusinDataTaskService.runReplenishIn(businDataTaskVo, agvno); |
|
|
|
Result<Boolean> booleanResult = iPutInOutStorageService.reduceInventory(taskId, goodsNoStr); |
|
|
|
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)); |
|
|
|
Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area)); |
|
|
|
@ -1542,6 +1554,25 @@ public class ScheduledTasks { |
|
|
|
businDataTaskVo.setTaskStatus("-3"); |
|
|
|
businDataTaskVo.setTaskStatus("-3"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (taskType.equals("22")){ |
|
|
|
|
|
|
|
BusinDataTask businDataTask = iBusinDataTaskService.getById(businDataTaskVo.getId()); |
|
|
|
|
|
|
|
Result<Boolean> taskResult = outTask(businDataTask); |
|
|
|
|
|
|
|
if (Result.isOk(taskResult)) { |
|
|
|
|
|
|
|
businDataTask.setTaskStatus(TaskStatusEnum.wait_callback.getValue()); |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) { |
|
|
|
|
|
|
|
redisTemplate.opsForValue().set("outbound:" + businDataTask.getId(), businDataTask.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) { |
|
|
|
|
|
|
|
businDataTask.setExceptionMsg("下发堆垛机失败"); |
|
|
|
|
|
|
|
businDataTask.setTaskStatus(TaskStatusEnum.err.getValue()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
businDataTask.setExceptionMsg("已经下发堆垛机"); |
|
|
|
|
|
|
|
businDataTask.setTaskStatus("-3"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
log.info("任务号" + businDataTaskVo.getId() + "任务状态" + businDataTaskVo.getTaskStatus() + "点位信息" + businDataTaskVo.getPoints()); |
|
|
|
log.info("任务号" + businDataTaskVo.getId() + "任务状态" + businDataTaskVo.getTaskStatus() + "点位信息" + businDataTaskVo.getPoints()); |
|
|
|
//统一提交任务数据
|
|
|
|
//统一提交任务数据
|
|
|
|
iBusinDataTaskService.saveOrUpdate(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); |
|
|
|
iBusinDataTaskService.saveOrUpdate(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); |
|
|
|
|