Commit 6ff609eb26cdea6447efb276d072629c5dd682bf
1 parent
a5e8ff07
取消任务
Showing
18 changed files
with
299 additions
and
78 deletions
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
@@ -143,8 +143,9 @@ | @@ -143,8 +143,9 @@ | ||
143 | <a-divider type="vertical"/></a> | 143 | <a-divider type="vertical"/></a> |
144 | <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 | 144 | <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 |
145 | <a-divider type="vertical"/></a> | 145 | <a-divider type="vertical"/></a> |
146 | - <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消 | ||
147 | - <a-divider type="vertical"/></a> | 146 | + <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)"> |
147 | + <a>取消</a> | ||
148 | + </a-popconfirm> | ||
148 | </span> | 149 | </span> |
149 | 150 | ||
150 | </a-table> | 151 | </a-table> |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/IHuahengMultiHandlerService.java
@@ -2,6 +2,8 @@ package org.jeecg.modules.wms.framework.service; | @@ -2,6 +2,8 @@ package org.jeecg.modules.wms.framework.service; | ||
2 | 2 | ||
3 | import org.jeecg.common.api.vo.Result; | 3 | import org.jeecg.common.api.vo.Result; |
4 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | 4 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
5 | +import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; | ||
6 | +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam; | ||
5 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; | 7 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
6 | 8 | ||
7 | /** | 9 | /** |
@@ -12,4 +14,10 @@ public interface IHuahengMultiHandlerService { | @@ -12,4 +14,10 @@ public interface IHuahengMultiHandlerService { | ||
12 | Result sendTaskToWcs(TaskHeader taskHeader); | 14 | Result sendTaskToWcs(TaskHeader taskHeader); |
13 | 15 | ||
14 | Result<TaskHeader> createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode); | 16 | Result<TaskHeader> createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode); |
17 | + | ||
18 | + Result combination(CombinationModel combinationModel); | ||
19 | + | ||
20 | + Result combination(CombinationParam combinationParam); | ||
21 | + | ||
22 | + Result cancelCombine(Integer id); | ||
15 | } | 23 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java
1 | package org.jeecg.modules.wms.framework.service.impl; | 1 | package org.jeecg.modules.wms.framework.service.impl; |
2 | 2 | ||
3 | +import java.math.BigDecimal; | ||
4 | + | ||
3 | import javax.annotation.Resource; | 5 | import javax.annotation.Resource; |
4 | 6 | ||
5 | import org.jeecg.common.api.vo.Result; | 7 | import org.jeecg.common.api.vo.Result; |
6 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; | 8 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
7 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; | 9 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
10 | +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | ||
11 | +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | ||
8 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | 12 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
9 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; | 13 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService; |
14 | +import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; | ||
15 | +import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; | ||
16 | +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; | ||
17 | +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam; | ||
18 | +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | ||
19 | +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; | ||
10 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; | 20 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
11 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; | 21 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
12 | import org.springframework.stereotype.Service; | 22 | import org.springframework.stereotype.Service; |
23 | +import org.springframework.transaction.annotation.Transactional; | ||
13 | 24 | ||
14 | /** | 25 | /** |
15 | * @author 游杰 | 26 | * @author 游杰 |
@@ -21,8 +32,17 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem | @@ -21,8 +32,17 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem | ||
21 | private ITaskHeaderService taskHeaderService; | 32 | private ITaskHeaderService taskHeaderService; |
22 | @Resource | 33 | @Resource |
23 | private IReceiptContainerHeaderService receiptContainerHeaderService; | 34 | private IReceiptContainerHeaderService receiptContainerHeaderService; |
35 | + @Resource | ||
36 | + private IShipmentCombinationService shipmentCombinationService; | ||
37 | + @Resource | ||
38 | + private IShipmentDetailService shipmentDetailService; | ||
39 | + @Resource | ||
40 | + private IInventoryDetailService inventoryDetailService; | ||
41 | + @Resource | ||
42 | + private IShipmentContainerHeaderService shipmentContainerHeaderService; | ||
24 | 43 | ||
25 | @Override | 44 | @Override |
45 | + @Transactional(rollbackFor = Exception.class) | ||
26 | public Result sendTaskToWcs(TaskHeader taskHeader) { | 46 | public Result sendTaskToWcs(TaskHeader taskHeader) { |
27 | if (taskHeader == null) { | 47 | if (taskHeader == null) { |
28 | return Result.error("任务信息为空"); | 48 | return Result.error("任务信息为空"); |
@@ -39,6 +59,7 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem | @@ -39,6 +59,7 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem | ||
39 | } | 59 | } |
40 | 60 | ||
41 | @Override | 61 | @Override |
62 | + @Transactional(rollbackFor = Exception.class) | ||
42 | public Result<TaskHeader> createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode) { | 63 | public Result<TaskHeader> createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode) { |
43 | String lockKey = warehouseCode; | 64 | String lockKey = warehouseCode; |
44 | Result result = handleMultiProcess("createReceiptTask", lockKey, new MultiProcessListener() { | 65 | Result result = handleMultiProcess("createReceiptTask", lockKey, new MultiProcessListener() { |
@@ -50,4 +71,50 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem | @@ -50,4 +71,50 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem | ||
50 | }); | 71 | }); |
51 | return result; | 72 | return result; |
52 | } | 73 | } |
74 | + | ||
75 | + @Override | ||
76 | + @Transactional(rollbackFor = Exception.class) | ||
77 | + public Result combination(CombinationModel combinationModel) { | ||
78 | + Result result = handleMultiProcess("combination", new MultiProcessListener() { | ||
79 | + @Override | ||
80 | + public Result<?> doProcess() { | ||
81 | + Result result = shipmentCombinationService.combination(combinationModel); | ||
82 | + return result; | ||
83 | + } | ||
84 | + }); | ||
85 | + return result; | ||
86 | + } | ||
87 | + | ||
88 | + @Override | ||
89 | + @Transactional(rollbackFor = Exception.class) | ||
90 | + public Result combination(CombinationParam combinationParam) { | ||
91 | + Result result = handleMultiProcess("combination", new MultiProcessListener() { | ||
92 | + @Override | ||
93 | + public Result<?> doProcess() { | ||
94 | + ShipmentDetail shipmentDetail = shipmentDetailService.getById(combinationParam.getShipmentDetailID()); | ||
95 | + InventoryDetail inventoryDetail = inventoryDetailService.getById(combinationParam.getInventoryDetailID()); | ||
96 | + CombinationModel combinationModel = new CombinationModel(); | ||
97 | + combinationModel.setShipmentDetail(shipmentDetail); | ||
98 | + combinationModel.setInventoryDetail(inventoryDetail); | ||
99 | + combinationModel.setShipQty(new BigDecimal(combinationParam.getShipQty())); | ||
100 | + Result result = shipmentCombinationService.combination(combinationModel); | ||
101 | + return result; | ||
102 | + } | ||
103 | + }); | ||
104 | + return result; | ||
105 | + } | ||
106 | + | ||
107 | + @Override | ||
108 | + @Transactional(rollbackFor = Exception.class) | ||
109 | + public Result cancelCombine(Integer id) { | ||
110 | + Result result = handleMultiProcess("cancelCombine", new MultiProcessListener() { | ||
111 | + @Override | ||
112 | + public Result<?> doProcess() { | ||
113 | + Result result = shipmentContainerHeaderService.cancelCombine(id); | ||
114 | + return result; | ||
115 | + } | ||
116 | + }); | ||
117 | + return result; | ||
118 | + } | ||
119 | + | ||
53 | } | 120 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
@@ -40,4 +40,12 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | @@ -40,4 +40,12 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | ||
40 | */ | 40 | */ |
41 | IPage<InventoryDetail> queryPage(Page<InventoryDetail> page, QueryWrapper<InventoryDetail> queryWrapper); | 41 | IPage<InventoryDetail> queryPage(Page<InventoryDetail> page, QueryWrapper<InventoryDetail> queryWrapper); |
42 | 42 | ||
43 | + /** | ||
44 | + * 更新库存详情的任务数量 | ||
45 | + * @param taskQty | ||
46 | + * @param id | ||
47 | + * @return | ||
48 | + */ | ||
49 | + boolean updateTaskQtyById(BigDecimal taskQty, int id); | ||
50 | + | ||
43 | } | 51 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
@@ -111,6 +111,15 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -111,6 +111,15 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
111 | return pageResult; | 111 | return pageResult; |
112 | } | 112 | } |
113 | 113 | ||
114 | + @Override | ||
115 | + public boolean updateTaskQtyById(BigDecimal taskQty, int id) { | ||
116 | + InventoryDetail inventoryDetail = new InventoryDetail(); | ||
117 | + inventoryDetail.setTaskQty(taskQty); | ||
118 | + inventoryDetail.setId(id); | ||
119 | + boolean success = updateById(inventoryDetail); | ||
120 | + return success; | ||
121 | + } | ||
122 | + | ||
114 | /** | 123 | /** |
115 | * 计算库存明细托盘填充度 | 124 | * 计算库存明细托盘填充度 |
116 | * @author TanYibin | 125 | * @author TanYibin |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java
@@ -10,14 +10,12 @@ import org.jeecg.common.api.vo.Result; | @@ -10,14 +10,12 @@ import org.jeecg.common.api.vo.Result; | ||
10 | import org.jeecg.common.aspect.annotation.AutoLog; | 10 | import org.jeecg.common.aspect.annotation.AutoLog; |
11 | import org.jeecg.modules.wms.config.location.entity.Location; | 11 | import org.jeecg.modules.wms.config.location.entity.Location; |
12 | import org.jeecg.modules.wms.config.location.service.ILocationService; | 12 | import org.jeecg.modules.wms.config.location.service.ILocationService; |
13 | -import org.jeecg.modules.wms.config.locationHigh.entity.LocationHigh; | ||
14 | import org.jeecg.modules.wms.config.port.entity.Port; | 13 | import org.jeecg.modules.wms.config.port.entity.Port; |
15 | import org.jeecg.modules.wms.config.port.service.IPortService; | 14 | import org.jeecg.modules.wms.config.port.service.IPortService; |
16 | import org.jeecg.modules.wms.config.zone.entity.Zone; | 15 | import org.jeecg.modules.wms.config.zone.entity.Zone; |
17 | import org.jeecg.modules.wms.config.zone.service.IZoneService; | 16 | import org.jeecg.modules.wms.config.zone.service.IZoneService; |
18 | -import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 17 | +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
19 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 18 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
20 | -import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; | ||
21 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.Shipment; | 19 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.Shipment; |
22 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; | 20 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; |
23 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | 21 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; |
@@ -58,6 +56,8 @@ public class ShipmentCombinationController { | @@ -58,6 +56,8 @@ public class ShipmentCombinationController { | ||
58 | private IZoneService zoneService; | 56 | private IZoneService zoneService; |
59 | @Resource | 57 | @Resource |
60 | private IPortService portService; | 58 | private IPortService portService; |
59 | + @Resource | ||
60 | + private IHuahengMultiHandlerService huahengMultiHandlerService; | ||
61 | 61 | ||
62 | /** | 62 | /** |
63 | * 获取单据列表 | 63 | * 获取单据列表 |
@@ -100,13 +100,7 @@ public class ShipmentCombinationController { | @@ -100,13 +100,7 @@ public class ShipmentCombinationController { | ||
100 | @PostMapping("/combination") | 100 | @PostMapping("/combination") |
101 | @ResponseBody | 101 | @ResponseBody |
102 | public Result combination(@RequestBody CombinationParam combinationParam) { | 102 | public Result combination(@RequestBody CombinationParam combinationParam) { |
103 | - ShipmentDetail shipmentDetail = shipmentDetailService.getById(combinationParam.getShipmentDetailID()); | ||
104 | - InventoryDetail inventoryDetail = inventoryDetailService.getById(combinationParam.getInventoryDetailID()); | ||
105 | - CombinationModel combinationModel = new CombinationModel(); | ||
106 | - combinationModel.setShipmentDetail(shipmentDetail); | ||
107 | - combinationModel.setInventoryDetail(inventoryDetail); | ||
108 | - combinationModel.setShipQty(new BigDecimal(combinationParam.getShipQty())); | ||
109 | - return shipmentCombinationService.combination(combinationModel); | 103 | + return huahengMultiHandlerService.combination(combinationParam); |
110 | } | 104 | } |
111 | 105 | ||
112 | /** | 106 | /** |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/IShipmentCombinationService.java
1 | package org.jeecg.modules.wms.shipment.shipmentCombination.service; | 1 | package org.jeecg.modules.wms.shipment.shipmentCombination.service; |
2 | 2 | ||
3 | +import java.math.BigDecimal; | ||
4 | +import java.util.List; | ||
5 | + | ||
3 | import org.jeecg.common.api.vo.Result; | 6 | import org.jeecg.common.api.vo.Result; |
4 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 7 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
5 | -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | ||
6 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; | 8 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; |
9 | +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; | ||
7 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | 10 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; |
8 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | 11 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
9 | 12 | ||
10 | -import java.math.BigDecimal; | ||
11 | -import java.util.List; | ||
12 | - | ||
13 | /** | 13 | /** |
14 | * @author 游杰 | 14 | * @author 游杰 |
15 | */ | 15 | */ |
@@ -26,4 +26,8 @@ public interface IShipmentCombinationService { | @@ -26,4 +26,8 @@ public interface IShipmentCombinationService { | ||
26 | public Result combination(CombinationModel combinationModel); | 26 | public Result combination(CombinationModel combinationModel); |
27 | 27 | ||
28 | public Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty); | 28 | public Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty); |
29 | + | ||
30 | + ShipmentContainerHeader addShipmentContainerHeader(InventoryDetail inventoryDetail, ShipmentDetail shipmentDetail); | ||
31 | + | ||
32 | + ShipmentContainerDetail addShipmentContainerDetail(ShipmentContainerHeader shipmentContainerHeader, CombinationModel combinationModel); | ||
29 | } | 33 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
@@ -5,6 +5,8 @@ import java.util.ArrayList; | @@ -5,6 +5,8 @@ import java.util.ArrayList; | ||
5 | import java.util.Collections; | 5 | import java.util.Collections; |
6 | import java.util.List; | 6 | import java.util.List; |
7 | 7 | ||
8 | +import javax.annotation.Resource; | ||
9 | + | ||
8 | import org.jeecg.common.api.vo.Result; | 10 | import org.jeecg.common.api.vo.Result; |
9 | import org.jeecg.common.exception.JeecgBootException; | 11 | import org.jeecg.common.exception.JeecgBootException; |
10 | import org.jeecg.modules.wms.config.container.entity.Container; | 12 | import org.jeecg.modules.wms.config.container.entity.Container; |
@@ -14,6 +16,7 @@ import org.jeecg.modules.wms.config.location.service.ILocationService; | @@ -14,6 +16,7 @@ import org.jeecg.modules.wms.config.location.service.ILocationService; | ||
14 | import org.jeecg.modules.wms.config.material.entity.Material; | 16 | import org.jeecg.modules.wms.config.material.entity.Material; |
15 | import org.jeecg.modules.wms.config.material.service.IMaterialService; | 17 | import org.jeecg.modules.wms.config.material.service.IMaterialService; |
16 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; | 18 | import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; |
19 | +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; | ||
17 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 20 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
18 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 21 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
19 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; | 22 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; |
@@ -46,10 +49,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | @@ -46,10 +49,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
46 | 49 | ||
47 | import cn.monitor4all.logRecord.annotation.OperationLog; | 50 | import cn.monitor4all.logRecord.annotation.OperationLog; |
48 | import cn.monitor4all.logRecord.context.LogRecordContext; | 51 | import cn.monitor4all.logRecord.context.LogRecordContext; |
52 | +import lombok.extern.slf4j.Slf4j; | ||
49 | 53 | ||
50 | /** | 54 | /** |
51 | * @author 游杰 | 55 | * @author 游杰 |
52 | */ | 56 | */ |
57 | +@Slf4j | ||
53 | @Service | 58 | @Service |
54 | public class ShipmentCombinationServiceImpl implements IShipmentCombinationService { | 59 | public class ShipmentCombinationServiceImpl implements IShipmentCombinationService { |
55 | 60 | ||
@@ -81,6 +86,8 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -81,6 +86,8 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
81 | private ITaskDetailService taskDetailService; | 86 | private ITaskDetailService taskDetailService; |
82 | @Autowired | 87 | @Autowired |
83 | private IInventoryHeaderService inventoryHeaderService; | 88 | private IInventoryHeaderService inventoryHeaderService; |
89 | + @Resource | ||
90 | + private IHuahengMultiHandlerService huahengMultiHandlerService; | ||
84 | 91 | ||
85 | /** | 92 | /** |
86 | * 根据出库单详情,匹配到可用出库的库存详情 | 93 | * 根据出库单详情,匹配到可用出库的库存详情 |
@@ -212,7 +219,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -212,7 +219,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
212 | combinationModel.setShipQty(inventoryQty); | 219 | combinationModel.setShipQty(inventoryQty); |
213 | shipmentQty = shipmentQty.subtract(inventoryQty); | 220 | shipmentQty = shipmentQty.subtract(inventoryQty); |
214 | } | 221 | } |
215 | - Result result = shipmentCombinationService.combination(combinationModel); | 222 | + Result result = huahengMultiHandlerService.combination(combinationModel); |
216 | if (!result.isSuccess()) { | 223 | if (!result.isSuccess()) { |
217 | throw new JeecgBootException(result.getMessage()); | 224 | throw new JeecgBootException(result.getMessage()); |
218 | } | 225 | } |
@@ -227,6 +234,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -227,6 +234,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
227 | BigDecimal shipmentQty = combinationModel.getShipQty(); | 234 | BigDecimal shipmentQty = combinationModel.getShipQty(); |
228 | ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail(); | 235 | ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail(); |
229 | InventoryDetail inventoryDetail = combinationModel.getInventoryDetail(); | 236 | InventoryDetail inventoryDetail = combinationModel.getInventoryDetail(); |
237 | + log.info("开始出库配盘" + shipmentDetail); | ||
230 | if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) { | 238 | if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) { |
231 | return Result.error("配盘时,出库数量必须大于0"); | 239 | return Result.error("配盘时,出库数量必须大于0"); |
232 | } | 240 | } |
@@ -281,7 +289,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -281,7 +289,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
281 | return Result.error("配盘时, 库存详情的任务数量不能超过库存数量"); | 289 | return Result.error("配盘时, 库存详情的任务数量不能超过库存数量"); |
282 | } | 290 | } |
283 | inventoryDetail.setTaskQty(inventoryDetailTaskQty); | 291 | inventoryDetail.setTaskQty(inventoryDetailTaskQty); |
284 | - success = inventoryDetailService.updateById(inventoryDetail); | 292 | + success = inventoryDetailService.updateTaskQtyById(inventoryDetailTaskQty, inventoryDetail.getId()); |
285 | if (!success) { | 293 | if (!success) { |
286 | throw new JeecgBootException("配盘时, 更新库存详情失败"); | 294 | throw new JeecgBootException("配盘时, 更新库存详情失败"); |
287 | } | 295 | } |
@@ -291,21 +299,18 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -291,21 +299,18 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
291 | } | 299 | } |
292 | if (shipmentDetailTaskQty.compareTo(shipmentDetailQty) > 0) { | 300 | if (shipmentDetailTaskQty.compareTo(shipmentDetailQty) > 0) { |
293 | return Result.error("配盘时, 出库详情的任务数量不能超过单据数量"); | 301 | return Result.error("配盘时, 出库详情的任务数量不能超过单据数量"); |
294 | - } else if (inventoryDetailTaskQty.compareTo(inventoryDetailQty) == 0) { | ||
295 | - shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAITING_OFF_SHELF); | ||
296 | - } else if (inventoryDetailTaskQty.compareTo(inventoryDetailQty) < 0) { | ||
297 | - shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAITING_OFF_SHELF); | ||
298 | } | 302 | } |
303 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK); | ||
299 | shipmentDetail.setTaskQty(shipmentDetailTaskQty); | 304 | shipmentDetail.setTaskQty(shipmentDetailTaskQty); |
300 | - success = shipmentDetailService.updateById(shipmentDetail); | 305 | + success = shipmentDetailService.updateTaskQtyAndStatusById(shipmentDetailTaskQty, QuantityConstant.SHIPMENT_HEADER_GROUPDISK, shipmentDetail.getId()); |
301 | if (!success) { | 306 | if (!success) { |
302 | throw new JeecgBootException("配盘时, 更新出库详情失败"); | 307 | throw new JeecgBootException("配盘时, 更新出库详情失败"); |
303 | } | 308 | } |
304 | - ShipmentContainerHeader shipmentContainerHeader = addShipmentContainerHeader(inventoryDetail, shipmentDetail); | 309 | + ShipmentContainerHeader shipmentContainerHeader = shipmentCombinationService.addShipmentContainerHeader(inventoryDetail, shipmentDetail); |
305 | if (shipmentContainerHeader == null) { | 310 | if (shipmentContainerHeader == null) { |
306 | throw new JeecgBootException("配盘时, 新增出库组盘头失败"); | 311 | throw new JeecgBootException("配盘时, 新增出库组盘头失败"); |
307 | } | 312 | } |
308 | - ShipmentContainerDetail shipmentContainerDetail = addShipmentContainerDetail(shipmentContainerHeader, combinationModel); | 313 | + ShipmentContainerDetail shipmentContainerDetail = shipmentCombinationService.addShipmentContainerDetail(shipmentContainerHeader, combinationModel); |
309 | if (shipmentContainerDetail == null) { | 314 | if (shipmentContainerDetail == null) { |
310 | throw new JeecgBootException("配盘时, 新增出库组盘详情失败"); | 315 | throw new JeecgBootException("配盘时, 新增出库组盘详情失败"); |
311 | } | 316 | } |
@@ -314,9 +319,11 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -314,9 +319,11 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
314 | throw new JeecgBootException("配盘时, 更新出库单失败"); | 319 | throw new JeecgBootException("配盘时, 更新出库单失败"); |
315 | } | 320 | } |
316 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentContainerDetail))); | 321 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentContainerDetail))); |
322 | + log.info("完成出库配盘" + shipmentDetail); | ||
317 | return Result.ok("配盘成功"); | 323 | return Result.ok("配盘成功"); |
318 | } | 324 | } |
319 | 325 | ||
326 | + @Override | ||
320 | @Transactional(rollbackFor = JeecgBootException.class) | 327 | @Transactional(rollbackFor = JeecgBootException.class) |
321 | public ShipmentContainerHeader addShipmentContainerHeader(InventoryDetail inventoryDetail, ShipmentDetail shipmentDetail) { | 328 | public ShipmentContainerHeader addShipmentContainerHeader(InventoryDetail inventoryDetail, ShipmentDetail shipmentDetail) { |
322 | String containerCode = inventoryDetail.getContainerCode(); | 329 | String containerCode = inventoryDetail.getContainerCode(); |
@@ -342,14 +349,22 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -342,14 +349,22 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
342 | if (shipmentContainerHeader != null) { | 349 | if (shipmentContainerHeader != null) { |
343 | if (taskType != shipmentContainerHeader.getTaskType()) { | 350 | if (taskType != shipmentContainerHeader.getTaskType()) { |
344 | shipmentContainerHeader.setTaskType(taskType); | 351 | shipmentContainerHeader.setTaskType(taskType); |
345 | - if (!shipmentContainerHeaderService.updateById(shipmentContainerHeader)) { | 352 | + if (!shipmentContainerHeaderService.updateTaskTypeById(taskType, shipmentContainerHeader.getId())) { |
346 | throw new ServiceException("更新出库组盘头任务类型失败"); | 353 | throw new ServiceException("更新出库组盘头任务类型失败"); |
347 | } | 354 | } |
348 | } | 355 | } |
349 | } else { | 356 | } else { |
357 | + String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION); | ||
358 | + if (StringUtils.isEmpty(value)) { | ||
359 | + throw new JeecgBootException("取消入库任务时, 没有获取到配置属性"); | ||
360 | + } | ||
361 | + int taskLocationRule = Integer.parseInt(value); | ||
350 | shipmentContainerHeader = new ShipmentContainerHeader(); | 362 | shipmentContainerHeader = new ShipmentContainerHeader(); |
351 | shipmentContainerHeader.setContainerCode(containerCode); | 363 | shipmentContainerHeader.setContainerCode(containerCode); |
352 | shipmentContainerHeader.setFromLocationCode(locationCode); | 364 | shipmentContainerHeader.setFromLocationCode(locationCode); |
365 | + if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) { | ||
366 | + shipmentContainerHeader.setToLocationCode(locationCode); | ||
367 | + } | ||
353 | shipmentContainerHeader.setWarehouseCode(warehouseCode); | 368 | shipmentContainerHeader.setWarehouseCode(warehouseCode); |
354 | shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode()); | 369 | shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode()); |
355 | shipmentContainerHeader.setContainerTypeCode(container.getContainerTypeCode()); | 370 | shipmentContainerHeader.setContainerTypeCode(container.getContainerTypeCode()); |
@@ -365,6 +380,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -365,6 +380,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
365 | return shipmentContainerHeader; | 380 | return shipmentContainerHeader; |
366 | } | 381 | } |
367 | 382 | ||
383 | + @Override | ||
368 | @Transactional(rollbackFor = JeecgBootException.class) | 384 | @Transactional(rollbackFor = JeecgBootException.class) |
369 | public ShipmentContainerDetail addShipmentContainerDetail(ShipmentContainerHeader shipmentContainerHeader, CombinationModel combinationModel) { | 385 | public ShipmentContainerDetail addShipmentContainerDetail(ShipmentContainerHeader shipmentContainerHeader, CombinationModel combinationModel) { |
370 | boolean success = false; | 386 | boolean success = false; |
@@ -381,8 +397,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -381,8 +397,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
381 | .eq(ShipmentContainerDetail::getWarehouseCode, warehouseCode); | 397 | .eq(ShipmentContainerDetail::getWarehouseCode, warehouseCode); |
382 | ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getOne(shipmentContainerDetailLambdaQueryWrapper); | 398 | ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getOne(shipmentContainerDetailLambdaQueryWrapper); |
383 | if (shipmentContainerDetail != null) { | 399 | if (shipmentContainerDetail != null) { |
384 | - shipmentContainerDetail.setQty(shipmentContainerDetail.getQty().add(combinationModel.getShipQty())); | ||
385 | - success = shipmentContainerDetailService.updateById(shipmentContainerDetail); | 400 | + BigDecimal qty = shipmentContainerDetail.getQty().add(combinationModel.getShipQty()); |
401 | + shipmentContainerDetail.setQty(qty); | ||
402 | + success = shipmentContainerDetailService.updateQtyById(qty, shipmentContainerDetail.getId()); | ||
386 | if (!success) { | 403 | if (!success) { |
387 | throw new JeecgBootException("更新出库组盘详情失败"); | 404 | throw new JeecgBootException("更新出库组盘详情失败"); |
388 | } | 405 | } |
@@ -435,6 +452,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -435,6 +452,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
435 | if (shipmentContainerHeader.getStatus() >= QuantityConstant.SHIPMENT_CONTAINER_TASK) { | 452 | if (shipmentContainerHeader.getStatus() >= QuantityConstant.SHIPMENT_CONTAINER_TASK) { |
436 | return Result.error("生成出库任务时, 出库组盘头" + shipmentContainerHeader.getId() + "已经生成任务,请不要重复生成,操作中止"); | 453 | return Result.error("生成出库任务时, 出库组盘头" + shipmentContainerHeader.getId() + "已经生成任务,请不要重复生成,操作中止"); |
437 | } | 454 | } |
455 | + log.info("开始创建出库任务,出库配盘头" + shipmentContainerHeader.getId()); | ||
438 | List<ShipmentContainerDetail> shipmentContainerDetailList = | 456 | List<ShipmentContainerDetail> shipmentContainerDetailList = |
439 | shipmentContainerDetailService.getShipmentContainerDetailListByHeaderId(shipmentContainerHeader.getId()); | 457 | shipmentContainerDetailService.getShipmentContainerDetailListByHeaderId(shipmentContainerHeader.getId()); |
440 | if (shipmentContainerDetailList.size() == 0) { | 458 | if (shipmentContainerDetailList.size() == 0) { |
@@ -446,6 +464,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -446,6 +464,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
446 | String fromLocationCode = shipmentContainerHeader.getFromLocationCode(); | 464 | String fromLocationCode = shipmentContainerHeader.getFromLocationCode(); |
447 | String toLocationCode = shipmentContainerHeader.getToLocationCode(); | 465 | String toLocationCode = shipmentContainerHeader.getToLocationCode(); |
448 | String containerCode = shipmentContainerHeader.getContainerCode(); | 466 | String containerCode = shipmentContainerHeader.getContainerCode(); |
467 | + String toPort = shipmentContainerHeader.getToPort(); | ||
449 | if (StringUtils.isEmpty(fromLocationCode)) { | 468 | if (StringUtils.isEmpty(fromLocationCode)) { |
450 | return Result.error("生成出库任务时, 出库组盘头没有起始库位号"); | 469 | return Result.error("生成出库任务时, 出库组盘头没有起始库位号"); |
451 | } | 470 | } |
@@ -500,13 +519,6 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -500,13 +519,6 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
500 | if (shipmentTaskRule == QuantityConstant.RULE_TASK_PICK_SHIPMENT) { | 519 | if (shipmentTaskRule == QuantityConstant.RULE_TASK_PICK_SHIPMENT) { |
501 | taskType = QuantityConstant.TASK_TYPE_SORTINGSHIPMENT; | 520 | taskType = QuantityConstant.TASK_TYPE_SORTINGSHIPMENT; |
502 | } | 521 | } |
503 | - value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION); | ||
504 | - int taskLocationRule = Integer.parseInt(value); | ||
505 | - if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) { | ||
506 | - toLocationCode = fromLocationCode; | ||
507 | - shipmentContainerHeader.setToLocationCode(toLocationCode); | ||
508 | - } | ||
509 | - shipmentContainerHeader.setTaskType(taskType); | ||
510 | String zoneCode = location.getZoneCode(); | 522 | String zoneCode = location.getZoneCode(); |
511 | TaskHeader taskHeader = new TaskHeader(); | 523 | TaskHeader taskHeader = new TaskHeader(); |
512 | taskHeader.setPreTaskNo(preTaskNo); | 524 | taskHeader.setPreTaskNo(preTaskNo); |
@@ -556,6 +568,17 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -556,6 +568,17 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
556 | if (!success) { | 568 | if (!success) { |
557 | throw new JeecgBootException("生成出库任务时, 创建任务详情失败"); | 569 | throw new JeecgBootException("生成出库任务时, 创建任务详情失败"); |
558 | } | 570 | } |
571 | + value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION); | ||
572 | + int taskLocationRule = Integer.parseInt(value); | ||
573 | + int shipmentContainerHeaderId = shipmentContainerHeader.getId(); | ||
574 | + shipmentContainerHeader = new ShipmentContainerHeader(); | ||
575 | + if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) { | ||
576 | + toLocationCode = fromLocationCode; | ||
577 | + shipmentContainerHeader.setToLocationCode(toLocationCode); | ||
578 | + } | ||
579 | + shipmentContainerHeader.setToPort(toPort); | ||
580 | + shipmentContainerHeader.setId(shipmentContainerHeaderId); | ||
581 | + shipmentContainerHeader.setTaskType(taskType); | ||
559 | shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_TASK); | 582 | shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_TASK); |
560 | success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); | 583 | success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); |
561 | if (!success) { | 584 | if (!success) { |
@@ -570,6 +593,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | @@ -570,6 +593,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi | ||
570 | LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(shipmentContainerDetailList));// 操作日志收集 | 593 | LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(shipmentContainerDetailList));// 操作日志收集 |
571 | LogRecordContext.putVariable("taskDetailList", taskDetailList);// 操作日志收集 | 594 | LogRecordContext.putVariable("taskDetailList", taskDetailList);// 操作日志收集 |
572 | LogRecordContext.putVariable("extraJsonString2", JSON.toJSONString(taskDetailList));// 操作日志收集 | 595 | LogRecordContext.putVariable("extraJsonString2", JSON.toJSONString(taskDetailList));// 操作日志收集 |
596 | + log.info("完成创建出库任务,出库配盘头" + shipmentContainerHeader.getId()); | ||
573 | return Result.OK("生成出库任务成功"); | 597 | return Result.OK("生成出库任务成功"); |
574 | } | 598 | } |
575 | 599 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java
@@ -6,6 +6,7 @@ import java.util.List; | @@ -6,6 +6,7 @@ import java.util.List; | ||
6 | import java.util.Map; | 6 | import java.util.Map; |
7 | import java.util.stream.Collectors; | 7 | import java.util.stream.Collectors; |
8 | 8 | ||
9 | +import javax.annotation.Resource; | ||
9 | import javax.servlet.http.HttpServletRequest; | 10 | import javax.servlet.http.HttpServletRequest; |
10 | import javax.servlet.http.HttpServletResponse; | 11 | import javax.servlet.http.HttpServletResponse; |
11 | 12 | ||
@@ -17,12 +18,12 @@ import org.jeecg.common.system.base.controller.JeecgController; | @@ -17,12 +18,12 @@ import org.jeecg.common.system.base.controller.JeecgController; | ||
17 | import org.jeecg.common.system.query.QueryGenerator; | 18 | import org.jeecg.common.system.query.QueryGenerator; |
18 | import org.jeecg.common.system.vo.LoginUser; | 19 | import org.jeecg.common.system.vo.LoginUser; |
19 | import org.jeecg.common.util.oConvertUtils; | 20 | import org.jeecg.common.util.oConvertUtils; |
21 | +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; | ||
20 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; | 22 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; |
21 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | 23 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; |
22 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; | 24 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; |
23 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; | 25 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; |
24 | import org.jeecg.utils.HuahengJwtUtil; | 26 | import org.jeecg.utils.HuahengJwtUtil; |
25 | -import org.jeecg.utils.StringUtils; | ||
26 | import org.jeecgframework.poi.excel.ExcelImportUtil; | 27 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
27 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; | 28 | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
28 | import org.jeecgframework.poi.excel.entity.ExportParams; | 29 | import org.jeecgframework.poi.excel.entity.ExportParams; |
@@ -60,6 +61,9 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | @@ -60,6 +61,9 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | ||
60 | @Autowired | 61 | @Autowired |
61 | private IShipmentContainerDetailService shipmentContainerDetailService; | 62 | private IShipmentContainerDetailService shipmentContainerDetailService; |
62 | 63 | ||
64 | + @Resource | ||
65 | + private IHuahengMultiHandlerService huahengMultiHandlerService; | ||
66 | + | ||
63 | /*---------------------------------主表处理-begin-------------------------------------*/ | 67 | /*---------------------------------主表处理-begin-------------------------------------*/ |
64 | 68 | ||
65 | /** | 69 | /** |
@@ -122,7 +126,7 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | @@ -122,7 +126,7 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC | ||
122 | @RequiresPermissions("shipmentContainerHeader:delete") | 126 | @RequiresPermissions("shipmentContainerHeader:delete") |
123 | @DeleteMapping(value = "/delete") | 127 | @DeleteMapping(value = "/delete") |
124 | public Result<?> delete(@RequestParam(name = "id", required = true) String id) { | 128 | public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
125 | - return shipmentContainerHeaderService.cancelCombine(Integer.parseInt(id)); | 129 | + return huahengMultiHandlerService.cancelCombine(Integer.parseInt(id)); |
126 | } | 130 | } |
127 | 131 | ||
128 | /** | 132 | /** |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/IShipmentContainerDetailService.java
1 | package org.jeecg.modules.wms.shipment.shipmentContainerHeader.service; | 1 | package org.jeecg.modules.wms.shipment.shipmentContainerHeader.service; |
2 | 2 | ||
3 | +import java.math.BigDecimal; | ||
4 | +import java.util.List; | ||
5 | + | ||
3 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; | 6 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; |
7 | + | ||
4 | import com.baomidou.mybatisplus.extension.service.IService; | 8 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | -import java.util.List; | ||
6 | 9 | ||
7 | /** | 10 | /** |
8 | * @Description: 出库组盘详情 | 11 | * @Description: 出库组盘详情 |
@@ -17,4 +20,6 @@ public interface IShipmentContainerDetailService extends IService<ShipmentContai | @@ -17,4 +20,6 @@ public interface IShipmentContainerDetailService extends IService<ShipmentContai | ||
17 | public List<ShipmentContainerDetail> getShipmentContainerDetailListByHeaderId(int shipmentContainerHeaderId); | 20 | public List<ShipmentContainerDetail> getShipmentContainerDetailListByHeaderId(int shipmentContainerHeaderId); |
18 | 21 | ||
19 | public List<ShipmentContainerDetail> getShipmentContainerDetailListByShipmentCode(String shipmentCode); | 22 | public List<ShipmentContainerDetail> getShipmentContainerDetailListByShipmentCode(String shipmentCode); |
23 | + | ||
24 | + boolean updateQtyById(BigDecimal qty, int id); | ||
20 | } | 25 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/IShipmentContainerHeaderService.java
@@ -55,4 +55,21 @@ public interface IShipmentContainerHeaderService extends IService<ShipmentContai | @@ -55,4 +55,21 @@ public interface IShipmentContainerHeaderService extends IService<ShipmentContai | ||
55 | * @return | 55 | * @return |
56 | */ | 56 | */ |
57 | Result cancelCombine(List<Integer> ids); | 57 | Result cancelCombine(List<Integer> ids); |
58 | + | ||
59 | + /** | ||
60 | + * 更新任务类型 | ||
61 | + * @param taskType | ||
62 | + * @param id | ||
63 | + * @return | ||
64 | + */ | ||
65 | + boolean updateTaskTypeById(int taskType, int id); | ||
66 | + | ||
67 | + /** | ||
68 | + * 更新出库配盘状态 | ||
69 | + * @param status | ||
70 | + * @param id | ||
71 | + * @return | ||
72 | + */ | ||
73 | + boolean updateStatusById(int status, int id); | ||
74 | + | ||
58 | } | 75 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerDetailServiceImpl.java
1 | package org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.impl; | 1 | package org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.impl; |
2 | 2 | ||
3 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 3 | +import java.math.BigDecimal; |
4 | +import java.util.List; | ||
5 | + | ||
5 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; | 6 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; |
6 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.mapper.ShipmentContainerDetailMapper; | 7 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.mapper.ShipmentContainerDetailMapper; |
7 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; | 8 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; |
9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
8 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
9 | -import java.util.List; | 11 | + |
12 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
13 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 14 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
11 | -import org.springframework.beans.factory.annotation.Autowired; | ||
12 | 15 | ||
13 | /** | 16 | /** |
14 | * @Description: 出库组盘详情 | 17 | * @Description: 出库组盘详情 |
@@ -43,4 +46,13 @@ public class ShipmentContainerDetailServiceImpl extends ServiceImpl<ShipmentCont | @@ -43,4 +46,13 @@ public class ShipmentContainerDetailServiceImpl extends ServiceImpl<ShipmentCont | ||
43 | List<ShipmentContainerDetail> shipmentContainerDetailList = list(shipmentContainerDetailLambdaQueryWrapper); | 46 | List<ShipmentContainerDetail> shipmentContainerDetailList = list(shipmentContainerDetailLambdaQueryWrapper); |
44 | return shipmentContainerDetailList; | 47 | return shipmentContainerDetailList; |
45 | } | 48 | } |
49 | + | ||
50 | + @Override | ||
51 | + public boolean updateQtyById(BigDecimal qty, int id) { | ||
52 | + ShipmentContainerDetail shipmentContainerDetail = new ShipmentContainerDetail(); | ||
53 | + shipmentContainerDetail.setQty(qty); | ||
54 | + shipmentContainerDetail.setId(id); | ||
55 | + boolean success = updateById(shipmentContainerDetail); | ||
56 | + return success; | ||
57 | + } | ||
46 | } | 58 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java
1 | package org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.impl; | 1 | package org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.impl; |
2 | 2 | ||
3 | import java.io.Serializable; | 3 | import java.io.Serializable; |
4 | +import java.math.BigDecimal; | ||
4 | import java.util.ArrayList; | 5 | import java.util.ArrayList; |
5 | import java.util.Collection; | 6 | import java.util.Collection; |
6 | import java.util.List; | 7 | import java.util.List; |
@@ -9,9 +10,10 @@ import java.util.stream.Collectors; | @@ -9,9 +10,10 @@ import java.util.stream.Collectors; | ||
9 | import javax.annotation.Resource; | 10 | import javax.annotation.Resource; |
10 | 11 | ||
11 | import org.jeecg.common.api.vo.Result; | 12 | import org.jeecg.common.api.vo.Result; |
13 | +import org.jeecg.common.exception.JeecgBootException; | ||
14 | +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; | ||
12 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | 15 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
13 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 16 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
14 | -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; | ||
15 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; | 17 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; |
16 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | 18 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; |
17 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.mapper.ShipmentContainerDetailMapper; | 19 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.mapper.ShipmentContainerDetailMapper; |
@@ -28,13 +30,13 @@ import org.springframework.stereotype.Service; | @@ -28,13 +30,13 @@ import org.springframework.stereotype.Service; | ||
28 | import org.springframework.transaction.annotation.Transactional; | 30 | import org.springframework.transaction.annotation.Transactional; |
29 | 31 | ||
30 | import com.alibaba.fastjson.JSON; | 32 | import com.alibaba.fastjson.JSON; |
31 | -import org.jeecg.common.exception.JeecgBootException; | ||
32 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 33 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
33 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 34 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
34 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 35 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
35 | 36 | ||
36 | import cn.monitor4all.logRecord.annotation.OperationLog; | 37 | import cn.monitor4all.logRecord.annotation.OperationLog; |
37 | import cn.monitor4all.logRecord.context.LogRecordContext; | 38 | import cn.monitor4all.logRecord.context.LogRecordContext; |
39 | +import lombok.extern.slf4j.Slf4j; | ||
38 | 40 | ||
39 | /** | 41 | /** |
40 | * @Description: 出库组盘 | 42 | * @Description: 出库组盘 |
@@ -42,6 +44,7 @@ import cn.monitor4all.logRecord.context.LogRecordContext; | @@ -42,6 +44,7 @@ import cn.monitor4all.logRecord.context.LogRecordContext; | ||
42 | * @Date: 2022-11-22 | 44 | * @Date: 2022-11-22 |
43 | * @Version: V1.0 | 45 | * @Version: V1.0 |
44 | */ | 46 | */ |
47 | +@Slf4j | ||
45 | @Service | 48 | @Service |
46 | public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentContainerHeaderMapper, ShipmentContainerHeader> | 49 | public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentContainerHeaderMapper, ShipmentContainerHeader> |
47 | implements IShipmentContainerHeaderService { | 50 | implements IShipmentContainerHeaderService { |
@@ -58,6 +61,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -58,6 +61,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
58 | private IShipmentContainerDetailService shipmentContainerDetailService; | 61 | private IShipmentContainerDetailService shipmentContainerDetailService; |
59 | @Resource | 62 | @Resource |
60 | private IInventoryDetailService inventoryDetailService; | 63 | private IInventoryDetailService inventoryDetailService; |
64 | + @Resource | ||
65 | + private IHuahengMultiHandlerService huahengMultiHandlerService; | ||
61 | 66 | ||
62 | @Override | 67 | @Override |
63 | @Transactional | 68 | @Transactional |
@@ -138,12 +143,13 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -138,12 +143,13 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
138 | if (shipmentContainerHeader == null) { | 143 | if (shipmentContainerHeader == null) { |
139 | return false; | 144 | return false; |
140 | } | 145 | } |
146 | + log.info("开始取消出库任务,任务id" + taskHeader.getId()); | ||
141 | int shipmentContainerStatus = shipmentContainerHeader.getStatus(); | 147 | int shipmentContainerStatus = shipmentContainerHeader.getStatus(); |
142 | if (shipmentContainerStatus != QuantityConstant.SHIPMENT_CONTAINER_TASK) { | 148 | if (shipmentContainerStatus != QuantityConstant.SHIPMENT_CONTAINER_TASK) { |
143 | throw new JeecgBootException("取消出库任务时, 任务状态不为生成任务状态"); | 149 | throw new JeecgBootException("取消出库任务时, 任务状态不为生成任务状态"); |
144 | } | 150 | } |
145 | shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD); | 151 | shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD); |
146 | - boolean success = updateById(shipmentContainerHeader); | 152 | + boolean success = this.updateStatusById(QuantityConstant.SHIPMENT_CONTAINER_BUILD, shipmentContainerHeader.getId()); |
147 | if (!success) { | 153 | if (!success) { |
148 | throw new JeecgBootException("取消入库任务时, 更新入库组盘头失败"); | 154 | throw new JeecgBootException("取消入库任务时, 更新入库组盘头失败"); |
149 | } | 155 | } |
@@ -156,6 +162,10 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -156,6 +162,10 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
156 | if (shipmentDetail == null) { | 162 | if (shipmentDetail == null) { |
157 | throw new JeecgBootException("取消出库任务时, 没有找到出库单详情" + shipmentContainerDetail.getShipmentDetailId()); | 163 | throw new JeecgBootException("取消出库任务时, 没有找到出库单详情" + shipmentContainerDetail.getShipmentDetailId()); |
158 | } | 164 | } |
165 | + int shipmentId = shipmentDetail.getShipmentId(); | ||
166 | + shipmentDetail = new ShipmentDetail(); | ||
167 | + shipmentDetail.setId(shipmentContainerDetail.getShipmentDetailId()); | ||
168 | + shipmentDetail.setShipmentId(shipmentId); | ||
159 | shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK); | 169 | shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK); |
160 | shipmentDetailList.add(shipmentDetail); | 170 | shipmentDetailList.add(shipmentDetail); |
161 | } | 171 | } |
@@ -172,6 +182,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -172,6 +182,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
172 | } | 182 | } |
173 | } | 183 | } |
174 | } | 184 | } |
185 | + log.info("完成取消出库任务,任务id" + taskHeader.getId()); | ||
175 | LogRecordContext.putVariable("shipmentContainerHeader", shipmentContainerHeader);// 操作日志收集 | 186 | LogRecordContext.putVariable("shipmentContainerHeader", shipmentContainerHeader);// 操作日志收集 |
176 | LogRecordContext.putVariable("shipmentContainerDetailList", shipmentContainerDetailList);// 操作日志收集 | 187 | LogRecordContext.putVariable("shipmentContainerDetailList", shipmentContainerDetailList);// 操作日志收集 |
177 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(shipmentContainerDetailList));// 操作日志收集 | 188 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(shipmentContainerDetailList));// 操作日志收集 |
@@ -182,6 +193,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -182,6 +193,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
182 | @Transactional(rollbackFor = JeecgBootException.class) | 193 | @Transactional(rollbackFor = JeecgBootException.class) |
183 | @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情取消配盘'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | 194 | @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情取消配盘'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) |
184 | public Result cancelCombine(Integer id) { | 195 | public Result cancelCombine(Integer id) { |
196 | + log.info("开始取消配盘,id:" + id); | ||
185 | ShipmentContainerHeader shipmentContainerHeader = this.getById(id); | 197 | ShipmentContainerHeader shipmentContainerHeader = this.getById(id); |
186 | if (shipmentContainerHeader == null) { | 198 | if (shipmentContainerHeader == null) { |
187 | return Result.error("取消出库配盘失败, 没有找到出库组盘头ID:" + id); | 199 | return Result.error("取消出库配盘失败, 没有找到出库组盘头ID:" + id); |
@@ -191,15 +203,15 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -191,15 +203,15 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
191 | return Result.error("取消出库配盘失败,已经生成出库任务"); | 203 | return Result.error("取消出库配盘失败,已经生成出库任务"); |
192 | } | 204 | } |
193 | List<ShipmentContainerDetail> shipmentContainerDetailList = shipmentContainerDetailService.getShipmentContainerDetailListByHeaderId(id); | 205 | List<ShipmentContainerDetail> shipmentContainerDetailList = shipmentContainerDetailService.getShipmentContainerDetailListByHeaderId(id); |
194 | - List<ShipmentDetail> shipmentDetailList = new ArrayList<ShipmentDetail>(); | ||
195 | for (ShipmentContainerDetail shipmentContainerDetail : shipmentContainerDetailList) { | 206 | for (ShipmentContainerDetail shipmentContainerDetail : shipmentContainerDetailList) { |
196 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentContainerDetail.getShipmentDetailId()); | 207 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentContainerDetail.getShipmentDetailId()); |
197 | if (shipmentDetail == null) { | 208 | if (shipmentDetail == null) { |
198 | throw new JeecgBootException("取消出库配盘失败, 没有找到出库单,出库详情ID:" + shipmentContainerDetail.getShipmentDetailId()); | 209 | throw new JeecgBootException("取消出库配盘失败, 没有找到出库单,出库详情ID:" + shipmentContainerDetail.getShipmentDetailId()); |
199 | } | 210 | } |
200 | shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_BUILD); | 211 | shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_BUILD); |
201 | - shipmentDetail.setTaskQty(shipmentDetail.getTaskQty().subtract(shipmentContainerDetail.getQty())); | ||
202 | - if (!shipmentDetailService.updateById(shipmentDetail)) { | 212 | + BigDecimal taskQty = shipmentDetail.getTaskQty().subtract(shipmentContainerDetail.getQty()); |
213 | + shipmentDetail.setTaskQty(taskQty); | ||
214 | + if (!shipmentDetailService.updateTaskQtyAndStatusById(taskQty, QuantityConstant.SHIPMENT_HEADER_BUILD, shipmentDetail.getId())) { | ||
203 | throw new JeecgBootException("取消出库配盘失败, 更新出库明细失败,出库详情ID:" + shipmentContainerDetail.getShipmentDetailId()); | 215 | throw new JeecgBootException("取消出库配盘失败, 更新出库明细失败,出库详情ID:" + shipmentContainerDetail.getShipmentDetailId()); |
204 | } | 216 | } |
205 | if (!shipmentContainerDetailService.removeById(shipmentContainerDetail.getId())) { | 217 | if (!shipmentContainerDetailService.removeById(shipmentContainerDetail.getId())) { |
@@ -209,26 +221,48 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | @@ -209,26 +221,48 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont | ||
209 | throw new JeecgBootException("取消出库配盘失败, 更新出库单头失败,出库单ID:" + shipmentDetail.getShipmentId()); | 221 | throw new JeecgBootException("取消出库配盘失败, 更新出库单头失败,出库单ID:" + shipmentDetail.getShipmentId()); |
210 | } | 222 | } |
211 | InventoryDetail inventoryDetail = inventoryDetailService.getById(shipmentContainerDetail.getInventoryDetailId()); | 223 | InventoryDetail inventoryDetail = inventoryDetailService.getById(shipmentContainerDetail.getInventoryDetailId()); |
212 | - inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().subtract(shipmentContainerDetail.getQty())); | ||
213 | - if (!inventoryDetailService.updateById(inventoryDetail)) { | 224 | + if (inventoryDetail == null) { |
225 | + throw new JeecgBootException("取消出库配盘失败, 没有找到库存详情失败,库存详情ID:" + shipmentContainerDetail.getInventoryDetailId()); | ||
226 | + } | ||
227 | + BigDecimal inventoryDetailTaskQty = inventoryDetail.getTaskQty().subtract(shipmentContainerDetail.getQty()); | ||
228 | + if (!inventoryDetailService.updateTaskQtyById(inventoryDetailTaskQty, shipmentContainerDetail.getInventoryDetailId())) { | ||
214 | throw new JeecgBootException("取消出库配盘失败, 解锁库存详情失败,库存详情ID:" + inventoryDetail.getId()); | 229 | throw new JeecgBootException("取消出库配盘失败, 解锁库存详情失败,库存详情ID:" + inventoryDetail.getId()); |
215 | } | 230 | } |
216 | - shipmentDetailList.add(shipmentDetail); | ||
217 | } | 231 | } |
218 | if (!this.removeById(id)) { | 232 | if (!this.removeById(id)) { |
219 | throw new JeecgBootException("取消出库配盘失败, 删除出库组盘头表失败,配盘ID:" + id); | 233 | throw new JeecgBootException("取消出库配盘失败, 删除出库组盘头表失败,配盘ID:" + id); |
220 | } | 234 | } |
221 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(shipmentContainerDetailList)); | 235 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(shipmentContainerDetailList)); |
236 | + log.info("完成取消配盘,id:" + id); | ||
222 | return Result.ok("取消配盘成功"); | 237 | return Result.ok("取消配盘成功"); |
223 | } | 238 | } |
224 | 239 | ||
225 | @Override | 240 | @Override |
241 | + @Transactional(rollbackFor = Exception.class) | ||
226 | public Result cancelCombine(List<Integer> ids) { | 242 | public Result cancelCombine(List<Integer> ids) { |
227 | Result result = null; | 243 | Result result = null; |
228 | for (Integer id : ids) { | 244 | for (Integer id : ids) { |
229 | - result = cancelCombine(id); | 245 | + result = huahengMultiHandlerService.cancelCombine(id); |
230 | } | 246 | } |
231 | return result; | 247 | return result; |
232 | } | 248 | } |
233 | 249 | ||
250 | + @Override | ||
251 | + public boolean updateTaskTypeById(int taskType, int id) { | ||
252 | + ShipmentContainerHeader shipmentContainerHeader = new ShipmentContainerHeader(); | ||
253 | + shipmentContainerHeader.setTaskType(taskType); | ||
254 | + shipmentContainerHeader.setId(id); | ||
255 | + boolean success = this.updateById(shipmentContainerHeader); | ||
256 | + return success; | ||
257 | + } | ||
258 | + | ||
259 | + @Override | ||
260 | + public boolean updateStatusById(int status, int id) { | ||
261 | + ShipmentContainerHeader shipmentContainerHeader = new ShipmentContainerHeader(); | ||
262 | + shipmentContainerHeader.setStatus(status); | ||
263 | + shipmentContainerHeader.setId(id); | ||
264 | + boolean success = this.updateById(shipmentContainerHeader); | ||
265 | + return success; | ||
266 | + } | ||
267 | + | ||
234 | } | 268 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/IShipmentDetailService.java
1 | package org.jeecg.modules.wms.shipment.shipmentHeader.service; | 1 | package org.jeecg.modules.wms.shipment.shipmentHeader.service; |
2 | 2 | ||
3 | +import java.math.BigDecimal; | ||
4 | +import java.util.List; | ||
5 | + | ||
3 | import org.jeecg.common.api.vo.Result; | 6 | import org.jeecg.common.api.vo.Result; |
4 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | 7 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
5 | -import com.baomidou.mybatisplus.extension.service.IService; | ||
6 | -import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; | ||
7 | 8 | ||
8 | -import java.util.List; | 9 | +import com.baomidou.mybatisplus.extension.service.IService; |
9 | 10 | ||
10 | /** | 11 | /** |
11 | * @Description: 出库单详情 | 12 | * @Description: 出库单详情 |
@@ -22,4 +23,6 @@ public interface IShipmentDetailService extends IService<ShipmentDetail> { | @@ -22,4 +23,6 @@ public interface IShipmentDetailService extends IService<ShipmentDetail> { | ||
22 | public List<ShipmentDetail> getShipmentDetailListByShipmentId(Integer id); | 23 | public List<ShipmentDetail> getShipmentDetailListByShipmentId(Integer id); |
23 | 24 | ||
24 | boolean batchSave(List<ShipmentDetail> shipmentDetailList); | 25 | boolean batchSave(List<ShipmentDetail> shipmentDetailList); |
26 | + | ||
27 | + boolean updateTaskQtyAndStatusById(BigDecimal taskQty, int status, int id); | ||
25 | } | 28 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/IShipmentHeaderService.java
1 | package org.jeecg.modules.wms.shipment.shipmentHeader.service; | 1 | package org.jeecg.modules.wms.shipment.shipmentHeader.service; |
2 | 2 | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.Collection; | ||
5 | + | ||
3 | import org.jeecg.common.api.vo.Result; | 6 | import org.jeecg.common.api.vo.Result; |
4 | -import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; | ||
5 | -import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | ||
6 | -import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | ||
7 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; | 7 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; |
8 | + | ||
8 | import com.baomidou.mybatisplus.extension.service.IService; | 9 | import com.baomidou.mybatisplus.extension.service.IService; |
9 | -import org.springframework.beans.factory.annotation.Autowired; | ||
10 | -import java.io.Serializable; | ||
11 | -import java.util.Collection; | ||
12 | -import java.util.List; | ||
13 | 10 | ||
14 | /** | 11 | /** |
15 | * @Description: 出库单 | 12 | * @Description: 出库单 |
@@ -40,4 +37,6 @@ public interface IShipmentHeaderService extends IService<ShipmentHeader> { | @@ -40,4 +37,6 @@ public interface IShipmentHeaderService extends IService<ShipmentHeader> { | ||
40 | public ShipmentHeader getShipmentHeaderByCode(String code, String warehouseCode); | 37 | public ShipmentHeader getShipmentHeaderByCode(String code, String warehouseCode); |
41 | 38 | ||
42 | public ShipmentHeader getShipmentHeaderByReferCode(String referCode, String warehouseCode); | 39 | public ShipmentHeader getShipmentHeaderByReferCode(String referCode, String warehouseCode); |
40 | + | ||
41 | + boolean updateFirstStatusAndLastStatusById(Integer firstStatus, Integer lastStatus, int id); | ||
43 | } | 42 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java
1 | package org.jeecg.modules.wms.shipment.shipmentHeader.service.impl; | 1 | package org.jeecg.modules.wms.shipment.shipmentHeader.service.impl; |
2 | 2 | ||
3 | -import com.alibaba.fastjson.JSON; | ||
4 | -import org.jeecg.common.exception.JeecgBootException; | ||
5 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
6 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 3 | +import java.math.BigDecimal; |
4 | +import java.util.Collections; | ||
5 | +import java.util.List; | ||
6 | + | ||
7 | +import javax.annotation.Resource; | ||
8 | + | ||
7 | import org.jeecg.common.api.vo.Result; | 9 | import org.jeecg.common.api.vo.Result; |
10 | +import org.jeecg.common.exception.JeecgBootException; | ||
8 | import org.jeecg.modules.wms.config.material.entity.Material; | 11 | import org.jeecg.modules.wms.config.material.entity.Material; |
9 | import org.jeecg.modules.wms.config.material.service.IMaterialService; | 12 | import org.jeecg.modules.wms.config.material.service.IMaterialService; |
10 | -import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; | ||
11 | -import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService; | ||
12 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | 13 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
13 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; | 14 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; |
14 | import org.jeecg.modules.wms.shipment.shipmentHeader.mapper.ShipmentDetailMapper; | 15 | import org.jeecg.modules.wms.shipment.shipmentHeader.mapper.ShipmentDetailMapper; |
@@ -16,19 +17,17 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailServ | @@ -16,19 +17,17 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailServ | ||
16 | import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService; | 17 | import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService; |
17 | import org.jeecg.utils.StringUtils; | 18 | import org.jeecg.utils.StringUtils; |
18 | import org.jeecg.utils.constant.QuantityConstant; | 19 | import org.jeecg.utils.constant.QuantityConstant; |
20 | +import org.springframework.beans.factory.annotation.Autowired; | ||
19 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
20 | 22 | ||
21 | -import java.util.Collections; | ||
22 | -import java.util.List; | 23 | +import com.alibaba.fastjson.JSON; |
24 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
25 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
23 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 26 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
24 | 27 | ||
25 | import cn.monitor4all.logRecord.annotation.OperationLog; | 28 | import cn.monitor4all.logRecord.annotation.OperationLog; |
26 | import cn.monitor4all.logRecord.context.LogRecordContext; | 29 | import cn.monitor4all.logRecord.context.LogRecordContext; |
27 | 30 | ||
28 | -import org.springframework.beans.factory.annotation.Autowired; | ||
29 | - | ||
30 | -import javax.annotation.Resource; | ||
31 | - | ||
32 | /** | 31 | /** |
33 | * @Description: 出库单详情 | 32 | * @Description: 出库单详情 |
34 | * @Author: jeecg-boot | 33 | * @Author: jeecg-boot |
@@ -108,4 +107,15 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, | @@ -108,4 +107,15 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, | ||
108 | public boolean batchSave(List<ShipmentDetail> shipmentDetailList) { | 107 | public boolean batchSave(List<ShipmentDetail> shipmentDetailList) { |
109 | return this.saveBatch(shipmentDetailList); | 108 | return this.saveBatch(shipmentDetailList); |
110 | } | 109 | } |
110 | + | ||
111 | + @Override | ||
112 | + public boolean updateTaskQtyAndStatusById(BigDecimal taskQty, int status, int id) { | ||
113 | + ShipmentDetail shipmentDetail = new ShipmentDetail(); | ||
114 | + shipmentDetail.setTaskQty(taskQty); | ||
115 | + shipmentDetail.setStatus(status); | ||
116 | + shipmentDetail.setId(id); | ||
117 | + boolean success = updateById(shipmentDetail); | ||
118 | + return success; | ||
119 | + } | ||
120 | + | ||
111 | } | 121 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
@@ -193,7 +193,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | @@ -193,7 +193,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | ||
193 | // 尾状态是单据详情中最小的状态 | 193 | // 尾状态是单据详情中最小的状态 |
194 | shipmentHeader.setFirstStatus(maxStatus); | 194 | shipmentHeader.setFirstStatus(maxStatus); |
195 | shipmentHeader.setLastStatus(minStatus); | 195 | shipmentHeader.setLastStatus(minStatus); |
196 | - if (!shipmentHeaderService.updateById(shipmentHeader)) { | 196 | + if (!shipmentHeaderService.updateFirstStatusAndLastStatusById(maxStatus, minStatus, shipmentId)) { |
197 | throw new JeecgBootException("更新出库单:" + shipmentHeader.getCode() + " 头状态失败"); | 197 | throw new JeecgBootException("更新出库单:" + shipmentHeader.getCode() + " 头状态失败"); |
198 | } | 198 | } |
199 | LogRecordContext.putVariable("minStatus", minStatus); | 199 | LogRecordContext.putVariable("minStatus", minStatus); |
@@ -238,4 +238,14 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | @@ -238,4 +238,14 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, | ||
238 | return shipmentHeader; | 238 | return shipmentHeader; |
239 | } | 239 | } |
240 | 240 | ||
241 | + @Override | ||
242 | + public boolean updateFirstStatusAndLastStatusById(Integer firstStatus, Integer lastStatus, int id) { | ||
243 | + ShipmentHeader shipmentHeader = new ShipmentHeader(); | ||
244 | + shipmentHeader.setFirstStatus(firstStatus); | ||
245 | + shipmentHeader.setLastStatus(lastStatus); | ||
246 | + shipmentHeader.setId(id); | ||
247 | + boolean success = updateById(shipmentHeader); | ||
248 | + return success; | ||
249 | + } | ||
250 | + | ||
241 | } | 251 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -909,6 +909,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -909,6 +909,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
909 | if (!success) { | 909 | if (!success) { |
910 | return Result.error("取消任务失败, 删除任务失败"); | 910 | return Result.error("取消任务失败, 删除任务失败"); |
911 | } | 911 | } |
912 | + List<TaskDetail> taskDetailList = taskDetailService.getTaskDetailListByTaskId(taskId); | ||
913 | + if (taskDetailList.size() > 0) { | ||
914 | + List<Integer> taskDetailIdList = taskDetailList.stream().map(TaskDetail::getId).collect(Collectors.toList()); | ||
915 | + success = taskDetailService.removeByIds(taskDetailIdList); | ||
916 | + if (!success) { | ||
917 | + return Result.error("取消任务失败, 删除任务详情失败"); | ||
918 | + } | ||
919 | + } | ||
912 | Result result = Result.ok("取消任务成功"); | 920 | Result result = Result.ok("取消任务成功"); |
913 | switch (taskType) { | 921 | switch (taskType) { |
914 | case QuantityConstant.TASK_TYPE_WHOLERECEIPT: | 922 | case QuantityConstant.TASK_TYPE_WHOLERECEIPT: |
@@ -959,6 +967,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -959,6 +967,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
959 | @Override | 967 | @Override |
960 | @Transactional(rollbackFor = Exception.class) | 968 | @Transactional(rollbackFor = Exception.class) |
961 | public Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode) { | 969 | public Result<TaskHeader> createEmptyIn(String containerCode, String toLocationCode, String warehouseCode) { |
970 | + log.info("开始创建空托入库任务"); | ||
962 | if (StringUtils.isEmpty(containerCode)) { | 971 | if (StringUtils.isEmpty(containerCode)) { |
963 | return Result.error("创建空托盘入库时, 托盘号为空"); | 972 | return Result.error("创建空托盘入库时, 托盘号为空"); |
964 | } | 973 | } |
@@ -1004,6 +1013,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1004,6 +1013,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1004 | taskHeader.setToLocationCode(toLocationCode); | 1013 | taskHeader.setToLocationCode(toLocationCode); |
1005 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | 1014 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
1006 | success = taskHeaderService.save(taskHeader); | 1015 | success = taskHeaderService.save(taskHeader); |
1016 | + log.info("完成创建空托入库任务"); | ||
1007 | if (!success) { | 1017 | if (!success) { |
1008 | throw new JeecgBootException("创建空托盘入库时,保存任务失败"); | 1018 | throw new JeecgBootException("创建空托盘入库时,保存任务失败"); |
1009 | } | 1019 | } |
@@ -1503,6 +1513,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1503,6 +1513,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1503 | && inventoryDetail1.getLot().equals(inventoryDetail2.getLot()) && inventoryDetail1.getProject().equals(inventoryDetail2.getProject())) { | 1513 | && inventoryDetail1.getLot().equals(inventoryDetail2.getLot()) && inventoryDetail1.getProject().equals(inventoryDetail2.getProject())) { |
1504 | // 属性一样的库存,相加合并。 | 1514 | // 属性一样的库存,相加合并。 |
1505 | BigDecimal totalQty = inventoryDetail1.getQty().add(inventoryDetail2.getQty()); | 1515 | BigDecimal totalQty = inventoryDetail1.getQty().add(inventoryDetail2.getQty()); |
1516 | + inventoryDetail1.setQty(totalQty); | ||
1506 | InventoryDetail inventoryDetail = new InventoryDetail(); | 1517 | InventoryDetail inventoryDetail = new InventoryDetail(); |
1507 | inventoryDetail.setId(inventoryDetail1.getId()); | 1518 | inventoryDetail.setId(inventoryDetail1.getId()); |
1508 | inventoryDetail.setQty(totalQty); | 1519 | inventoryDetail.setQty(totalQty); |
@@ -1546,6 +1557,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1546,6 +1557,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1546 | @Override | 1557 | @Override |
1547 | @Transactional(rollbackFor = Exception.class) | 1558 | @Transactional(rollbackFor = Exception.class) |
1548 | public Result completeEmptyInTask(TaskHeader taskHeader) { | 1559 | public Result completeEmptyInTask(TaskHeader taskHeader) { |
1560 | + log.info("开始完成空托入库任务"); | ||
1549 | String warehouseCode = taskHeader.getWarehouseCode(); | 1561 | String warehouseCode = taskHeader.getWarehouseCode(); |
1550 | String toLocationCode = taskHeader.getToLocationCode(); | 1562 | String toLocationCode = taskHeader.getToLocationCode(); |
1551 | String containerCode = taskHeader.getContainerCode(); | 1563 | String containerCode = taskHeader.getContainerCode(); |
@@ -1574,8 +1586,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1574,8 +1586,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1574 | if (!success) { | 1586 | if (!success) { |
1575 | throw new JeecgBootException("完成空托盘入库任务时, 更新库位的容器编码和状态失败"); | 1587 | throw new JeecgBootException("完成空托盘入库任务时, 更新库位的容器编码和状态失败"); |
1576 | } | 1588 | } |
1577 | - taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | ||
1578 | - success = taskHeaderService.updateById(taskHeader); | 1589 | + success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); |
1590 | + log.info("完成空托入库任务"); | ||
1579 | if (!success) { | 1591 | if (!success) { |
1580 | throw new JeecgBootException("完成空托盘入库任务时, 更新任务失败"); | 1592 | throw new JeecgBootException("完成空托盘入库任务时, 更新任务失败"); |
1581 | } | 1593 | } |
@@ -2244,7 +2256,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -2244,7 +2256,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
2244 | public Result cancelShipmentTask(TaskHeader taskHeader) { | 2256 | public Result cancelShipmentTask(TaskHeader taskHeader) { |
2245 | boolean success = shipmentContainerHeaderService.cancelShipmentTask(taskHeader); | 2257 | boolean success = shipmentContainerHeaderService.cancelShipmentTask(taskHeader); |
2246 | if (!success) { | 2258 | if (!success) { |
2247 | - throw new JeecgBootException("取消入库任务时, 更新组盘头状态失败"); | 2259 | + throw new JeecgBootException("取消出库任务时, 更新组盘头状态失败"); |
2248 | } | 2260 | } |
2249 | return Result.ok("取消出库任务成功"); | 2261 | return Result.ok("取消出库任务成功"); |
2250 | } | 2262 | } |