Commit 38dc728e0b0c1ddccdfb471395e3a3b2bbbd878f
1 parent
98b459ae
优化空出、重入、取货错
Showing
4 changed files
with
68 additions
and
29 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
@@ -262,7 +262,7 @@ public class WcsServiceImpl implements WcsService { | @@ -262,7 +262,7 @@ public class WcsServiceImpl implements WcsService { | ||
262 | if (!taskHeaderService.updateById(taskHeader)) { | 262 | if (!taskHeaderService.updateById(taskHeader)) { |
263 | throw new JeecgBootException("更新任务头表目标库位失败"); | 263 | throw new JeecgBootException("更新任务头表目标库位失败"); |
264 | } | 264 | } |
265 | - | 265 | + |
266 | WcsTask wcsTask = new WcsTask(); | 266 | WcsTask wcsTask = new WcsTask(); |
267 | wcsTask.setToLocationCode(locationCode); | 267 | wcsTask.setToLocationCode(locationCode); |
268 | wcsTask.setPreTaskNo(String.valueOf(preTaskNo)); | 268 | wcsTask.setPreTaskNo(String.valueOf(preTaskNo)); |
@@ -350,7 +350,7 @@ public class WcsServiceImpl implements WcsService { | @@ -350,7 +350,7 @@ public class WcsServiceImpl implements WcsService { | ||
350 | } | 350 | } |
351 | Result<TaskHeader> result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); | 351 | Result<TaskHeader> result = taskHeaderService.createTransferTask(insideLocation.getCode(), destinationLocation.getCode(), warehouseCode); |
352 | if (!result.isSuccess()) { | 352 | if (!result.isSuccess()) { |
353 | - throw new JeecgBootException("创建移库任务失败"); | 353 | + throw new JeecgBootException(result.getMessage()); |
354 | } | 354 | } |
355 | preTaskNo = result.getResult().getId(); | 355 | preTaskNo = result.getResult().getId(); |
356 | taskHeader.setPreTaskNo(preTaskNo); | 356 | taskHeader.setPreTaskNo(preTaskNo); |
@@ -634,6 +634,8 @@ public class WcsServiceImpl implements WcsService { | @@ -634,6 +634,8 @@ public class WcsServiceImpl implements WcsService { | ||
634 | originLocationCode = originLocationCode + "," + taskLocationCode; | 634 | originLocationCode = originLocationCode + "," + taskLocationCode; |
635 | } | 635 | } |
636 | 636 | ||
637 | + taskHeader = new TaskHeader(); | ||
638 | + taskHeader.setId(Integer.parseInt(taskNo)); | ||
637 | taskHeader.setToLocationCode(locationCode); | 639 | taskHeader.setToLocationCode(locationCode); |
638 | taskHeader.setExceptionName("重入处理"); | 640 | taskHeader.setExceptionName("重入处理"); |
639 | taskHeader.setIsDoubleIn(QuantityConstant.DOUBLE_IN); | 641 | taskHeader.setIsDoubleIn(QuantityConstant.DOUBLE_IN); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
@@ -365,7 +365,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -365,7 +365,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
365 | shipmentContainerHeader = new ShipmentContainerHeader(); | 365 | shipmentContainerHeader = new ShipmentContainerHeader(); |
366 | shipmentContainerHeader.setContainerCode(containerCode); | 366 | shipmentContainerHeader.setContainerCode(containerCode); |
367 | shipmentContainerHeader.setFromLocationCode(locationCode); | 367 | shipmentContainerHeader.setFromLocationCode(locationCode); |
368 | - if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) { | 368 | + if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION && taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { |
369 | shipmentContainerHeader.setToLocationCode(locationCode); | 369 | shipmentContainerHeader.setToLocationCode(locationCode); |
370 | } | 370 | } |
371 | shipmentContainerHeader.setWarehouseCode(warehouseCode); | 371 | shipmentContainerHeader.setWarehouseCode(warehouseCode); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
@@ -305,6 +305,14 @@ public interface ITaskHeaderService extends IService<TaskHeader> { | @@ -305,6 +305,14 @@ public interface ITaskHeaderService extends IService<TaskHeader> { | ||
305 | boolean updateStatusById(int status, int id); | 305 | boolean updateStatusById(int status, int id); |
306 | 306 | ||
307 | /** | 307 | /** |
308 | + * 更新 | ||
309 | + * @param status | ||
310 | + * @param id | ||
311 | + * @return | ||
312 | + */ | ||
313 | + boolean updateExceptionStateById(int status, int id); | ||
314 | + | ||
315 | + /** | ||
308 | * 更新状态 | 316 | * 更新状态 |
309 | * @param preTaskNo | 317 | * @param preTaskNo |
310 | * @param id | 318 | * @param id |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -550,6 +550,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -550,6 +550,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
550 | @Override | 550 | @Override |
551 | @Transactional(rollbackFor = Exception.class) | 551 | @Transactional(rollbackFor = Exception.class) |
552 | public Result handleEmptyOut(String taskNo) { | 552 | public Result handleEmptyOut(String taskNo) { |
553 | + log.info("开始处理空出任务" + taskNo); | ||
553 | // 1、判断非空字段 | 554 | // 1、判断非空字段 |
554 | if (StringUtils.isEmpty(taskNo)) { | 555 | if (StringUtils.isEmpty(taskNo)) { |
555 | return Result.error("处理空出失败,任务号为空"); | 556 | return Result.error("处理空出失败,任务号为空"); |
@@ -615,15 +616,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -615,15 +616,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
615 | } | 616 | } |
616 | // 9 更新单据 | 617 | // 9 更新单据 |
617 | taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); | 618 | taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); |
618 | - success = taskHeaderService.updateById(taskHeader); | 619 | + success = taskHeaderService.updateExceptionStateById(QuantityConstant.EXCEPTION_TASK_HANDLE, taskHeader.getId()); |
619 | if (!success) { | 620 | if (!success) { |
620 | throw new JeecgBootException("处理空出失败,更新任务失败"); | 621 | throw new JeecgBootException("处理空出失败,更新任务失败"); |
621 | } | 622 | } |
623 | + log.info("完成处理空出任务" + taskNo); | ||
622 | return Result.ok("处理空出成功"); | 624 | return Result.ok("处理空出成功"); |
623 | } | 625 | } |
624 | 626 | ||
625 | @Override | 627 | @Override |
628 | + @Transactional(rollbackFor = Exception.class) | ||
626 | public Result handleDoubleIn(String taskNo) { | 629 | public Result handleDoubleIn(String taskNo) { |
630 | + log.info("开始处理重入任务" + taskNo); | ||
627 | // 1、判断非空字段 | 631 | // 1、判断非空字段 |
628 | if (StringUtils.isEmpty(taskNo)) { | 632 | if (StringUtils.isEmpty(taskNo)) { |
629 | return Result.error("处理重入失败,任务号为空"); | 633 | return Result.error("处理重入失败,任务号为空"); |
@@ -661,22 +665,24 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -661,22 +665,24 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
661 | if (toLocation == null) { | 665 | if (toLocation == null) { |
662 | return Result.error("处理重入失败,没有找到库位"); | 666 | return Result.error("处理重入失败,没有找到库位"); |
663 | } | 667 | } |
664 | - toLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY); | ||
665 | - boolean success = locationService.updateById(toLocation); | 668 | + boolean success = locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); |
666 | if (!success) { | 669 | if (!success) { |
667 | throw new JeecgBootException("处理重入失败,更新库位失败"); | 670 | throw new JeecgBootException("处理重入失败,更新库位失败"); |
668 | } | 671 | } |
669 | } | 672 | } |
670 | taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); | 673 | taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); |
671 | - boolean success = taskHeaderService.updateById(taskHeader); | 674 | + boolean success = taskHeaderService.updateExceptionStateById(QuantityConstant.EXCEPTION_TASK_HANDLE, taskHeader.getId()); |
672 | if (!success) { | 675 | if (!success) { |
673 | throw new JeecgBootException("处理重入失败,更新任务失败"); | 676 | throw new JeecgBootException("处理重入失败,更新任务失败"); |
674 | } | 677 | } |
678 | + log.info("完成处理重入任务" + taskNo); | ||
675 | return Result.ok("处理重入成功"); | 679 | return Result.ok("处理重入成功"); |
676 | } | 680 | } |
677 | 681 | ||
678 | @Override | 682 | @Override |
683 | + @Transactional(rollbackFor = Exception.class) | ||
679 | public Result handlePickupError(String taskNo) { | 684 | public Result handlePickupError(String taskNo) { |
685 | + log.info("开始处理取货错任务" + taskNo); | ||
680 | // 1、判断非空字段 | 686 | // 1、判断非空字段 |
681 | if (StringUtils.isEmpty(taskNo)) { | 687 | if (StringUtils.isEmpty(taskNo)) { |
682 | return Result.error("处理取货错失败,任务号为空"); | 688 | return Result.error("处理取货错失败,任务号为空"); |
@@ -691,12 +697,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -691,12 +697,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
691 | return Result.OK("处理取货错失败, 任务已经完成"); | 697 | return Result.OK("处理取货错失败, 任务已经完成"); |
692 | } | 698 | } |
693 | 699 | ||
700 | + taskHeader = new TaskHeader(); | ||
701 | + taskHeader.setId(Integer.parseInt(taskNo)); | ||
694 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | 702 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
695 | taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); | 703 | taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); |
696 | boolean success = taskHeaderService.updateById(taskHeader); | 704 | boolean success = taskHeaderService.updateById(taskHeader); |
697 | if (!success) { | 705 | if (!success) { |
698 | throw new JeecgBootException("处理取货错失败,更新任务失败"); | 706 | throw new JeecgBootException("处理取货错失败,更新任务失败"); |
699 | } | 707 | } |
708 | + log.info("完成处理取货错任务" + taskNo); | ||
700 | return Result.ok("处理取货错成功"); | 709 | return Result.ok("处理取货错成功"); |
701 | } | 710 | } |
702 | 711 | ||
@@ -1556,7 +1565,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1556,7 +1565,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1556 | } | 1565 | } |
1557 | zoneCode = fromLocation.getZoneCode(); | 1566 | zoneCode = fromLocation.getZoneCode(); |
1558 | taskLockEntity.setZoneCode(zoneCode); | 1567 | taskLockEntity.setZoneCode(zoneCode); |
1559 | - if (StringUtils.isNotEmpty(toLocationCode)) { | 1568 | + if (StringUtils.isNotEmpty(toLocationCode) && !fromLocationCode.equals(toLocationCode)) { |
1560 | Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); | 1569 | Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); |
1561 | if (toLocation == null) { | 1570 | if (toLocation == null) { |
1562 | return Result.error("创建分拣任务时," + toLocationCode + "目标库位不存在"); | 1571 | return Result.error("创建分拣任务时," + toLocationCode + "目标库位不存在"); |
@@ -1577,9 +1586,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1577,9 +1586,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1577 | throw new JeecgBootException("创建分拣任务时,更新库位状态失败"); | 1586 | throw new JeecgBootException("创建分拣任务时,更新库位状态失败"); |
1578 | } | 1587 | } |
1579 | if (StringUtils.isNotEmpty(toLocationCode)) { | 1588 | if (StringUtils.isNotEmpty(toLocationCode)) { |
1580 | - success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | ||
1581 | - if (!success) { | ||
1582 | - throw new JeecgBootException("创建分拣任务时,更新库位状态失败"); | 1589 | + if (!fromLocationCode.equals(toLocationCode)) { |
1590 | + success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | ||
1591 | + if (!success) { | ||
1592 | + throw new JeecgBootException("创建分拣任务时,更新库位状态失败"); | ||
1593 | + } | ||
1583 | } | 1594 | } |
1584 | } | 1595 | } |
1585 | return Result.OK("创建分拣任务成功", taskLockEntity); | 1596 | return Result.OK("创建分拣任务成功", taskLockEntity); |
@@ -1611,9 +1622,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1611,9 +1622,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1611 | String toLocationCode, String warehouseCode) { | 1622 | String toLocationCode, String warehouseCode) { |
1612 | Result result = null; | 1623 | Result result = null; |
1613 | boolean success = false; | 1624 | boolean success = false; |
1614 | - if (StringUtils.isEmpty(toLocationCode) && taskType != QuantityConstant.TASK_TYPE_OVER_STATION) { | ||
1615 | - return Result.error("任务类型" + taskType + "完成任务时, 目标库位号为空"); | ||
1616 | - } | ||
1617 | if (StringUtils.isEmpty(containerCode)) { | 1625 | if (StringUtils.isEmpty(containerCode)) { |
1618 | return Result.error("任务类型" + taskType + "完成任务时, 容器号为空"); | 1626 | return Result.error("任务类型" + taskType + "完成任务时, 容器号为空"); |
1619 | } | 1627 | } |
@@ -1624,14 +1632,23 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1624,14 +1632,23 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1624 | switch (taskType) { | 1632 | switch (taskType) { |
1625 | case QuantityConstant.TASK_TYPE_WHOLERECEIPT: | 1633 | case QuantityConstant.TASK_TYPE_WHOLERECEIPT: |
1626 | case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: | 1634 | case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: |
1635 | + if (StringUtils.isEmpty(toLocationCode)) { | ||
1636 | + return Result.error("任务类型" + taskType + "完成任务时, 目标库位号为空"); | ||
1637 | + } | ||
1627 | success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, containerFillStatus, | 1638 | success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, containerFillStatus, |
1628 | warehouseCode); | 1639 | warehouseCode); |
1629 | break; | 1640 | break; |
1630 | case QuantityConstant.TASK_TYPE_EMPTYRECEIPT: | 1641 | case QuantityConstant.TASK_TYPE_EMPTYRECEIPT: |
1642 | + if (StringUtils.isEmpty(toLocationCode)) { | ||
1643 | + return Result.error("任务类型" + taskType + "完成任务时, 目标库位号为空"); | ||
1644 | + } | ||
1631 | success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, | 1645 | success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, |
1632 | QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode); | 1646 | QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode); |
1633 | break; | 1647 | break; |
1634 | case QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT: | 1648 | case QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT: |
1649 | + if (StringUtils.isEmpty(toLocationCode)) { | ||
1650 | + return Result.error("任务类型" + taskType + "完成任务时, 目标库位号为空"); | ||
1651 | + } | ||
1635 | success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, | 1652 | success = containerService.updateLocationCodeAndStatus(containerCode, toLocationCode, QuantityConstant.STATUS_CONTAINER_EMPTY, |
1636 | QuantityConstant.STATUS_CONTAINER_FILL_MANY, warehouseCode); | 1653 | QuantityConstant.STATUS_CONTAINER_FILL_MANY, warehouseCode); |
1637 | break; | 1654 | break; |
@@ -1651,6 +1668,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1651,6 +1668,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1651 | if (StringUtils.isEmpty(fromLocationCode)) { | 1668 | if (StringUtils.isEmpty(fromLocationCode)) { |
1652 | return Result.error("任务类型" + taskType + "完成任务时, 起始库位号为空"); | 1669 | return Result.error("任务类型" + taskType + "完成任务时, 起始库位号为空"); |
1653 | } | 1670 | } |
1671 | + if (StringUtils.isEmpty(toLocationCode)) { | ||
1672 | + return Result.error("任务类型" + taskType + "完成任务时, 目标库位号为空"); | ||
1673 | + } | ||
1654 | InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); | 1674 | InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); |
1655 | if (inventoryHeader != null) { | 1675 | if (inventoryHeader != null) { |
1656 | if (fromLocationCode.equals(toLocationCode)) { | 1676 | if (fromLocationCode.equals(toLocationCode)) { |
@@ -1679,7 +1699,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1679,7 +1699,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1679 | if (StringUtils.isNotEmpty(fromLocationCode) && !fromLocationCode.equals(toLocationCode)) { | 1699 | if (StringUtils.isNotEmpty(fromLocationCode) && !fromLocationCode.equals(toLocationCode)) { |
1680 | Location toLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode); | 1700 | Location toLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode); |
1681 | if (toLocation == null) { | 1701 | if (toLocation == null) { |
1682 | - return Result.error("完成任务时," + toLocationCode + "目标库位不存在"); | 1702 | + return Result.error("任务类型" + taskType + "完成任务时," + toLocationCode + "目标库位不存在"); |
1683 | } | 1703 | } |
1684 | success = | 1704 | success = |
1685 | locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | 1705 | locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); |
@@ -2019,7 +2039,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2019,7 +2039,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2019 | if (port == null) { | 2039 | if (port == null) { |
2020 | return Result.error("完成空托盘出库任务时," + toPortCode + "目标出库口不存在"); | 2040 | return Result.error("完成空托盘出库任务时," + toPortCode + "目标出库口不存在"); |
2021 | } | 2041 | } |
2022 | - Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_EMPTYRECEIPT, | 2042 | + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_EMPTYSHIPMENT, |
2023 | containerCode, fromLocationCode, QuantityConstant.EMPTY_STRING, warehouseCode); | 2043 | containerCode, fromLocationCode, QuantityConstant.EMPTY_STRING, warehouseCode); |
2024 | if (!result.isSuccess()) { | 2044 | if (!result.isSuccess()) { |
2025 | throw new JeecgBootException(result.getMessage()); | 2045 | throw new JeecgBootException(result.getMessage()); |
@@ -2108,7 +2128,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2108,7 +2128,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2108 | throw new JeecgBootException("完成移库任务时, 更新库存详情失败"); | 2128 | throw new JeecgBootException("完成移库任务时, 更新库存详情失败"); |
2109 | } | 2129 | } |
2110 | } | 2130 | } |
2111 | - Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_OVER_STATION, | 2131 | + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_TRANSFER, |
2112 | containerCode, fromLocationCode, toLocationCode, warehouseCode); | 2132 | containerCode, fromLocationCode, toLocationCode, warehouseCode); |
2113 | if (!result.isSuccess()) { | 2133 | if (!result.isSuccess()) { |
2114 | throw new JeecgBootException(result.getMessage()); | 2134 | throw new JeecgBootException(result.getMessage()); |
@@ -2184,7 +2204,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2184,7 +2204,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2184 | } | 2204 | } |
2185 | } | 2205 | } |
2186 | 2206 | ||
2187 | - Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_EMPTYRECEIPT, | 2207 | + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_CHECK_OUT, |
2188 | containerCode, fromLocationCode, toLocationCode, warehouseCode); | 2208 | containerCode, fromLocationCode, toLocationCode, warehouseCode); |
2189 | if (!result.isSuccess()) { | 2209 | if (!result.isSuccess()) { |
2190 | throw new JeecgBootException(result.getMessage()); | 2210 | throw new JeecgBootException(result.getMessage()); |
@@ -2307,6 +2327,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2307,6 +2327,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2307 | String warehouseCode = taskHeader.getWarehouseCode(); | 2327 | String warehouseCode = taskHeader.getWarehouseCode(); |
2308 | String containerCode = taskHeader.getContainerCode(); | 2328 | String containerCode = taskHeader.getContainerCode(); |
2309 | String toPortCode = taskHeader.getToPortCode(); | 2329 | String toPortCode = taskHeader.getToPortCode(); |
2330 | + String fromLocationCode = taskHeader.getFromLocationCode(); | ||
2310 | log.info("开始完成空托盘组出库任务" + taskHeader.getId()); | 2331 | log.info("开始完成空托盘组出库任务" + taskHeader.getId()); |
2311 | if (StringUtils.isEmpty(containerCode)) { | 2332 | if (StringUtils.isEmpty(containerCode)) { |
2312 | return Result.error("完成空托盘组出库任务时, 托盘号为空"); | 2333 | return Result.error("完成空托盘组出库任务时, 托盘号为空"); |
@@ -2317,12 +2338,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2317,12 +2338,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2317 | if (StringUtils.isEmpty(toPortCode)) { | 2338 | if (StringUtils.isEmpty(toPortCode)) { |
2318 | return Result.error("完成空托盘组出库任务时, 目标出入口为空"); | 2339 | return Result.error("完成空托盘组出库任务时, 目标出入口为空"); |
2319 | } | 2340 | } |
2341 | + if (StringUtils.isEmpty(fromLocationCode)) { | ||
2342 | + return Result.error("完成空托盘组出库任务时, 起始库位为空"); | ||
2343 | + } | ||
2320 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); | 2344 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); |
2321 | if (container == null) { | 2345 | if (container == null) { |
2322 | return Result.error("完成空托盘组出库任务时,没有找到容器" + containerCode); | 2346 | return Result.error("完成空托盘组出库任务时,没有找到容器" + containerCode); |
2323 | } | 2347 | } |
2324 | - String toLocationCode = container.getLocationCode(); | ||
2325 | - if (StringUtils.isEmpty(toLocationCode)) { | 2348 | + String locationCode = container.getLocationCode(); |
2349 | + if (StringUtils.isEmpty(locationCode)) { | ||
2326 | return Result.error("完成空托盘组出库任务时, 容器不在库位上"); | 2350 | return Result.error("完成空托盘组出库任务时, 容器不在库位上"); |
2327 | } | 2351 | } |
2328 | Port port = portService.getPortByCode(toPortCode, warehouseCode); | 2352 | Port port = portService.getPortByCode(toPortCode, warehouseCode); |
@@ -2334,16 +2358,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2334,16 +2358,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2334 | if (!success) { | 2358 | if (!success) { |
2335 | throw new JeecgBootException("完成空托盘组出库任务时, 更新任务失败"); | 2359 | throw new JeecgBootException("完成空托盘组出库任务时, 更新任务失败"); |
2336 | } | 2360 | } |
2337 | - success = containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, | ||
2338 | - QuantityConstant.STATUS_CONTAINER_FILL_EMPTY, warehouseCode); | ||
2339 | - if (!success) { | ||
2340 | - throw new JeecgBootException("完成空托盘组出库任务时, 更新容器失败"); | ||
2341 | - } | ||
2342 | - success = locationService.updateContainerCodeAndStatus(toLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | ||
2343 | - log.info("开始完成空托盘组出库任务" + taskHeader.getId()); | ||
2344 | - if (!success) { | ||
2345 | - throw new JeecgBootException("完成空托盘组出库任务时, 更新库位失败"); | 2361 | + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT, |
2362 | + containerCode, fromLocationCode, QuantityConstant.EMPTY_STRING, warehouseCode); | ||
2363 | + if (!result.isSuccess()) { | ||
2364 | + throw new JeecgBootException(result.getMessage()); | ||
2346 | } | 2365 | } |
2366 | + log.info("完成空托盘组出库任务" + taskHeader.getId()); | ||
2347 | return Result.ok("完成空托盘组出库任务成功"); | 2367 | return Result.ok("完成空托盘组出库任务成功"); |
2348 | } | 2368 | } |
2349 | 2369 | ||
@@ -2389,6 +2409,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2389,6 +2409,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2389 | } | 2409 | } |
2390 | 2410 | ||
2391 | @Override | 2411 | @Override |
2412 | + public boolean updateExceptionStateById(int exceptionState, int id) { | ||
2413 | + TaskHeader taskHeader = new TaskHeader(); | ||
2414 | + taskHeader.setExceptionState(exceptionState); | ||
2415 | + taskHeader.setId(id); | ||
2416 | + boolean success = taskHeaderService.updateById(taskHeader); | ||
2417 | + return success; | ||
2418 | + } | ||
2419 | + | ||
2420 | + @Override | ||
2392 | public boolean updatePreTaskNoById(int preTaskNo, int id) { | 2421 | public boolean updatePreTaskNoById(int preTaskNo, int id) { |
2393 | TaskHeader taskHeader = new TaskHeader(); | 2422 | TaskHeader taskHeader = new TaskHeader(); |
2394 | taskHeader.setId(id); | 2423 | taskHeader.setId(id); |