|
|
|
@ -208,8 +208,9 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private BigDecimal getWeightByOrderIdList(List<Long> orderIdList) { |
|
|
|
private BigDecimal getWeightByOrderIdList(List<Long> orderIdList) { |
|
|
|
// 查询订单对应的工单列表
|
|
|
|
// 查询订单对应的工单列表
|
|
|
|
|
|
|
|
log.info("查询订单list:{}",orderIdList); |
|
|
|
List<YieldOrder> orderList = iYieldOrderService.list(new LambdaQueryWrapper<YieldOrder>().in(YieldOrder::getId, orderIdList)); |
|
|
|
List<YieldOrder> orderList = iYieldOrderService.list(new LambdaQueryWrapper<YieldOrder>().in(YieldOrder::getId, orderIdList)); |
|
|
|
|
|
|
|
log.info("查询订单orderList:{}",orderIdList); |
|
|
|
// 流式累加实际称重值(过滤null,初始值为0)
|
|
|
|
// 流式累加实际称重值(过滤null,初始值为0)
|
|
|
|
return orderList.stream() |
|
|
|
return orderList.stream() |
|
|
|
.map(YieldOrder::getActualWeighing) |
|
|
|
.map(YieldOrder::getActualWeighing) |
|
|
|
@ -263,7 +264,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
} |
|
|
|
} |
|
|
|
String stationCode=""; |
|
|
|
String stationCode=""; |
|
|
|
String endStationCode=""; |
|
|
|
String endStationCode=""; |
|
|
|
if (!returnToWarehouseDto.getStartStationCode().isEmpty()) { |
|
|
|
if (returnToWarehouseDto.getStartStationCode()!=null&&!returnToWarehouseDto.getStartStationCode().isEmpty()) { |
|
|
|
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getStationCode, returnToWarehouseDto.getStartStationCode())); |
|
|
|
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getStationCode, returnToWarehouseDto.getStartStationCode())); |
|
|
|
if (stationList.isEmpty()) { |
|
|
|
if (stationList.isEmpty()) { |
|
|
|
return R.fail("站点编码不存在"); |
|
|
|
return R.fail("站点编码不存在"); |
|
|
|
@ -277,7 +278,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
} |
|
|
|
} |
|
|
|
Task task = new Task(); |
|
|
|
Task task = new Task(); |
|
|
|
//判断箱条码是否为空,如果不为空判断是否在使用
|
|
|
|
//判断箱条码是否为空,如果不为空判断是否在使用
|
|
|
|
if (!returnToWarehouseDto.getBoxBarcode().isEmpty()) { |
|
|
|
if (returnToWarehouseDto.getBoxBarcode()!=null&&!returnToWarehouseDto.getBoxBarcode().isEmpty()) { |
|
|
|
R taskCheckResult = checkBoxBarcodeRunningTask(returnToWarehouseDto.getBoxBarcode()); |
|
|
|
R taskCheckResult = checkBoxBarcodeRunningTask(returnToWarehouseDto.getBoxBarcode()); |
|
|
|
if (!taskCheckResult.isSuccess()) { |
|
|
|
if (!taskCheckResult.isSuccess()) { |
|
|
|
return taskCheckResult; |
|
|
|
return taskCheckResult; |
|
|
|
@ -299,17 +300,24 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
// 6. 完善任务信息并保存
|
|
|
|
// 6. 完善任务信息并保存
|
|
|
|
task = (Task) locationResult.getData(); |
|
|
|
task = (Task) locationResult.getData(); |
|
|
|
log.info("task:"+task.toString()); |
|
|
|
log.info("task:"+task.toString()); |
|
|
|
if (task.getStationId()==null&&agvSend) { |
|
|
|
if (task.getStationId()==null) { |
|
|
|
List<Location> locationList = iLocationService.list(new LambdaQueryWrapper<Location>().eq(Location::getId, task.getLocationId())); |
|
|
|
if (agvSend) { |
|
|
|
if (!CollectionUtils.isEmpty(locationList)) { |
|
|
|
List<Location> locationList = iLocationService.list(new LambdaQueryWrapper<Location>().eq(Location::getId, task.getLocationId())); |
|
|
|
Location location = locationList.get(0); |
|
|
|
if (!CollectionUtils.isEmpty(locationList)) { |
|
|
|
location.setLocationStatus(Location.STATUS_FREE); |
|
|
|
Location location = locationList.get(0); |
|
|
|
iLocationService.updateById(location); |
|
|
|
location.setLocationStatus(Location.STATUS_FREE); |
|
|
|
|
|
|
|
iLocationService.updateById(location); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return R.fail("结束站点被占用"); |
|
|
|
} |
|
|
|
} |
|
|
|
return R.fail("结束站点被占用"); |
|
|
|
|
|
|
|
}else { |
|
|
|
}else { |
|
|
|
endStationCode=iStationService.getById(task.getStationId()).getStationCode(); |
|
|
|
Station station = iStationService.getById(task.getStationId()); |
|
|
|
|
|
|
|
if (station==null) { |
|
|
|
|
|
|
|
return R.fail("结束站点不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
endStationCode=station.getStationCode(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
task.setTaskStatus(Task.STATUS_START); // 设置任务初始状态为启动
|
|
|
|
task.setTaskStatus(Task.STATUS_START); // 设置任务初始状态为启动
|
|
|
|
@ -317,7 +325,8 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { |
|
|
|
task.setCreateUser(AuthUtil.getUserId()); |
|
|
|
task.setCreateUser(AuthUtil.getUserId()); |
|
|
|
if (!returnToWarehouseDto.getBoxBarcode().isEmpty()) { |
|
|
|
if (!returnToWarehouseDto.getBoxBarcode().isEmpty()) { |
|
|
|
List<OrderBind> orderBindList = iOrderBindService.list(new LambdaQueryWrapper<OrderBind>().eq(OrderBind::getBoxBarcode, returnToWarehouseDto.getBoxBarcode()).eq(false, OrderBind::getBindingStatus, OrderBind.STATUS_UNBINDED)); |
|
|
|
List<OrderBind> orderBindList = iOrderBindService.list(new LambdaQueryWrapper<OrderBind>().eq(OrderBind::getBoxBarcode, returnToWarehouseDto.getBoxBarcode()).eq(false, OrderBind::getBindingStatus, OrderBind.STATUS_UNBINDED)); |
|
|
|
if (orderBindList.isEmpty()) { |
|
|
|
log.info("需要承重的list:"+orderBindList); |
|
|
|
|
|
|
|
if (orderBindList==null||orderBindList.isEmpty()) { |
|
|
|
task.setWeight(new BigDecimal(0)); |
|
|
|
task.setWeight(new BigDecimal(0)); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
List<Long> orderIdsList = orderBindList.stream() |
|
|
|
List<Long> orderIdsList = orderBindList.stream() |
|
|
|
|