Commit c3e435c5c07ae402486e6c3fd37ed8ffe79e13fd

Authored by 肖超群
1 parent f224e411

完善容器 库位状态变更

huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -1455,16 +1455,21 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
1455 1455 throw new JeecgBootException("完成整盘出库任务,更新容器失败");
1456 1456 }
1457 1457 } else if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) {
1458   - success =
1459   - locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
1460   - if (!success) {
1461   - throw new JeecgBootException("完成分拣出库任务,更新源库位失败");
1462   - }
1463   - if (StringUtils.isNotEmpty(fromLocationCode) && !fromLocationCode.equals(toLocationCode)) {
  1458 + if (!fromLocationCode.equals(toLocationCode)) {
  1459 + success = locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY,
  1460 + warehouseCode);
  1461 + if (!success) {
  1462 + throw new JeecgBootException("完成分拣出库任务,更新源库位失败");
  1463 + }
1464 1464 success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
1465 1465 if (!success) {
1466 1466 throw new JeecgBootException("完成分拣出库任务,更新目标库位失败");
1467 1467 }
  1468 + } else {
  1469 + success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  1470 + if (!success) {
  1471 + throw new JeecgBootException("完成分拣出库任务,更新源库位失败");
  1472 + }
1468 1473 }
1469 1474 success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY,
1470 1475 inventoryDetailList.size() == 0 ? QuantityConstant.STATUS_CONTAINER_FILL_EMPTY : QuantityConstant.STATUS_CONTAINER_FILL_SOME, warehouseCode);
... ... @@ -1486,7 +1491,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
1486 1491 throw new JeecgBootException("合并入库库存失败");
1487 1492 }
1488 1493 }
1489   - success = shipmentDetailService.updateBatchById(shipmentDetailList);
  1494 + success = shipmentDetailService.updateBatchById(shipmentDetailList1);
1490 1495 if (!success) {
1491 1496 throw new JeecgBootException("完成出库任务,更新出库详情失败");
1492 1497 }
... ... @@ -2096,14 +2101,24 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
2096 2101 throw new JeecgBootException("完成出库查看任务时,更新容器状态失败");
2097 2102 }
2098 2103 }
2099   - success =
2100   - locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
2101   - if (!success) {
2102   - throw new JeecgBootException("完成出库查看任务时,更新起始库位状态失败");
  2104 +
  2105 + if (!fromLocationCode.equals(toLocationCode)) {
  2106 + success =
  2107 + locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  2108 + if (!success) {
  2109 + throw new JeecgBootException("完成出库查看任务时,更新源库位失败");
  2110 + }
  2111 + } else {
  2112 + success = locationService.updateStatus(fromLocationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  2113 + if (!success) {
  2114 + throw new JeecgBootException("完成出库查看任务时,更新源库位失败");
  2115 + }
2103 2116 }
2104   - success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
2105   - if (!success) {
2106   - throw new JeecgBootException("完成出库查看任务时,更新目标库位状态失败");
  2117 + if (StringUtils.isNotEmpty(fromLocationCode) && !fromLocationCode.equals(toLocationCode)) {
  2118 + success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode);
  2119 + if (!success) {
  2120 + throw new JeecgBootException("完成出库查看任务时,更新目标库位失败");
  2121 + }
2107 2122 }
2108 2123 taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED);
2109 2124 success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId());
... ...