Commit 1ca89a52a7afdb3c596cd35090298dc6430d9c0b

Authored by 易文鹏
1 parent 45cb9338

feat: 修复概率发生完成出库任务后,容器对应库位没有修改的情况

src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
... ... @@ -85,7 +85,7 @@ public class ShippingCombinationService {
85 85  
86 86  
87 87 // 如果物料的供需政策为LP的,必须匹配通知单号才可以出库
88   - if (policy.equals("PL")) {
  88 + if (!openExhibitionRestrictions && policy.equals("LP")) {
89 89 String finalNoticeNo = noticeNo;
90 90 list.removeIf(detail -> !detail.getNoticeCode().equals(finalNoticeNo));
91 91 }
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/ShipmentTaskService.java
... ... @@ -650,7 +650,6 @@ public class ShipmentTaskService {
650 650 if (StringUtils.isEmpty(containerCode)) {
651 651 throw new ServiceException("系统无" + container + "容器");
652 652 }
653   -
654 653 //将库位状态改为空闲,如果是整出的对应的容器也清空
655 654 Location fromLocationRecord = locationService.getLocationByCode(fromLocation, warehouseCode);
656 655 if (StringUtils.isNull(fromLocationRecord)) {
... ... @@ -686,7 +685,13 @@ public class ShipmentTaskService {
686 685 throw new ServiceException("删除临时容器失败");
687 686 }
688 687 } else {
689   - containerService.updateLocationCodeAndStatus(containerCode, "", QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
  688 + container.setCode(containerCode);
  689 + container.setLocationCode("");
  690 + container.setStatus(QuantityConstant.STATUS_CONTAINER_EMPTY);
  691 + if (!containerService.updateById(container)) {
  692 + throw new ServiceException("完成出库任务时,修改容器状态失败");
  693 + }
  694 + //containerService.updateLocationCodeAndStatus(containerCode, "", QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
690 695 }
691 696 } else {
692 697 //查询是否存在关联的库存,入如果没有就修改容器状态为empty
... ... @@ -695,9 +700,21 @@ public class ShipmentTaskService {
695 700 List<InventoryDetail> detailList = inventoryDetailService.list(inventoryDetaillambdaQueryWrapper);
696 701 //库存查询不到该容器就把容器状态改为可用
697 702 if (detailList.isEmpty()) {
698   - containerService.updateLocationCodeAndStatus(containerCode, toLocation, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
  703 + container.setCode(containerCode);
  704 + container.setLocationCode(toLocation);
  705 + container.setStatus(QuantityConstant.STATUS_CONTAINER_EMPTY);
  706 + if (!containerService.updateById(container)) {
  707 + throw new ServiceException("完成出库任务时,修改容器状态失败");
  708 + }
  709 + //containerService.updateLocationCodeAndStatus(containerCode, toLocation, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode);
699 710 } else {
700   - containerService.updateLocationCodeAndStatus(containerCode, toLocation, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode);
  711 + container.setCode(containerCode);
  712 + container.setLocationCode(toLocation);
  713 + container.setStatus(QuantityConstant.STATUS_CONTAINER_SOME);
  714 + if (!containerService.updateById(container)) {
  715 + throw new ServiceException("完成出库任务时,修改容器状态失败");
  716 + }
  717 + //containerService.updateLocationCodeAndStatus(containerCode, toLocation, QuantityConstant.STATUS_CONTAINER_SOME, warehouseCode);
701 718 }
702 719 }
703 720 }
... ...