Commit faa216412398de5099973e4c598ec8cd7caa56f7
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4 into develop
Showing
19 changed files
with
131 additions
and
97 deletions
ant-design-vue-jeecg/src/utils/request.js
... | ... | @@ -17,7 +17,7 @@ let apiBaseUrl = window._CONFIG['domianURL'] || "/jeecg-boot"; |
17 | 17 | const service = axios.create({ |
18 | 18 | //baseURL: '/jeecg-boot', |
19 | 19 | baseURL: apiBaseUrl, // api base_url |
20 | - timeout: 10 * 1000 // 请求超时时间 | |
20 | + timeout: 120 * 1000 // 请求超时时间 | |
21 | 21 | }) |
22 | 22 | |
23 | 23 | const err = (error) => { |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | <a-input placeholder="请输入库位号" v-model="queryParam.locationCode"></a-input> |
32 | 32 | </a-form-item> |
33 | 33 | </a-col> |
34 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
34 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
35 | 35 | <a-form-item label="创建日期"> |
36 | 36 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
37 | 37 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | <a-input placeholder="请输入创建人" v-model="queryParam.createBy"></a-input> |
72 | 72 | </a-form-item> |
73 | 73 | </a-col> |
74 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
74 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
75 | 75 | <a-form-item label="创建日期"> |
76 | 76 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
77 | 77 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 | <a-input placeholder="请输入业务响应码" v-model="queryParam.retCode"></a-input> |
46 | 46 | </a-form-item> |
47 | 47 | </a-col> |
48 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
48 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
49 | 49 | <a-form-item label="创建日期"> |
50 | 50 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
51 | 51 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/monitor/OperationLog.vue
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | <j-input placeholder="请输入操作内容" v-model="queryParam.operationMsg"></j-input> |
25 | 25 | </a-form-item> |
26 | 26 | </a-col> |
27 | - <a-col :xl="12" :lg="7" :md="8" :sm="24"> | |
27 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
28 | 28 | <a-form-item label="创建日期"> |
29 | 29 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
30 | 30 | class="query-group-cust" v-model="queryParam.operationTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 | </a-form-item> |
21 | 21 | </a-col> |
22 | 22 | <template v-if="toggleSearchStatus"> |
23 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
23 | 24 | <a-form-item label="起始库位"> |
24 | 25 | <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input> |
25 | 26 | </a-form-item> |
... | ... | @@ -34,7 +35,7 @@ |
34 | 35 | <a-input placeholder="请输入目标出入口" v-model="queryParam.toPort"></a-input> |
35 | 36 | </a-form-item> |
36 | 37 | </a-col> |
37 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
38 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
38 | 39 | <a-form-item label="创建日期"> |
39 | 40 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
40 | 41 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderHistoryList.vue
... | ... | @@ -75,8 +75,7 @@ |
75 | 75 | </a-select> |
76 | 76 | </a-form-item> |
77 | 77 | </a-col> |
78 | - | |
79 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
78 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
80 | 79 | <a-form-item label="创建日期"> |
81 | 80 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
82 | 81 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue
... | ... | @@ -71,8 +71,7 @@ |
71 | 71 | </a-select> |
72 | 72 | </a-form-item> |
73 | 73 | </a-col> |
74 | - | |
75 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
74 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
76 | 75 | <a-form-item label="创建日期"> |
77 | 76 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
78 | 77 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | <a-input placeholder="请输入创建人" v-model="queryParam.createBy"></a-input> |
42 | 42 | </a-form-item> |
43 | 43 | </a-col> |
44 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
44 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
45 | 45 | <a-form-item label="创建日期"> |
46 | 46 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
47 | 47 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | <a-input placeholder="请输入创建人" v-model="queryParam.createBy"></a-input> |
81 | 81 | </a-form-item> |
82 | 82 | </a-col> |
83 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
83 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
84 | 84 | <a-form-item label="创建日期"> |
85 | 85 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
86 | 86 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | <a-input placeholder="请输入重入库位号" v-model="queryParam.originLocationCode"></a-input> |
72 | 72 | </a-form-item> |
73 | 73 | </a-col> |
74 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
74 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
75 | 75 | <a-form-item label="创建日期"> |
76 | 76 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
77 | 77 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | <a-input placeholder="请输入重入库位号" v-model="queryParam.originLocationCode"></a-input> |
72 | 72 | </a-form-item> |
73 | 73 | </a-col> |
74 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
74 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
75 | 75 | <a-form-item label="创建日期"> |
76 | 76 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
77 | 77 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | <a-input placeholder="请输入目标出入口" v-model="queryParam.toPortCode"></a-input> |
72 | 72 | </a-form-item> |
73 | 73 | </a-col> |
74 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
74 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
75 | 75 | <a-form-item label="创建日期"> |
76 | 76 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
77 | 77 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | <a-input placeholder="请输入重入库位号" v-model="queryParam.originLocationCode"></a-input> |
72 | 72 | </a-form-item> |
73 | 73 | </a-col> |
74 | - <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
74 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
75 | 75 | <a-form-item label="创建日期"> |
76 | 76 | <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" |
77 | 77 | class="query-group-cust" v-model="queryParam.createTime_begin"></j-date> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.api.wcs.service; |
2 | 2 | |
3 | 3 | import java.util.ArrayList; |
4 | +import java.util.Collections; | |
4 | 5 | import java.util.List; |
5 | 6 | import java.util.stream.Collectors; |
6 | 7 | |
... | ... | @@ -46,6 +47,9 @@ import com.aliyun.oss.ServiceException; |
46 | 47 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
47 | 48 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
48 | 49 | |
50 | +import cn.monitor4all.logRecord.annotation.OperationLog; | |
51 | +import cn.monitor4all.logRecord.context.LogRecordContext; | |
52 | + | |
49 | 53 | /** |
50 | 54 | * @author 游杰 |
51 | 55 | */ |
... | ... | @@ -86,6 +90,8 @@ public class WcsServiceImpl implements WcsService { |
86 | 90 | */ |
87 | 91 | @Override |
88 | 92 | @Transactional(rollbackFor = Exception.class) |
93 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情分配库位'", extra = "#extraJsonString", msg = "'分配库位:' + #locationCode", | |
94 | + condition = "#receiptContainerDetailList.size() > 0", recordReturnValue = true) | |
89 | 95 | public Result warecellAllocation(WarecellDomain warecellDomain) { |
90 | 96 | String warehouseCode = warecellDomain.getWarehouseCode(); |
91 | 97 | String zoneCode = warecellDomain.getZoneCode(); |
... | ... | @@ -170,8 +176,8 @@ public class WcsServiceImpl implements WcsService { |
170 | 176 | } |
171 | 177 | } |
172 | 178 | |
179 | + List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); | |
173 | 180 | if (taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT || taskType == QuantityConstant.TASK_TYPE_EMPTYRECEIPT) { |
174 | - List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); | |
175 | 181 | for (TaskDetail taskDetail : taskDetailList) { |
176 | 182 | ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService.getById(taskDetail.getReceiptContainerDetailId()); |
177 | 183 | if (receiptContainerDetail != null) { |
... | ... | @@ -233,6 +239,9 @@ public class WcsServiceImpl implements WcsService { |
233 | 239 | WcsTask wcsTask = new WcsTask(); |
234 | 240 | wcsTask.setToLocationCode(locationCode); |
235 | 241 | wcsTask.setPreTaskNo(String.valueOf(preTaskNo)); |
242 | + LogRecordContext.putVariable("locationCode", locationCode);// 操作日志收集 | |
243 | + LogRecordContext.putVariable("receiptContainerDetailList", receiptContainerDetailList);// 操作日志收集 | |
244 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList));// 操作日志收集 | |
236 | 245 | return Result.OK(wcsTask); |
237 | 246 | } |
238 | 247 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/TestController.java
1 | 1 | package org.jeecg.modules.wms.framework.controller; |
2 | 2 | |
3 | +import java.math.BigDecimal; | |
3 | 4 | import java.security.NoSuchAlgorithmException; |
4 | 5 | import java.security.SecureRandom; |
6 | +import java.util.ArrayList; | |
7 | +import java.util.Collections; | |
8 | +import java.util.List; | |
5 | 9 | import java.util.Map; |
6 | 10 | import java.util.concurrent.ConcurrentHashMap; |
7 | 11 | |
... | ... | @@ -9,6 +13,7 @@ import javax.servlet.http.HttpServletRequest; |
9 | 13 | |
10 | 14 | import org.jeecg.common.api.vo.Result; |
11 | 15 | import org.jeecg.modules.system.service.ISysDataLogService; |
16 | +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail; | |
12 | 17 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader; |
13 | 18 | import org.jeecg.utils.HuahengJwtUtil; |
14 | 19 | import org.jeecg.utils.HuahengRedisUtil; |
... | ... | @@ -52,28 +57,42 @@ public class TestController extends HuahengBaseController { |
52 | 57 | // @AutoLog(value = "TestController-testRedis") |
53 | 58 | @ResponseBody |
54 | 59 | @PostMapping(value = "/test/testRedis") |
55 | - @OperationLog(bizType = "'物料追踪'", tag = "'分配库位'", bizId = "#paramMap.get('bizId')",extra = "#jsonString", msg = "'测试操作日志'", recordReturnValue = true) | |
60 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情分配库位'", extra = "#extraJsonString", msg = "'库位编码:' + #locationCode", | |
61 | + condition = "#receiptContainerDetailList.size() > 0", recordReturnValue = true) | |
56 | 62 | public Result<?> testRedis(@RequestBody Map<String, String> paramMap, HttpServletRequest request) throws InterruptedException { |
57 | 63 | Result result = new Result<>(); |
58 | - String testString = "我是testString1"; | |
59 | - LogRecordContext.putVariable("testString1", testString); | |
60 | - testString = "我是testString2"; | |
61 | - LogRecordContext.putVariable("testString2", testString); | |
62 | - result.setMessage(testString); | |
63 | - log.info("testRedis in paramMap:{}", JSON.toJSONString(paramMap)); | |
64 | - String key = "testKey"; | |
65 | - Map<String, ReceiptHeader> receiptHeaderMap = new ConcurrentHashMap<String, ReceiptHeader>(); | |
66 | - ReceiptHeader receiptHeader = new ReceiptHeader(); | |
67 | - receiptHeader.setCode(paramMap.get("bizId")); | |
68 | - receiptHeaderMap.put("receiptHeaderKey", receiptHeader); | |
69 | - LogRecordContext.putVariable("jsonString", JSON.toJSONString(receiptHeaderMap)); | |
70 | - Map<String, ReceiptHeader> value = redisUtil.getAndSet(key, receiptHeaderMap, new TypeReference<Map<String, ReceiptHeader>>() {}, 10); | |
71 | - Long rxpireTime = redisUtil.getExpire(key); | |
72 | - log.info("redisUtil.getAndSet {} -> {} rxpireTime -> {}", key, JSON.toJSONString(value), rxpireTime); | |
64 | + List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); | |
65 | + ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail(); | |
66 | + receiptContainerDetail.setReceiptCode("SDH10101"); | |
67 | + receiptContainerDetail.setContainerCode("M00061"); | |
68 | + receiptContainerDetail.setMaterialCode("EH812736"); | |
69 | + receiptContainerDetail.setQty(BigDecimal.valueOf(10)); | |
70 | + receiptContainerDetailList.add(receiptContainerDetail); | |
71 | + LogRecordContext.putVariable("locationCode", "100001");// 操作日志收集 | |
72 | + LogRecordContext.putVariable("receiptContainerDetailList", receiptContainerDetailList);// 操作日志收集 | |
73 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList));// 操作日志收集 | |
74 | + | |
75 | + | |
76 | + | |
77 | +// String testString = "我是testString1"; | |
78 | +// LogRecordContext.putVariable("testString1", testString); | |
79 | +// testString = "我是testString2"; | |
80 | +// LogRecordContext.putVariable("testString2", testString); | |
81 | +// result.setMessage(testString); | |
82 | +// log.info("testRedis in paramMap:{}", JSON.toJSONString(paramMap)); | |
83 | +// String key = "testKey"; | |
84 | +// Map<String, ReceiptHeader> receiptHeaderMap = new ConcurrentHashMap<String, ReceiptHeader>(); | |
85 | +// ReceiptHeader receiptHeader = new ReceiptHeader(); | |
86 | +// receiptHeader.setCode(paramMap.get("bizId")); | |
87 | +// receiptHeaderMap.put("receiptHeaderKey", receiptHeader); | |
88 | +// LogRecordContext.putVariable("jsonString", JSON.toJSONString(receiptHeaderMap)); | |
89 | +// Map<String, ReceiptHeader> value = redisUtil.getAndSet(key, receiptHeaderMap, new TypeReference<Map<String, ReceiptHeader>>() {}, 10); | |
90 | +// Long rxpireTime = redisUtil.getExpire(key); | |
91 | +// log.info("redisUtil.getAndSet {} -> {} rxpireTime -> {}", key, JSON.toJSONString(value), rxpireTime); | |
73 | 92 | // result.setSuccess(false); |
74 | 93 | // LogRecordContext.putVariable("isSuccess", result.isSuccess()); |
75 | 94 | |
76 | - Thread.sleep(2000l); | |
95 | +// Thread.sleep(2000l); | |
77 | 96 | // throw new RuntimeException("自定义失败"); |
78 | 97 | return result; |
79 | 98 | // receiptHeaderMap = redisUtil.get(key, new TypeReference<Map<String, ReceiptHeader>>() {}); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.monitor.operation.service.impl; |
2 | 2 | |
3 | 3 | import java.util.ArrayList; |
4 | +import java.util.Collections; | |
4 | 5 | import java.util.List; |
5 | 6 | |
6 | 7 | import org.jeecg.modules.wms.monitor.operation.entity.OperationLog; |
... | ... | @@ -8,6 +9,7 @@ import org.jeecg.modules.wms.monitor.operation.mapper.OperationLogMapper; |
8 | 9 | import org.jeecg.modules.wms.monitor.operation.service.IOperationLogService; |
9 | 10 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail; |
10 | 11 | import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; |
12 | +import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; | |
11 | 13 | import org.jeecg.utils.StringUtils; |
12 | 14 | import org.springframework.stereotype.Service; |
13 | 15 | import org.springframework.util.CollectionUtils; |
... | ... | @@ -15,6 +17,7 @@ import org.springframework.util.CollectionUtils; |
15 | 17 | import com.alibaba.fastjson.JSON; |
16 | 18 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
17 | 19 | |
20 | +import cn.hutool.core.util.ReflectUtil; | |
18 | 21 | import cn.hutool.core.util.StrUtil; |
19 | 22 | import cn.monitor4all.logRecord.bean.LogDTO; |
20 | 23 | import cn.monitor4all.logRecord.service.IOperationLogGetService; |
... | ... | @@ -36,70 +39,35 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
36 | 39 | log.debug(">>>>>> create OperationLog:{} <<<<<<", JSON.toJSONString(logDTO)); |
37 | 40 | List<OperationLog> operationLogList = new ArrayList<OperationLog>(); |
38 | 41 | if (!StringUtils.isEmpty(logDTO.getExtra())) { |
39 | - if (logDTO.getBizType().equals("物料追踪") && logDTO.getTag().equals("入库组盘")) { | |
40 | - List<ReceiptContainerDetail> receiptContainerDetailList = JSON.parseArray(logDTO.getExtra(), ReceiptContainerDetail.class); | |
41 | - if (CollectionUtils.isEmpty(receiptContainerDetailList)) { | |
42 | - return true; | |
43 | - } | |
44 | - for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) { | |
45 | - if (receiptContainerDetail == null || receiptContainerDetail.getUniqueCode() == null) { | |
46 | - continue; | |
47 | - } | |
48 | - String operationMsg = null; | |
49 | - String msg = StrUtil.format("上游单号:{},入库单据号:{},仓库编码:{},容器编码:{},物料编码:{},数量:{}", receiptContainerDetail.getReferCode(), | |
50 | - receiptContainerDetail.getReceiptCode(), receiptContainerDetail.getWarehouseCode(), receiptContainerDetail.getContainerCode(), | |
51 | - receiptContainerDetail.getMaterialCode(), receiptContainerDetail.getQty()); | |
52 | - if (!StringUtils.isEmpty(logDTO.getMsg())) { | |
53 | - operationMsg = logDTO.getMsg() + "," + msg; | |
54 | - } else { | |
55 | - operationMsg = msg; | |
56 | - } | |
57 | - OperationLog operationLog = new OperationLog(); | |
58 | - operationLog.setBizId(receiptContainerDetail.getUniqueCode()); | |
59 | - operationLog.setOperationMsg(StringUtils.substring(operationMsg, 0, 1000)); | |
60 | - operationLog.setBizType(logDTO.getBizType()); | |
61 | - operationLog.setBizTag(logDTO.getTag()); | |
62 | - operationLog.setContentException(StringUtils.substring(logDTO.getException(), 0, 1000)); | |
63 | - operationLog.setContentReturn(StringUtils.substring(logDTO.getReturnStr(), 0, 1000)); | |
64 | - operationLog.setOperationCostTime(logDTO.getExecutionTime()); | |
65 | - operationLog.setOperationStatus(logDTO.getSuccess().equals(true) ? 1 : 0); | |
66 | - operationLog.setOperationTime(logDTO.getOperateDate()); | |
67 | - operationLog.setOperatorName(logDTO.getOperatorId()); | |
68 | - operationLogList.add(operationLog); | |
42 | + if (logDTO.getBizType().equals("物料追踪")) { | |
43 | + if (logDTO.getTag().equals("入库组盘")) { | |
44 | + String message = "容器编码:{},物料编码:{},数量:{}"; | |
45 | + operationLogList.addAll(createOperationLogs(logDTO, ReceiptContainerDetail.class, "getUniqueCode", message, "getReferCode", "getReceiptCode", | |
46 | + "getWarehouseCode", "getContainerCode", "getMaterialCode", "getQty")); | |
69 | 47 | } |
70 | 48 | } else if (logDTO.getBizType().equals("入库单追踪")) { |
71 | - List<ReceiptDetail> receiptDetailList = JSON.parseArray(logDTO.getExtra(), ReceiptDetail.class); | |
72 | - if (CollectionUtils.isEmpty(receiptDetailList)) { | |
73 | - return true; | |
74 | - } | |
75 | - for (ReceiptDetail receiptDetail : receiptDetailList) { | |
76 | - if (receiptDetail == null || receiptDetail.getReceiptCode() == null) { | |
77 | - continue; | |
78 | - } | |
79 | - String operationMsg = null; | |
80 | - String msg = StrUtil.format("物料编码:{},数量:{},已收数量:{}", receiptDetail.getMaterialCode(), receiptDetail.getQty(), | |
81 | - receiptDetail.getTaskQty() == null ? 0 : receiptDetail.getTaskQty()); | |
82 | - if (!StringUtils.isEmpty(logDTO.getMsg())) { | |
83 | - operationMsg = logDTO.getMsg() + "," + msg; | |
84 | - } else { | |
85 | - operationMsg = msg; | |
86 | - } | |
87 | - OperationLog operationLog = new OperationLog(); | |
88 | - operationLog.setBizId(receiptDetail.getReceiptCode()); | |
89 | - operationLog.setOperationMsg(StringUtils.substring(operationMsg, 0, 1000)); | |
90 | - operationLog.setBizType(logDTO.getBizType()); | |
91 | - operationLog.setBizTag(logDTO.getTag()); | |
92 | - operationLog.setContentException(StringUtils.substring(logDTO.getException(), 0, 1000)); | |
93 | - operationLog.setContentReturn(StringUtils.substring(logDTO.getReturnStr(), 0, 1000)); | |
94 | - operationLog.setOperationCostTime(logDTO.getExecutionTime()); | |
95 | - operationLog.setOperationStatus(logDTO.getSuccess().equals(true) ? 1 : 0); | |
96 | - operationLog.setOperationTime(logDTO.getOperateDate()); | |
97 | - operationLog.setOperatorName(logDTO.getOperatorId()); | |
98 | - operationLogList.add(operationLog); | |
49 | + if (logDTO.getTag().equals("详情添加")) { | |
50 | + String message = "物料编码:{},数量:{}"; | |
51 | + operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
52 | + } else if (logDTO.getTag().equals("详情分配库位")) { | |
53 | + String message = "容器编码:{},物料编码:{},收货数量:{}"; | |
54 | + operationLogList.addAll( | |
55 | + createOperationLogs(logDTO, ReceiptContainerDetail.class, "getReceiptCode", message, "getContainerCode", "getMaterialCode", "getQty")); | |
56 | + } else if (logDTO.getTag().equals("详情入库")) { | |
57 | + String message = "物料编码:{},收货数量:{}"; | |
58 | + operationLogList | |
59 | + .addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getTaskQty")); | |
60 | + } else if (logDTO.getTag().equals("详情组盘")) { | |
61 | + String message = "物料编码:{},数量:{},收货数量:{}"; | |
62 | + operationLogList | |
63 | + .addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty", "getTaskQty")); | |
64 | + } else { | |
65 | + String message = "物料编码:{},数量:{}"; | |
66 | + operationLogList | |
67 | + .addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
99 | 68 | } |
100 | 69 | } |
101 | - } | |
102 | - if (!StringUtils.isEmpty(logDTO.getBizId())) { | |
70 | + } else { | |
103 | 71 | OperationLog operationLog = new OperationLog(); |
104 | 72 | operationLog.setBizId(logDTO.getBizId()); |
105 | 73 | operationLog.setOperationMsg(StringUtils.substring(logDTO.getMsg(), 0, 1000)); |
... | ... | @@ -120,4 +88,43 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
120 | 88 | return false; |
121 | 89 | } |
122 | 90 | } |
91 | + | |
92 | + private List<OperationLog> createOperationLogs(LogDTO logDTO, Class<?> clazz, String bizIdMethodName, String text, String... msgMethodNames) { | |
93 | + List<OperationLog> operationLogList = new ArrayList<OperationLog>(); | |
94 | + List<?> detailList = JSON.parseArray(logDTO.getExtra(), clazz); | |
95 | + if (CollectionUtils.isEmpty(detailList)) { | |
96 | + return operationLogList; | |
97 | + } | |
98 | + for (Object detail : detailList) { | |
99 | + String bizId = ReflectUtil.invoke(detail, bizIdMethodName).toString(); | |
100 | + if (detail == null || bizId == null) { | |
101 | + continue; | |
102 | + } | |
103 | + List<String> msgValueList = new ArrayList<String>(); | |
104 | + for (String messageMethodName : msgMethodNames) { | |
105 | + Object value = ReflectUtil.invoke(detail, messageMethodName); | |
106 | + msgValueList.add(value == null ? "" : value.toString()); | |
107 | + } | |
108 | + String operationMsg = null; | |
109 | + String msg = StrUtil.format(text, msgValueList.toArray()); | |
110 | + if (!StringUtils.isEmpty(logDTO.getMsg())) { | |
111 | + operationMsg = logDTO.getMsg() + "," + msg; | |
112 | + } else { | |
113 | + operationMsg = msg; | |
114 | + } | |
115 | + OperationLog operationLog = new OperationLog(); | |
116 | + operationLog.setBizId(bizId); | |
117 | + operationLog.setOperationMsg(StringUtils.substring(operationMsg, 0, 1000)); | |
118 | + operationLog.setBizType(logDTO.getBizType()); | |
119 | + operationLog.setBizTag(logDTO.getTag()); | |
120 | + operationLog.setContentException(StringUtils.substring(logDTO.getException(), 0, 1000)); | |
121 | + operationLog.setContentReturn(StringUtils.substring(logDTO.getReturnStr(), 0, 1000)); | |
122 | + operationLog.setOperationCostTime(logDTO.getExecutionTime()); | |
123 | + operationLog.setOperationStatus(logDTO.getSuccess().equals(true) ? 1 : 0); | |
124 | + operationLog.setOperationTime(logDTO.getOperateDate()); | |
125 | + operationLog.setOperatorName(logDTO.getOperatorId()); | |
126 | + operationLogList.add(operationLog); | |
127 | + } | |
128 | + return operationLogList; | |
129 | + } | |
123 | 130 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/entity/ReceiptDetail.java
huaheng-wms-core/src/main/java/org/jeecg/utils/Swagger3Config.java
... | ... | @@ -75,8 +75,7 @@ public class Swagger3Config implements WebMvcConfigurer { |
75 | 75 | * 新增 securityContexts 保持登录状态 |
76 | 76 | */ |
77 | 77 | private List<SecurityContext> securityContexts() { |
78 | - return new ArrayList( | |
79 | - Collections.singleton(SecurityContext.builder().securityReferences(defaultAuth()).forPaths(PathSelectors.regex("^(?!auth).*$")).build())); | |
78 | + return Collections.singletonList(SecurityContext.builder().securityReferences(defaultAuth()).forPaths(PathSelectors.regex("^(?!auth).*$")).build()); | |
80 | 79 | } |
81 | 80 | |
82 | 81 | /** |
... | ... | @@ -98,7 +97,7 @@ public class Swagger3Config implements WebMvcConfigurer { |
98 | 97 | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
99 | 98 | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
100 | 99 | authorizationScopes[0] = authorizationScope; |
101 | - return new ArrayList(Collections.singleton(new SecurityReference(CommonConstant.X_ACCESS_TOKEN, authorizationScopes))); | |
100 | + return Collections.singletonList(new SecurityReference(CommonConstant.X_ACCESS_TOKEN, authorizationScopes)); | |
102 | 101 | } |
103 | 102 | |
104 | 103 | } |
... | ... |