Commit b967d36b6356a1b1b1655c4bc2b9f51b4bacd0e9

Authored by 易文鹏
1 parent f1791980

fix: 修复完成平库整盘出库任务,删除库位和容器的bug

src/main/java/com/huaheng/pc/task/taskHeader/service/ShipmentTaskService.java
... ... @@ -448,9 +448,15 @@ public class ShipmentTaskService {
448 448 //平库删除库位和容器
449 449 if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLESHIPMENT) && task.getFlat() != null && task.getFlat() == 1) {
450 450 if (StringUtils.isNotEmpty(task.getFromLocation())) {
451   - locationService.remove(new LambdaQueryWrapper<Location>().eq(Location::getCode, task.getFromLocation()));
452   - if (!containerService.remove(new LambdaQueryWrapper<Container>().eq(Container::getCode, task.getContainerCode()))) {
453   - throw new ServiceException("删除容器失败:" + task.getContainerCode());
  451 + //删除库位
  452 + if (locationService.getOne(new LambdaQueryWrapper<Location>().eq(Location::getCode, task.getFromLocation())) != null) {
  453 + locationService.remove(new LambdaQueryWrapper<Location>().eq(Location::getCode, task.getFromLocation()));
  454 + }
  455 + //删除容器
  456 + if (containerService.getOne(new LambdaQueryWrapper<Container>().eq(Container::getCode, task.getContainerCode())) != null) {
  457 + if (!containerService.remove(new LambdaQueryWrapper<Container>().eq(Container::getCode, task.getContainerCode()))) {
  458 + throw new ServiceException("删除容器失败:" + task.getContainerCode());
  459 + }
454 460 }
455 461 }
456 462 } else {
... ...