Commit 051b1936b19ed06092832f78dba80195a425952e

Authored by 肖超群
1 parent 0404b57d

出库加入并发控制

huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/servuce/impl/MesServiceImpl.java
... ... @@ -223,7 +223,7 @@ public class MesServiceImpl implements IMesService {
223 223 if (!success) {
224 224 throw new JeecgBootException("MES下发出库信息,更新出库组盘头失败");
225 225 }
226   - Result result = shipmentCombinationService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber);
  226 + Result result = huahengMultiHandlerService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber);
227 227 if (!result.isSuccess()) {
228 228 throw new JeecgBootException(result.getMessage());
229 229 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/IHuahengMultiHandlerService.java
... ... @@ -3,6 +3,7 @@ package org.jeecg.modules.wms.framework.service;
3 3 import org.jeecg.common.api.vo.Result;
4 4 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
5 5 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel;
  6 +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
6 7 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam;
7 8 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
8 9  
... ... @@ -22,4 +23,6 @@ public interface IHuahengMultiHandlerService {
22 23 Result cancelCombine(Integer id);
23 24  
24 25 Result autoCombination(String shipmentCode, String warehouseCode);
  26 +
  27 + Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber);
25 28 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java
... ... @@ -13,6 +13,7 @@ import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContai
13 13 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
14 14 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel;
15 15 import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService;
  16 +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
16 17 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService;
17 18 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam;
18 19 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
... ... @@ -129,4 +130,16 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem
129 130 return result;
130 131 }
131 132  
  133 + @Override
  134 + public Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber) {
  135 + Result result = handleMultiProcess("createShipmentTask", new MultiProcessListener() {
  136 + @Override
  137 + public Result<?> doProcess() {
  138 + Result result = shipmentCombinationService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber);
  139 + return result;
  140 + }
  141 + });
  142 + return result;
  143 + }
  144 +
132 145 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryHeader.java
... ... @@ -99,8 +99,8 @@ public class InventoryHeader implements Serializable {
99 99 private Date updateTime;
100 100  
101 101 public void setTotalQty(BigDecimal totalQty) {
102   - if (totalQty.compareTo(BigDecimal.ZERO) <= 0) {
103   - throw new JeecgBootException("总数量必须大于0");
  102 + if (totalQty.compareTo(BigDecimal.ZERO) < 0) {
  103 + throw new JeecgBootException("总数量必须大于等于0");
104 104 }
105 105 this.totalQty = totalQty;
106 106 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptDetail.java
... ... @@ -134,7 +134,7 @@ public class ReceiptDetail implements Serializable {
134 134 }
135 135  
136 136 public void setTaskQty(BigDecimal taskQty) {
137   - if (qty.compareTo(BigDecimal.ZERO) < 0) {
  137 + if (taskQty.compareTo(BigDecimal.ZERO) < 0) {
138 138 throw new JeecgBootException("已收数量必须大于等于0");
139 139 }
140 140 this.taskQty = taskQty;
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java
... ... @@ -112,7 +112,7 @@ public class ShipmentCombinationController {
112 112 @ResponseBody
113 113 public Result createShipmentTask(@RequestBody ShipmentContainerHeader shipmentContainerHeader, HttpServletRequest req) {
114 114 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
115   - return shipmentCombinationService.createShipmentTask(shipmentContainerHeader, warehouseCode, 0, 0, 0);
  115 + return huahengMultiHandlerService.createShipmentTask(shipmentContainerHeader, warehouseCode, 0, 0, 0);
116 116 }
117 117  
118 118 /**
... ...