Commit 98135dc71c760f149fa370ac14c977064290fb24
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4.git into develop
Showing
2 changed files
with
73 additions
and
0 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... | ... | @@ -349,4 +349,10 @@ public interface ITaskHeaderService extends IService<TaskHeader> { |
349 | 349 | */ |
350 | 350 | Result createOverStationTaskLockContainer(String containerCode, String warehouseCode); |
351 | 351 | |
352 | + /** | |
353 | + * 完成任务 解锁容器和库位 | |
354 | + * @param | |
355 | + */ | |
356 | + Result completeTaskUnLockContainerAndLocation(String containerFillStatus, int taskType, String containerCode, String fromLocationCode, String toLocationCode, | |
357 | + String warehouseCode); | |
352 | 358 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1649,6 +1649,73 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1649 | 1649 | } |
1650 | 1650 | |
1651 | 1651 | /** |
1652 | + * 完成任务时,统一解锁容器和库位 | |
1653 | + */ | |
1654 | + @Override | |
1655 | + @Transactional(rollbackFor = Exception.class) | |
1656 | + public Result completeTaskUnLockContainerAndLocation(String containerFillStatus, int taskType, String containerCode, String fromLocationCode, | |
1657 | + String toLocationCode, String warehouseCode) { | |
1658 | + Result result = null; | |
1659 | + boolean success = false; | |
1660 | + if (StringUtils.isEmpty(toLocationCode) && taskType == QuantityConstant.TASK_TYPE_OVER_STATION) { | |
1661 | + return Result.error("完成任务时, 目标库位号为空"); | |
1662 | + } | |
1663 | + switch (taskType) { | |
1664 | + case QuantityConstant.TASK_TYPE_WHOLERECEIPT: | |
1665 | + case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: | |
1666 | + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, containerFillStatus, | |
1667 | + warehouseCode); | |
1668 | + break; | |
1669 | + case QuantityConstant.TASK_TYPE_EMPTYRECEIPT: | |
1670 | + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, | |
1671 | + QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode); | |
1672 | + break; | |
1673 | + case QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT: | |
1674 | + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, | |
1675 | + QuantityConstant.STATUS_CONTAINER_FILL_MANY, warehouseCode); | |
1676 | + break; | |
1677 | + case QuantityConstant.TASK_TYPE_WHOLESHIPMENT: | |
1678 | + case QuantityConstant.TASK_TYPE_EMPTYSHIPMENT: | |
1679 | + case QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT: | |
1680 | + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, | |
1681 | + QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode); | |
1682 | + break; | |
1683 | + case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT: | |
1684 | + case QuantityConstant.TASK_TYPE_CYCLECOUNT: | |
1685 | + case QuantityConstant.TASK_TYPE_TRANSFER: | |
1686 | + case QuantityConstant.TASK_TYPE_CHECK_OUT: | |
1687 | + InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); | |
1688 | + if (inventoryHeader != null) { | |
1689 | + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, | |
1690 | + QuantityConstant.STATUS_CONTAINER_FILL_SOME, warehouseCode); | |
1691 | + } else { | |
1692 | + success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, | |
1693 | + QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode); | |
1694 | + } | |
1695 | + break; | |
1696 | + case QuantityConstant.TASK_TYPE_OVER_STATION: | |
1697 | + success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, | |
1698 | + warehouseCode); | |
1699 | + break; | |
1700 | + } | |
1701 | + if (!success) { | |
1702 | + throw new JeecgBootException("完成任务时,更新容器失败"); | |
1703 | + } | |
1704 | + if (StringUtils.isNotEmpty(fromLocationCode) && !fromLocationCode.equals(toLocationCode)) { | |
1705 | + success = | |
1706 | + locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
1707 | + if (!success) { | |
1708 | + throw new JeecgBootException("完成任务时,更新源库位失败"); | |
1709 | + } | |
1710 | + } | |
1711 | + success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
1712 | + if (!success) { | |
1713 | + throw new JeecgBootException("完成任务时,更新库位失败"); | |
1714 | + } | |
1715 | + return Result.OK("完成任务成功"); | |
1716 | + } | |
1717 | + | |
1718 | + /** | |
1652 | 1719 | * 完成空托盘入库任务 |
1653 | 1720 | * @param taskHeader 任务 |
1654 | 1721 | * @return Result 完成入库任务结果 |
... | ... |