Commit cd1b594c5dafd057404e534c62eede2b2c0f30c9

Authored by 李泰瑜
2 parents 01919d34 d32ff51b

Merge branch 'develop4' of http://172.16.29.40:8010/wms/wms4 into develop4

Showing 16 changed files with 214 additions and 113 deletions
ant-design-vue-jeecg/src/views/system/DictList.vue
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <a-row :gutter="12"> 7 <a-row :gutter="12">
8 <a-col :md="7" :sm="8"> 8 <a-col :md="7" :sm="8">
9 <a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> 9 <a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
10 - <a-input placeholder="请输入字典名称" v-model="queryParam.dictName"></a-input> 10 + <j-input placeholder="请输入字典名称" v-model="queryParam.dictName"></j-input>
11 </a-form-item> 11 </a-form-item>
12 </a-col> 12 </a-col>
13 <a-col :md="7" :sm="8"> 13 <a-col :md="7" :sm="8">
ant-design-vue-jeecg/src/views/system/monitor/OperationLog.vue
@@ -11,18 +11,30 @@ @@ -11,18 +11,30 @@
11 </a-col> 11 </a-col>
12 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 12 <a-col :xl="6" :lg="7" :md="8" :sm="24">
13 <a-form-item label="业务类型"> 13 <a-form-item label="业务类型">
14 - <a-input placeholder="请输入业务类型" v-model="queryParam.bizType"></a-input> 14 + <j-dict-select-tag placeholder="请选择业务类型" v-model="queryParam.bizType" dictCode="operation_log_type"/>
15 </a-form-item> 15 </a-form-item>
16 </a-col> 16 </a-col>
17 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 17 <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18 + <a-form-item label="业务标签">
  19 + <j-multi-select-tag placeholder="请选择业务标签" v-model="queryParam.bizTag" dictCode="operation_log_tag"/>
  20 + </a-form-item>
  21 + </a-col>
  22 + <template v-if="toggleSearchStatus">
  23 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
18 <a-form-item label="操作内容"> 24 <a-form-item label="操作内容">
19 <j-input placeholder="请输入操作内容" v-model="queryParam.operationMsg"></j-input> 25 <j-input placeholder="请输入操作内容" v-model="queryParam.operationMsg"></j-input>
20 </a-form-item> 26 </a-form-item>
21 </a-col> 27 </a-col>
  28 + </template>
22 <a-col :xl="6" :lg="7" :md="8" :sm="24"> 29 <a-col :xl="6" :lg="7" :md="8" :sm="24">
23 <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> 30 <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
24 <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> 31 <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  32 + <a-button type="primary" @click="handleExportXls('操作记录')" icon="download" style="margin-left: 8px">导出</a-button>
25 <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> 33 <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  34 + <a @click="handleToggleSearch" style="margin-left: 8px">
  35 + {{ toggleSearchStatus ? '收起' : '展开' }}
  36 + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  37 + </a>
26 </span> 38 </span>
27 </a-col> 39 </a-col>
28 </a-row> 40 </a-row>
@@ -30,14 +42,6 @@ @@ -30,14 +42,6 @@
30 </div> 42 </div>
31 <!-- 查询区域-END --> 43 <!-- 查询区域-END -->
32 44
33 - <!-- 操作按钮区域 -->  
34 - <div class="table-operator">  
35 - <a-button type="primary" icon="download" @click="handleExportXls('操作记录表')">导出</a-button>  
36 - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">  
37 - <a-button type="primary" icon="import">导入</a-button>  
38 - </a-upload>  
39 - </div>  
40 -  
41 <!-- table区域-begin --> 45 <!-- table区域-begin -->
42 <div> 46 <div>
43 <a-table 47 <a-table
@@ -113,6 +117,11 @@ @@ -113,6 +117,11 @@
113 dataIndex: 'bizType' 117 dataIndex: 'bizType'
114 }, 118 },
115 { 119 {
  120 + title:'业务标签',
  121 + align:"center",
  122 + dataIndex: 'bizTag'
  123 + },
  124 + {
116 title:'操作内容', 125 title:'操作内容',
117 align:"center", 126 align:"center",
118 dataIndex: 'operationMsg' 127 dataIndex: 'operationMsg'
@@ -133,21 +142,6 @@ @@ -133,21 +142,6 @@
133 dataIndex: 'operationCostTime' 142 dataIndex: 'operationCostTime'
134 }, 143 },
135 { 144 {
136 - title:'方法返回内容',  
137 - align:"center",  
138 - dataIndex: 'contentReturn'  
139 - },  
140 - {  
141 - title:'方法异常内容',  
142 - align:"center",  
143 - dataIndex: 'contentException'  
144 - },  
145 - {  
146 - title:'操作人ID',  
147 - align:"center",  
148 - dataIndex: 'operatorId'  
149 - },  
150 - {  
151 title:'操作人姓名', 145 title:'操作人姓名',
152 align:"center", 146 align:"center",
153 dataIndex: 'operatorName' 147 dataIndex: 'operatorName'
@@ -207,7 +201,6 @@ @@ -207,7 +201,6 @@
207 fieldList.push({type:'int',value:'operationCostTime',text:'操作耗时',dictCode:''}) 201 fieldList.push({type:'int',value:'operationCostTime',text:'操作耗时',dictCode:''})
208 fieldList.push({type:'string',value:'contentReturn',text:'方法返回内容',dictCode:''}) 202 fieldList.push({type:'string',value:'contentReturn',text:'方法返回内容',dictCode:''})
209 fieldList.push({type:'string',value:'contentException',text:'方法异常内容',dictCode:''}) 203 fieldList.push({type:'string',value:'contentException',text:'方法异常内容',dictCode:''})
210 - fieldList.push({type:'string',value:'operatorId',text:'操作人ID',dictCode:''})  
211 fieldList.push({type:'string',value:'operatorName',text:'操作人姓名',dictCode:''}) 204 fieldList.push({type:'string',value:'operatorName',text:'操作人姓名',dictCode:''})
212 this.superFieldList = fieldList 205 this.superFieldList = fieldList
213 } 206 }
ant-design-vue-jeecg/src/views/system/monitor/modules/OperationLogForm.vue
@@ -14,6 +14,11 @@ @@ -14,6 +14,11 @@
14 </a-form-model-item> 14 </a-form-model-item>
15 </a-col> 15 </a-col>
16 <a-col :span="24"> 16 <a-col :span="24">
  17 + <a-form-model-item label="业务标签" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bizTag">
  18 + <a-input v-model="model.bizTag" placeholder="请输入业务标签" ></a-input>
  19 + </a-form-model-item>
  20 + </a-col>
  21 + <a-col :span="24">
17 <a-form-model-item label="操作内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationMsg"> 22 <a-form-model-item label="操作内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationMsg">
18 <a-input v-model="model.operationMsg" placeholder="请输入操作内容" ></a-input> 23 <a-input v-model="model.operationMsg" placeholder="请输入操作内容" ></a-input>
19 </a-form-model-item> 24 </a-form-model-item>
@@ -44,11 +49,6 @@ @@ -44,11 +49,6 @@
44 </a-form-model-item> 49 </a-form-model-item>
45 </a-col> 50 </a-col>
46 <a-col :span="24"> 51 <a-col :span="24">
47 - <a-form-model-item label="操作人ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operatorId">  
48 - <a-input v-model="model.operatorId" placeholder="请输入操作人ID" ></a-input>  
49 - </a-form-model-item>  
50 - </a-col>  
51 - <a-col :span="24">  
52 <a-form-model-item label="操作人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operatorName"> 52 <a-form-model-item label="操作人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operatorName">
53 <a-input v-model="model.operatorName" placeholder="请输入操作人姓名" ></a-input> 53 <a-input v-model="model.operatorName" placeholder="请输入操作人姓名" ></a-input>
54 </a-form-model-item> 54 </a-form-model-item>
huaheng-wms-core/src/main/java/org/jeecg/modules/cas/controller/CasClientController.java
@@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletRequest; @@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletRequest;
6 import javax.servlet.http.HttpServletResponse; 6 import javax.servlet.http.HttpServletResponse;
7 7
8 import cn.hutool.crypto.SecureUtil; 8 import cn.hutool.crypto.SecureUtil;
  9 +import cn.monitor4all.logRecord.annotation.OperationLog;
  10 +
9 import org.apache.commons.lang.StringUtils; 11 import org.apache.commons.lang.StringUtils;
10 import org.jeecg.common.api.vo.Result; 12 import org.jeecg.common.api.vo.Result;
11 import org.jeecg.common.constant.CacheConstant; 13 import org.jeecg.common.constant.CacheConstant;
@@ -71,7 +73,7 @@ public class CasClientController { @@ -71,7 +73,7 @@ public class CasClientController {
71 if (StringUtils.isEmpty(principal)) { 73 if (StringUtils.isEmpty(principal)) {
72 throw new Exception("No principal was found in the response from the CAS server."); 74 throw new Exception("No principal was found in the response from the CAS server.");
73 } 75 }
74 - log.info("-------token----username---" + principal); 76 + log.info("---token---username---" + principal);
75 // 1. 校验用户是否有效 77 // 1. 校验用户是否有效
76 SysUser sysUser = sysUserService.getUserByName(principal); 78 SysUser sysUser = sysUserService.getUserByName(principal);
77 result = sysUserService.checkUserIsEffective(sysUser); 79 result = sysUserService.checkUserIsEffective(sysUser);
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/controller/AcsController.java
@@ -9,24 +9,21 @@ import org.jeecg.common.api.vo.Result; @@ -9,24 +9,21 @@ import org.jeecg.common.api.vo.Result;
9 import org.jeecg.modules.wms.api.acs.entity.AcsStatus; 9 import org.jeecg.modules.wms.api.acs.entity.AcsStatus;
10 import org.jeecg.modules.wms.api.acs.service.IAcsService; 10 import org.jeecg.modules.wms.api.acs.service.IAcsService;
11 import org.jeecg.modules.wms.config.address.service.IAddressService; 11 import org.jeecg.modules.wms.config.address.service.IAddressService;
12 -import org.jeecg.modules.wms.framework.aspectj.dto.ApiAuthentication;  
13 -import org.jeecg.modules.wms.framework.aspectj.dto.ApiAuthentication.ApiAuthenticationBuild;  
14 import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; 12 import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger;
15 import org.jeecg.modules.wms.framework.controller.HuahengBaseController; 13 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
16 import org.jeecg.modules.wms.task.agvTask.service.IAgvTaskService; 14 import org.jeecg.modules.wms.task.agvTask.service.IAgvTaskService;
17 -import org.jeecg.utils.OkHttpUtils; 15 +import org.jeecg.utils.HuahengJwtUtil;
18 import org.jeecg.utils.StringUtils; 16 import org.jeecg.utils.StringUtils;
19 import org.jeecg.utils.constant.QuantityConstant; 17 import org.jeecg.utils.constant.QuantityConstant;
20 import org.springframework.transaction.annotation.Transactional; 18 import org.springframework.transaction.annotation.Transactional;
21 import org.springframework.web.bind.annotation.PostMapping; 19 import org.springframework.web.bind.annotation.PostMapping;
22 import org.springframework.web.bind.annotation.RequestBody; 20 import org.springframework.web.bind.annotation.RequestBody;
23 -import org.springframework.web.bind.annotation.RequestHeader;  
24 import org.springframework.web.bind.annotation.RequestMapping; 21 import org.springframework.web.bind.annotation.RequestMapping;
25 import org.springframework.web.bind.annotation.ResponseBody; 22 import org.springframework.web.bind.annotation.ResponseBody;
26 import org.springframework.web.bind.annotation.RestController; 23 import org.springframework.web.bind.annotation.RestController;
27 24
28 -import com.alibaba.fastjson.JSON;  
29 - 25 +import cn.monitor4all.logRecord.annotation.OperationLog;
  26 +import cn.monitor4all.logRecord.context.LogRecordContext;
30 import io.swagger.annotations.ApiOperation; 27 import io.swagger.annotations.ApiOperation;
31 28
32 @RestController 29 @RestController
@@ -46,12 +43,15 @@ public class AcsController extends HuahengBaseController { @@ -46,12 +43,15 @@ public class AcsController extends HuahengBaseController {
46 // @ApiLogger(apiName = "API接口第三方Token校验测试", from = "TEST") 43 // @ApiLogger(apiName = "API接口第三方Token校验测试", from = "TEST")
47 @ResponseBody 44 @ResponseBody
48 @PostMapping(value = "/testTokenCheck") 45 @PostMapping(value = "/testTokenCheck")
  46 + @OperationLog(bizType = "'物料追踪'", tag = "'入库完成'", bizId = "#paramMap.get('bizId')",extra = "#jsonString", msg = "'测试操作日志'",
  47 + operatorId = "#username", recordReturnValue = true)
49 public Result<?> testTokenCheck(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { 48 public Result<?> testTokenCheck(@RequestBody Map<String, String> paramMap, HttpServletRequest request) {
50 - String audience = ApiAuthentication.getInstance().getAudience();  
51 - String url = "http://127.0.0.1:8080/wms/api/wms/acs/testTokenCheck";  
52 - String body = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(paramMap)); 49 +// String audience = ApiAuthentication.getInstance().getAudience();
  50 +// String url = "http://localhost:8080/wms/api/wms/acs/testTokenCheck";
  51 +// String body = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(paramMap));
53 // String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_AGV_TASK_ASSIGN); 52 // String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_AGV_TASK_ASSIGN);
54 - return Result.ok(body); 53 + LogRecordContext.putVariable("username", HuahengJwtUtil.getCurrentOperator());
  54 + return Result.ok();
55 } 55 }
56 56
57 57
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/aspectj/dto/ApiAuthentication.java
@@ -22,7 +22,7 @@ public class ApiAuthentication { @@ -22,7 +22,7 @@ public class ApiAuthentication {
22 private String operator; 22 private String operator;
23 23
24 /** Token使用方 */ 24 /** Token使用方 */
25 - private String audience; // 观众,相当于接受者 25 + private String audience = "Unknown"; // 观众,相当于接受者
26 26
27 /** Token签发方(WMS) */ 27 /** Token签发方(WMS) */
28 private String issuer = HuahengJwtUtil.HUAHENG_SYSTEM_ID; 28 private String issuer = HuahengJwtUtil.HUAHENG_SYSTEM_ID;
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/TestController.java
@@ -2,29 +2,27 @@ package org.jeecg.modules.wms.framework.controller; @@ -2,29 +2,27 @@ package org.jeecg.modules.wms.framework.controller;
2 2
3 import java.security.NoSuchAlgorithmException; 3 import java.security.NoSuchAlgorithmException;
4 import java.security.SecureRandom; 4 import java.security.SecureRandom;
5 -import java.util.Date;  
6 import java.util.Map; 5 import java.util.Map;
  6 +import java.util.concurrent.ConcurrentHashMap;
7 7
8 import javax.servlet.http.HttpServletRequest; 8 import javax.servlet.http.HttpServletRequest;
9 9
10 import org.jeecg.common.api.vo.Result; 10 import org.jeecg.common.api.vo.Result;
11 -import org.jeecg.common.aspect.annotation.AutoLog;  
12 -import org.jeecg.modules.system.entity.SysDataLog;  
13 import org.jeecg.modules.system.service.ISysDataLogService; 11 import org.jeecg.modules.system.service.ISysDataLogService;
14 -import org.jeecg.modules.wms.framework.aspectj.lang.annotation.ApiLogger; 12 +import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
  13 +import org.jeecg.utils.HuahengJwtUtil;
15 import org.jeecg.utils.HuahengRedisUtil; 14 import org.jeecg.utils.HuahengRedisUtil;
16 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
17 -import org.springframework.transaction.annotation.Transactional;  
18 import org.springframework.web.bind.annotation.PostMapping; 16 import org.springframework.web.bind.annotation.PostMapping;
19 import org.springframework.web.bind.annotation.RequestBody; 17 import org.springframework.web.bind.annotation.RequestBody;
20 -import org.springframework.web.bind.annotation.RequestMapping;  
21 import org.springframework.web.bind.annotation.ResponseBody; 18 import org.springframework.web.bind.annotation.ResponseBody;
22 import org.springframework.web.bind.annotation.RestController; 19 import org.springframework.web.bind.annotation.RestController;
23 20
24 import com.alibaba.fastjson.JSON; 21 import com.alibaba.fastjson.JSON;
25 -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;  
26 -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; 22 +import com.alibaba.fastjson.TypeReference;
27 23
  24 +import cn.monitor4all.logRecord.annotation.OperationLog;
  25 +import cn.monitor4all.logRecord.context.LogRecordContext;
28 import lombok.extern.slf4j.Slf4j; 26 import lombok.extern.slf4j.Slf4j;
29 27
30 /** 28 /**
@@ -41,8 +39,7 @@ public class TestController extends HuahengBaseController { @@ -41,8 +39,7 @@ public class TestController extends HuahengBaseController {
41 39
42 @Autowired 40 @Autowired
43 private ISysDataLogService sysDataLogService; 41 private ISysDataLogService sysDataLogService;
44 -  
45 - 42 +
46 // @ApiLogger(apiName = "API接口第三方Token校验测试", from = "TEST") 43 // @ApiLogger(apiName = "API接口第三方Token校验测试", from = "TEST")
47 // @ResponseBody 44 // @ResponseBody
48 // @PostMapping(value = "/api/wms/testTokenCheck") 45 // @PostMapping(value = "/api/wms/testTokenCheck")
@@ -51,42 +48,54 @@ public class TestController extends HuahengBaseController { @@ -51,42 +48,54 @@ public class TestController extends HuahengBaseController {
51 // 48 //
52 // return new Result<>(); 49 // return new Result<>();
53 // } 50 // }
54 -  
55 51
56 - @AutoLog(value = "TestController-testRedis") 52 +// @AutoLog(value = "TestController-testRedis")
57 @ResponseBody 53 @ResponseBody
58 @PostMapping(value = "/test/testRedis") 54 @PostMapping(value = "/test/testRedis")
59 - public Result<?> testRedis(@RequestBody Map<String, String> paramMap, HttpServletRequest request) {  
60 -  
61 -// log.info("testRedis in paramMap:{}", JSON.toJSONString(paramMap));  
62 -// String key = "testKey";  
63 -// Map<String, ReceiptHeader> receiptHeaderMap = new ConcurrentHashMap<String, ReceiptHeader>();  
64 -// ReceiptHeader receiptHeader = new ReceiptHeader();  
65 -// receiptHeader.setCode("001");  
66 -// receiptHeaderMap.put("receiptHeaderKey", receiptHeader);  
67 -// Map<String, ReceiptHeader> value = redisUtil.getAndSet(key, receiptHeaderMap, new TypeReference<Map<String, ReceiptHeader>>() {}, 10);  
68 -// Long rxpireTime = redisUtil.getExpire(key);  
69 -// log.info("redisUtil.getAndSet {} -> {} rxpireTime -> {}", key, JSON.toJSONString(value), rxpireTime);  
70 -//  
71 -// Thread.sleep(2000l); 55 + @OperationLog(bizType = "'物料追踪'", tag = "'分配库位'", bizId = "#paramMap.get('bizId')",extra = "#jsonString", msg = "'测试操作日志'",
  56 + operatorId = "#username", recordReturnValue = true)
  57 + public Result<?> testRedis(@RequestBody Map<String, String> paramMap, HttpServletRequest request) throws InterruptedException {
  58 + Result result = new Result<>();
  59 + String testString = "我是testString1";
  60 + LogRecordContext.putVariable("testString1", testString);
  61 + testString = "我是testString2";
  62 + LogRecordContext.putVariable("testString2", testString);
  63 + result.setMessage(testString);
  64 + log.info("testRedis in paramMap:{}", JSON.toJSONString(paramMap));
  65 + String key = "testKey";
  66 + Map<String, ReceiptHeader> receiptHeaderMap = new ConcurrentHashMap<String, ReceiptHeader>();
  67 + ReceiptHeader receiptHeader = new ReceiptHeader();
  68 + receiptHeader.setCode(paramMap.get("bizId"));
  69 + receiptHeaderMap.put("receiptHeaderKey", receiptHeader);
  70 + LogRecordContext.putVariable("jsonString", JSON.toJSONString(receiptHeaderMap));
  71 + Map<String, ReceiptHeader> value = redisUtil.getAndSet(key, receiptHeaderMap, new TypeReference<Map<String, ReceiptHeader>>() {}, 10);
  72 + Long rxpireTime = redisUtil.getExpire(key);
  73 + log.info("redisUtil.getAndSet {} -> {} rxpireTime -> {}", key, JSON.toJSONString(value), rxpireTime);
  74 + LogRecordContext.putVariable("username", HuahengJwtUtil.getCurrentOperator());
  75 +// result.setSuccess(false);
  76 +// LogRecordContext.putVariable("isSuccess", result.isSuccess());
  77 +
  78 + Thread.sleep(2000l);
  79 +// throw new RuntimeException("自定义失败");
  80 + return result;
72 // receiptHeaderMap = redisUtil.get(key, new TypeReference<Map<String, ReceiptHeader>>() {}); 81 // receiptHeaderMap = redisUtil.get(key, new TypeReference<Map<String, ReceiptHeader>>() {});
73 // rxpireTime = redisUtil.getExpire(key); 82 // rxpireTime = redisUtil.getExpire(key);
74 // log.info("redisUtil.get {} sleep 2s -> {} rxpireTime -> {}", key, JSON.toJSONString(value), rxpireTime); 83 // log.info("redisUtil.get {} sleep 2s -> {} rxpireTime -> {}", key, JSON.toJSONString(value), rxpireTime);
75 84
76 - Result result = handleMultiProcess("testRedis", paramMap.get("username"), new MultiProcessListener() {  
77 -  
78 - @Override  
79 - @Transactional(timeout = 10)  
80 - public Result<?> doProcess() throws Exception {  
81 - LambdaUpdateWrapper<SysDataLog> updateWrapper = new UpdateWrapper().lambda();  
82 - updateWrapper.set(SysDataLog::getUpdateTime, new Date());  
83 - updateWrapper.eq(SysDataLog::getId, 10);  
84 - Thread.sleep(1000);  
85 - sysDataLogService.update(updateWrapper);  
86 - return new Result<>();  
87 - }  
88 -  
89 - }); 85 +// Result result = handleMultiProcess("testRedis", paramMap.get("username"), new MultiProcessListener() {
  86 +//
  87 +// @Override
  88 +// @Transactional(timeout = 10)
  89 +// public Result<?> doProcess() throws Exception {
  90 +// LambdaUpdateWrapper<SysDataLog> updateWrapper = new UpdateWrapper().lambda();
  91 +// updateWrapper.set(SysDataLog::getUpdateTime, new Date());
  92 +// updateWrapper.eq(SysDataLog::getId, 10);
  93 +// Thread.sleep(1000);
  94 +// sysDataLogService.update(updateWrapper);
  95 +// return new Result<>();
  96 +// }
  97 +//
  98 +// });
90 99
91 // Long count = redisUtil.decr("countKey", 10); 100 // Long count = redisUtil.decr("countKey", 10);
92 // rxpireTime = redisUtil.getExpire("countKey"); 101 // rxpireTime = redisUtil.getExpire("countKey");
@@ -119,8 +128,8 @@ public class TestController extends HuahengBaseController { @@ -119,8 +128,8 @@ public class TestController extends HuahengBaseController {
119 // rxpireTime = redisUtil.getExpire("countKey"); 128 // rxpireTime = redisUtil.getExpire("countKey");
120 // log.info("countKey sleep 10s get -> {} rxpireTime -> {}", count, rxpireTime); 129 // log.info("countKey sleep 10s get -> {} rxpireTime -> {}", count, rxpireTime);
121 // log.info("countKey hasKey -> {}",redisUtil.hasKey("countKey")); 130 // log.info("countKey hasKey -> {}",redisUtil.hasKey("countKey"));
122 -  
123 - return result; 131 +// LogRecordContext.putVariable("result", result);
  132 +// return result;
124 } 133 }
125 134
126 private int generateInt(int min, int max) throws NoSuchAlgorithmException { 135 private int generateInt(int min, int max) throws NoSuchAlgorithmException {
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/controller/OperationLogController.java
@@ -58,6 +58,7 @@ public class OperationLogController extends JeecgController&lt;OperationLog, IOpera @@ -58,6 +58,7 @@ public class OperationLogController extends JeecgController&lt;OperationLog, IOpera
58 public Result<IPage<OperationLog>> queryPageList(OperationLog operationLog, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, 58 public Result<IPage<OperationLog>> queryPageList(OperationLog operationLog, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
59 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { 59 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
60 QueryWrapper<OperationLog> queryWrapper = QueryGenerator.initQueryWrapper(operationLog, req.getParameterMap()); 60 QueryWrapper<OperationLog> queryWrapper = QueryGenerator.initQueryWrapper(operationLog, req.getParameterMap());
  61 + queryWrapper.orderByAsc("operation_time");
61 Page<OperationLog> page = new Page<OperationLog>(pageNo, pageSize); 62 Page<OperationLog> page = new Page<OperationLog>(pageNo, pageSize);
62 IPage<OperationLog> pageList = operationLogService.page(page, queryWrapper); 63 IPage<OperationLog> pageList = operationLogService.page(page, queryWrapper);
63 return Result.OK(pageList); 64 return Result.OK(pageList);
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/entity/OperationLog.java
@@ -43,6 +43,10 @@ public class OperationLog implements Serializable { @@ -43,6 +43,10 @@ public class OperationLog implements Serializable {
43 @Excel(name = "业务类型", width = 15) 43 @Excel(name = "业务类型", width = 15)
44 @ApiModelProperty(value = "业务类型") 44 @ApiModelProperty(value = "业务类型")
45 private java.lang.String bizType; 45 private java.lang.String bizType;
  46 + /**业务标签*/
  47 + @Excel(name = "业务标签", width = 15)
  48 + @ApiModelProperty(value = "业务标签")
  49 + private java.lang.String bizTag;
46 /**操作内容*/ 50 /**操作内容*/
47 @Excel(name = "操作内容", width = 15) 51 @Excel(name = "操作内容", width = 15)
48 @ApiModelProperty(value = "操作内容") 52 @ApiModelProperty(value = "操作内容")
@@ -67,10 +71,6 @@ public class OperationLog implements Serializable { @@ -67,10 +71,6 @@ public class OperationLog implements Serializable {
67 @Excel(name = "方法异常内容", width = 15) 71 @Excel(name = "方法异常内容", width = 15)
68 @ApiModelProperty(value = "方法异常内容") 72 @ApiModelProperty(value = "方法异常内容")
69 private java.lang.String contentException; 73 private java.lang.String contentException;
70 - /**操作人ID*/  
71 - @Excel(name = "操作人ID", width = 15)  
72 - @ApiModelProperty(value = "操作人ID")  
73 - private java.lang.String operatorId;  
74 /**操作人姓名*/ 74 /**操作人姓名*/
75 @Excel(name = "操作人姓名", width = 15) 75 @Excel(name = "操作人姓名", width = 15)
76 @ApiModelProperty(value = "操作人姓名") 76 @ApiModelProperty(value = "操作人姓名")
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java
1 package org.jeecg.modules.wms.monitor.operation.service.impl; 1 package org.jeecg.modules.wms.monitor.operation.service.impl;
2 2
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
3 import org.jeecg.modules.wms.monitor.operation.entity.OperationLog; 6 import org.jeecg.modules.wms.monitor.operation.entity.OperationLog;
4 import org.jeecg.modules.wms.monitor.operation.mapper.OperationLogMapper; 7 import org.jeecg.modules.wms.monitor.operation.mapper.OperationLogMapper;
5 import org.jeecg.modules.wms.monitor.operation.service.IOperationLogService; 8 import org.jeecg.modules.wms.monitor.operation.service.IOperationLogService;
  9 +import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
  10 +import org.jeecg.utils.StringUtils;
6 import org.springframework.stereotype.Service; 11 import org.springframework.stereotype.Service;
  12 +import org.springframework.util.CollectionUtils;
7 13
8 import com.alibaba.fastjson.JSON; 14 import com.alibaba.fastjson.JSON;
9 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 15 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
10 16
  17 +import cn.hutool.core.util.StrUtil;
11 import cn.monitor4all.logRecord.bean.LogDTO; 18 import cn.monitor4all.logRecord.bean.LogDTO;
12 import cn.monitor4all.logRecord.service.IOperationLogGetService; 19 import cn.monitor4all.logRecord.service.IOperationLogGetService;
13 import lombok.extern.slf4j.Slf4j; 20 import lombok.extern.slf4j.Slf4j;
@@ -25,26 +32,54 @@ public class OperationLogServiceImpl extends ServiceImpl&lt;OperationLogMapper, Ope @@ -25,26 +32,54 @@ public class OperationLogServiceImpl extends ServiceImpl&lt;OperationLogMapper, Ope
25 @Override 32 @Override
26 public boolean createLog(LogDTO logDTO) throws Exception { 33 public boolean createLog(LogDTO logDTO) throws Exception {
27 try { 34 try {
28 - log.debug(">>>>>> create OperationLog: [{}]", JSON.toJSONString(logDTO));  
29 - if (null == logDTO.getBizId()) {  
30 - log.error(">>>>>> create OperationLog bizId is null");  
31 - return false; 35 + log.debug(">>>>>> create OperationLog:{} <<<<<<", JSON.toJSONString(logDTO));
  36 + List<OperationLog> operationLogList = new ArrayList<OperationLog>();
  37 + if (!StringUtils.isEmpty(logDTO.getExtra())) {
  38 + if (logDTO.getBizType().equals("物料追踪") && logDTO.getTag().equals("入库组盘")) {
  39 + List<ReceiptContainerDetail> receiptContainerDetailList = JSON.parseArray(logDTO.getExtra(), ReceiptContainerDetail.class);
  40 + if (CollectionUtils.isEmpty(receiptContainerDetailList)) {
  41 + return true;
  42 + }
  43 + for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) {
  44 + if (receiptContainerDetail == null || receiptContainerDetail.getUniqueCode() == null) {
  45 + continue;
  46 + }
  47 + String msg = StrUtil.format("上游单号:{},入库单据号:{},仓库编码:{},托盘编码:{},物料编码:{},入库数量:{}", receiptContainerDetail.getReferCode(),
  48 + receiptContainerDetail.getReceiptCode(), receiptContainerDetail.getWarehouseCode(), receiptContainerDetail.getContainerCode(),
  49 + receiptContainerDetail.getMaterialCode(), receiptContainerDetail.getQty());
  50 + OperationLog operationLog = new OperationLog();
  51 + operationLog.setBizId(receiptContainerDetail.getUniqueCode());
  52 + operationLog.setBizType(logDTO.getBizType());
  53 + operationLog.setBizTag(logDTO.getTag());
  54 + operationLog.setContentException(StringUtils.substring(logDTO.getException(), 0, 1000));
  55 + operationLog.setContentReturn(StringUtils.substring(logDTO.getReturnStr(), 0, 1000));
  56 + operationLog.setOperationCostTime(logDTO.getExecutionTime());
  57 + operationLog.setOperationMsg(StringUtils.substring(msg, 0, 1000));
  58 + operationLog.setOperationStatus(logDTO.getSuccess().equals(true) ? 1 : 0);
  59 + operationLog.setOperationTime(logDTO.getOperateDate());
  60 + operationLog.setOperatorName(logDTO.getOperatorId());
  61 + operationLogList.add(operationLog);
  62 + }
  63 + }
  64 + }
  65 + if (!StringUtils.isEmpty(logDTO.getBizId())) {
  66 + OperationLog operationLog = new OperationLog();
  67 + operationLog.setBizId(logDTO.getBizId());
  68 + operationLog.setBizType(logDTO.getBizType());
  69 + operationLog.setBizTag(logDTO.getTag());
  70 + operationLog.setContentException(StringUtils.substring(logDTO.getException(), 0, 1000));
  71 + operationLog.setContentReturn(StringUtils.substring(logDTO.getReturnStr(), 0, 1000));
  72 + operationLog.setOperationCostTime(logDTO.getExecutionTime());
  73 + operationLog.setOperationMsg(StringUtils.substring(logDTO.getMsg(), 0, 1000));
  74 + operationLog.setOperationStatus(logDTO.getSuccess().equals(true) ? 1 : 0);
  75 + operationLog.setOperationTime(logDTO.getOperateDate());
  76 + operationLog.setOperatorName(logDTO.getOperatorId());
  77 + operationLogList.add(operationLog);
32 } 78 }
33 - OperationLog operationLog = new OperationLog();  
34 - operationLog.setBizId(logDTO.getBizId());  
35 - operationLog.setBizType(logDTO.getBizType());  
36 - operationLog.setContentException(logDTO.getException());  
37 - operationLog.setContentReturn(logDTO.getReturnStr());  
38 - operationLog.setOperationCostTime(logDTO.getExecutionTime());  
39 - operationLog.setOperationMsg(logDTO.getMsg());  
40 - operationLog.setOperationStatus(logDTO.getSuccess().equals(true) ? 1 : 0);  
41 - operationLog.setOperationTime(logDTO.getOperateDate());  
42 - operationLog.setOperatorId(logDTO.getOperatorId());  
43 - operationLog.setOperatorName(logDTO.getOperatorId());  
44 - this.save(operationLog); 79 + this.saveBatch(operationLogList);
45 return true; 80 return true;
46 } catch (Exception e) { 81 } catch (Exception e) {
47 - log.error(">>>>>> create OperationLog error:{}", e.getMessage(), e); 82 + log.error(">>>>>> create OperationLog error:{} <<<<<<", e.getMessage(), e);
48 return false; 83 return false;
49 } 84 }
50 } 85 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/entity/ReceiptContainerDetail.java
@@ -39,6 +39,10 @@ public class ReceiptContainerDetail implements Serializable { @@ -39,6 +39,10 @@ public class ReceiptContainerDetail implements Serializable {
39 /** 入库单详情ID */ 39 /** 入库单详情ID */
40 @ApiModelProperty(value = "入库单详情ID") 40 @ApiModelProperty(value = "入库单详情ID")
41 private Integer receiptDetailId; 41 private Integer receiptDetailId;
  42 + /** 容器号 */
  43 + @Excel(name = "容器号", width = 15)
  44 + @ApiModelProperty(value = "容器号")
  45 + private String containerCode;
42 /** 入库单编码 */ 46 /** 入库单编码 */
43 @ApiModelProperty(value = "入库单编码") 47 @ApiModelProperty(value = "入库单编码")
44 private String receiptCode; 48 private String receiptCode;
@@ -50,6 +54,10 @@ public class ReceiptContainerDetail implements Serializable { @@ -50,6 +54,10 @@ public class ReceiptContainerDetail implements Serializable {
50 @Excel(name = "货主编码", width = 15) 54 @Excel(name = "货主编码", width = 15)
51 @ApiModelProperty(value = "货主编码") 55 @ApiModelProperty(value = "货主编码")
52 private String companyCode; 56 private String companyCode;
  57 + /** 上游单号 */
  58 + @Excel(name = "上游单号", width = 15)
  59 + @ApiModelProperty(value = "上游单号")
  60 + private String referCode;
53 /** 物料编码 */ 61 /** 物料编码 */
54 @Excel(name = "物料编码", width = 15) 62 @Excel(name = "物料编码", width = 15)
55 @ApiModelProperty(value = "物料编码") 63 @ApiModelProperty(value = "物料编码")
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
1 package org.jeecg.modules.wms.receipt.receiptHeader.controller; 1 package org.jeecg.modules.wms.receipt.receiptHeader.controller;
2 2
3 import com.aliyun.oss.ServiceException; 3 import com.aliyun.oss.ServiceException;
  4 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  5 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
4 import org.apache.shiro.authz.annotation.RequiresPermissions; 6 import org.apache.shiro.authz.annotation.RequiresPermissions;
5 import org.jeecg.common.system.query.QueryGenerator; 7 import org.jeecg.common.system.query.QueryGenerator;
6 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 8 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -195,6 +197,25 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec @@ -195,6 +197,25 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
195 return Result.OK(pageList); 197 return Result.OK(pageList);
196 } 198 }
197 199
  200 + @ApiOperation(value = "入库单详情-通过多个明细id查询", notes = "入库单详情-通过多个明细id查询")
  201 + @PostMapping(value = "/listReceiptDetailByIds")
  202 + public Result<List<ReceiptDetail>> listReceiptDetailByIds(@RequestBody List<Integer> ids ) {
  203 + return Result.ok(receiptDetailService.listByIds(ids));
  204 + }
  205 +
  206 + @ApiOperation(value = "入库单详情-查询未收完的明细", notes = "入库单详情-查询未收完的明细")
  207 + @GetMapping(value = "/listReceiptDetailByCode")
  208 + public Result<IPage<ReceiptDetail>> listReceiptDetailByCode(String code, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
  209 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
  210 + LambdaQueryWrapper<ReceiptDetail> query = Wrappers.lambdaQuery();
  211 + query.eq(StringUtils.isNotEmpty(code), ReceiptDetail::getReceiptCode, code)
  212 + .lt(ReceiptDetail::getStatus, QuantityConstant.RECEIPT_HEADER_COMPLETED)
  213 + .last(" and qty-task_qty>0");
  214 + Page<ReceiptDetail> page = new Page<ReceiptDetail>(pageNo, pageSize);
  215 + IPage<ReceiptDetail> pageList = receiptDetailService.page(page, query);
  216 + return Result.ok(pageList);
  217 + }
  218 +
198 /** 219 /**
199 * 添加 220 * 添加
200 * @param receiptDetail 221 * @param receiptDetail
@@ -287,7 +308,7 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec @@ -287,7 +308,7 @@ public class ReceiptHeaderController extends JeecgController&lt;ReceiptHeader, IRec
287 String selections = request.getParameter("selections"); 308 String selections = request.getParameter("selections");
288 if (oConvertUtils.isNotEmpty(selections)) { 309 if (oConvertUtils.isNotEmpty(selections)) {
289 List<String> selectionList = Arrays.asList(selections.split(",")); 310 List<String> selectionList = Arrays.asList(selections.split(","));
290 - exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); 311 + exportList = pageList.stream().filter(item -> selectionList.contains(item.getId().toString())).collect(Collectors.toList());
291 } else { 312 } else {
292 exportList = pageList; 313 exportList = pageList;
293 } 314 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/domain/Receive.java
@@ -7,8 +7,9 @@ import java.math.BigDecimal; @@ -7,8 +7,9 @@ import java.math.BigDecimal;
7 @Data 7 @Data
8 public class Receive { 8 public class Receive {
9 9
10 - private Integer id;  
11 - private String containerCode; 10 + private Integer id;// 入库详情ID
  11 + private String containerCode; // 托盘号
  12 + private String uniqueCode;// 唯一号
12 private String materialCode; 13 private String materialCode;
13 private String materialName; 14 private String materialName;
14 private String mateiralSpec; 15 private String mateiralSpec;
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
1 package org.jeecg.modules.wms.receipt.receiving.service.impl; 1 package org.jeecg.modules.wms.receipt.receiving.service.impl;
2 2
  3 +import com.alibaba.fastjson.JSON;
3 import com.aliyun.oss.ServiceException; 4 import com.aliyun.oss.ServiceException;
4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 5 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 6 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  8 +
  9 +import cn.monitor4all.logRecord.annotation.OperationLog;
  10 +import cn.monitor4all.logRecord.context.LogRecordContext;
  11 +
7 import org.jeecg.common.api.vo.Result; 12 import org.jeecg.common.api.vo.Result;
8 import org.jeecg.modules.wms.config.container.entity.Container; 13 import org.jeecg.modules.wms.config.container.entity.Container;
9 import org.jeecg.modules.wms.config.container.service.IContainerService; 14 import org.jeecg.modules.wms.config.container.service.IContainerService;
@@ -23,6 +28,7 @@ import org.jeecg.modules.wms.receipt.receiving.domain.Receive; @@ -23,6 +28,7 @@ import org.jeecg.modules.wms.receipt.receiving.domain.Receive;
23 import org.jeecg.modules.wms.receipt.receiving.mapper.ReceiveMapper; 28 import org.jeecg.modules.wms.receipt.receiving.mapper.ReceiveMapper;
24 import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService; 29 import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService;
25 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; 30 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
  31 +import org.jeecg.utils.HuahengJwtUtil;
26 import org.jeecg.utils.StringUtils; 32 import org.jeecg.utils.StringUtils;
27 import org.jeecg.utils.constant.QuantityConstant; 33 import org.jeecg.utils.constant.QuantityConstant;
28 import org.springframework.stereotype.Service; 34 import org.springframework.stereotype.Service;
@@ -82,6 +88,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl @@ -82,6 +88,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl
82 */ 88 */
83 @Override 89 @Override
84 @Transactional(rollbackFor = ServiceException.class) 90 @Transactional(rollbackFor = ServiceException.class)
  91 + @OperationLog(bizId = "''", bizType = "'物料追踪'", tag = "'入库组盘'", extra = "#extraJsonString", msg = "''",
  92 + operatorId = "#username", recordReturnValue = true)
85 public Result<ReceiptContainerHeader> receiving(List<Receive> receiveList, String warehouseCode) { 93 public Result<ReceiptContainerHeader> receiving(List<Receive> receiveList, String warehouseCode) {
86 boolean result = false; 94 boolean result = false;
87 if (receiveList == null || receiveList.size() == 0) { 95 if (receiveList == null || receiveList.size() == 0) {
@@ -144,12 +152,15 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl @@ -144,12 +152,15 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl
144 List<ReceiptDetail> receiptDetailList = new ArrayList<>(); 152 List<ReceiptDetail> receiptDetailList = new ArrayList<>();
145 List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); 153 List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>();
146 for (Receive receive : receiveList) { 154 for (Receive receive : receiveList) {
147 - // 收数量 155 + // 收数量
148 BigDecimal qty = receive.getQty(); 156 BigDecimal qty = receive.getQty();
149 // 收货数量 157 // 收货数量
150 BigDecimal taskQty = receive.getTaskQty(); 158 BigDecimal taskQty = receive.getTaskQty();
  159 + if (qty == null || taskQty == null) {
  160 + throw new ServiceException("收货数量或可收数量为空");
  161 + }
151 if (taskQty.compareTo(qty) > 0) { 162 if (taskQty.compareTo(qty) > 0) {
152 - throw new ServiceException("收货数量不能可收数量,收货数量:" + taskQty + " 可收数量:" + qty); 163 + throw new ServiceException("收货数量不能大于可收数量,收货数量:" + taskQty + "可收数量:" + qty);
153 } 164 }
154 if (taskQty.compareTo(BigDecimal.ZERO) <= 0) { 165 if (taskQty.compareTo(BigDecimal.ZERO) <= 0) {
155 continue; 166 continue;
@@ -194,6 +205,9 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl @@ -194,6 +205,9 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl
194 } else { 205 } else {
195 receiptContainerDetail = new ReceiptContainerDetail(); 206 receiptContainerDetail = new ReceiptContainerDetail();
196 receiptContainerDetail.setCompanyCode(receiptDetail.getCompanyCode()); 207 receiptContainerDetail.setCompanyCode(receiptDetail.getCompanyCode());
  208 + receiptContainerDetail.setReferCode(receiptDetail.getReferCode());
  209 + receiptContainerDetail.setUniqueCode(receive.getUniqueCode());
  210 + receiptContainerDetail.setContainerCode(receive.getContainerCode());
197 receiptContainerDetail.setReceiptDetailId(receiptDetail.getId()); 211 receiptContainerDetail.setReceiptDetailId(receiptDetail.getId());
198 receiptContainerDetail.setReceiptId(receiptDetail.getReceiptId()); 212 receiptContainerDetail.setReceiptId(receiptDetail.getReceiptId());
199 receiptContainerDetail.setReceiptCode(receiptDetail.getReceiptCode()); 213 receiptContainerDetail.setReceiptCode(receiptDetail.getReceiptCode());
@@ -210,8 +224,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl @@ -210,8 +224,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl
210 receiptContainerDetail.setInventoryStatus(receiptDetail.getInventoryStatus()); 224 receiptContainerDetail.setInventoryStatus(receiptDetail.getInventoryStatus());
211 receiptContainerDetailList.add(receiptContainerDetail); 225 receiptContainerDetailList.add(receiptContainerDetail);
212 } 226 }
213 -  
214 } 227 }
  228 +
215 result = receiptDetailService.updateBatchById(receiptDetailList); 229 result = receiptDetailService.updateBatchById(receiptDetailList);
216 if (!result) { 230 if (!result) {
217 throw new ServiceException("批量更新入库单详情失败"); 231 throw new ServiceException("批量更新入库单详情失败");
@@ -223,7 +237,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl @@ -223,7 +237,8 @@ public class ReceiveServiceImpl extends ServiceImpl&lt;ReceiveMapper, Receive&gt; impl
223 throw new ServiceException("保存入库组盘详情失败"); 237 throw new ServiceException("保存入库组盘详情失败");
224 } 238 }
225 } 239 }
226 - 240 + LogRecordContext.putVariable("username", HuahengJwtUtil.getCurrentOperator());
  241 + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList));
227 return Result.OK("收货成功", receiptContainerHeader); 242 return Result.OK("收货成功", receiptContainerHeader);
228 } 243 }
229 } 244 }
huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java
@@ -6,7 +6,9 @@ import java.util.UUID; @@ -6,7 +6,9 @@ import java.util.UUID;
6 6
7 import javax.servlet.http.HttpServletRequest; 7 import javax.servlet.http.HttpServletRequest;
8 8
  9 +import org.apache.shiro.SecurityUtils;
9 import org.jeecg.common.exception.JeecgBootException; 10 import org.jeecg.common.exception.JeecgBootException;
  11 +import org.jeecg.common.system.vo.LoginUser;
10 import org.jeecg.common.util.oConvertUtils; 12 import org.jeecg.common.util.oConvertUtils;
11 import org.jeecg.modules.wms.framework.aspectj.dto.ApiAuthentication; 13 import org.jeecg.modules.wms.framework.aspectj.dto.ApiAuthentication;
12 import org.jeecg.modules.wms.framework.aspectj.dto.RSA256Key; 14 import org.jeecg.modules.wms.framework.aspectj.dto.RSA256Key;
@@ -141,6 +143,20 @@ public class HuahengJwtUtil { @@ -141,6 +143,20 @@ public class HuahengJwtUtil {
141 } 143 }
142 144
143 /** 145 /**
  146 + * 获取当前操作人
  147 + * @author TanYibin
  148 + * @createDate 2023年2月22日
  149 + * @return
  150 + */
  151 + public static String getCurrentOperator() {
  152 + LoginUser loginUser = SecurityUtils.getSubject().getPrincipal() != null ? (LoginUser)SecurityUtils.getSubject().getPrincipal() : null;
  153 + if (loginUser != null) {
  154 + return loginUser.getRealname();
  155 + }
  156 + return ApiAuthentication.getInstance().getAudience();
  157 + }
  158 +
  159 + /**
144 * 获得token中的信息无需secret解密也能获得 160 * 获得token中的信息无需secret解密也能获得
145 * @return token中包含的用户名 161 * @return token中包含的用户名
146 */ 162 */
huaheng-wms-core/src/main/java/org/jeecg/utils/interceptor/HuahengBatisInterceptor.java
@@ -24,7 +24,7 @@ public class HuahengBatisInterceptor implements Interceptor { @@ -24,7 +24,7 @@ public class HuahengBatisInterceptor implements Interceptor {
24 @Override 24 @Override
25 public Object intercept(Invocation invocation) throws Throwable { 25 public Object intercept(Invocation invocation) throws Throwable {
26 MappedStatement mappedStatement = (MappedStatement)invocation.getArgs()[0]; 26 MappedStatement mappedStatement = (MappedStatement)invocation.getArgs()[0];
27 - String sqlId = mappedStatement.getId(); 27 +// String sqlId = mappedStatement.getId();
28 // log.debug("------sqlId------" + sqlId); 28 // log.debug("------sqlId------" + sqlId);
29 SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType(); 29 SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
30 Object parameter = invocation.getArgs()[1]; 30 Object parameter = invocation.getArgs()[1];