|
|
|
@ -943,15 +943,24 @@ public class ScheduledTasks { |
|
|
|
basePointDeviceVo = baseLocationPlcMapper.selectBasePointByGroupno(pointQueryBo).get(1); |
|
|
|
basePointDeviceVo = baseLocationPlcMapper.selectBasePointByGroupno(pointQueryBo).get(1); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NUMBER = false; |
|
|
|
NUMBER = false; |
|
|
|
//先入待冲孔区
|
|
|
|
//先入待冲孔区
|
|
|
|
Long punchingArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area)); |
|
|
|
Long punchingArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area)); |
|
|
|
|
|
|
|
|
|
|
|
List<BaseLocationVo> baseLocationVos = baseLocationMapper.getLocationByAreaId(punchingArea); |
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTaskVo.getId()); |
|
|
|
if (baseLocationVos.size() > 0) { |
|
|
|
AssingEmptyLocBo assingEmptyLocBo = new AssingEmptyLocBo(); |
|
|
|
locationVo = baseLocationVos.get(0); |
|
|
|
assingEmptyLocBo.setBusinDataTaskGoodsVos(businDataTaskGoodsVos); |
|
|
|
|
|
|
|
//冲孔杠分配货位
|
|
|
|
|
|
|
|
Result<BaseLocationVo> locationVoResult = iBaseLocationService.assignEmptyLocatioPunching(assingEmptyLocBo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isNotEmpty(locationVoResult) && locationVoResult.getCode() == HttpStatus.SUCCESS.getCode()) { |
|
|
|
|
|
|
|
//如果是P01则设置randome为P02
|
|
|
|
|
|
|
|
redisTemplate.opsForValue().set("randome", "P02"); |
|
|
|
|
|
|
|
locationVo = locationVoResult.getData(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(locationVo == null){ |
|
|
|
|
|
|
|
log.info("冲孔杠分配货位为空"); |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
businDataTaskVo.setToColumn(locationVo.getLocationColumn()); |
|
|
|
businDataTaskVo.setToColumn(locationVo.getLocationColumn()); |
|
|
|
businDataTaskVo.setToLayer(locationVo.getLayer()); |
|
|
|
businDataTaskVo.setToLayer(locationVo.getLayer()); |
|
|
|
@ -960,16 +969,6 @@ public class ScheduledTasks { |
|
|
|
String tunnel = locationVo.getTunnel(); |
|
|
|
String tunnel = locationVo.getTunnel(); |
|
|
|
businDataTaskVo.setTunnel(tunnel); |
|
|
|
businDataTaskVo.setTunnel(tunnel); |
|
|
|
businDataTaskVo.setLocationId(locationVo.getId()); |
|
|
|
businDataTaskVo.setLocationId(locationVo.getId()); |
|
|
|
// Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(locationVo.getId());
|
|
|
|
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTaskVo.getId()); |
|
|
|
|
|
|
|
BusinTaskExeBo exeBo = new BusinTaskExeBo(); |
|
|
|
|
|
|
|
exeBo.setTaskCode(taskId); |
|
|
|
|
|
|
|
exeBo.setBusinDataTaskGoodsVo(businDataTaskGoodsVos); |
|
|
|
|
|
|
|
exeBo.setContainerId(containerId); |
|
|
|
|
|
|
|
exeBo.setBaseLocationVo(locationVo); |
|
|
|
|
|
|
|
exeBo.setTransNo("1"); |
|
|
|
|
|
|
|
exeBo.setTransQual("1"); |
|
|
|
|
|
|
|
// iPutInOutStorageService.exeTaskPutinStorage(exeBo);
|
|
|
|
|
|
|
|
//获取巷道对应的立库输送线接驳口
|
|
|
|
//获取巷道对应的立库输送线接驳口
|
|
|
|
pointQueryBo.setTunnel(tunnel); |
|
|
|
pointQueryBo.setTunnel(tunnel); |
|
|
|
pointQueryBo.setDirection("0"); |
|
|
|
pointQueryBo.setDirection("0"); |
|
|
|
@ -978,16 +977,10 @@ public class ScheduledTasks { |
|
|
|
basePointDeviceVo = basePointDeviceVos.get(0); |
|
|
|
basePointDeviceVo = basePointDeviceVos.get(0); |
|
|
|
basePointDeviceVo.setPlcId(Long.valueOf(isysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id))); |
|
|
|
basePointDeviceVo.setPlcId(Long.valueOf(isysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取巷道对应的堆垛机信息
|
|
|
|
//获取巷道对应的堆垛机信息
|
|
|
|
pointQueryBo.setDevType("1"); |
|
|
|
pointQueryBo.setDevType("1"); |
|
|
|
BaseDevicePlcVo baseDevicePlcVo = baseLocationPlcMapper.selectBaseDevicePlc(pointQueryBo); |
|
|
|
BaseDevicePlcVo baseDevicePlcVo = baseLocationPlcMapper.selectBaseDevicePlc(pointQueryBo); |
|
|
|
stkPlcId = baseDevicePlcVo.getPlcId(); |
|
|
|
stkPlcId = baseDevicePlcVo.getPlcId(); |
|
|
|
// points.add(basePointDeviceVo.getHandshakePoint());
|
|
|
|
|
|
|
|
// points.add(basePointDeviceVo.getHandshakePoint());
|
|
|
|
|
|
|
|
// snPointMap.put("3",basePointDeviceVo.getHandshakePoint());
|
|
|
|
|
|
|
|
// snPointMap.put("4",basePointDeviceVo.getHandshakePoint());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String toPointNo = ""; |
|
|
|
String toPointNo = ""; |
|
|
|
@ -998,16 +991,12 @@ public class ScheduledTasks { |
|
|
|
|
|
|
|
|
|
|
|
points.add(toPointNo); |
|
|
|
points.add(toPointNo); |
|
|
|
snPointMap.put("3", toPointNo); |
|
|
|
snPointMap.put("3", toPointNo); |
|
|
|
// String toPointNo="KW18";
|
|
|
|
|
|
|
|
// points.add(toPointNo);
|
|
|
|
|
|
|
|
// snPointMap.put("3",toPointNo);
|
|
|
|
|
|
|
|
int agvTaskType; |
|
|
|
int agvTaskType; |
|
|
|
if (toPointNo.equals("KW12")) { |
|
|
|
if (toPointNo.equals("KW12")) { |
|
|
|
agvTaskType = 24; |
|
|
|
agvTaskType = 24; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
agvTaskType = 27; |
|
|
|
agvTaskType = 27; |
|
|
|
} |
|
|
|
} |
|
|
|
// TODO 中科 测试 需要删除
|
|
|
|
|
|
|
|
businDataTaskVo.setPoints(JsonUtil.toJSONString(snPointMap)); |
|
|
|
businDataTaskVo.setPoints(JsonUtil.toJSONString(snPointMap)); |
|
|
|
businDataTaskVo.setIsDown(String.valueOf(agvTaskType)); |
|
|
|
businDataTaskVo.setIsDown(String.valueOf(agvTaskType)); |
|
|
|
//呼叫AGV
|
|
|
|
//呼叫AGV
|
|
|
|
@ -1058,12 +1047,6 @@ public class ScheduledTasks { |
|
|
|
//获取要出库的物料信息
|
|
|
|
//获取要出库的物料信息
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); |
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); |
|
|
|
|
|
|
|
|
|
|
|
//拿到按比例分配的库区
|
|
|
|
|
|
|
|
// randome = allocationTasksUtils.randomeout();
|
|
|
|
|
|
|
|
//测试时使用
|
|
|
|
|
|
|
|
randome = "P01"; |
|
|
|
|
|
|
|
//TODO 测试注释 要到开
|
|
|
|
|
|
|
|
// if (randome.equals("P02")) {
|
|
|
|
|
|
|
|
if (businDataTaskVo.getDistinction().equals("2")) { |
|
|
|
if (businDataTaskVo.getDistinction().equals("2")) { |
|
|
|
int number = businDataTaskGoodsVos.size(); |
|
|
|
int number = businDataTaskGoodsVos.size(); |
|
|
|
List<String> goodsno = businDataTaskGoodsVos.stream().map(e -> e.getGoodsNo()).collect(Collectors.toList()); |
|
|
|
List<String> goodsno = businDataTaskGoodsVos.stream().map(e -> e.getGoodsNo()).collect(Collectors.toList()); |
|
|
|
@ -1086,7 +1069,6 @@ public class ScheduledTasks { |
|
|
|
businDataTaskVo.setTaskType(TaskTypeEnum.thirteen_out.getValue()); |
|
|
|
businDataTaskVo.setTaskType(TaskTypeEnum.thirteen_out.getValue()); |
|
|
|
businDataTaskVo.setTaskPath(frompoint); |
|
|
|
businDataTaskVo.setTaskPath(frompoint); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//TODO 测试注释 要到开
|
|
|
|
//TODO 测试注释 要到开
|
|
|
|
@ -1142,9 +1124,6 @@ public class ScheduledTasks { |
|
|
|
baseBarcodesOutServiceOne.setOutStatus("2"); |
|
|
|
baseBarcodesOutServiceOne.setOutStatus("2"); |
|
|
|
iBaseBarcodesOutService.updateById(baseBarcodesOutServiceOne); |
|
|
|
iBaseBarcodesOutService.updateById(baseBarcodesOutServiceOne); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//添加巷道任务数和总任务数
|
|
|
|
|
|
|
|
//tunnelTaskUtil.addOutboundTaskNum(businDataTask.getTunnel());
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) { |
|
|
|
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) { |
|
|
|
businDataTask.setExceptionMsg("下发堆垛机失败"); |
|
|
|
businDataTask.setExceptionMsg("下发堆垛机失败"); |
|
|
|
@ -1161,38 +1140,6 @@ public class ScheduledTasks { |
|
|
|
businDataTaskVo.setExceptionMsg("当前开放的货位已无当前库存"); |
|
|
|
businDataTaskVo.setExceptionMsg("当前开放的货位已无当前库存"); |
|
|
|
businDataTaskVo.setTaskStatus("-3"); |
|
|
|
businDataTaskVo.setTaskStatus("-3"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// if (ObjectUtils.isNotEmpty(list)) {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
|
|
// businDataTaskVo.setExceptionMsg("当前开放的货位已无当前库存");
|
|
|
|
|
|
|
|
// businDataTaskVo.setTaskStatus("-3");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else {
|
|
|
|
|
|
|
|
// //如果立库没有库存那么查看平库是否有库存
|
|
|
|
|
|
|
|
// int numberT = businDataTaskGoodsVos.size();
|
|
|
|
|
|
|
|
// List<String> goodsnoT = businDataTaskGoodsVos.stream().map(e -> e.getGoodsNo()).collect(Collectors.toList());
|
|
|
|
|
|
|
|
// //根据GoodsNo查看立库是否有库存
|
|
|
|
|
|
|
|
// List<SysStockDetail> listT = iSysStockDetailService.list(new LambdaQueryWrapper<SysStockDetail>()
|
|
|
|
|
|
|
|
// .in(SysStockDetail::getGoodsNo, goodsno)
|
|
|
|
|
|
|
|
// .eq(SysStockDetail::getQty, "1")
|
|
|
|
|
|
|
|
// .isNull(SysStockDetail::getOutQty)
|
|
|
|
|
|
|
|
// .isNull(SysStockDetail::getLocationId));
|
|
|
|
|
|
|
|
// if (ObjectUtils.isEmpty(listT)) {
|
|
|
|
|
|
|
|
// businDataTaskVo.setTaskStatus("-3");
|
|
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
|
|
// String frompoint = null;
|
|
|
|
|
|
|
|
// String tepairGroup = sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.P_out01);
|
|
|
|
|
|
|
|
// pointQueryBo.setGroupNo(tepairGroup);
|
|
|
|
|
|
|
|
// BasePointDeviceVo pointDeviceout = basePointDeviceMapper.selectBasePointByGroupno(pointQueryBo);
|
|
|
|
|
|
|
|
// frompoint = pointDeviceout.getPointNo();
|
|
|
|
|
|
|
|
// businDataTaskVo.setTaskStatus(TaskStatusEnum.four_out.getValue());
|
|
|
|
|
|
|
|
// businDataTaskVo.setTaskType(TaskTypeEnum.thirteen_out.getValue());
|
|
|
|
|
|
|
|
// businDataTaskVo.setTaskPath(TaskTypeEnum.thirteen_out.getValue());
|
|
|
|
|
|
|
|
// businDataTaskVo.setTaskPath(frompoint);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -1606,6 +1553,17 @@ public class ScheduledTasks { |
|
|
|
} |
|
|
|
} |
|
|
|
else if("25".equals(taskType)){ |
|
|
|
else if("25".equals(taskType)){ |
|
|
|
BusinDataTask businDataTask = iBusinDataTaskService.getById(businDataTaskVo.getId()); |
|
|
|
BusinDataTask businDataTask = iBusinDataTaskService.getById(businDataTaskVo.getId()); |
|
|
|
|
|
|
|
//获取货位对应的巷道及巷道对应的设备信息
|
|
|
|
|
|
|
|
pointQueryBo.setTunnel(businDataTask.getTunnel()); |
|
|
|
|
|
|
|
pointQueryBo.setDirection("0"); |
|
|
|
|
|
|
|
BasePointDeviceVo basePointDeviceVo = baseLocationPlcMapper.selectBasePointByGroupno(pointQueryBo).get(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long plcId=0L; |
|
|
|
|
|
|
|
if (basePointDeviceVo != null) { |
|
|
|
|
|
|
|
plcId = Long.valueOf(isysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
businDataTask.setDpsNoOne(plcId); |
|
|
|
|
|
|
|
businDataTaskVo.setDpsNoOne(plcId); |
|
|
|
Result<Boolean> taskResult = outTask(businDataTask); |
|
|
|
Result<Boolean> taskResult = outTask(businDataTask); |
|
|
|
businDataTaskVo.setUpdateTime(DateUtils.getNowDate()); |
|
|
|
businDataTaskVo.setUpdateTime(DateUtils.getNowDate()); |
|
|
|
if (Result.isOk(taskResult)) { |
|
|
|
if (Result.isOk(taskResult)) { |
|
|
|
@ -2080,11 +2038,6 @@ public class ScheduledTasks { |
|
|
|
Long stkPlcId = null; |
|
|
|
Long stkPlcId = null; |
|
|
|
|
|
|
|
|
|
|
|
String agvno = null; |
|
|
|
String agvno = null; |
|
|
|
//获取派生
|
|
|
|
|
|
|
|
// TODO 由于逻辑区域换成与车型相匹配,不是与派生匹配,所以注释掉
|
|
|
|
|
|
|
|
// Long dervieId = getLocationByDervie(vehicheModel, color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String randome = "P01"; |
|
|
|
String randome = "P01"; |
|
|
|
if (businDataTaskVo.getWarehouseType().equals("1")) { |
|
|
|
if (businDataTaskVo.getWarehouseType().equals("1")) { |
|
|
|
randome = "P01"; |
|
|
|
randome = "P01"; |
|
|
|
|