Commit 9ff7e1e3cc3c85da0e5fa96724df682243469f49

Authored by 肖超群
1 parent f4c5f733

1. 修复pda 呼叫料盒 没有锁库位的问题

2. 一些接口加上并发限制
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java
... ... @@ -10,6 +10,7 @@ import java.util.stream.Collectors;
10 10 import javax.annotation.Resource;
11 11  
12 12 import org.jeecg.common.api.vo.Result;
  13 +import org.jeecg.common.exception.JeecgBootException;
13 14 import org.jeecg.modules.wms.api.erp.entity.*;
14 15 import org.jeecg.modules.wms.api.erp.service.IErpService;
15 16 import org.jeecg.modules.wms.config.address.service.IAddressService;
... ... @@ -38,7 +39,6 @@ import org.springframework.stereotype.Service;
38 39 import org.springframework.transaction.annotation.Transactional;
39 40  
40 41 import com.alibaba.fastjson.JSON;
41   -import org.jeecg.common.exception.JeecgBootException;
42 42 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
43 43 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
44 44  
... ... @@ -399,6 +399,7 @@ public class ErpServiceImpl implements IErpService {
399 399 }
400 400  
401 401 @Override
  402 + @Transactional(rollbackFor = Exception.class)
402 403 public Result backReceipt(ReceiptHeader receiptHeader) {
403 404 if (receiptHeader == null) {
404 405 return Result.error("回传入库单, 入库单为空!!");
... ... @@ -436,6 +437,7 @@ public class ErpServiceImpl implements IErpService {
436 437 }
437 438  
438 439 @Override
  440 + @Transactional(rollbackFor = Exception.class)
439 441 public Result backShipment(ShipmentHeader shipmentHeader) {
440 442 if (shipmentHeader == null) {
441 443 return Result.error("回传出库单, 出库单为空!!");
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/IMobileService.java
... ... @@ -8,5 +8,6 @@ import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
8 8 public interface IMobileService {
9 9  
10 10 Result<TaskHeader> callBox(CallBoxBean bean, String warehouseCode);
  11 +
11 12 Result<TaskHeader> quickReceipt(QuickReceiptBean bean, String warehouseCode);
12 13 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/service/impl/MobileService.java
1 1 package org.jeecg.modules.wms.api.mobile.service.impl;
2 2  
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
3 6 import javax.annotation.Resource;
4 7  
5 8 import org.apache.commons.lang3.StringUtils;
6 9 import org.jeecg.common.api.vo.Result;
  10 +import org.jeecg.common.exception.JeecgBootException;
7 11 import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean;
8 12 import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean;
9 13 import org.jeecg.modules.wms.api.mobile.service.IMobileService;
10 14 import org.jeecg.modules.wms.config.container.entity.Container;
11 15 import org.jeecg.modules.wms.config.container.service.IContainerService;
12   -import org.jeecg.modules.wms.config.location.entity.Location;
13 16 import org.jeecg.modules.wms.config.location.service.ILocationService;
  17 +import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService;
14 18 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
15 19 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
16 20 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
... ... @@ -24,11 +28,6 @@ import org.springframework.beans.factory.annotation.Autowired;
24 28 import org.springframework.stereotype.Service;
25 29 import org.springframework.transaction.annotation.Transactional;
26 30  
27   -import org.jeecg.common.exception.JeecgBootException;
28   -
29   -import java.util.ArrayList;
30   -import java.util.List;
31   -
32 31 /**
33 32 */
34 33 @Service
... ... @@ -51,56 +50,47 @@ public class MobileService implements IMobileService {
51 50  
52 51 @Resource
53 52 private IReceiveService receiveService;
  53 + @Resource
  54 + private IParameterConfigurationService parameterConfigurationService;
54 55  
55 56 @Override
56 57 @Transactional(rollbackFor = Exception.class)
57 58 public Result<TaskHeader> callBox(CallBoxBean bean, String warehouseCode) {
  59 + String containerCode = bean.getContainerCode();
58 60 if (StringUtils.isEmpty(bean.getContainerCode())) {
59   - return Result.error("托盘号containerCode不能为空");
  61 + return Result.error("呼叫料盒,托盘号containerCode不能为空");
60 62 }
61 63  
62 64 if (StringUtils.isEmpty(bean.getLocationCode())) {
63   - return Result.error("库位locationCode不能为空");
  65 + return Result.error("呼叫料盒, 库位locationCode不能为空");
64 66 }
65 67  
66 68 if (StringUtils.isEmpty(bean.getCompanyCode())) {
67   - return Result.error("货主companyCode不能为空");
  69 + return Result.error("呼叫料盒, 货主companyCode不能为空");
68 70 }
69 71  
70   - if(StringUtils.isEmpty(bean.getPort())){
71   - return Result.error("出库口不能为空");
  72 + if (StringUtils.isEmpty(bean.getPort())) {
  73 + return Result.error("呼叫料盒, 出库口不能为空");
72 74 }
73   -
74   - Container container = containerService.getContainerByCode(bean.getContainerCode(), warehouseCode);
  75 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
75 76 if (container == null) {
76   - return Result.error(bean.getContainerCode() + " " + warehouseCode + "容器不存在");
  77 + return Result.error("呼叫料盒,容器为空");
77 78 }
78   -
79   - if (StringUtils.isEmpty(container.getLocationCode())) {
80   - return Result.error(bean.getContainerCode() + "容器不在库位上");
  79 + String fromLocationCode = container.getLocationCode();
  80 + String toLocationCode = QuantityConstant.EMPTY_STRING;
  81 + String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION);
  82 + int taskLocationRule = Integer.parseInt(value);
  83 + if (taskLocationRule == QuantityConstant.RULE_TASK_SET_LOCATION) {
  84 + toLocationCode = fromLocationCode;
81 85 }
82   -
83   - if (!container.getLocationCode().equals(bean.getLocationCode())) {
84   - return Result.error(bean.getContainerCode() + "容器不在库位[" + bean.getLocationCode() + "]上");
85   - }
86   -
87   - Location loc = locationService.getLocationByCode(bean.getLocationCode(), warehouseCode);
88   - // 校验目标地址
89   - if (loc == null) {
90   - return Result.error("目标库位不存在");
91   - }
92   - if (!QuantityConstant.STATUS_LOCATION_EMPTY.equals(loc.getStatus())) {
93   - return Result.error("目标库位非空闲");
94   - }
95   - // 判断托盘是否已经存在任务
96   - TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByContainerCode(bean.getContainerCode(), warehouseCode);
97   - if (taskHeader != null) {
98   - return Result.error("容器已存在任务");
  86 + Result result = taskHeaderService.createTaskLockContainerAndLocation(bean.getType(), containerCode, fromLocationCode, toLocationCode, warehouseCode);
  87 + if (!result.isSuccess()) {
  88 + throw new JeecgBootException(result.getMessage());
99 89 }
100 90  
101 91 // 创建主任务
102   - taskHeader = new TaskHeader();
103   - taskHeader.setWarehouseCode(loc.getWarehouseCode());
  92 + TaskHeader taskHeader = new TaskHeader();
  93 + taskHeader.setWarehouseCode(warehouseCode);
104 94 taskHeader.setCompanyCode(bean.getCompanyCode());
105 95 taskHeader.setToPortCode(bean.getPort());
106 96 if (bean.getType() == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) {
... ... @@ -112,14 +102,12 @@ public class MobileService implements IMobileService {
112 102 taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT);
113 103 taskHeader.setTaskType(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT);
114 104 }
115   - taskHeader.setContainerCode(container.getCode());
  105 + taskHeader.setContainerCode(containerCode);
116 106 taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD);
117   - taskHeader.setFromLocationCode(loc.getCode());
118   - if (taskHeaderService.save(taskHeader)) {
119   - // 锁定库位状态
120   - locationService.updateStatus(loc.getCode(), QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode);
121   - } else {
122   - throw new JeecgBootException("补充入库主表生成失败!");
  107 + taskHeader.setFromLocationCode(fromLocationCode);
  108 + taskHeader.setToLocationCode(toLocationCode);
  109 + if (!taskHeaderService.save(taskHeader)) {
  110 + throw new JeecgBootException("呼叫料盒, 保存任务失败");
123 111 }
124 112  
125 113 return Result.OK("呼叫料盒成功", taskHeader);
... ... @@ -141,7 +129,7 @@ public class MobileService implements IMobileService {
141 129 return Result.error("收货明细不能为空");
142 130 }
143 131  
144   - //创建入库单
  132 + // 创建入库单
145 133 ReceiptHeader receiptHeader = new ReceiptHeader();
146 134 receiptHeader.setType(bean.getReceiptType());
147 135 receiptHeader.setCompanyCode(bean.getCompanyCode());
... ... @@ -153,32 +141,32 @@ public class MobileService implements IMobileService {
153 141 } else {
154 142 throw new JeecgBootException(rs1.getMessage());
155 143 }
156   -
  144 + List<ReceiptDetail> receiptDetailList = bean.getReceiptDetails();
157 145 List<Receive> receiveList = new ArrayList<>();
158   - for (ReceiptDetail d : bean.getReceiptDetails()) {
159   - d.setReceiptId(receiptHeader.getId());
160   - Result rs2 = receiptDetailService.saveReceiptDetail(d);
161   - if(!rs2.isSuccess()) {
  146 + for (ReceiptDetail receiptDetail : receiptDetailList) {
  147 + receiptDetail.setReceiptId(receiptHeader.getId());
  148 + Result rs2 = receiptDetailService.saveReceiptDetail(receiptDetail);
  149 + if (!rs2.isSuccess()) {
162 150 throw new JeecgBootException(rs2.getMessage());
163 151 }
164   - Receive v = new Receive();
165   - v.setId(d.getId());
166   - v.setQty(d.getQty());
167   - v.setTaskQty(d.getQty());
168   - v.setInventoryStatus(d.getInventoryStatus());
169   - v.setMaterialCode(d.getMaterialCode());
170   - v.setMaterialName(d.getMaterialName());
171   - v.setBatch(d.getBatch());
172   - v.setMaterialSpec(d.getMaterialSpec());
173   - v.setMaterialUnit(d.getMaterialUnit());
174   - v.setContainerCode(bean.getContainerCode());
175   - receiveList.add(v);
  152 + Receive receive = new Receive();
  153 + receive.setId(receiptDetail.getId());
  154 + receive.setQty(receiptDetail.getQty());
  155 + receive.setTaskQty(receiptDetail.getQty());
  156 + receive.setInventoryStatus(receiptDetail.getInventoryStatus());
  157 + receive.setMaterialCode(receiptDetail.getMaterialCode());
  158 + receive.setMaterialName(receiptDetail.getMaterialName());
  159 + receive.setBatch(receiptDetail.getBatch());
  160 + receive.setMaterialSpec(receiptDetail.getMaterialSpec());
  161 + receive.setMaterialUnit(receiptDetail.getMaterialUnit());
  162 + receive.setContainerCode(bean.getContainerCode());
  163 + receiveList.add(receive);
176 164 }
177 165  
178 166 Result<TaskHeader> rs3 = receiveService.receivingAndCreateTask(receiveList, warehouseCode);
179   - if(rs3.isSuccess()) {
  167 + if (rs3.isSuccess()) {
180 168 return rs3;
181   - }else{
  169 + } else {
182 170 throw new JeecgBootException(rs3.getMessage());
183 171 }
184 172 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/IHuahengMultiHandlerService.java
1 1 package org.jeecg.modules.wms.framework.service;
2 2  
3 3 import org.jeecg.common.api.vo.Result;
  4 +import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean;
  5 +import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean;
4 6 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
  7 +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
5 8 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel;
6 9 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
7 10 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam;
  11 +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
8 12 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
9 13  
10 14 /**
... ... @@ -25,4 +29,12 @@ public interface IHuahengMultiHandlerService {
25 29 Result autoCombination(String shipmentCode, String warehouseCode);
26 30  
27 31 Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber);
  32 +
  33 + Result callBox(CallBoxBean bean, String warehouseCode);
  34 +
  35 + Result quickReceipt(QuickReceiptBean bean, String warehouseCode);
  36 +
  37 + Result backReceipt(ReceiptHeader receiptHeader);
  38 +
  39 + Result backShipment(ShipmentHeader shipmentHeader);
28 40 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java
... ... @@ -5,18 +5,24 @@ import java.math.BigDecimal;
5 5 import javax.annotation.Resource;
6 6  
7 7 import org.jeecg.common.api.vo.Result;
  8 +import org.jeecg.modules.wms.api.erp.service.IErpService;
  9 +import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean;
  10 +import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean;
  11 +import org.jeecg.modules.wms.api.mobile.service.IMobileService;
8 12 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
9 13 import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
10 14 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
11 15 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
12 16 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader;
13 17 import org.jeecg.modules.wms.receipt.receiptContainerHeader.service.IReceiptContainerHeaderService;
  18 +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
14 19 import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel;
15 20 import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService;
16 21 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
17 22 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService;
18 23 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.CombinationParam;
19 24 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
  25 +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
20 26 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService;
21 27 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
22 28 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
... ... @@ -41,6 +47,10 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem
41 47 private IInventoryDetailService inventoryDetailService;
42 48 @Resource
43 49 private IShipmentContainerHeaderService shipmentContainerHeaderService;
  50 + @Resource
  51 + private IMobileService mobileService;
  52 + @Resource
  53 + private IErpService erpService;
44 54  
45 55 @Override
46 56 @Transactional(rollbackFor = Exception.class)
... ... @@ -119,6 +129,7 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem
119 129 }
120 130  
121 131 @Override
  132 + @Transactional(rollbackFor = Exception.class)
122 133 public Result autoCombination(String shipmentCode, String warehouseCode) {
123 134 Result result = handleMultiProcess("combination", new MultiProcessListener() {
124 135 @Override
... ... @@ -131,6 +142,7 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem
131 142 }
132 143  
133 144 @Override
  145 + @Transactional(rollbackFor = Exception.class)
134 146 public Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber) {
135 147 Result result = handleMultiProcess("createShipmentTask", new MultiProcessListener() {
136 148 @Override
... ... @@ -142,4 +154,58 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem
142 154 return result;
143 155 }
144 156  
  157 + @Override
  158 + @Transactional(rollbackFor = Exception.class)
  159 + public Result callBox(CallBoxBean bean, String warehouseCode) {
  160 + String lockKey = warehouseCode;
  161 + Result result = handleMultiProcess("callBox", lockKey, new MultiProcessListener() {
  162 + @Override
  163 + public Result<?> doProcess() {
  164 + Result result = mobileService.callBox(bean, warehouseCode);
  165 + return result;
  166 + }
  167 + });
  168 + return result;
  169 + }
  170 +
  171 + @Override
  172 + @Transactional(rollbackFor = Exception.class)
  173 + public Result quickReceipt(QuickReceiptBean bean, String warehouseCode) {
  174 + String lockKey = warehouseCode;
  175 + Result result = handleMultiProcess("quickReceipt", lockKey, new MultiProcessListener() {
  176 + @Override
  177 + public Result<?> doProcess() {
  178 + Result result = mobileService.quickReceipt(bean, warehouseCode);
  179 + return result;
  180 + }
  181 + });
  182 + return result;
  183 + }
  184 +
  185 + @Override
  186 + @Transactional(rollbackFor = Exception.class)
  187 + public Result backReceipt(ReceiptHeader receiptHeader) {
  188 + Result result = handleMultiProcess("backReceipt", new MultiProcessListener() {
  189 + @Override
  190 + public Result<?> doProcess() {
  191 + Result result = erpService.backReceipt(receiptHeader);
  192 + return result;
  193 + }
  194 + });
  195 + return result;
  196 + }
  197 +
  198 + @Override
  199 + @Transactional(rollbackFor = Exception.class)
  200 + public Result backShipment(ShipmentHeader shipmentHeader) {
  201 + Result result = handleMultiProcess("backShipment", new MultiProcessListener() {
  202 + @Override
  203 + public Result<?> doProcess() {
  204 + Result result = erpService.backShipment(shipmentHeader);
  205 + return result;
  206 + }
  207 + });
  208 + return result;
  209 + }
  210 +
145 211 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/ErpTask.java
1 1 package org.jeecg.modules.wms.monitor.job;
2 2  
3   -import java.util.HashMap;
4 3 import java.util.List;
5   -import java.util.Map;
6 4  
7 5 import javax.annotation.Resource;
8 6  
9   -import org.apache.commons.collections.MapUtils;
10 7 import org.jeecg.modules.wms.api.erp.service.IErpService;
  8 +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
11 9 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
12 10 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService;
13 11 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader;
14 12 import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService;
15 13 import org.jeecg.utils.constant.QuantityConstant;
16   -import org.quartz.DisallowConcurrentExecution;
17   -import org.quartz.Job;
18   -import org.quartz.JobExecutionContext;
19   -import org.quartz.JobExecutionException;
20   -import org.quartz.PersistJobDataAfterExecution;
  14 +import org.quartz.*;
21 15  
22 16 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
23 17 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
... ... @@ -42,6 +36,8 @@ public class ErpTask implements Job {
42 36  
43 37 @Resource
44 38 private IErpService erpService;
  39 + @Resource
  40 + private IHuahengMultiHandlerService huahengMultiHandlerService;
45 41  
46 42 @Override
47 43 public void execute(JobExecutionContext context) throws JobExecutionException {
... ... @@ -51,7 +47,7 @@ public class ErpTask implements Job {
51 47 List<ReceiptHeader> receiptHeaderList = receiptHeaderService.list(receiptHeaderLambdaQueryWrapper);
52 48 for (ReceiptHeader receiptHeader : receiptHeaderList) {
53 49 try {
54   - erpService.backReceipt(receiptHeader);
  50 + huahengMultiHandlerService.backReceipt(receiptHeader);
55 51 } catch (Exception e) {
56 52 e.printStackTrace();
57 53 }
... ... @@ -63,7 +59,7 @@ public class ErpTask implements Job {
63 59 List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(shipmentHeaderLambdaQueryWrapper);
64 60 for (ShipmentHeader shipmentHeader : shipmentHeaderList) {
65 61 try {
66   - erpService.backShipment(shipmentHeader);
  62 + huahengMultiHandlerService.backShipment(shipmentHeader);
67 63 } catch (Exception e) {
68 64 e.printStackTrace();
69 65 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
... ... @@ -137,7 +137,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl&lt;ReceiptContai
137 137 // 锁定容器和库位
138 138 Result result = taskHeaderService.createTaskLockContainerAndLocation(taskType, containerCode, fromLocationCode, toLocationCode, warehouseCode);
139 139 if (!result.isSuccess()) {
140   - return result;
  140 + throw new JeecgBootException(result.getMessage());
141 141 }
142 142 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
143 143 String zoneCode = taskLockEntity.getZoneCode();
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
... ... @@ -24,6 +24,7 @@ import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean;
24 24 import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean;
25 25 import org.jeecg.modules.wms.api.mobile.service.IMobileService;
26 26 import org.jeecg.modules.wms.config.material.service.IMaterialService;
  27 +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
27 28 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
28 29 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
29 30 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
... ... @@ -80,6 +81,8 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
80 81 private IMaterialService materialService;
81 82 @Resource
82 83 private IErpService erpService;
  84 + @Resource
  85 + private IHuahengMultiHandlerService huahengMultiHandlerService;
83 86  
84 87 /*---------------------------------主表处理-begin-------------------------------------*/
85 88  
... ... @@ -357,7 +360,7 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
357 360 @RequiresPermissions("receiptHeader:back")
358 361 @RequestMapping(value = "/backErpReceipt", method = {RequestMethod.PUT, RequestMethod.POST})
359 362 public Result<?> backErpReceipt(@RequestBody ReceiptHeader receiptHeader) {
360   - return erpService.backReceipt(receiptHeader);
  363 + return huahengMultiHandlerService.backReceipt(receiptHeader);
361 364 }
362 365  
363 366 @AutoLog(value = "PDA入库-快速入库")
... ... @@ -368,9 +371,8 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
368 371 public Result<?> quickReceipt(@RequestBody QuickReceiptBean bean, HttpServletRequest req) {
369 372 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
370 373 bean.setWarehouseCode(warehouseCode);
371   -
372   - return mobileService.quickReceipt(bean, warehouseCode);
373   -
  374 + Result result = huahengMultiHandlerService.quickReceipt(bean, warehouseCode);
  375 + return result;
374 376 }
375 377  
376 378 @AutoLog(value = "PDA入库-呼叫料盒")
... ... @@ -382,6 +384,7 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
382 384 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
383 385 // 补充入库类型
384 386 bean.setType(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT);
385   - return mobileService.callBox(bean, warehouseCode);
  387 + Result result = huahengMultiHandlerService.callBox(bean, warehouseCode);
  388 + return result;
386 389 }
387 390 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... ... @@ -512,7 +512,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
512 512 // 锁定容器、库位
513 513 Result result = taskHeaderService.createTaskLockContainerAndLocation(taskType, containerCode, fromLocationCode, toLocationCode, warehouseCode);
514 514 if (!result.isSuccess()) {
515   - return result;
  515 + throw new JeecgBootException(result.getMessage());
516 516 }
517 517 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
518 518 String zoneCode = taskLockEntity.getZoneCode();
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... ... @@ -24,6 +24,7 @@ import org.jeecg.common.util.oConvertUtils;
24 24 import org.jeecg.modules.wms.api.erp.service.IErpService;
25 25 import org.jeecg.modules.wms.api.mobile.entity.CallBoxBean;
26 26 import org.jeecg.modules.wms.api.mobile.service.IMobileService;
  27 +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
27 28 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
28 29 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
29 30 import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
... ... @@ -40,16 +41,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
40 41 import org.jeecgframework.poi.excel.entity.ImportParams;
41 42 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
42 43 import org.springframework.beans.factory.annotation.Autowired;
43   -import org.springframework.web.bind.annotation.DeleteMapping;
44   -import org.springframework.web.bind.annotation.GetMapping;
45   -import org.springframework.web.bind.annotation.PathVariable;
46   -import org.springframework.web.bind.annotation.PostMapping;
47   -import org.springframework.web.bind.annotation.RequestBody;
48   -import org.springframework.web.bind.annotation.RequestMapping;
49   -import org.springframework.web.bind.annotation.RequestMethod;
50   -import org.springframework.web.bind.annotation.RequestParam;
51   -import org.springframework.web.bind.annotation.ResponseBody;
52   -import org.springframework.web.bind.annotation.RestController;
  44 +import org.springframework.web.bind.annotation.*;
53 45 import org.springframework.web.multipart.MultipartFile;
54 46 import org.springframework.web.multipart.MultipartHttpServletRequest;
55 47 import org.springframework.web.servlet.ModelAndView;
... ... @@ -89,6 +81,8 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
89 81 private IErpService erpService;
90 82 @Resource
91 83 private IInventoryDetailService inventoryDetailService;
  84 + @Resource
  85 + private IHuahengMultiHandlerService huahengMultiHandlerService;
92 86  
93 87 /*---------------------------------主表处理-begin-------------------------------------*/
94 88  
... ... @@ -378,7 +372,7 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
378 372 @RequiresPermissions("shipmentHeader:back")
379 373 @RequestMapping(value = "/backErpShipment", method = {RequestMethod.PUT, RequestMethod.POST})
380 374 public Result<?> backErpShipment(@RequestBody ShipmentHeader shipmentHeader) {
381   - return erpService.backShipment(shipmentHeader);
  375 + return huahengMultiHandlerService.backShipment(shipmentHeader);
382 376 }
383 377  
384 378 @AutoLog(value = "PDA出库-呼叫料盒")
... ... @@ -390,6 +384,7 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
390 384 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
391 385 // 补充入库类型
392 386 bean.setType(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT);
393   - return mobileService.callBox(bean, warehouseCode);
  387 + Result result = huahengMultiHandlerService.callBox(bean, warehouseCode);
  388 + return result;
394 389 }
395 390 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... ... @@ -227,7 +227,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
227 227 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_CYCLECOUNT, containerCode, fromLocationCode, toLocationCode,
228 228 warehouseCode);
229 229 if (!result.isSuccess()) {
230   - return result;
  230 + throw new JeecgBootException(result.getMessage());
231 231 }
232 232 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
233 233 String zoneCode = taskLockEntity.getZoneCode();
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -257,7 +257,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
257 257 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_TRANSFER, containerCode, fromLocationCode, toLocationCode,
258 258 warehouseCode);
259 259 if (!result.isSuccess()) {
260   - return result;
  260 + throw new JeecgBootException(result.getMessage());
261 261 }
262 262 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
263 263 String zoneCode = taskLockEntity.getZoneCode();
... ... @@ -308,7 +308,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
308 308 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_CHECK_OUT, containerCode, fromLocationCode, toLocationCode,
309 309 warehouseCode);
310 310 if (!result.isSuccess()) {
311   - return result;
  311 + throw new JeecgBootException(result.getMessage());
312 312 }
313 313 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
314 314 String zoneCode = taskLockEntity.getZoneCode();
... ... @@ -380,7 +380,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
380 380 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_OVER_STATION, containerCode, QuantityConstant.EMPTY_STRING,
381 381 QuantityConstant.EMPTY_STRING, warehouseCode);
382 382 if (!result.isSuccess()) {
383   - return result;
  383 + throw new JeecgBootException(result.getMessage());
384 384 }
385 385 TaskHeader taskHeader = new TaskHeader();
386 386 taskHeader.setWarehouseCode(warehouseCode);
... ... @@ -476,7 +476,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
476 476 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT, containerCode,
477 477 QuantityConstant.EMPTY_STRING, toLocationCode, warehouseCode);
478 478 if (!result.isSuccess()) {
479   - return result;
  479 + throw new JeecgBootException(result.getMessage());
480 480 }
481 481 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
482 482 String zoneCode = taskLockEntity.getZoneCode();
... ... @@ -512,7 +512,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
512 512 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT, containerCode,
513 513 QuantityConstant.EMPTY_STRING, QuantityConstant.EMPTY_STRING, warehouseCode);
514 514 if (!result.isSuccess()) {
515   - return result;
  515 + throw new JeecgBootException(result.getMessage());
516 516 }
517 517 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
518 518 String zoneCode = taskLockEntity.getZoneCode();
... ... @@ -912,7 +912,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
912 912 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_EMPTYRECEIPT, containerCode, QuantityConstant.EMPTY_STRING,
913 913 toLocationCode, warehouseCode);
914 914 if (!result.isSuccess()) {
915   - return result;
  915 + throw new JeecgBootException(result.getMessage());
916 916 }
917 917 TaskHeader taskHeader = new TaskHeader();
918 918 taskHeader.setWarehouseCode(warehouseCode);
... ... @@ -954,7 +954,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
954 954 Result result = taskHeaderService.createTaskLockContainerAndLocation(QuantityConstant.TASK_TYPE_EMPTYSHIPMENT, containerCode, QuantityConstant.EMPTY_STRING,
955 955 QuantityConstant.EMPTY_STRING, warehouseCode);
956 956 if (!result.isSuccess()) {
957   - return result;
  957 + throw new JeecgBootException(result.getMessage());
958 958 }
959 959 TaskLockEntity taskLockEntity = (TaskLockEntity)result.getResult();
960 960 String zoneCode = taskLockEntity.getZoneCode();
... ... @@ -1011,7 +1011,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1011 1011 return Result.ok("入库任务(" + taskHeader.getId() + ")已经是完成的!");
1012 1012 }
1013 1013 if (taskDetailList.isEmpty()) {
1014   - throw new JeecgBootException("入库任务明细为空");
  1014 + throw new JeecgBootException("完成入库任务时, 入库任务明细为空");
1015 1015 }
1016 1016 Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode);
1017 1017 if (toLocation == null) {
... ... @@ -1442,6 +1442,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1442 1442 case QuantityConstant.TASK_TYPE_OVER_STATION:
1443 1443 result = taskHeaderService.createOverStationTaskLockContainer(containerCode, warehouseCode);
1444 1444 break;
  1445 + default:
  1446 + throw new JeecgBootException("创建任务时,没有匹配到这种任务类型" + taskType);
1445 1447 }
1446 1448 return result;
1447 1449 }
... ...