Commit 66dc1410c64bd2ea5fc33f11e9dbde974fba84a9

Authored by 谭毅彬
1 parent 707966ca

补充入库BUG修复

Signed-off-by: TanYibin <5491541@qq.com>
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -1073,6 +1073,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1073 1073 return Result.error("完成入库任务时,没有找到目的库位");
1074 1074 }
1075 1075 InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode);
  1076 + if (inventoryHeader != null && taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT && !fromLocationCode.equals(toLocationCode)) {
  1077 + inventoryHeader.setLocationCode(toLocationCode);
  1078 + inventoryHeader.setZoneCode(zoneCode);
  1079 + if (!inventoryHeaderService.updateById(inventoryHeader)) {
  1080 + throw new JeecgBootException("完成入库任务时, 更新库存头失败");
  1081 + }
  1082 + List<InventoryDetail> inventoryDetails = inventoryDetailService.getInventoryDetailListByInventoryHeaderId(inventoryHeader.getId());
  1083 + for (InventoryDetail inventoryDetail : inventoryDetails) {
  1084 + inventoryDetail.setLocationCode(toLocationCode);
  1085 + inventoryDetail.setZoneCode(zoneCode);
  1086 + if (!inventoryDetailService.updateById(inventoryDetail)) {
  1087 + throw new JeecgBootException("完成入库任务时, 更新库存详情失败");
  1088 + }
  1089 + }
  1090 + }
1076 1091 if (inventoryHeader == null) {
1077 1092 inventoryHeader = new InventoryHeader();
1078 1093 inventoryHeader.setWarehouseCode(warehouseCode);
... ...