Commit c4bb74af40404902a90e8a4fc5b52049797f6016
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4 into develop
# Conflicts: # huaheng-wms-core/src/main/resources/application-dev.yml
Showing
13 changed files
with
179 additions
and
108 deletions
.gitignore
huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/CommonController.java
... | ... | @@ -2,6 +2,8 @@ package org.jeecg.modules.system.controller; |
2 | 2 | |
3 | 3 | import com.alibaba.fastjson.JSON; |
4 | 4 | import com.alibaba.fastjson.JSONObject; |
5 | + | |
6 | +import io.swagger.annotations.ApiOperation; | |
5 | 7 | import lombok.extern.slf4j.Slf4j; |
6 | 8 | import org.jeecg.common.api.vo.Result; |
7 | 9 | import org.jeecg.common.constant.CommonConstant; |
... | ... | @@ -11,6 +13,7 @@ import org.jeecg.common.util.CommonUtils; |
11 | 13 | import org.jeecg.common.util.RestUtil; |
12 | 14 | import org.jeecg.common.util.TokenUtils; |
13 | 15 | import org.jeecg.common.util.oConvertUtils; |
16 | +import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; | |
14 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
15 | 18 | import org.springframework.beans.factory.annotation.Value; |
16 | 19 | import org.springframework.http.HttpHeaders; |
... | ... | @@ -29,6 +32,8 @@ import javax.servlet.http.HttpServletRequest; |
29 | 32 | import javax.servlet.http.HttpServletResponse; |
30 | 33 | import java.io.*; |
31 | 34 | import java.net.URLDecoder; |
35 | +import java.util.Arrays; | |
36 | +import java.util.Collections; | |
32 | 37 | |
33 | 38 | /** |
34 | 39 | * <p> |
... | ... | @@ -53,6 +58,12 @@ public class CommonController { |
53 | 58 | */ |
54 | 59 | @Value(value = "${jeecg.uploadType}") |
55 | 60 | private String uploadType; |
61 | + | |
62 | + /** | |
63 | + * 允许上传的文件类型 | |
64 | + */ | |
65 | + @Value(value = "${jeecg.uploadFileType}") | |
66 | + private String uploadFileType; | |
56 | 67 | |
57 | 68 | /** |
58 | 69 | * @Author 政辉 |
... | ... | @@ -70,29 +81,35 @@ public class CommonController { |
70 | 81 | * @return |
71 | 82 | */ |
72 | 83 | @PostMapping(value = "/upload") |
84 | + @ApiLogger(apiName = "文件上传", from = "WMS") | |
73 | 85 | public Result<?> upload(HttpServletRequest request, HttpServletResponse response) { |
74 | 86 | Result<?> result = new Result<>(); |
75 | 87 | String savePath = ""; |
76 | 88 | String bizPath = request.getParameter("biz"); |
77 | - | |
78 | 89 | // LOWCOD-2580 sys/common/upload接口存在任意文件上传漏洞 |
79 | 90 | if (oConvertUtils.isNotEmpty(bizPath) && (bizPath.contains("../") || bizPath.contains("..\\"))) { |
80 | - throw new JeecgBootException("上传目录bizPath,格式非法!"); | |
91 | + throw new JeecgBootException("上传路径格式非法!"); | |
81 | 92 | } |
82 | - | |
83 | 93 | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest)request; |
84 | 94 | MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象 |
95 | + if (file == null) { | |
96 | + throw new JeecgBootException("未找到上传文件!"); | |
97 | + } | |
85 | 98 | if (oConvertUtils.isEmpty(bizPath)) { |
86 | 99 | if (CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)) { |
87 | - // 未指定目录,则用阿里云默认目录 upload | |
88 | - bizPath = "upload"; | |
89 | - // result.setMessage("使用阿里云文件上传时,必须添加目录!"); | |
90 | - // result.setSuccess(false); | |
91 | - // return result; | |
100 | + result.setMessage("使用阿里云文件上传时,必须添加目录!"); | |
101 | + result.setSuccess(false); | |
102 | + return result; | |
92 | 103 | } else { |
93 | 104 | bizPath = ""; |
94 | 105 | } |
95 | 106 | } |
107 | + String orgName = file.getOriginalFilename();// 获取文件名 | |
108 | + String suffix = orgName.substring(orgName.lastIndexOf(".") + 1); // 文件后缀 | |
109 | + String[] uploadFileTypes = uploadFileType.split(","); | |
110 | + if (orgName.equals(suffix) || !Arrays.asList(uploadFileTypes).contains(suffix)) { | |
111 | + throw new JeecgBootException("上传文件类型非法!"); | |
112 | + } | |
96 | 113 | if (CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { |
97 | 114 | // update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 |
98 | 115 | savePath = this.uploadLocal(file, bizPath); |
... | ... | @@ -130,24 +147,17 @@ public class CommonController { |
130 | 147 | * @param bizPath 自定义路径 |
131 | 148 | * @return |
132 | 149 | */ |
133 | - private String uploadLocal(MultipartFile mf, String bizPath) { | |
150 | + private String uploadLocal(MultipartFile multipartFile, String bizPath) { | |
134 | 151 | try { |
135 | 152 | String ctxPath = uploadpath; |
136 | - String fileName = null; | |
137 | 153 | File file = new File(ctxPath + File.separator + bizPath + File.separator); |
138 | 154 | if (!file.exists()) { |
139 | 155 | file.mkdirs();// 创建文件根目录 |
140 | 156 | } |
141 | - String orgName = mf.getOriginalFilename();// 获取文件名 | |
142 | - orgName = CommonUtils.getFileName(orgName); | |
143 | - if (orgName.indexOf(".") != -1) { | |
144 | - fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf(".")); | |
145 | - } else { | |
146 | - fileName = orgName + "_" + System.currentTimeMillis(); | |
147 | - } | |
157 | + String fileName = CommonUtils.getFileName(multipartFile.getOriginalFilename()); | |
148 | 158 | String savePath = file.getPath() + File.separator + fileName; |
149 | 159 | File savefile = new File(savePath); |
150 | - FileCopyUtils.copy(mf.getBytes(), savefile); | |
160 | + FileCopyUtils.copy(multipartFile.getBytes(), savefile); | |
151 | 161 | String dbpath = null; |
152 | 162 | if (oConvertUtils.isNotEmpty(bizPath)) { |
153 | 163 | dbpath = bizPath + File.separator + fileName; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -91,6 +91,9 @@ public class WcsServiceImpl implements WcsService { |
91 | 91 | @Transactional(rollbackFor = Exception.class) |
92 | 92 | @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情分配库位'", extra = "#extraJsonString", |
93 | 93 | msg = "'任务ID:' + #warecellDomain.getTaskNo() + ',库位编码:' + #locationCode", condition = "#receiptContainerDetailList.size() > 0", recordReturnValue = true) |
94 | + @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'分配库位'", extra = "''", | |
95 | + msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
96 | + recordReturnValue = true) | |
94 | 97 | public Result warecellAllocation(WarecellDomain warecellDomain) { |
95 | 98 | String warehouseCode = warecellDomain.getWarehouseCode(); |
96 | 99 | String zoneCode = warecellDomain.getZoneCode(); |
... | ... | @@ -241,12 +244,16 @@ public class WcsServiceImpl implements WcsService { |
241 | 244 | LogRecordContext.putVariable("locationCode", locationCode);// 操作日志收集 |
242 | 245 | LogRecordContext.putVariable("receiptContainerDetailList", receiptContainerDetailList);// 操作日志收集 |
243 | 246 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList));// 操作日志收集 |
247 | + LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 | |
244 | 248 | return Result.OK(wcsTask); |
245 | 249 | } |
246 | 250 | |
247 | 251 | @Override |
248 | 252 | @Transactional(rollbackFor = Exception.class) |
249 | 253 | @ApiLogger(apiName = "任务下发", from = "WCS") |
254 | + @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'任务下发'", extra = "''", | |
255 | + msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
256 | + recordReturnValue = true) | |
250 | 257 | public Result wcsTaskAssign(TaskHeader taskHeader) { |
251 | 258 | if (taskHeader == null) { |
252 | 259 | return Result.error("wms任务为空"); |
... | ... | @@ -400,7 +407,7 @@ public class WcsServiceImpl implements WcsService { |
400 | 407 | return Result.error(result.getMessage()); |
401 | 408 | } |
402 | 409 | } |
403 | - | |
410 | + LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 | |
404 | 411 | return Result.ok("下发成功"); |
405 | 412 | } |
406 | 413 | |
... | ... | @@ -614,6 +621,9 @@ public class WcsServiceImpl implements WcsService { |
614 | 621 | |
615 | 622 | @Override |
616 | 623 | @Transactional(rollbackFor = Exception.class) |
624 | + @OperationLog(bizId = "#taskHeader.getId()", bizType = "'任务追踪'", tag = "'到达站台'", extra = "''", | |
625 | + msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", | |
626 | + recordReturnValue = true) | |
617 | 627 | public Result arrivedNotice(String taskNo, String port) { |
618 | 628 | TaskHeader taskHeader = taskHeaderService.getById(taskNo); |
619 | 629 | if (taskHeader == null) { |
... | ... | @@ -629,6 +639,7 @@ public class WcsServiceImpl implements WcsService { |
629 | 639 | if (!result) { |
630 | 640 | return Result.error("更新到达站台失败"); |
631 | 641 | } |
642 | + LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 | |
632 | 643 | return Result.ok("更新到达站台成功"); |
633 | 644 | } |
634 | 645 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/ApiLogAspect.java renamed to huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/ApiLoggerAspect.java
... | ... | @@ -52,8 +52,8 @@ import okhttp3.Response; |
52 | 52 | @Aspect |
53 | 53 | @Component |
54 | 54 | @EnableAsync |
55 | -public class ApiLogAspect { | |
56 | - private static final Logger log = LoggerFactory.getLogger(ApiLogAspect.class); | |
55 | +public class ApiLoggerAspect { | |
56 | + private static final Logger log = LoggerFactory.getLogger(ApiLoggerAspect.class); | |
57 | 57 | |
58 | 58 | private static IApiLogService apiLogService; |
59 | 59 | |
... | ... | @@ -61,12 +61,12 @@ public class ApiLogAspect { |
61 | 61 | |
62 | 62 | @Autowired |
63 | 63 | public void setApiLogService(IApiLogService apiLogService) { |
64 | - ApiLogAspect.apiLogService = apiLogService; | |
64 | + ApiLoggerAspect.apiLogService = apiLogService; | |
65 | 65 | } |
66 | 66 | |
67 | 67 | @Autowired |
68 | 68 | public void setAddressService(IAddressService addressService) { |
69 | - ApiLogAspect.addressService = addressService; | |
69 | + ApiLoggerAspect.addressService = addressService; | |
70 | 70 | } |
71 | 71 | |
72 | 72 | // 配置织入点 |
... | ... | @@ -285,7 +285,7 @@ public class ApiLogAspect { |
285 | 285 | } catch (Exception e) { |
286 | 286 | e.printStackTrace(); |
287 | 287 | } |
288 | - SpringUtils.getBean(ApiLogAspect.class).saveApiLog(log); | |
288 | + SpringUtils.getBean(ApiLoggerAspect.class).saveApiLog(log); | |
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
... | ... | @@ -491,7 +491,7 @@ public class ApiLogAspect { |
491 | 491 | private void rebuildResponseHeader(ApiLog log) { |
492 | 492 | try { |
493 | 493 | HttpServletResponse resp = ServletUtils.getResponse(); |
494 | - Collection names = resp.getHeaderNames(); | |
494 | + Collection<String> names = resp.getHeaderNames(); | |
495 | 495 | ArrayList<String> headerList = new ArrayList<>(); |
496 | 496 | Iterator<String> it = names.iterator(); |
497 | 497 | while (it.hasNext()) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java
... | ... | @@ -42,51 +42,85 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
42 | 42 | log.debug(">>>>>> create OperationLog:{} <<<<<<", JSON.toJSONString(logDTO)); |
43 | 43 | List<OperationLog> operationLogList = new ArrayList<OperationLog>(); |
44 | 44 | if (!StringUtils.isEmpty(logDTO.getExtra())) { |
45 | - if (logDTO.getBizType().equals("物料追踪")) { | |
46 | - if (logDTO.getTag().equals("入库组盘")) { | |
47 | - String message = "容器编码:{},物料编码:{},数量:{}"; | |
48 | - operationLogList.addAll(createOperationLogs(logDTO, ReceiptContainerDetail.class, "getUniqueCode", message, "getReferCode", "getReceiptCode", | |
49 | - "getWarehouseCode", "getContainerCode", "getMaterialCode", "getQty")); | |
50 | - } | |
51 | - } else if (logDTO.getBizType().equals("入库单追踪")) { | |
52 | - if (logDTO.getTag().equals("详情分配库位") || logDTO.getTag().equals("详情组盘") || logDTO.getTag().equals("详情取消组盘") || logDTO.getTag().equals("入库任务生成") | |
53 | - || logDTO.getTag().equals("入库任务取消")) { | |
54 | - String message = "容器编码:{},物料编码:{},入库数量:{}"; | |
55 | - operationLogList.addAll( | |
56 | - createOperationLogs(logDTO, ReceiptContainerDetail.class, "getReceiptCode", message, "getContainerCode", "getMaterialCode", "getQty")); | |
57 | - } else if (logDTO.getTag().equals("入库任务完成")) { | |
58 | - String message = "物料编码:{},入库数量:{}"; | |
59 | - operationLogList.addAll(createOperationLogs(logDTO, TaskDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
60 | - } else if (logDTO.getTag().equals("详情入库完成")) { | |
61 | - Thread.sleep(100); | |
62 | - String message = "物料编码:{},数量:{}"; | |
63 | - operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
64 | - } else { | |
65 | - String message = "物料编码:{},数量:{}"; | |
66 | - operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
67 | - } | |
68 | - } else if (logDTO.getBizType().equals("出库单追踪")) { | |
69 | - if (logDTO.getTag().equals("详情配盘") || logDTO.getTag().equals("详情取消配盘")) { | |
70 | - String message = "库位编码:{},容器编码:{},物料编码:{},出库数量:{}"; | |
71 | - operationLogList.addAll(createOperationLogs(logDTO, ShipmentContainerDetail.class, "getShipmentCode", message, "getFromLocationCode", | |
72 | - "getContainerCode", "getMaterialCode", "getQty")); | |
73 | - } else if (logDTO.getTag().equals("出库任务生成") || logDTO.getTag().equals("出库任务取消")) { | |
74 | - String message = "物料编码:{},出库数量:{}"; | |
75 | - operationLogList.addAll(createOperationLogs(logDTO, ShipmentContainerDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
76 | - } else if (logDTO.getTag().equals("出库任务完成")) { | |
77 | - String message = "物料编码:{},出库数量:{}"; | |
78 | - operationLogList.addAll(createOperationLogs(logDTO, TaskDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
79 | - } else if (logDTO.getTag().equals("详情出库完成")) { | |
80 | - Thread.sleep(100); | |
81 | - String message = "物料编码:{},数量:{}"; | |
82 | - operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
83 | - } else { | |
84 | - String message = "物料编码:{},数量:{}"; | |
85 | - operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
86 | - } | |
45 | + String message = null; | |
46 | + switch (logDTO.getBizType()) { | |
47 | + case "物料追踪": | |
48 | + switch (logDTO.getTag()) { | |
49 | + case "入库组盘": | |
50 | + message = "容器编码:{},物料编码:{},数量:{}"; | |
51 | + operationLogList.addAll(createOperationLogs(logDTO, ReceiptContainerDetail.class, "getUniqueCode", message, "getReferCode", | |
52 | + "getReceiptCode", "getWarehouseCode", "getContainerCode", "getMaterialCode", "getQty")); | |
53 | + break; | |
54 | + } | |
55 | + break; | |
56 | + case "入库单追踪": | |
57 | + switch (logDTO.getTag()) { | |
58 | + case "详情分配库位": | |
59 | + case "详情组盘": | |
60 | + case "详情取消组盘": | |
61 | + case "入库任务生成": | |
62 | + case "入库任务取消": | |
63 | + message = "容器编码:{},物料编码:{},入库数量:{}"; | |
64 | + operationLogList.addAll(createOperationLogs(logDTO, ReceiptContainerDetail.class, "getReceiptCode", message, "getContainerCode", | |
65 | + "getMaterialCode", "getQty")); | |
66 | + break; | |
67 | + case "入库任务完成": | |
68 | + message = "物料编码:{},入库数量:{}"; | |
69 | + operationLogList.addAll(createOperationLogs(logDTO, TaskDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
70 | + break; | |
71 | + case "详情入库完成": | |
72 | + Thread.sleep(200);// 确保日志输出顺序 | |
73 | + message = "物料编码:{},数量:{}"; | |
74 | + operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
75 | + break; | |
76 | + default: | |
77 | + message = "物料编码:{},数量:{}"; | |
78 | + operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
79 | + break; | |
80 | + } | |
81 | + break; | |
82 | + case "出库单追踪": | |
83 | + switch (logDTO.getTag()) { | |
84 | + case "详情配盘": | |
85 | + case "详情取消配盘": | |
86 | + message = "库位编码:{},容器编码:{},物料编码:{},出库数量:{}"; | |
87 | + operationLogList.addAll(createOperationLogs(logDTO, ShipmentContainerDetail.class, "getShipmentCode", message, "getFromLocationCode", | |
88 | + "getContainerCode", "getMaterialCode", "getQty")); | |
89 | + break; | |
90 | + case "出库任务生成": | |
91 | + case "出库任务取消": | |
92 | + message = "物料编码:{},出库数量:{}"; | |
93 | + operationLogList | |
94 | + .addAll(createOperationLogs(logDTO, ShipmentContainerDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
95 | + break; | |
96 | + case "出库任务完成": | |
97 | + message = "物料编码:{},出库数量:{}"; | |
98 | + operationLogList.addAll(createOperationLogs(logDTO, TaskDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
99 | + break; | |
100 | + case "详情出库完成": | |
101 | + Thread.sleep(200);// 确保日志输出顺序 | |
102 | + message = "物料编码:{},数量:{}"; | |
103 | + operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
104 | + break; | |
105 | + default: | |
106 | + message = "物料编码:{},数量:{}"; | |
107 | + operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
108 | + break; | |
109 | + } | |
110 | + break; | |
111 | + case "任务追踪": | |
112 | + switch (logDTO.getTag()) { | |
113 | + case "入库任务生成": | |
114 | + case "入库任务完成": | |
115 | + message = "详情ID:{},物料编码:{},物料名称:{},数量:{}"; | |
116 | + operationLogList.addAll(createOperationLogs(logDTO, TaskDetail.class, "getTaskHeaderId", message, "getId", "getMaterialCode", | |
117 | + "getMaterialName", "getQty")); | |
118 | + break; | |
119 | + } | |
120 | + | |
87 | 121 | } |
88 | 122 | } else { |
89 | - Thread.sleep(200); | |
123 | + Thread.sleep(1000); // 确保日志输出顺序 | |
90 | 124 | OperationLog operationLog = new OperationLog(); |
91 | 125 | operationLog.setBizId(logDTO.getBizId()); |
92 | 126 | operationLog.setOperationMsg(StringUtils.substring(logDTO.getMsg(), 0, 1000)); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -98,8 +98,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
98 | 98 | |
99 | 99 | @Override |
100 | 100 | @Transactional(rollbackFor = ServiceException.class) |
101 | - @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库任务生成'", extra = "#extraJsonString", msg = "'任务ID:' + #taskHeaderId", | |
101 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库任务生成'", extra = "#extraJsonString1", msg = "'任务ID:' + #taskHeader.getId()", | |
102 | 102 | condition = "#receiptContainerDetailList.size() > 0", recordReturnValue = true) |
103 | + @OperationLog(bizId = "''", bizType = "'任务追踪'", tag = "'入库任务生成'", extra = "#extraJsonString2", | |
104 | + msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
105 | + condition = "#taskDetailList.size() > 0", recordReturnValue = true) | |
103 | 106 | public Result<TaskHeader> createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode) { |
104 | 107 | if (!receiptContainerHeader.getWarehouseCode().equals(warehouseCode)) { |
105 | 108 | return Result.error("id:" + receiptContainerHeader.getId() + "的入库组盘不能在" + warehouseCode + "仓库操作"); |
... | ... | @@ -216,9 +219,11 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
216 | 219 | throw new ServiceException("更新入库单明细失败"); |
217 | 220 | } |
218 | 221 | } |
219 | - LogRecordContext.putVariable("taskHeaderId", taskHeaderId);// 操作日志收集 | |
222 | + LogRecordContext.putVariable("taskHeader", taskHeader);// 操作日志收集 | |
220 | 223 | LogRecordContext.putVariable("receiptContainerDetailList", receiptContainerDetailList);// 操作日志收集 |
221 | - LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList));// 操作日志收集 | |
224 | + LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(receiptContainerDetailList));// 操作日志收集 | |
225 | + LogRecordContext.putVariable("taskDetailList", taskDetailList);// 操作日志收集 | |
226 | + LogRecordContext.putVariable("extraJsonString2", JSON.toJSONString(taskDetailList));// 操作日志收集 | |
222 | 227 | return Result.OK("生成入库任务成功", taskHeader); |
223 | 228 | } |
224 | 229 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1068,8 +1068,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1068 | 1068 | */ |
1069 | 1069 | @Override |
1070 | 1070 | @Transactional(rollbackFor = Exception.class) |
1071 | + @OperationLog(bizId = "''", bizType = "'任务追踪'", tag = "'入库任务完成'", extra = "#extraJsonString1", | |
1072 | + msg = "'任务类型:' + #taskHeader.getTaskType() + ',起始库位:' + #taskHeader.getFromLocationCode() + ',目标库位:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
1073 | + condition = "#taskDetailList.size() > 0", recordReturnValue = true) | |
1071 | 1074 | @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库任务完成'", extra = "#extraJsonString1", |
1072 | - msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", recordReturnValue = true) | |
1075 | + msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", | |
1076 | + condition = "#taskDetailList.size() > 0", recordReturnValue = true) | |
1073 | 1077 | @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情入库完成'", extra = "#extraJsonString2", msg = "''", condition = "#receiptDetaiList.size() > 0", |
1074 | 1078 | recordReturnValue = true) |
1075 | 1079 | public Result completeReceiptTask(TaskHeader taskHeader) { |
... | ... | @@ -1231,10 +1235,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1231 | 1235 | } |
1232 | 1236 | } |
1233 | 1237 | receiptDetaiList = receiptDetaiList.stream().filter(t -> t.getStatus().equals(QuantityConstant.RECEIPT_HEADER_COMPLETED)).collect(Collectors.toList()); |
1234 | - LogRecordContext.putVariable("receiptDetaiList", receiptDetaiList); | |
1238 | + LogRecordContext.putVariable("taskDetailList", taskDetailList); | |
1235 | 1239 | LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(taskDetailList)); |
1240 | + LogRecordContext.putVariable("receiptDetaiList", receiptDetaiList); | |
1236 | 1241 | LogRecordContext.putVariable("extraJsonString2", JSON.toJSONString(receiptDetaiList)); |
1237 | - | |
1242 | + LogRecordContext.putVariable("taskHeader", taskHeader); | |
1238 | 1243 | return Result.ok("完成入库任务"); |
1239 | 1244 | } |
1240 | 1245 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java
... | ... | @@ -25,7 +25,7 @@ import cn.hutool.core.date.DateUtil; |
25 | 25 | public class HuahengJwtUtil { |
26 | 26 | |
27 | 27 | /** token失效时间 1天 */ |
28 | - public static final long EXPIRE_TIME = 24 * 60 * 60 * 1000; | |
28 | + public static final long EXPIRE_TIME = 12 * 60 * 60 * 1000; | |
29 | 29 | |
30 | 30 | public static final String HUAHENG_SYSTEM_ID = "HUAHENG-WMS4"; |
31 | 31 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/OkHttpUtils.java
... | ... | @@ -10,7 +10,7 @@ import antlr.StringUtils; |
10 | 10 | import cn.hutool.core.util.StrUtil; |
11 | 11 | import net.bytebuddy.asm.Advice.This; |
12 | 12 | import okhttp3.*; |
13 | -import org.jeecg.modules.wms.framework.aspectj.ApiLogAspect; | |
13 | +import org.jeecg.modules.wms.framework.aspectj.ApiLoggerAspect; | |
14 | 14 | import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; |
15 | 15 | import org.slf4j.Logger; |
16 | 16 | import org.slf4j.LoggerFactory; |
... | ... | @@ -104,16 +104,16 @@ public class OkHttpUtils { |
104 | 104 | Response response = null; |
105 | 105 | String result = null; |
106 | 106 | try { |
107 | - ApiLogAspect.initApiLog(apiLog, request, param); | |
107 | + ApiLoggerAspect.initApiLog(apiLog, request, param); | |
108 | 108 | response = HTTP_CLIENT.newCall(request).execute(); |
109 | 109 | result = response.body().string(); |
110 | 110 | } catch (Exception e) { |
111 | 111 | String errorString = |
112 | 112 | StrUtil.format("执行GET请求异常,url:{},header:{},param:{},errorMessage:{}", url, JSON.toJSONString(headers), param, e.getMessage()); |
113 | - ApiLogAspect.setApiLogException(apiLog, e); | |
113 | + ApiLoggerAspect.setApiLogException(apiLog, e); | |
114 | 114 | throw new RuntimeException(errorString, e); |
115 | 115 | } finally { |
116 | - ApiLogAspect.finishApiLog(apiLog, response, result); | |
116 | + ApiLoggerAspect.finishApiLog(apiLog, response, result); | |
117 | 117 | } |
118 | 118 | if (response.isSuccessful() && Objects.nonNull(response.body())) {// 调用成功 |
119 | 119 | log.info("执行GET请求成功,url:{},header:{},param:{},result:{}", url, JSON.toJSONString(headers), param, result); |
... | ... | @@ -154,16 +154,16 @@ public class OkHttpUtils { |
154 | 154 | Response response = null; |
155 | 155 | String result = null; |
156 | 156 | try { |
157 | - ApiLogAspect.initApiLog(apiLog, request, param); | |
157 | + ApiLoggerAspect.initApiLog(apiLog, request, param); | |
158 | 158 | response = HTTP_CLIENT.newCall(request).execute(); |
159 | 159 | result = response.body().string(); |
160 | 160 | } catch (Exception e) { |
161 | 161 | String errorString = |
162 | 162 | StrUtil.format("执行POST请求异常,url:{},header:{},param:{},errorMessage:{}", url, JSON.toJSONString(headers), param, e.getMessage()); |
163 | - ApiLogAspect.setApiLogException(apiLog, e); | |
163 | + ApiLoggerAspect.setApiLogException(apiLog, e); | |
164 | 164 | throw new RuntimeException(errorString, e); |
165 | 165 | } finally { |
166 | - ApiLogAspect.finishApiLog(apiLog, response, result); | |
166 | + ApiLoggerAspect.finishApiLog(apiLog, response, result); | |
167 | 167 | } |
168 | 168 | if (response.isSuccessful() && Objects.nonNull(response.body())) {// 调用成功 |
169 | 169 | log.info("执行POST请求成功,url:{},header:{},param:{},result:{}", url, JSON.toJSONString(headers), param, result); |
... | ... | @@ -196,15 +196,15 @@ public class OkHttpUtils { |
196 | 196 | Response response = null; |
197 | 197 | String result = null; |
198 | 198 | try { |
199 | - ApiLogAspect.initApiLog(apiLog, request, jsonString); | |
199 | + ApiLoggerAspect.initApiLog(apiLog, request, jsonString); | |
200 | 200 | response = HTTP_CLIENT.newCall(request).execute(); |
201 | 201 | result = response.body().string(); |
202 | 202 | } catch (Exception e) { |
203 | 203 | String errorString = StrUtil.format("执行POST请求异常,url:{},header:{},param:{},errorMessage:{}", url, JSON.toJSONString(headers), jsonString, e.getMessage()); |
204 | - ApiLogAspect.setApiLogException(apiLog, e); | |
204 | + ApiLoggerAspect.setApiLogException(apiLog, e); | |
205 | 205 | throw new RuntimeException(errorString); |
206 | 206 | } finally { |
207 | - ApiLogAspect.finishApiLog(apiLog, response, result); | |
207 | + ApiLoggerAspect.finishApiLog(apiLog, response, result); | |
208 | 208 | } |
209 | 209 | if (response.isSuccessful() && Objects.nonNull(response.body())) {// 调用成功 |
210 | 210 | log.info("执行POST请求成功,url:{},header:{},param:{},result:{}", url, JSON.toJSONString(headers), jsonString, result); |
... | ... |
huaheng-wms-core/src/main/resources/application-dev.yml
... | ... | @@ -22,8 +22,8 @@ management: |
22 | 22 | spring: |
23 | 23 | servlet: |
24 | 24 | multipart: |
25 | - max-file-size: 10MB | |
26 | - max-request-size: 10MB | |
25 | + max-file-size: 100MB | |
26 | + max-request-size: 100MB | |
27 | 27 | mail: |
28 | 28 | host: smtp.163.com |
29 | 29 | username: jeecgos@163.com |
... | ... | @@ -131,7 +131,7 @@ spring: |
131 | 131 | connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 |
132 | 132 | datasource: |
133 | 133 | master: |
134 | - url: jdbc:mysql://localhost:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true | |
134 | + url: jdbc:mysql://127.0.0.1:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true | |
135 | 135 | username: root |
136 | 136 | password: HHsoft123. |
137 | 137 | driver-class-name: com.mysql.cj.jdbc.Driver |
... | ... | @@ -149,9 +149,9 @@ spring: |
149 | 149 | #redis 配置 |
150 | 150 | redis: |
151 | 151 | database: 0 |
152 | - host: 172.16.29.77 | |
152 | + host: 127.0.0.1 | |
153 | 153 | port: 6379 |
154 | - password: 123456 | |
154 | + password: "" | |
155 | 155 | lettuce: |
156 | 156 | pool: |
157 | 157 | min-idle: 0 #最小等待连接中的数量,设 0 为没有限制 |
... | ... | @@ -189,15 +189,16 @@ jeecg: |
189 | 189 | # 签名密钥串(前后端要一致,正式发布请自行修改) |
190 | 190 | signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a |
191 | 191 | # 本地:local\Minio:minio\阿里云:alioss |
192 | - uploadType: minio | |
192 | + uploadType: local | |
193 | + # 允许上传的文件类型,使用,分割 | |
194 | + uploadFileType: apk,txt,jpg,png | |
193 | 195 | path: |
194 | 196 | #文件上传根目录 设置 |
195 | - upload: /opt/upFiles | |
197 | + upload: ./upFiles | |
196 | 198 | #webapp文件路径 |
197 | - webapp: /opt/webapp | |
199 | + webapp: ./webapp | |
198 | 200 | shiro: |
199 | - excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/api/**,/sys/cas/client/validateLogin | |
200 | - #阿里云oss存储和大鱼短信秘钥配置 | |
201 | + excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/**,/sys/cas/client/validateLogin #阿里云oss存储和大鱼短信秘钥配置 | |
201 | 202 | oss: |
202 | 203 | accessKey: ?? |
203 | 204 | secretKey: ?? |
... | ... |
huaheng-wms-core/src/main/resources/application-prod.yml
... | ... | @@ -22,8 +22,8 @@ management: |
22 | 22 | spring: |
23 | 23 | servlet: |
24 | 24 | multipart: |
25 | - max-file-size: 10MB | |
26 | - max-request-size: 10MB | |
25 | + max-file-size: 100MB | |
26 | + max-request-size: 100MB | |
27 | 27 | mail: |
28 | 28 | host: smtp.163.com |
29 | 29 | username: jeecgos@163.com |
... | ... | @@ -187,14 +187,16 @@ jeecg: |
187 | 187 | # 签名密钥串(前后端要一致,正式发布请自行修改) |
188 | 188 | signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a |
189 | 189 | # 本地:local\Minio:minio\阿里云:alioss |
190 | - uploadType: alioss | |
190 | + uploadType: local | |
191 | + # 允许上传的文件类型,使用,分割 | |
192 | + uploadFileType: apk,txt,jpg,png | |
191 | 193 | path: |
192 | 194 | #文件上传根目录 设置 |
193 | - upload: /opt/jeecg-boot/upload | |
195 | + upload: ./upload | |
194 | 196 | #webapp文件路径 |
195 | - webapp: /opt/jeecg-boot/webapp | |
197 | + webapp: ./webapp | |
196 | 198 | shiro: |
197 | - excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/**,/sys/cas/client/validateLogin | |
199 | + excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/test/test**,/api/**,/sys/cas/client/validateLogin,/sys/common/static/** | |
198 | 200 | #阿里云oss存储和大鱼短信秘钥配置 |
199 | 201 | oss: |
200 | 202 | accessKey: ?? |
... | ... |
huaheng-wms-core/src/main/resources/application-test.yml
... | ... | @@ -22,8 +22,8 @@ management: |
22 | 22 | spring: |
23 | 23 | servlet: |
24 | 24 | multipart: |
25 | - max-file-size: 10MB | |
26 | - max-request-size: 10MB | |
25 | + max-file-size: 100MB | |
26 | + max-request-size: 100MB | |
27 | 27 | mail: |
28 | 28 | host: smtp.163.com |
29 | 29 | username: jeecgos@163.com |
... | ... | @@ -189,14 +189,16 @@ jeecg: |
189 | 189 | # 签名密钥串(前后端要一致,正式发布请自行修改) |
190 | 190 | signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a |
191 | 191 | # 本地:local\Minio:minio\阿里云:alioss |
192 | - uploadType: minio | |
192 | + uploadType: local | |
193 | + # 允许上传的文件类型,使用,分割 | |
194 | + uploadFileType: apk,txt,jpg,png | |
193 | 195 | path: |
194 | 196 | #文件上传根目录 设置 |
195 | - upload: /opt/upFiles | |
197 | + upload: ./upFiles | |
196 | 198 | #webapp文件路径 |
197 | - webapp: /opt/webapp | |
199 | + webapp: ./webapp | |
198 | 200 | shiro: |
199 | - excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/api/**,/sys/cas/client/validateLogin | |
201 | + excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/getWarehouseByUserCode,/api/**,/sys/cas/client/validateLogin,/sys/common/static/** | |
200 | 202 | #阿里云oss存储和大鱼短信秘钥配置 |
201 | 203 | oss: |
202 | 204 | accessKey: ?? |
... | ... |