Commit 6579fe3c60b5ab424a8a7f59bc0b124ea2f77911
1 parent
a8066191
开始创建移库任务
Showing
3 changed files
with
51 additions
and
23 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryHeaderService.java
@@ -34,4 +34,6 @@ public interface IInventoryHeaderService extends IService<InventoryHeader> { | @@ -34,4 +34,6 @@ public interface IInventoryHeaderService extends IService<InventoryHeader> { | ||
34 | boolean updateContainerStatusById(String containerStatus, Integer id); | 34 | boolean updateContainerStatusById(String containerStatus, Integer id); |
35 | 35 | ||
36 | boolean updateContainerStatusAndLocationCode(String containerStatus, String locationCode, Integer id); | 36 | boolean updateContainerStatusAndLocationCode(String containerStatus, String locationCode, Integer id); |
37 | + | ||
38 | + boolean updateLocationCodeById(String locationCode, Integer id); | ||
37 | } | 39 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java
@@ -125,4 +125,13 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | @@ -125,4 +125,13 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe | ||
125 | return success; | 125 | return success; |
126 | } | 126 | } |
127 | 127 | ||
128 | + @Override | ||
129 | + public boolean updateLocationCodeById(String locationCode, Integer id) { | ||
130 | + InventoryHeader inventoryHeader = new InventoryHeader(); | ||
131 | + inventoryHeader.setId(id); | ||
132 | + inventoryHeader.setLocationCode(locationCode); | ||
133 | + boolean success = inventoryHeaderService.updateById(inventoryHeader); | ||
134 | + return success; | ||
135 | + } | ||
136 | + | ||
128 | } | 137 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -182,6 +182,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -182,6 +182,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
182 | @Override | 182 | @Override |
183 | @Transactional(rollbackFor = Exception.class) | 183 | @Transactional(rollbackFor = Exception.class) |
184 | public Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode) { | 184 | public Result createTransferTask(String fromLocationCode, String toLocationCode, String warehouseCode) { |
185 | + log.info("开始创建移库任务,起始库位" + fromLocationCode + ",目标库位" + toLocationCode); | ||
185 | if (StringUtils.isEmpty(fromLocationCode)) { | 186 | if (StringUtils.isEmpty(fromLocationCode)) { |
186 | return Result.error("创建移库任务时,起始库位为空"); | 187 | return Result.error("创建移库任务时,起始库位为空"); |
187 | } | 188 | } |
@@ -245,15 +246,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -245,15 +246,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
245 | return Result.error("创建移库任务时,目标库位和源库位不在同一个区域"); | 246 | return Result.error("创建移库任务时,目标库位和源库位不在同一个区域"); |
246 | } | 247 | } |
247 | 248 | ||
248 | - // 2023-04-11 托盘状态与填充状态分离 无需再更新字段 | ||
249 | -// // 2. 记住移库前的容器类型,因为空托盘组无法区分 | ||
250 | -// Container container = containerService.getContainerByCode(fromLocation.getContainerCode(), warehouseCode); | ||
251 | -// container.setLastStatus(container.getStatus()); | ||
252 | -// boolean success = containerService.updateById(container); | ||
253 | -// if (!success) { | ||
254 | -// throw new JeecgBootException("创建移库任务时,更新容器状态失败,容器编码" + fromLocation.getContainerCode()); | ||
255 | -// } | ||
256 | - | ||
257 | // 3. 判断源库位旁边有托盘但是没有任务,那么不允许移库 | 249 | // 3. 判断源库位旁边有托盘但是没有任务,那么不允许移库 |
258 | if (fromLocation.getRowFlag() == QuantityConstant.ROW_OUT) { | 250 | if (fromLocation.getRowFlag() == QuantityConstant.ROW_OUT) { |
259 | // 内侧库位 | 251 | // 内侧库位 |
@@ -299,6 +291,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -299,6 +291,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
299 | throw new JeecgBootException("创建移库任务时, 终点库位" + toLocationCode + "更新失败"); | 291 | throw new JeecgBootException("创建移库任务时, 终点库位" + toLocationCode + "更新失败"); |
300 | } | 292 | } |
301 | success = containerService.updateStatus(fromLocation.getContainerCode(), QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); | 293 | success = containerService.updateStatus(fromLocation.getContainerCode(), QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); |
294 | + log.info("完成创建移库任务,起始库位" + fromLocationCode + ",目的库位" + toLocationCode); | ||
302 | if (!success) { | 295 | if (!success) { |
303 | throw new JeecgBootException("创建移库任务时,容器" + fromLocation.getContainerCode() + "更新失败"); | 296 | throw new JeecgBootException("创建移库任务时,容器" + fromLocation.getContainerCode() + "更新失败"); |
304 | } | 297 | } |
@@ -308,6 +301,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -308,6 +301,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
308 | @Override | 301 | @Override |
309 | @Transactional(rollbackFor = Exception.class) | 302 | @Transactional(rollbackFor = Exception.class) |
310 | public Result createCheckOutTask(String containerCode, String toPortCode, String warehouseCode) { | 303 | public Result createCheckOutTask(String containerCode, String toPortCode, String warehouseCode) { |
304 | + log.info("开始创建出库查看任务,容器编码" + containerCode + "目标站台号" + toPortCode); | ||
311 | if (StringUtils.isEmpty(containerCode)) { | 305 | if (StringUtils.isEmpty(containerCode)) { |
312 | return Result.error("创建出库查看任务时,容器编码为空"); | 306 | return Result.error("创建出库查看任务时,容器编码为空"); |
313 | } | 307 | } |
@@ -342,11 +336,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -342,11 +336,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
342 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getContainerCode, containerCode).eq(InventoryDetail::getWarehouseCode, warehouseCode) | 336 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getContainerCode, containerCode).eq(InventoryDetail::getWarehouseCode, warehouseCode) |
343 | .eq(InventoryDetail::getLocationCode, fromLocationCode); | 337 | .eq(InventoryDetail::getLocationCode, fromLocationCode); |
344 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | 338 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
339 | + List<InventoryDetail> inventoryDetailList1 = new ArrayList<>(); | ||
345 | if (inventoryDetailList.size() != 0) { | 340 | if (inventoryDetailList.size() != 0) { |
346 | for (InventoryDetail inventoryDetail : inventoryDetailList) { | 341 | for (InventoryDetail inventoryDetail : inventoryDetailList) { |
347 | inventoryDetail.setTaskQty(inventoryDetail.getQty()); | 342 | inventoryDetail.setTaskQty(inventoryDetail.getQty()); |
343 | + InventoryDetail inventoryDetail1 = new InventoryDetail(); | ||
344 | + inventoryDetail1.setId(inventoryDetail.getId()); | ||
345 | + inventoryDetail1.setTaskQty(inventoryDetail.getQty()); | ||
346 | + inventoryDetailList1.add(inventoryDetail1); | ||
348 | } | 347 | } |
349 | - success = inventoryDetailService.updateBatchById(inventoryDetailList); | 348 | + success = inventoryDetailService.updateBatchById(inventoryDetailList1); |
350 | if (!success) { | 349 | if (!success) { |
351 | throw new JeecgBootException("创建出库查看任务时,更新库存详情失败"); | 350 | throw new JeecgBootException("创建出库查看任务时,更新库存详情失败"); |
352 | } | 351 | } |
@@ -374,6 +373,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -374,6 +373,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
374 | } | 373 | } |
375 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | 374 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
376 | success = taskHeaderService.save(taskHeader); | 375 | success = taskHeaderService.save(taskHeader); |
376 | + log.info("完成创建出库查看任务,容器编码" + containerCode + "目标站台号" + toPortCode); | ||
377 | if (!success) { | 377 | if (!success) { |
378 | throw new JeecgBootException("创建出库查看任务时, 创建任务失败"); | 378 | throw new JeecgBootException("创建出库查看任务时, 创建任务失败"); |
379 | } | 379 | } |
@@ -383,6 +383,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -383,6 +383,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
383 | @Override | 383 | @Override |
384 | @Transactional(rollbackFor = Exception.class) | 384 | @Transactional(rollbackFor = Exception.class) |
385 | public Result createOverStationTask(String containerCode, String fromPortCode, String toPortCode, String warehouseCode) { | 385 | public Result createOverStationTask(String containerCode, String fromPortCode, String toPortCode, String warehouseCode) { |
386 | + log.info("开始创建跨站任务,容器号" + containerCode + ",起始站台号" + fromPortCode + ",目标站台号" + toPortCode); | ||
386 | if (StringUtils.isEmpty(containerCode)) { | 387 | if (StringUtils.isEmpty(containerCode)) { |
387 | return Result.error("创建跨站任务时,容器编码为空"); | 388 | return Result.error("创建跨站任务时,容器编码为空"); |
388 | } | 389 | } |
@@ -427,6 +428,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -427,6 +428,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
427 | return Result.error("创建跨站任务时, 创建任务失败"); | 428 | return Result.error("创建跨站任务时, 创建任务失败"); |
428 | } | 429 | } |
429 | success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); | 430 | success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_LOCK, warehouseCode); |
431 | + log.info("完成创建跨站任务,容器号" + containerCode + ",起始站台号" + fromPortCode + ",目标站台号" + toPortCode); | ||
430 | if (!success) { | 432 | if (!success) { |
431 | return Result.error("创建跨站任务时, 更新容器状态失败"); | 433 | return Result.error("创建跨站任务时, 更新容器状态失败"); |
432 | } | 434 | } |
@@ -507,6 +509,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -507,6 +509,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
507 | if (StringUtils.isEmpty(warehouseCode)) { | 509 | if (StringUtils.isEmpty(warehouseCode)) { |
508 | return Result.error("创建空托盘组入库任务时,仓库编码为空"); | 510 | return Result.error("创建空托盘组入库任务时,仓库编码为空"); |
509 | } | 511 | } |
512 | + log.info("开始创建空托盘组入库任务,容器编码" + containerCode + ",库位编码" + toLocationCode); | ||
510 | String zoneCode = null; | 513 | String zoneCode = null; |
511 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); | 514 | Container container = containerService.getContainerByCode(containerCode, warehouseCode); |
512 | if (container == null) { | 515 | if (container == null) { |
@@ -548,6 +551,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -548,6 +551,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
548 | taskHeader.setZoneCode(zoneCode); | 551 | taskHeader.setZoneCode(zoneCode); |
549 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | 552 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
550 | success = taskHeaderService.save(taskHeader); | 553 | success = taskHeaderService.save(taskHeader); |
554 | + log.info("完成创建空托盘组入库任务,容器编码" + containerCode + ",库位编码" + toLocationCode); | ||
551 | if (!success) { | 555 | if (!success) { |
552 | throw new JeecgBootException("创建空托盘组入库任务时, 创建任务失败"); | 556 | throw new JeecgBootException("创建空托盘组入库任务时, 创建任务失败"); |
553 | } | 557 | } |
@@ -557,6 +561,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -557,6 +561,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
557 | @Override | 561 | @Override |
558 | @Transactional(rollbackFor = Exception.class) | 562 | @Transactional(rollbackFor = Exception.class) |
559 | public Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode) { | 563 | public Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode) { |
564 | + log.info("开始创建空托盘组出库任务,容器编码" + containerCode + ",去向位置编码" + toPortCode); | ||
560 | if (StringUtils.isEmpty(containerCode)) { | 565 | if (StringUtils.isEmpty(containerCode)) { |
561 | return Result.error("创建空托盘组出库任务时,托盘号为空"); | 566 | return Result.error("创建空托盘组出库任务时,托盘号为空"); |
562 | } | 567 | } |
@@ -606,6 +611,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -606,6 +611,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
606 | taskHeader.setToPortCode(toPortCode); | 611 | taskHeader.setToPortCode(toPortCode); |
607 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | 612 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
608 | success = taskHeaderService.save(taskHeader); | 613 | success = taskHeaderService.save(taskHeader); |
614 | + log.info("完成创建空托盘组出库任务,容器编码" + containerCode + ",去向位置编码" + toPortCode); | ||
609 | if (!success) { | 615 | if (!success) { |
610 | throw new JeecgBootException("创建空托盘组出库任务时,生成任务失败"); | 616 | throw new JeecgBootException("创建空托盘组出库任务时,生成任务失败"); |
611 | } | 617 | } |
@@ -889,6 +895,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -889,6 +895,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
889 | if (taskHeader == null) { | 895 | if (taskHeader == null) { |
890 | return Result.error("任务" + taskId + "未找到,执行中止"); | 896 | return Result.error("任务" + taskId + "未找到,执行中止"); |
891 | } | 897 | } |
898 | + log.info("开始取消任务" + taskHeader.getId()); | ||
892 | if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { | 899 | if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { |
893 | return Result.ok("任务(" + taskId + ")任务已经是完成的!"); | 900 | return Result.ok("任务(" + taskId + ")任务已经是完成的!"); |
894 | } | 901 | } |
@@ -929,6 +936,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -929,6 +936,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
929 | break; | 936 | break; |
930 | } | 937 | } |
931 | taskHeaderService.cancelLocationAndContainerStatus(taskHeader); | 938 | taskHeaderService.cancelLocationAndContainerStatus(taskHeader); |
939 | + log.info("完成取消任务" + taskHeader.getId()); | ||
932 | return result; | 940 | return result; |
933 | } | 941 | } |
934 | 942 | ||
@@ -1920,6 +1928,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1920,6 +1928,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1920 | @Override | 1928 | @Override |
1921 | @Transactional(rollbackFor = Exception.class) | 1929 | @Transactional(rollbackFor = Exception.class) |
1922 | public Result completeTransferTask(TaskHeader taskHeader) { | 1930 | public Result completeTransferTask(TaskHeader taskHeader) { |
1931 | + log.info("开始完成移库任务" + taskHeader.getId()); | ||
1923 | String warehouseCode = taskHeader.getWarehouseCode(); | 1932 | String warehouseCode = taskHeader.getWarehouseCode(); |
1924 | String containerCode = taskHeader.getContainerCode(); | 1933 | String containerCode = taskHeader.getContainerCode(); |
1925 | String fromLocationCode = taskHeader.getFromLocationCode(); | 1934 | String fromLocationCode = taskHeader.getFromLocationCode(); |
@@ -1979,13 +1988,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1979,13 +1988,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1979 | if (!success) { | 1988 | if (!success) { |
1980 | throw new JeecgBootException("完成移库任务时, 更新容器状态失败"); | 1989 | throw new JeecgBootException("完成移库任务时, 更新容器状态失败"); |
1981 | } | 1990 | } |
1982 | - // 2023-04-11 托盘状态与填充状态分离 无需再更新字段 | ||
1983 | -// Container container = containerService.getContainerByCode(containerCode, warehouseCode); | ||
1984 | -// container.setLastStatus(QuantityConstant.EMPTY_STRING); | ||
1985 | -// success = containerService.updateById(container); | ||
1986 | -// if (!success) { | ||
1987 | -// throw new JeecgBootException("完成移库任务时, 更新容器状态失败"); | ||
1988 | -// } | ||
1989 | success = | 1991 | success = |
1990 | locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | 1992 | locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); |
1991 | if (!success) { | 1993 | if (!success) { |
@@ -2012,6 +2014,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2012,6 +2014,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2012 | throw new JeecgBootException("完成移库任务时, 更新库存详情失败"); | 2014 | throw new JeecgBootException("完成移库任务时, 更新库存详情失败"); |
2013 | } | 2015 | } |
2014 | } | 2016 | } |
2017 | + log.info("完成移库任务" + taskHeader.getId()); | ||
2015 | return Result.OK("完成移库任务成功"); | 2018 | return Result.OK("完成移库任务成功"); |
2016 | } | 2019 | } |
2017 | 2020 | ||
@@ -2023,6 +2026,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2023,6 +2026,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2023 | @Override | 2026 | @Override |
2024 | @Transactional(rollbackFor = Exception.class) | 2027 | @Transactional(rollbackFor = Exception.class) |
2025 | public Result completeCheckOutTask(TaskHeader taskHeader) { | 2028 | public Result completeCheckOutTask(TaskHeader taskHeader) { |
2029 | + log.info("开始完成出库查看任务" + taskHeader.getId()); | ||
2026 | String warehouseCode = taskHeader.getWarehouseCode(); | 2030 | String warehouseCode = taskHeader.getWarehouseCode(); |
2027 | String containerCode = taskHeader.getContainerCode(); | 2031 | String containerCode = taskHeader.getContainerCode(); |
2028 | String fromLocationCode = taskHeader.getFromLocationCode(); | 2032 | String fromLocationCode = taskHeader.getFromLocationCode(); |
@@ -2051,11 +2055,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2051,11 +2055,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2051 | .eq(InventoryDetail::getLocationCode, fromLocationCode); | 2055 | .eq(InventoryDetail::getLocationCode, fromLocationCode); |
2052 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | 2056 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
2053 | if (inventoryDetailList.size() != 0) { | 2057 | if (inventoryDetailList.size() != 0) { |
2058 | + List<InventoryDetail> inventoryDetailList1 = new ArrayList<>(); | ||
2054 | for (InventoryDetail inventoryDetail : inventoryDetailList) { | 2059 | for (InventoryDetail inventoryDetail : inventoryDetailList) { |
2055 | inventoryDetail.setTaskQty(BigDecimal.ZERO); | 2060 | inventoryDetail.setTaskQty(BigDecimal.ZERO); |
2056 | inventoryDetail.setLocationCode(toLocationCode); | 2061 | inventoryDetail.setLocationCode(toLocationCode); |
2062 | + InventoryDetail inventoryDetail1 = new InventoryDetail(); | ||
2063 | + inventoryDetail1.setId(inventoryDetail.getId()); | ||
2064 | + inventoryDetail1.setLocationCode(toLocationCode); | ||
2065 | + inventoryDetail1.setTaskQty(BigDecimal.ZERO); | ||
2066 | + inventoryDetailList1.add(inventoryDetail1); | ||
2057 | } | 2067 | } |
2058 | - success = inventoryDetailService.updateBatchById(inventoryDetailList); | 2068 | + success = inventoryDetailService.updateBatchById(inventoryDetailList1); |
2059 | if (!success) { | 2069 | if (!success) { |
2060 | throw new JeecgBootException("完成出库查看任务时,更新库存详情失败"); | 2070 | throw new JeecgBootException("完成出库查看任务时,更新库存详情失败"); |
2061 | } | 2071 | } |
@@ -2064,7 +2074,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2064,7 +2074,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2064 | throw new JeecgBootException("完成出库查看任务时,没有找到库存头"); | 2074 | throw new JeecgBootException("完成出库查看任务时,没有找到库存头"); |
2065 | } | 2075 | } |
2066 | inventoryHeader.setLocationCode(toLocationCode); | 2076 | inventoryHeader.setLocationCode(toLocationCode); |
2067 | - success = inventoryHeaderService.updateById(inventoryHeader); | 2077 | + success = inventoryHeaderService.updateLocationCodeById(toLocationCode, inventoryHeader.getId()); |
2068 | if (!success) { | 2078 | if (!success) { |
2069 | throw new JeecgBootException("完成出库查看任务时,更新库存头失败"); | 2079 | throw new JeecgBootException("完成出库查看任务时,更新库存头失败"); |
2070 | } | 2080 | } |
@@ -2096,7 +2106,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2096,7 +2106,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2096 | throw new JeecgBootException("完成出库查看任务时,更新目标库位状态失败"); | 2106 | throw new JeecgBootException("完成出库查看任务时,更新目标库位状态失败"); |
2097 | } | 2107 | } |
2098 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | 2108 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); |
2099 | - success = taskHeaderService.updateById(taskHeader); | 2109 | + success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); |
2110 | + log.info("完成出库查看任务" + taskHeader.getId()); | ||
2100 | if (!success) { | 2111 | if (!success) { |
2101 | throw new JeecgBootException("完成出库查看任务时,保存任务失败"); | 2112 | throw new JeecgBootException("完成出库查看任务时,保存任务失败"); |
2102 | } | 2113 | } |
@@ -2111,6 +2122,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2111,6 +2122,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2111 | @Override | 2122 | @Override |
2112 | @Transactional(rollbackFor = Exception.class) | 2123 | @Transactional(rollbackFor = Exception.class) |
2113 | public Result completeOverStationTask(TaskHeader taskHeader) { | 2124 | public Result completeOverStationTask(TaskHeader taskHeader) { |
2125 | + log.info("完成跨站任务" + taskHeader.getId()); | ||
2114 | String warehouseCode = taskHeader.getWarehouseCode(); | 2126 | String warehouseCode = taskHeader.getWarehouseCode(); |
2115 | String containerCode = taskHeader.getContainerCode(); | 2127 | String containerCode = taskHeader.getContainerCode(); |
2116 | String fromPortCode = taskHeader.getFromPortCode(); | 2128 | String fromPortCode = taskHeader.getFromPortCode(); |
@@ -2140,11 +2152,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2140,11 +2152,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2140 | return Result.error("创建跨站任务时,目标站台为空"); | 2152 | return Result.error("创建跨站任务时,目标站台为空"); |
2141 | } | 2153 | } |
2142 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | 2154 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); |
2143 | - boolean success = taskHeaderService.updateById(taskHeader); | 2155 | + boolean success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); |
2144 | if (!success) { | 2156 | if (!success) { |
2145 | throw new JeecgBootException("创建跨站任务时, 更新任务失败"); | 2157 | throw new JeecgBootException("创建跨站任务时, 更新任务失败"); |
2146 | } | 2158 | } |
2147 | success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); | 2159 | success = containerService.updateStatus(containerCode, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); |
2160 | + log.info("完成跨站任务" + taskHeader.getId()); | ||
2148 | if (!success) { | 2161 | if (!success) { |
2149 | throw new JeecgBootException("创建跨站任务时, 更新容器状态失败"); | 2162 | throw new JeecgBootException("创建跨站任务时, 更新容器状态失败"); |
2150 | } | 2163 | } |
@@ -2162,6 +2175,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2162,6 +2175,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2162 | String warehouseCode = taskHeader.getWarehouseCode(); | 2175 | String warehouseCode = taskHeader.getWarehouseCode(); |
2163 | String containerCode = taskHeader.getContainerCode(); | 2176 | String containerCode = taskHeader.getContainerCode(); |
2164 | String toLocationCode = taskHeader.getToLocationCode(); | 2177 | String toLocationCode = taskHeader.getToLocationCode(); |
2178 | + log.info("开始完成空托盘组入库任务" + taskHeader.getId()); | ||
2165 | if (StringUtils.isEmpty(containerCode)) { | 2179 | if (StringUtils.isEmpty(containerCode)) { |
2166 | return Result.error("完成空托盘组入库任务时, 托盘号为空"); | 2180 | return Result.error("完成空托盘组入库任务时, 托盘号为空"); |
2167 | } | 2181 | } |
@@ -2180,7 +2194,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2180,7 +2194,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2180 | return Result.error("完成空托盘组入库任务时,没有找到库位" + toLocationCode); | 2194 | return Result.error("完成空托盘组入库任务时,没有找到库位" + toLocationCode); |
2181 | } | 2195 | } |
2182 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | 2196 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); |
2183 | - boolean success = taskHeaderService.updateById(taskHeader); | 2197 | + boolean success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); |
2184 | if (!success) { | 2198 | if (!success) { |
2185 | throw new JeecgBootException("完成空托盘组入库任务时, 更新任务失败"); | 2199 | throw new JeecgBootException("完成空托盘组入库任务时, 更新任务失败"); |
2186 | } | 2200 | } |
@@ -2190,6 +2204,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2190,6 +2204,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2190 | throw new JeecgBootException("完成空托盘组入库任务时, 更新容器失败"); | 2204 | throw new JeecgBootException("完成空托盘组入库任务时, 更新容器失败"); |
2191 | } | 2205 | } |
2192 | success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | 2206 | success = locationService.updateContainerCodeAndStatus(toLocationCode, containerCode, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); |
2207 | + log.info("完成空托盘组入库任务" + taskHeader.getId()); | ||
2193 | if (!success) { | 2208 | if (!success) { |
2194 | throw new JeecgBootException("完成空托盘组入库任务时, 更新库位失败"); | 2209 | throw new JeecgBootException("完成空托盘组入库任务时, 更新库位失败"); |
2195 | } | 2210 | } |
@@ -2207,6 +2222,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2207,6 +2222,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2207 | String warehouseCode = taskHeader.getWarehouseCode(); | 2222 | String warehouseCode = taskHeader.getWarehouseCode(); |
2208 | String containerCode = taskHeader.getContainerCode(); | 2223 | String containerCode = taskHeader.getContainerCode(); |
2209 | String toPortCode = taskHeader.getToPortCode(); | 2224 | String toPortCode = taskHeader.getToPortCode(); |
2225 | + log.info("开始完成空托盘组出库任务" + taskHeader.getId()); | ||
2210 | if (StringUtils.isEmpty(containerCode)) { | 2226 | if (StringUtils.isEmpty(containerCode)) { |
2211 | return Result.error("完成空托盘组出库任务时, 托盘号为空"); | 2227 | return Result.error("完成空托盘组出库任务时, 托盘号为空"); |
2212 | } | 2228 | } |
@@ -2229,7 +2245,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2229,7 +2245,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2229 | return Result.error("完成空托盘组出库任务时,没有找到出入口" + toPortCode); | 2245 | return Result.error("完成空托盘组出库任务时,没有找到出入口" + toPortCode); |
2230 | } | 2246 | } |
2231 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | 2247 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); |
2232 | - boolean success = taskHeaderService.updateById(taskHeader); | 2248 | + boolean success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); |
2233 | if (!success) { | 2249 | if (!success) { |
2234 | throw new JeecgBootException("完成空托盘组出库任务时, 更新任务失败"); | 2250 | throw new JeecgBootException("完成空托盘组出库任务时, 更新任务失败"); |
2235 | } | 2251 | } |
@@ -2239,6 +2255,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2239,6 +2255,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2239 | throw new JeecgBootException("完成空托盘组出库任务时, 更新容器失败"); | 2255 | throw new JeecgBootException("完成空托盘组出库任务时, 更新容器失败"); |
2240 | } | 2256 | } |
2241 | success = locationService.updateContainerCodeAndStatus(toLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | 2257 | success = locationService.updateContainerCodeAndStatus(toLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); |
2258 | + log.info("开始完成空托盘组出库任务" + taskHeader.getId()); | ||
2242 | if (!success) { | 2259 | if (!success) { |
2243 | throw new JeecgBootException("完成空托盘组出库任务时, 更新库位失败"); | 2260 | throw new JeecgBootException("完成空托盘组出库任务时, 更新库位失败"); |
2244 | } | 2261 | } |