代码修改

liweidong
绫Umbrella 1 month ago
parent 5f5230b132
commit 4834a524e7
  1. 14
      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. 35
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/IOrderBoxServiceImpl.java

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

@ -10,7 +10,7 @@
FROM LM_TASK
WHERE IS_DELETED = 0
AND BOX_BARCODE = #{boxBarcode}
AND TASK_STATUS NOT IN (2, 9);
AND TASK_STATUS NOT IN (2,4,5);
</select>
<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) {
// 查询订单对应的工单列表
log.info("查询订单list:{}",orderIdList);
List<YieldOrder> orderList = iYieldOrderService.list(new LambdaQueryWrapper<YieldOrder>().in(YieldOrder::getId, orderIdList));
log.info("查询订单orderList:{}",orderIdList);
// 流式累加实际称重值(过滤null,初始值为0)
return orderList.stream()
.map(YieldOrder::getActualWeighing)
@ -263,7 +264,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService {
}
String stationCode="";
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()));
if (stationList.isEmpty()) {
return R.fail("站点编码不存在");
@ -277,7 +278,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService {
}
Task task = new Task();
//判断箱条码是否为空,如果不为空判断是否在使用
if (!returnToWarehouseDto.getBoxBarcode().isEmpty()) {
if (returnToWarehouseDto.getBoxBarcode()!=null&&!returnToWarehouseDto.getBoxBarcode().isEmpty()) {
R taskCheckResult = checkBoxBarcodeRunningTask(returnToWarehouseDto.getBoxBarcode());
if (!taskCheckResult.isSuccess()) {
return taskCheckResult;
@ -299,17 +300,24 @@ public class IOrderBoxServiceImpl implements IOrderBoxService {
// 6. 完善任务信息并保存
task = (Task) locationResult.getData();
log.info("task:"+task.toString());
if (task.getStationId()==null&&agvSend) {
List<Location> locationList = iLocationService.list(new LambdaQueryWrapper<Location>().eq(Location::getId, task.getLocationId()));
if (!CollectionUtils.isEmpty(locationList)) {
Location location = locationList.get(0);
location.setLocationStatus(Location.STATUS_FREE);
iLocationService.updateById(location);
if (task.getStationId()==null) {
if (agvSend) {
List<Location> locationList = iLocationService.list(new LambdaQueryWrapper<Location>().eq(Location::getId, task.getLocationId()));
if (!CollectionUtils.isEmpty(locationList)) {
Location location = locationList.get(0);
location.setLocationStatus(Location.STATUS_FREE);
iLocationService.updateById(location);
}
return R.fail("结束站点被占用");
}
return R.fail("结束站点被占用");
}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); // 设置任务初始状态为启动
@ -317,7 +325,8 @@ public class IOrderBoxServiceImpl implements IOrderBoxService {
task.setCreateUser(AuthUtil.getUserId());
if (!returnToWarehouseDto.getBoxBarcode().isEmpty()) {
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));
}else {
List<Long> orderIdsList = orderBindList.stream()

Loading…
Cancel
Save