Commit 688f82333edf87427793bd6c0d13e7b03dcdeca4
1 parent
92aad0a8
修改接口。需要接口传仓库编码
Showing
10 changed files
with
81 additions
and
88 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/controller/ErpController.java
... | ... | @@ -14,11 +14,7 @@ import org.jeecg.modules.wms.config.material.entity.Material; |
14 | 14 | import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; |
15 | 15 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
16 | 16 | import org.jeecg.utils.HuahengJwtUtil; |
17 | -import org.springframework.web.bind.annotation.PostMapping; | |
18 | -import org.springframework.web.bind.annotation.RequestBody; | |
19 | -import org.springframework.web.bind.annotation.RequestMapping; | |
20 | -import org.springframework.web.bind.annotation.ResponseBody; | |
21 | -import org.springframework.web.bind.annotation.RestController; | |
17 | +import org.springframework.web.bind.annotation.*; | |
22 | 18 | |
23 | 19 | /** |
24 | 20 | * @author 游杰 |
... | ... | @@ -33,9 +29,9 @@ public class ErpController extends HuahengBaseController { |
33 | 29 | @PostMapping("/receipt") |
34 | 30 | @ResponseBody |
35 | 31 | @ApiLogger(apiName = "入库单下发", from = "ERP") |
36 | - public Result receipt(@RequestBody ErpReceipt erpReceipt, HttpServletRequest req) { | |
37 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
38 | - return erpService.receipt(erpReceipt, warehouseCode); | |
32 | + public Result receipt(@RequestBody ErpReceipt erpReceipt, @RequestHeader(value = "token", required = false) String token) { | |
33 | + String operator = HuahengJwtUtil.getAudienceByToken(token); | |
34 | + return erpService.receipt(erpReceipt, operator); | |
39 | 35 | } |
40 | 36 | |
41 | 37 | @PostMapping("/cancelReceipt") |
... | ... | @@ -43,16 +39,15 @@ public class ErpController extends HuahengBaseController { |
43 | 39 | @ApiLogger(apiName = "取消入库单", from = "ERP") |
44 | 40 | public Result cancelReceipt(@RequestBody Map<String, String> param, HttpServletRequest req) { |
45 | 41 | String referCode = param.get("referCode"); |
46 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
42 | + String warehouseCode = param.get("warehouseCode"); | |
47 | 43 | return erpService.cancelReceipt(referCode, warehouseCode); |
48 | 44 | } |
49 | 45 | |
50 | 46 | @PostMapping("/shipment") |
51 | 47 | @ResponseBody |
52 | 48 | @ApiLogger(apiName = "出库单下发", from = "ERP") |
53 | - public Result shipment(@RequestBody ErpShipment erpShipment, HttpServletRequest req) { | |
54 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
55 | - return erpService.shipment(erpShipment, warehouseCode); | |
49 | + public Result shipment(@RequestBody ErpShipment erpShipment) { | |
50 | + return erpService.shipment(erpShipment); | |
56 | 51 | } |
57 | 52 | |
58 | 53 | @PostMapping("/cancelShipment") |
... | ... | @@ -60,7 +55,7 @@ public class ErpController extends HuahengBaseController { |
60 | 55 | @ApiLogger(apiName = "取消出库单", from = "ERP") |
61 | 56 | public Result cancelShipment(@RequestBody Map<String, String> param, HttpServletRequest req) { |
62 | 57 | String referCode = param.get("referCode"); |
63 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
58 | + String warehouseCode = param.get("warehouseCode"); | |
64 | 59 | return erpService.cancelShipment(referCode, warehouseCode); |
65 | 60 | } |
66 | 61 | |
... | ... | @@ -75,8 +70,7 @@ public class ErpController extends HuahengBaseController { |
75 | 70 | @PostMapping("/addMaterial") |
76 | 71 | @ResponseBody |
77 | 72 | @ApiLogger(apiName = "增加物料", from = "ERP") |
78 | - public Result addMaterial(@RequestBody Material material, HttpServletRequest req) { | |
79 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
80 | - return erpService.addMaterial(material, warehouseCode); | |
73 | + public Result addMaterial(@RequestBody Material material) { | |
74 | + return erpService.addMaterial(material); | |
81 | 75 | } |
82 | 76 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/entity/ErpReceiptHeader.java
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/entity/ErpShipmentHeader.java
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/IErpService.java
... | ... | @@ -13,7 +13,7 @@ public interface IErpService { |
13 | 13 | /** |
14 | 14 | * 下发入库单 |
15 | 15 | */ |
16 | - public Result receipt(ErpReceipt erpReceipt, String warehouseCode); | |
16 | + public Result receipt(ErpReceipt erpReceipt, String operator); | |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * 取消入库单 |
... | ... | @@ -23,7 +23,7 @@ public interface IErpService { |
23 | 23 | /** |
24 | 24 | * 取消出库单 |
25 | 25 | */ |
26 | - public Result shipment(ErpShipment erpShipment, String warehouseCode); | |
26 | + public Result shipment(ErpShipment erpShipment); | |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * 取消出库单 |
... | ... | @@ -38,7 +38,7 @@ public interface IErpService { |
38 | 38 | /** |
39 | 39 | * 增加物料信息 |
40 | 40 | */ |
41 | - public Result addMaterial(Material material, String warehouseCode); | |
41 | + public Result addMaterial(Material material); | |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * 回传入库单 |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/service/impl/ErpServiceImpl.java
... | ... | @@ -10,16 +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.modules.wms.api.erp.entity.ErpBackReceipt; | |
14 | -import org.jeecg.modules.wms.api.erp.entity.ErpBackShipment; | |
15 | -import org.jeecg.modules.wms.api.erp.entity.ErpReceipt; | |
16 | -import org.jeecg.modules.wms.api.erp.entity.ErpReceiptDetail; | |
17 | -import org.jeecg.modules.wms.api.erp.entity.ErpReceiptHeader; | |
18 | -import org.jeecg.modules.wms.api.erp.entity.ErpShipment; | |
19 | -import org.jeecg.modules.wms.api.erp.entity.ErpShipmentDetail; | |
20 | -import org.jeecg.modules.wms.api.erp.entity.ErpShipmentHeader; | |
21 | -import org.jeecg.modules.wms.api.erp.entity.InventoryQueryParam; | |
22 | -import org.jeecg.modules.wms.api.erp.entity.InventorySummary; | |
13 | +import org.jeecg.modules.wms.api.erp.entity.*; | |
23 | 14 | import org.jeecg.modules.wms.api.erp.service.IErpService; |
24 | 15 | import org.jeecg.modules.wms.config.address.service.IAddressService; |
25 | 16 | import org.jeecg.modules.wms.config.company.entity.Company; |
... | ... | @@ -79,15 +70,8 @@ public class ErpServiceImpl implements IErpService { |
79 | 70 | |
80 | 71 | @Override |
81 | 72 | @Transactional(rollbackFor = Exception.class) |
82 | - public Result receipt(ErpReceipt erpReceipt, String warehouseCode) { | |
73 | + public Result receipt(ErpReceipt erpReceipt, String operator) { | |
83 | 74 | boolean success = false; |
84 | - if (StringUtils.isEmpty(warehouseCode)) { | |
85 | - return Result.error("入库单下发,仓库编码为空"); | |
86 | - } | |
87 | - Warehouse warehouse = warehouseService.getWarehouseByCode(warehouseCode); | |
88 | - if (warehouse == null) { | |
89 | - return Result.error("入库单下发, 没有找到仓库"); | |
90 | - } | |
91 | 75 | if (erpReceipt == null) { |
92 | 76 | return Result.error("入库单下发,没有传receipt"); |
93 | 77 | } |
... | ... | @@ -99,11 +83,19 @@ public class ErpServiceImpl implements IErpService { |
99 | 83 | if (erpReceiptDetailList == null) { |
100 | 84 | return Result.error("入库单下发,没有传receiptDetailList"); |
101 | 85 | } |
86 | + String warehouseCode = erpReceiptHeader.getWarehouseCode(); | |
102 | 87 | String receiptType = erpReceiptHeader.getReceiptType(); |
103 | 88 | String referCode = erpReceiptHeader.getReferCode(); |
104 | 89 | String companyCode = erpReceiptHeader.getCompanyCode(); |
105 | 90 | String remark = erpReceiptHeader.getRemark(); |
106 | 91 | String supplierCode = erpReceiptHeader.getSupplierCode(); |
92 | + if (StringUtils.isEmpty(warehouseCode)) { | |
93 | + return Result.error("入库单下发,仓库编码为空"); | |
94 | + } | |
95 | + Warehouse warehouse = warehouseService.getWarehouseByCode(warehouseCode); | |
96 | + if (warehouse == null) { | |
97 | + return Result.error("入库单下发, 没有找到仓库"); | |
98 | + } | |
107 | 99 | if (StringUtils.isEmpty(receiptType)) { |
108 | 100 | return Result.error("入库单下发, receiptType为空"); |
109 | 101 | } |
... | ... | @@ -129,6 +121,7 @@ public class ErpServiceImpl implements IErpService { |
129 | 121 | receiptHeader.setReferCode(referCode); |
130 | 122 | receiptHeader.setSupplierCode(supplierCode); |
131 | 123 | receiptHeader.setRemark(remark); |
124 | + receiptHeader.setCreateBy(operator); | |
132 | 125 | Result result = receiptHeaderService.saveReceiptHeader(receiptHeader); |
133 | 126 | if (!result.isSuccess()) { |
134 | 127 | throw new ServiceException("创建入库单头失败" + result.getMessage()); |
... | ... | @@ -181,6 +174,7 @@ public class ErpServiceImpl implements IErpService { |
181 | 174 | receiptDetail.setBatch(batch); |
182 | 175 | receiptDetail.setLot(lot); |
183 | 176 | receiptDetail.setProject(project); |
177 | + receiptDetail.setCreateBy(operator); | |
184 | 178 | success = receiptDetailService.save(receiptDetail); |
185 | 179 | if (!success) { |
186 | 180 | throw new ServiceException("入库单下发, 保存入库单详情失败"); |
... | ... | @@ -206,7 +200,7 @@ public class ErpServiceImpl implements IErpService { |
206 | 200 | if (receiptHeader == null) { |
207 | 201 | return Result.error("入库单取消, 没有找到入库单"); |
208 | 202 | } |
209 | - boolean success = receiptHeaderService.delMain(String.valueOf(receiptHeader.getId()),QuantityConstant.UPSTREAM_DELETE_RECEIPT); | |
203 | + boolean success = receiptHeaderService.delMain(String.valueOf(receiptHeader.getId()), QuantityConstant.UPSTREAM_DELETE_RECEIPT); | |
210 | 204 | if (!success) { |
211 | 205 | return Result.error("入库单取消失败"); |
212 | 206 | } |
... | ... | @@ -215,14 +209,7 @@ public class ErpServiceImpl implements IErpService { |
215 | 209 | |
216 | 210 | @Override |
217 | 211 | @Transactional(rollbackFor = Exception.class) |
218 | - public Result shipment(ErpShipment erpShipment, String warehouseCode) { | |
219 | - if (StringUtils.isEmpty(warehouseCode)) { | |
220 | - return Result.error("出库单下发,仓库编码为空"); | |
221 | - } | |
222 | - Warehouse warehouse = warehouseService.getWarehouseByCode(warehouseCode); | |
223 | - if (warehouse == null) { | |
224 | - return Result.error("出库单下发, 没有找到仓库"); | |
225 | - } | |
212 | + public Result shipment(ErpShipment erpShipment) { | |
226 | 213 | if (erpShipment == null) { |
227 | 214 | return Result.error("出库单下发,没有传shipment"); |
228 | 215 | } |
... | ... | @@ -239,6 +226,14 @@ public class ErpServiceImpl implements IErpService { |
239 | 226 | String companyCode = erpShipmentHeader.getCompanyCode(); |
240 | 227 | String remark = erpShipmentHeader.getRemark(); |
241 | 228 | String customerCode = erpShipmentHeader.getCustomerCode(); |
229 | + String warehouseCode = erpShipmentHeader.getWarehouseCode(); | |
230 | + if (StringUtils.isEmpty(warehouseCode)) { | |
231 | + return Result.error("出库单下发,仓库编码为空"); | |
232 | + } | |
233 | + Warehouse warehouse = warehouseService.getWarehouseByCode(warehouseCode); | |
234 | + if (warehouse == null) { | |
235 | + return Result.error("出库单下发, 没有找到仓库"); | |
236 | + } | |
242 | 237 | if (StringUtils.isEmpty(shipmentType)) { |
243 | 238 | return Result.error("出库单下发, shipmentType为空"); |
244 | 239 | } |
... | ... | @@ -387,22 +382,21 @@ public class ErpServiceImpl implements IErpService { |
387 | 382 | |
388 | 383 | @Override |
389 | 384 | @Transactional(rollbackFor = Exception.class) |
390 | - public Result addMaterial(Material material, String warehouseCode) { | |
385 | + public Result addMaterial(Material material) { | |
391 | 386 | if (StringUtils.isEmpty(material.getCode())) { |
392 | 387 | return Result.error("增加物料失败, 物料编码不能为空!!"); |
393 | 388 | } |
394 | 389 | if (StringUtils.isEmpty(material.getName())) { |
395 | 390 | return Result.error("增加物料失败, 物料名称不能为空!!"); |
396 | 391 | } |
397 | - if (StringUtils.isEmpty(warehouseCode)) { | |
392 | + if (StringUtils.isEmpty(material.getWarehouseCode())) { | |
398 | 393 | return Result.error("增加物料失败, 仓库编码不能为空!!"); |
399 | 394 | } |
400 | 395 | |
401 | - Warehouse warehouse = warehouseService.getWarehouseByCode(warehouseCode); | |
396 | + Warehouse warehouse = warehouseService.getWarehouseByCode(material.getWarehouseCode()); | |
402 | 397 | if (warehouse == null) { |
403 | 398 | return Result.error("增加物料失败, 仓库为空!!"); |
404 | 399 | } |
405 | - material.setWarehouseCode(warehouseCode); | |
406 | 400 | material.setEnable(QuantityConstant.STATUS_ENABLE); |
407 | 401 | Material material1 = materialService.getMaterialByCode(material.getCode()); |
408 | 402 | if (material1 != null) { |
... | ... | @@ -412,7 +406,7 @@ public class ErpServiceImpl implements IErpService { |
412 | 406 | if (!success) { |
413 | 407 | throw new ServiceException("增加物料失败, 保存时报错"); |
414 | 408 | } |
415 | - return Result.error("增加物料成功"); | |
409 | + return Result.ok("增加物料成功"); | |
416 | 410 | } |
417 | 411 | |
418 | 412 | @Override |
... | ... | @@ -444,7 +438,7 @@ public class ErpServiceImpl implements IErpService { |
444 | 438 | if (!success) { |
445 | 439 | throw new ServiceException("回传入库单失败, 更新入库单头失败"); |
446 | 440 | } |
447 | - receiptHeaderService.delMain(receiptHeader.getId().toString(),QuantityConstant.BACK_DELETE_RECEIPT); | |
441 | + receiptHeaderService.delMain(receiptHeader.getId().toString(), QuantityConstant.BACK_DELETE_RECEIPT); | |
448 | 442 | return Result.ok("回传入库单成功"); |
449 | 443 | } |
450 | 444 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/controller/MesController.java
... | ... | @@ -16,11 +16,7 @@ import org.jeecg.modules.wms.api.mes.servuce.IMesService; |
16 | 16 | import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; |
17 | 17 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
18 | 18 | import org.jeecg.utils.HuahengJwtUtil; |
19 | -import org.springframework.web.bind.annotation.PostMapping; | |
20 | -import org.springframework.web.bind.annotation.RequestBody; | |
21 | -import org.springframework.web.bind.annotation.RequestMapping; | |
22 | -import org.springframework.web.bind.annotation.ResponseBody; | |
23 | -import org.springframework.web.bind.annotation.RestController; | |
19 | +import org.springframework.web.bind.annotation.*; | |
24 | 20 | |
25 | 21 | /** |
26 | 22 | * @author 游杰 |
... | ... | @@ -37,26 +33,25 @@ public class MesController extends HuahengBaseController { |
37 | 33 | @PostMapping("/receipt") |
38 | 34 | @ResponseBody |
39 | 35 | @ApiLogger(apiName = "入库单下发", from = "MES") |
40 | - public Result receipt(@RequestBody ErpReceipt erpReceipt, HttpServletRequest req) { | |
41 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
42 | - return erpService.receipt(erpReceipt, warehouseCode); | |
36 | + public Result receipt(@RequestBody ErpReceipt erpReceipt, @RequestHeader(value = "token", required = false) String token) { | |
37 | + String operator = HuahengJwtUtil.getAudienceByToken(token); | |
38 | + return erpService.receipt(erpReceipt, operator); | |
43 | 39 | } |
44 | 40 | |
45 | 41 | @PostMapping("/cancelReceipt") |
46 | 42 | @ResponseBody |
47 | 43 | @ApiLogger(apiName = "取消入库单", from = "MES") |
48 | - public Result cancelReceipt(@RequestBody Map<String, String> param, HttpServletRequest req) { | |
44 | + public Result cancelReceipt(@RequestBody Map<String, String> param) { | |
49 | 45 | String referCode = param.get("referCode"); |
50 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
51 | - return erpService.cancelReceipt(referCode, warehouseCode); | |
46 | + String warehouseCOde = param.get("warehouseCode"); | |
47 | + return erpService.cancelReceipt(referCode, warehouseCOde); | |
52 | 48 | } |
53 | 49 | |
54 | 50 | @PostMapping("/shipment") |
55 | 51 | @ResponseBody |
56 | 52 | @ApiLogger(apiName = "出库单下发", from = "MES") |
57 | 53 | public Result shipment(@RequestBody ErpShipment erpShipment, HttpServletRequest req) { |
58 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
59 | - return erpService.shipment(erpShipment, warehouseCode); | |
54 | + return erpService.shipment(erpShipment); | |
60 | 55 | } |
61 | 56 | |
62 | 57 | @PostMapping("/cancelShipment") |
... | ... | @@ -64,7 +59,7 @@ public class MesController extends HuahengBaseController { |
64 | 59 | @ApiLogger(apiName = "取消出库单", from = "MES") |
65 | 60 | public Result cancelShipment(@RequestBody Map<String, String> param, HttpServletRequest req) { |
66 | 61 | String referCode = param.get("referCode"); |
67 | - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | |
62 | + String warehouseCode = param.get("warehouseCode"); | |
68 | 63 | return erpService.cancelShipment(referCode, warehouseCode); |
69 | 64 | } |
70 | 65 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
... | ... | @@ -21,10 +21,8 @@ import org.jeecg.utils.StringUtils; |
21 | 21 | import org.jeecg.utils.constant.QuantityConstant; |
22 | 22 | import org.springframework.web.bind.annotation.*; |
23 | 23 | |
24 | -import io.swagger.annotations.ApiOperation; | |
25 | - | |
26 | 24 | @RestController |
27 | -@RequestMapping("/api/wms/v2") | |
25 | +@RequestMapping("/api/wms") | |
28 | 26 | public class WcsController extends HuahengBaseController { |
29 | 27 | |
30 | 28 | @Resource |
... | ... | @@ -37,7 +35,6 @@ public class WcsController extends HuahengBaseController { |
37 | 35 | */ |
38 | 36 | @AutoLog(value = "WCS仓位分配") |
39 | 37 | @PostMapping("/warecellAllocation") |
40 | - @ApiOperation(value = "wcs仓位分配", notes = "wcs仓位分配", httpMethod = "POST") | |
41 | 38 | @ResponseBody |
42 | 39 | @ApiLogger(apiName = "仓位分配", from = "WCS") |
43 | 40 | public Result warecellAllocation(@RequestBody WarecellDomain warecellDomain, HttpServletRequest req) { |
... | ... | @@ -54,7 +51,6 @@ public class WcsController extends HuahengBaseController { |
54 | 51 | if (StringUtils.isEmpty(warecellDomain.getHeight())) { |
55 | 52 | return Result.error("仓位分配, 高度为空"); |
56 | 53 | } |
57 | - warecellDomain.setWarehouseCode(warehouseCode); | |
58 | 54 | Result result = handleMultiProcess("warecellAllocation", new MultiProcessListener() { |
59 | 55 | @Override |
60 | 56 | public Result doProcess() { |
... | ... | @@ -71,7 +67,6 @@ public class WcsController extends HuahengBaseController { |
71 | 67 | */ |
72 | 68 | @AutoLog(value = "WCS申请空托盘组入库") |
73 | 69 | @PostMapping("/manyEmptyIn") |
74 | - @ApiOperation(value = "WCS申请空托盘组入库", notes = "WCS申请空托盘组入库", httpMethod = "POST") | |
75 | 70 | @ResponseBody |
76 | 71 | @ApiLogger(apiName = "manyEmptyIn", from = "WCS") |
77 | 72 | public Result manyEmptyIn(@RequestBody ManyEmptyDomain manyEmptyDomain, HttpServletRequest req) { |
... | ... | @@ -97,7 +92,6 @@ public class WcsController extends HuahengBaseController { |
97 | 92 | */ |
98 | 93 | @AutoLog(value = "WCS申请空托盘组出库") |
99 | 94 | @PostMapping("/manyEmptyOut") |
100 | - @ApiOperation(value = "WCS申请空托盘组出库", notes = "WCS申请空托盘组出库", httpMethod = "POST") | |
101 | 95 | @ResponseBody |
102 | 96 | @ApiLogger(apiName = "manyEmptyOut", from = "WCS") |
103 | 97 | public Result manyEmptyOut(@RequestBody ManyEmptyDomain manyEmptyDomain, HttpServletRequest req) { |
... | ... | @@ -120,7 +114,6 @@ public class WcsController extends HuahengBaseController { |
120 | 114 | */ |
121 | 115 | @AutoLog(value = "WCS任务完成") |
122 | 116 | @PostMapping("/completeTaskByWMS") |
123 | - @ApiOperation(value = "WCS任务完成", notes = "WCS任务完成", httpMethod = "POST") | |
124 | 117 | @ResponseBody |
125 | 118 | @ApiLogger(apiName = "WCS任务完成", from = "WCS") |
126 | 119 | public Result completeTaskByWMS(@RequestBody TaskFinishEntity taskFinishEntity, HttpServletRequest req) { |
... | ... | @@ -141,7 +134,6 @@ public class WcsController extends HuahengBaseController { |
141 | 134 | */ |
142 | 135 | @AutoLog(value = "WCS设置物料信息") |
143 | 136 | @PostMapping("/setMaterialInfo") |
144 | - @ApiOperation(value = "WCS设置物料信息", notes = "WCS设置物料信息", httpMethod = "POST") | |
145 | 137 | @ResponseBody |
146 | 138 | @ApiLogger(apiName = "WCS设置物料信息", from = "WCS") |
147 | 139 | public Result setMaterialInfo(@RequestBody MaterialInfoEntity materialInfoEntity) { |
... | ... | @@ -151,7 +143,6 @@ public class WcsController extends HuahengBaseController { |
151 | 143 | |
152 | 144 | @AutoLog(value = "到达拣选台") |
153 | 145 | @PostMapping("/arrivedNotice") |
154 | - @ApiOperation("到达拣选台") | |
155 | 146 | @ResponseBody |
156 | 147 | @ApiLogger(apiName = "到达拣选台", from = "WCS") |
157 | 148 | public Result arrivedNotice(@RequestBody Map<String, String> map, HttpServletRequest req) { |
... | ... | @@ -182,7 +173,6 @@ public class WcsController extends HuahengBaseController { |
182 | 173 | |
183 | 174 | @AutoLog(value = "空出处理") |
184 | 175 | @PostMapping("/emptyOutHandle") |
185 | - @ApiOperation("空出处理") | |
186 | 176 | @ResponseBody |
187 | 177 | @ApiLogger(apiName = "空出处理", from = "WCS") |
188 | 178 | public Result emptyOutHandle(@RequestBody Map<String, String> map) { |
... | ... | @@ -193,7 +183,6 @@ public class WcsController extends HuahengBaseController { |
193 | 183 | |
194 | 184 | @AutoLog(value = "重入处理") |
195 | 185 | @PostMapping("/reentryHandle") |
196 | - @ApiOperation("重入处理") | |
197 | 186 | @ResponseBody |
198 | 187 | @ApiLogger(apiName = "重入处理", from = "WCS") |
199 | 188 | public Result reentryHandle(@RequestBody Map<String, String> map) { |
... | ... | @@ -204,7 +193,6 @@ public class WcsController extends HuahengBaseController { |
204 | 193 | |
205 | 194 | @AutoLog(value = "取货错处理") |
206 | 195 | @PostMapping("/pickupErrorHandle") |
207 | - @ApiOperation("取货错处理") | |
208 | 196 | @ResponseBody |
209 | 197 | @ApiLogger(apiName = "取货错处理", from = "WCS") |
210 | 198 | public Result pickupErrorHandle(@RequestBody Map<String, String> map) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -108,7 +108,7 @@ public class WcsServiceImpl implements WcsService { |
108 | 108 | return Result.error("分配库位时,根据任务号没有找到任务"); |
109 | 109 | } |
110 | 110 | if (taskHeader.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) { |
111 | - return Result.error("任务已经完成,不能再分库位"); | |
111 | + return Result.error("分配库位时,任务已经完成不能再分库位"); | |
112 | 112 | } |
113 | 113 | int taskType = taskHeader.getTaskType(); |
114 | 114 | String containerCode = taskHeader.getContainerCode(); |
... | ... | @@ -156,12 +156,18 @@ public class WcsServiceImpl implements WcsService { |
156 | 156 | locationCode = |
157 | 157 | locationAllocationService.allocation(allocationRule, locationTypeCodeList, high, zoneCode, roadWays, warehouseCode, containerCode, materialAreaCode); |
158 | 158 | if (StringUtils.isEmpty(locationCode)) { |
159 | - return Result.error("没有库位可分配"); | |
159 | + return Result.error("分配库位时,没有库位可分配"); | |
160 | 160 | } |
161 | 161 | |
162 | - locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
162 | + boolean success = locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); | |
163 | + if (!success) { | |
164 | + throw new ServiceException("分配库位时,更新库位状态失败"); | |
165 | + } | |
163 | 166 | if (StringUtils.isNotEmpty(taskHeader.getToLocationCode()) && !locationCode.equals(taskHeader.getToLocationCode())) { |
164 | - locationService.updateStatus(taskHeader.getToLocationCode(), QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
167 | + success = locationService.updateStatus(taskHeader.getToLocationCode(), QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); | |
168 | + if (!success) { | |
169 | + throw new ServiceException("分配库位时,更新之前分配的库位状态失败"); | |
170 | + } | |
165 | 171 | } |
166 | 172 | |
167 | 173 | if (taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT || taskType == QuantityConstant.TASK_TYPE_EMPTYRECEIPT) { |
... | ... | @@ -182,7 +188,7 @@ public class WcsServiceImpl implements WcsService { |
182 | 188 | ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); |
183 | 189 | receiptContainerHeader.setToLocationCode(locationCode); |
184 | 190 | if (!receiptContainerHeaderService.updateById(receiptContainerHeader)) { |
185 | - throw new ServiceException("更新库位失败"); | |
191 | + throw new ServiceException("分配库位时,更新入库组盘的库位号失败"); | |
186 | 192 | } |
187 | 193 | } |
188 | 194 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/config/HuahengBatisInterceptor.java
... | ... | @@ -25,10 +25,10 @@ public class HuahengBatisInterceptor implements Interceptor { |
25 | 25 | public Object intercept(Invocation invocation) throws Throwable { |
26 | 26 | MappedStatement mappedStatement = (MappedStatement)invocation.getArgs()[0]; |
27 | 27 | String sqlId = mappedStatement.getId(); |
28 | - log.debug("------sqlId------" + sqlId); | |
28 | +// log.debug("------sqlId------" + sqlId); | |
29 | 29 | SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType(); |
30 | 30 | Object parameter = invocation.getArgs()[1]; |
31 | - log.debug("------sqlCommandType------" + sqlCommandType); | |
31 | +// log.debug("------sqlCommandType------" + sqlCommandType); | |
32 | 32 | |
33 | 33 | if (parameter == null) { |
34 | 34 | return invocation.proceed(); |
... | ... | @@ -37,7 +37,7 @@ public class HuahengBatisInterceptor implements Interceptor { |
37 | 37 | LoginUser sysUser = this.getLoginUser(); |
38 | 38 | Field[] fields = oConvertUtils.getAllFields(parameter); |
39 | 39 | for (Field field : fields) { |
40 | - log.debug("------field.name------" + field.getName()); | |
40 | +// log.debug("------field.name------" + field.getName()); | |
41 | 41 | try { |
42 | 42 | if ("createBy".equals(field.getName())) { |
43 | 43 | field.setAccessible(true); |
... | ... | @@ -106,7 +106,7 @@ public class HuahengBatisInterceptor implements Interceptor { |
106 | 106 | } |
107 | 107 | |
108 | 108 | for (Field field : fields) { |
109 | - log.debug("------field.name------" + field.getName()); | |
109 | +// log.debug("------field.name------" + field.getName()); | |
110 | 110 | try { |
111 | 111 | if ("updateBy".equals(field.getName())) { |
112 | 112 | // 获取登录用户信息 |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java
... | ... | @@ -132,6 +132,14 @@ public class HuahengJwtUtil { |
132 | 132 | .withJWTId(UUID.randomUUID().toString()).sign(algorithm); |
133 | 133 | } |
134 | 134 | |
135 | + public static String getAudienceByToken(String token) { | |
136 | + RSA256Key rsa256Key = new RSA256Key(); // 获取公钥/私钥 | |
137 | + Algorithm algorithm = Algorithm.RSA256(rsa256Key.getPublicKey(), rsa256Key.getPrivateKey()); | |
138 | + JWTVerifier verifier = JWT.require(algorithm).withIssuer(HuahengJwtUtil.HUAHENG_SYSTEM_ID).build(); | |
139 | + DecodedJWT jwt = verifier.verify(token); | |
140 | + return Arrays.toString(jwt.getAudience().toArray()); | |
141 | + } | |
142 | + | |
135 | 143 | /** |
136 | 144 | * 获得token中的信息无需secret解密也能获得 |
137 | 145 | * @return token中包含的用户名 |
... | ... |