代码修改

liweidong
绫Umbrella 1 month ago
parent 5f5230b132
commit 4834a524e7
  1. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/controller/PipelineController.java
  2. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/TaskMapper.xml
  3. 21
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/IOrderBoxServiceImpl.java

@ -79,7 +79,6 @@ public class PipelineController extends BladeController {
throw new ServiceException("箱条码不能为空"); throw new ServiceException("箱条码不能为空");
} }
BigDecimal estimatedWeight = pipelineService.getMaterialBoxWeight(boxBarcode);
ReturnToWarehouseDto returnToWarehouseDto = new ReturnToWarehouseDto(); ReturnToWarehouseDto returnToWarehouseDto = new ReturnToWarehouseDto();
returnToWarehouseDto.setBoxBarcode(boxBarcode); returnToWarehouseDto.setBoxBarcode(boxBarcode);
R wcIdR = iOrderBoxService.getWcId(boxBarcode); R wcIdR = iOrderBoxService.getWcId(boxBarcode);
@ -91,6 +90,7 @@ public class PipelineController extends BladeController {
if (!taskR.isSuccess()) { if (!taskR.isSuccess()) {
return taskR; return taskR;
} }
BigDecimal estimatedWeight = pipelineService.getMaterialBoxWeight(boxBarcode);
return R.data(estimatedWeight); return R.data(estimatedWeight);
} }

@ -10,7 +10,7 @@
FROM LM_TASK FROM LM_TASK
WHERE IS_DELETED = 0 WHERE IS_DELETED = 0
AND BOX_BARCODE = #{boxBarcode} AND BOX_BARCODE = #{boxBarcode}
AND TASK_STATUS NOT IN (2, 9); AND TASK_STATUS NOT IN (2,4,5);
</select> </select>
<select id="selectPage" resultType="org.springblade.desk.logistics.pojo.vo.TaskVO"> <select id="selectPage" resultType="org.springblade.desk.logistics.pojo.vo.TaskVO">

@ -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,7 +300,8 @@ 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) {
if (agvSend) {
List<Location> locationList = iLocationService.list(new LambdaQueryWrapper<Location>().eq(Location::getId, task.getLocationId())); List<Location> locationList = iLocationService.list(new LambdaQueryWrapper<Location>().eq(Location::getId, task.getLocationId()));
if (!CollectionUtils.isEmpty(locationList)) { if (!CollectionUtils.isEmpty(locationList)) {
Location location = locationList.get(0); Location location = locationList.get(0);
@ -308,8 +310,14 @@ public class IOrderBoxServiceImpl implements IOrderBoxService {
} }
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()

Loading…
Cancel
Save