Commit 1db30dc64cc4c35ed315d6e99a2da9eb8b33de94
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms4 into develop
# Conflicts: # ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue # huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java # huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java
Showing
11 changed files
with
91 additions
and
70 deletions
ant-design-vue-jeecg/src/views/system/monitor/OperationLog.vue
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | <a-row :gutter="24"> |
7 | 7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
8 | 8 | <a-form-item label="业务ID"> |
9 | - <a-input placeholder="请输入业务ID" v-model="queryParam.bizId"></a-input> | |
9 | + <j-input placeholder="请输入业务ID" v-model="queryParam.bizId"></j-input> | |
10 | 10 | </a-form-item> |
11 | 11 | </a-col> |
12 | 12 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
... | ... | @@ -19,22 +19,30 @@ |
19 | 19 | <j-multi-select-tag placeholder="请选择业务标签" v-model="queryParam.bizTag" dictCode="operation_log_tag"/> |
20 | 20 | </a-form-item> |
21 | 21 | </a-col> |
22 | - <template v-if="toggleSearchStatus"> | |
23 | 22 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
24 | 23 | <a-form-item label="操作内容"> |
25 | 24 | <j-input placeholder="请输入操作内容" v-model="queryParam.operationMsg"></j-input> |
26 | 25 | </a-form-item> |
27 | 26 | </a-col> |
28 | - </template> | |
27 | + <a-col :xl="10" :lg="11" :md="12" :sm="24"> | |
28 | + <a-form-item label="创建日期"> | |
29 | + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" | |
30 | + class="query-group-cust" v-model="queryParam.operationTime_begin"></j-date> | |
31 | + <span class="query-group-split-cust"></span> | |
32 | + <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" | |
33 | + class="query-group-cust" v-model="queryParam.operationTime_end"></j-date> | |
34 | + </a-form-item> | |
35 | + </a-col> | |
36 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
37 | + <a-form-item label="操作结果状态"> | |
38 | + <a-input placeholder="请输入操作结果状态容" v-model="queryParam.operationStatus"></a-input> | |
39 | + </a-form-item> | |
40 | + </a-col> | |
29 | 41 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
30 | 42 | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
31 | 43 | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
32 | 44 | <a-button type="primary" @click="handleExportXls('操作记录')" icon="download" style="margin-left: 8px">导出</a-button> |
33 | 45 | <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> | |
38 | 46 | </span> |
39 | 47 | </a-col> |
40 | 48 | </a-row> |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
... | ... | @@ -14,13 +14,12 @@ |
14 | 14 | <j-dict-select-tag placeholder="请选择任务类型" v-model="queryParam.taskType" dictCode="receipt_task_type"/> |
15 | 15 | </a-form-item> |
16 | 16 | </a-col> |
17 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
18 | + <a-form-item label="状态"> | |
19 | + <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="receipt_container_status"/> | |
20 | + </a-form-item> | |
21 | + </a-col> | |
17 | 22 | <template v-if="toggleSearchStatus"> |
18 | - <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
19 | - <a-form-item label="状态"> | |
20 | - <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" dictCode="receipt_container_status"/> | |
21 | - </a-form-item> | |
22 | - </a-col> | |
23 | - <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
24 | 23 | <a-form-item label="起始库位"> |
25 | 24 | <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input> |
26 | 25 | </a-form-item> |
... | ... | @@ -64,9 +63,8 @@ |
64 | 63 | <div class="table-operator"> |
65 | 64 | <a-button v-has="'receiptContainerHeader:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
66 | 65 | <a-button type="primary" icon="download" @click="handleExportXls('入库组盘')">导出</a-button> |
67 | - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" | |
68 | - @change="handleImportExcel"> | |
69 | - <a-button type="primary" icon="import">导入</a-button> | |
66 | + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |
67 | + <a-button type="primary" icon="import">导入</a-button> | |
70 | 68 | </a-upload> |
71 | 69 | <!-- 高级查询区域 --> |
72 | 70 | <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"--> |
... | ... | @@ -75,12 +73,6 @@ |
75 | 73 | |
76 | 74 | <!-- table区域-begin --> |
77 | 75 | <div> |
78 | - <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |
79 | - <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a | |
80 | - style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |
81 | - <a style="margin-left: 24px" @click="onClearSelected">清空</a> | |
82 | - </div> | |
83 | - | |
84 | 76 | <a-table |
85 | 77 | ref="table" |
86 | 78 | size="middle" |
... | ... | @@ -117,13 +109,12 @@ |
117 | 109 | </a-button> |
118 | 110 | </template> |
119 | 111 | |
120 | - <span slot="action" slot-scope="text, record"> | |
121 | - <a-divider type="vertical"/> | |
112 | + <span slot="action" slot-scope="text, record"> | |
122 | 113 | <a v-if="record.status == 0 && record.taskType == 200" @click="selectPort(record)">生成任务</a> |
123 | 114 | <a v-else-if="record.status == 0" @click="createTask(record)">生成任务</a> |
124 | 115 | <a-divider type="vertical"/> |
125 | - <a-popconfirm v-if="record.status == 0" v-has="'receiptContainerHeader:delete'" title="确定取消组盘吗?" @confirm="() => handleDelete(record.id)"> | |
126 | - <a>取消组盘</a> | |
116 | + <a-popconfirm v-if="record.status == 0" v-has="'receiptContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> | |
117 | + <a>取消配盘</a> | |
127 | 118 | </a-popconfirm> |
128 | 119 | <a-divider type="vertical"/> |
129 | 120 | <a-dropdown> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/acs/controller/AcsController.java
... | ... | @@ -43,14 +43,12 @@ public class AcsController extends HuahengBaseController { |
43 | 43 | // @ApiLogger(apiName = "API接口第三方Token校验测试", from = "TEST") |
44 | 44 | @ResponseBody |
45 | 45 | @PostMapping(value = "/testTokenCheck") |
46 | - @OperationLog(bizType = "'物料追踪'", tag = "'入库完成'", bizId = "#paramMap.get('bizId')",extra = "#jsonString", msg = "'测试操作日志'", | |
47 | - operatorId = "#username", recordReturnValue = true) | |
46 | + @OperationLog(bizType = "'物料追踪'", tag = "'入库完成'", bizId = "#paramMap.get('bizId')",extra = "#jsonString", msg = "'测试操作日志'", recordReturnValue = true) | |
48 | 47 | public Result<?> testTokenCheck(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { |
49 | 48 | // String audience = ApiAuthentication.getInstance().getAudience(); |
50 | 49 | // String url = "http://localhost:8080/wms/api/wms/acs/testTokenCheck"; |
51 | 50 | // String body = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(paramMap)); |
52 | 51 | // String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_AGV_TASK_ASSIGN); |
53 | - LogRecordContext.putVariable("username", HuahengJwtUtil.getCurrentOperator()); | |
54 | 52 | return Result.ok(); |
55 | 53 | } |
56 | 54 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/TestController.java
... | ... | @@ -52,8 +52,7 @@ public class TestController extends HuahengBaseController { |
52 | 52 | // @AutoLog(value = "TestController-testRedis") |
53 | 53 | @ResponseBody |
54 | 54 | @PostMapping(value = "/test/testRedis") |
55 | - @OperationLog(bizType = "'物料追踪'", tag = "'分配库位'", bizId = "#paramMap.get('bizId')",extra = "#jsonString", msg = "'测试操作日志'", | |
56 | - operatorId = "#username", recordReturnValue = true) | |
55 | + @OperationLog(bizType = "'物料追踪'", tag = "'分配库位'", bizId = "#paramMap.get('bizId')",extra = "#jsonString", msg = "'测试操作日志'", recordReturnValue = true) | |
57 | 56 | public Result<?> testRedis(@RequestBody Map<String, String> paramMap, HttpServletRequest request) throws InterruptedException { |
58 | 57 | Result result = new Result<>(); |
59 | 58 | String testString = "我是testString1"; |
... | ... | @@ -71,7 +70,6 @@ public class TestController extends HuahengBaseController { |
71 | 70 | Map<String, ReceiptHeader> value = redisUtil.getAndSet(key, receiptHeaderMap, new TypeReference<Map<String, ReceiptHeader>>() {}, 10); |
72 | 71 | Long rxpireTime = redisUtil.getExpire(key); |
73 | 72 | log.info("redisUtil.getAndSet {} -> {} rxpireTime -> {}", key, JSON.toJSONString(value), rxpireTime); |
74 | - LogRecordContext.putVariable("username", HuahengJwtUtil.getCurrentOperator()); | |
75 | 73 | // result.setSuccess(false); |
76 | 74 | // LogRecordContext.putVariable("isSuccess", result.isSuccess()); |
77 | 75 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java
... | ... | @@ -45,17 +45,23 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
45 | 45 | if (receiptContainerDetail == null || receiptContainerDetail.getUniqueCode() == null) { |
46 | 46 | continue; |
47 | 47 | } |
48 | - String msg = StrUtil.format("上游单号:{},入库单据号:{},仓库编码:{},托盘编码:{},物料编码:{},数量:{}", receiptContainerDetail.getReferCode(), | |
48 | + String operationMsg = null; | |
49 | + String msg = StrUtil.format("上游单号:{},入库单据号:{},仓库编码:{},容器编码:{},物料编码:{},数量:{}", receiptContainerDetail.getReferCode(), | |
49 | 50 | receiptContainerDetail.getReceiptCode(), receiptContainerDetail.getWarehouseCode(), receiptContainerDetail.getContainerCode(), |
50 | 51 | receiptContainerDetail.getMaterialCode(), receiptContainerDetail.getQty()); |
52 | + if (!StringUtils.isEmpty(logDTO.getMsg())) { | |
53 | + operationMsg = logDTO.getMsg() + "," + msg; | |
54 | + } else { | |
55 | + operationMsg = msg; | |
56 | + } | |
51 | 57 | OperationLog operationLog = new OperationLog(); |
52 | 58 | operationLog.setBizId(receiptContainerDetail.getUniqueCode()); |
59 | + operationLog.setOperationMsg(StringUtils.substring(operationMsg, 0, 1000)); | |
53 | 60 | operationLog.setBizType(logDTO.getBizType()); |
54 | 61 | operationLog.setBizTag(logDTO.getTag()); |
55 | 62 | operationLog.setContentException(StringUtils.substring(logDTO.getException(), 0, 1000)); |
56 | 63 | operationLog.setContentReturn(StringUtils.substring(logDTO.getReturnStr(), 0, 1000)); |
57 | 64 | operationLog.setOperationCostTime(logDTO.getExecutionTime()); |
58 | - operationLog.setOperationMsg(StringUtils.substring(msg, 0, 1000)); | |
59 | 65 | operationLog.setOperationStatus(logDTO.getSuccess().equals(true) ? 1 : 0); |
60 | 66 | operationLog.setOperationTime(logDTO.getOperateDate()); |
61 | 67 | operationLog.setOperatorName(logDTO.getOperatorId()); |
... | ... | @@ -71,10 +77,16 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
71 | 77 | if (receiptDetail == null || receiptDetail.getReceiptCode() == null) { |
72 | 78 | continue; |
73 | 79 | } |
80 | + String operationMsg = null; | |
74 | 81 | String msg = StrUtil.format("物料编码:{},数量:{},已收数量:{}", receiptDetail.getMaterialCode(), receiptDetail.getQty(), receiptDetail.getTaskQty()); |
82 | + if (!StringUtils.isEmpty(logDTO.getMsg())) { | |
83 | + operationMsg = logDTO.getMsg() + "," + msg; | |
84 | + } else { | |
85 | + operationMsg = msg; | |
86 | + } | |
75 | 87 | OperationLog operationLog = new OperationLog(); |
76 | 88 | operationLog.setBizId(receiptDetail.getReceiptCode()); |
77 | - operationLog.setOperationMsg(StringUtils.substring(msg, 0, 1000)); | |
89 | + operationLog.setOperationMsg(StringUtils.substring(operationMsg, 0, 1000)); | |
78 | 90 | operationLog.setBizType(logDTO.getBizType()); |
79 | 91 | operationLog.setBizTag(logDTO.getTag()); |
80 | 92 | operationLog.setContentException(StringUtils.substring(logDTO.getException(), 0, 1000)); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperatorIdGetServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.monitor.operation.service.impl; | |
2 | + | |
3 | +import org.jeecg.utils.HuahengJwtUtil; | |
4 | +import org.springframework.stereotype.Component; | |
5 | + | |
6 | +import cn.monitor4all.logRecord.service.IOperatorIdGetService; | |
7 | + | |
8 | +@Component | |
9 | +public class OperatorIdGetServiceImpl implements IOperatorIdGetService { | |
10 | + | |
11 | + @Override | |
12 | + public String getOperatorId() throws Exception { | |
13 | + return HuahengJwtUtil.getCurrentOperator(); | |
14 | + } | |
15 | + | |
16 | +} | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/IReceiptContainerHeaderService.java
... | ... | @@ -6,6 +6,7 @@ import java.util.List; |
6 | 6 | |
7 | 7 | import org.jeecg.common.api.vo.Result; |
8 | 8 | import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerHeader; |
9 | +import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; | |
9 | 10 | |
10 | 11 | import com.baomidou.mybatisplus.extension.service.IService; |
11 | 12 | |
... | ... | @@ -29,7 +30,7 @@ public interface IReceiptContainerHeaderService extends IService<ReceiptContaine |
29 | 30 | |
30 | 31 | ReceiptContainerHeader getUnCompleteReceiptContainerByCode(String containerCode, String warehouseCode); |
31 | 32 | |
32 | - public Result createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode); | |
33 | + public Result<TaskHeader> createReceiptTask(ReceiptContainerHeader receiptContainerHeader, String warehouseCode); | |
33 | 34 | |
34 | 35 | boolean updateStatusById(int status, int id); |
35 | 36 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
1 | 1 | package org.jeecg.modules.wms.receipt.receiptHeader.controller; |
2 | 2 | |
3 | 3 | import java.io.IOException; |
4 | +import java.util.ArrayList; | |
4 | 5 | import java.util.Arrays; |
6 | +import java.util.Collections; | |
5 | 7 | import java.util.List; |
6 | 8 | import java.util.Map; |
7 | 9 | import java.util.stream.Collectors; |
... | ... | @@ -42,12 +44,15 @@ import org.springframework.web.multipart.MultipartFile; |
42 | 44 | import org.springframework.web.multipart.MultipartHttpServletRequest; |
43 | 45 | import org.springframework.web.servlet.ModelAndView; |
44 | 46 | |
45 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
47 | +import com.alibaba.fastjson.JSON; | |
48 | +import com.aliyun.oss.ServiceException;import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
46 | 49 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
47 | 50 | import com.baomidou.mybatisplus.core.metadata.IPage; |
48 | 51 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
49 | 52 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
50 | 53 | |
54 | +import cn.monitor4all.logRecord.annotation.OperationLog; | |
55 | +import cn.monitor4all.logRecord.context.LogRecordContext; | |
51 | 56 | import io.swagger.annotations.Api; |
52 | 57 | import io.swagger.annotations.ApiOperation; |
53 | 58 | import lombok.extern.slf4j.Slf4j; |
... | ... | @@ -107,13 +112,12 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
107 | 112 | @ApiOperation(value = "入库表主表-添加", notes = "入库表主表-添加") |
108 | 113 | @PostMapping(value = "/add") |
109 | 114 | @RequiresPermissions("receiptHeader:add") |
110 | - public Result<String> add(@RequestBody ReceiptHeader receiptHeader, HttpServletRequest req) { | |
115 | + public Result<ReceiptHeader> add(@RequestBody ReceiptHeader receiptHeader, HttpServletRequest req) { | |
111 | 116 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); |
112 | 117 | if (StringUtils.isNotEmpty(warehouseCode)) { |
113 | 118 | receiptHeader.setWarehouseCode(warehouseCode); |
114 | 119 | } |
115 | - Result result = receiptHeaderService.saveReceiptHeader(receiptHeader); | |
116 | - return result; | |
120 | + return receiptHeaderService.saveReceiptHeader(receiptHeader); | |
117 | 121 | } |
118 | 122 | |
119 | 123 | /** |
... | ... | @@ -218,10 +222,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
218 | 222 | */ |
219 | 223 | @AutoLog(value = "入库单详情-添加") |
220 | 224 | @ApiOperation(value = "入库单详情-添加", notes = "入库单详情-添加") |
221 | - @PostMapping(value = "/addReceiptDetail") | |
222 | 225 | @RequiresPermissions("receiptDetail:add") |
223 | - public Result<String> addReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { | |
224 | - Result result = receiptDetailService.saveReceiptDetail(receiptDetail); | |
226 | + @PostMapping(value = "/addReceiptDetail") | |
225 | 227 | return result; |
226 | 228 | } |
227 | 229 | |
... | ... | @@ -234,8 +236,10 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
234 | 236 | @ApiOperation(value = "入库单详情-编辑", notes = "入库单详情-编辑") |
235 | 237 | @RequiresPermissions("receiptDetail:edit") |
236 | 238 | @RequestMapping(value = "/editReceiptDetail", method = {RequestMethod.PUT, RequestMethod.POST}) |
239 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情编辑'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | |
237 | 240 | public Result<String> editReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { |
238 | 241 | receiptDetailService.updateById(receiptDetail); |
242 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 | |
239 | 243 | return Result.OK("编辑成功!"); |
240 | 244 | } |
241 | 245 | |
... | ... | @@ -248,8 +252,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
248 | 252 | @ApiOperation(value = "入库单详情-通过id删除", notes = "入库单详情-通过id删除") |
249 | 253 | @RequiresPermissions("receiptDetail:delete") |
250 | 254 | @DeleteMapping(value = "/deleteReceiptDetail") |
255 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情删除'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | |
251 | 256 | public Result<String> deleteReceiptDetail(@RequestParam(name = "id", required = true) String id) { |
252 | - return receiptDetailService.removeDetailById(id); | |
253 | 257 | } |
254 | 258 | |
255 | 259 | /** |
... | ... | @@ -262,7 +266,7 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
262 | 266 | @RequiresPermissions("receiptDetail:deleteBatch") |
263 | 267 | @DeleteMapping(value = "/deleteBatchReceiptDetail") |
264 | 268 | public Result<String> deleteBatchReceiptDetail(@RequestParam(name = "ids", required = true) String ids) { |
265 | - return receiptDetailService.removeDetailListById(Arrays.asList(ids.split(","))); | |
269 | + return Result.OK("批量删除成功!"); | |
266 | 270 | } |
267 | 271 | |
268 | 272 | /** |
... | ... | @@ -345,8 +349,6 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
345 | 349 | @ApiOperation(value = "回传入库单", notes = "回传入库单") |
346 | 350 | @RequiresPermissions("receiptHeader:back") |
347 | 351 | @RequestMapping(value = "/backErpReceipt", method = {RequestMethod.PUT, RequestMethod.POST}) |
348 | - public Result<String> backErpReceipt(@RequestBody ReceiptHeader receiptHeader) { | |
349 | - Result result = erpService.backReceipt(receiptHeader); | |
350 | 352 | return result; |
351 | 353 | } |
352 | 354 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java
... | ... | @@ -21,9 +21,11 @@ import org.springframework.beans.factory.annotation.Autowired; |
21 | 21 | import org.springframework.stereotype.Service; |
22 | 22 | import org.springframework.transaction.annotation.Transactional; |
23 | 23 | |
24 | -import com.alibaba.fastjson.JSON; | |
25 | -import com.aliyun.oss.ServiceException; | |
26 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
24 | +import java.util.ArrayList; | |
25 | +import java.util.List; | |
26 | +import java.util.ArrayList; | |
27 | +import java.util.Collections; | |
28 | +import java.util.List;import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
27 | 29 | |
28 | 30 | import cn.monitor4all.logRecord.annotation.OperationLog; |
29 | 31 | import cn.monitor4all.logRecord.context.LogRecordContext; |
... | ... | @@ -51,19 +53,16 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
51 | 53 | return receiptDetailMapper.selectByMainId(mainId); |
52 | 54 | } |
53 | 55 | |
54 | - @Override | |
55 | - public boolean save(ReceiptDetail entity) { | |
56 | + @Override | |
57 | + public boolean save(ReceiptDetail entity) { | |
56 | 58 | BigDecimal qty = entity.getQty(); |
57 | 59 | if (qty.compareTo(BigDecimal.ZERO) < 0) { |
58 | 60 | throw new ServiceException("单据数量不能小于0"); |
59 | 61 | } |
60 | 62 | return super.save(entity); |
61 | 63 | } |
62 | - | |
63 | 64 | @Override |
64 | - @Transactional(rollbackFor = ServiceException.class) | |
65 | - @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情添加'", extra = "#extraJsonString", msg = "''", operatorId = "#username", recordReturnValue = true) | |
66 | - public Result saveReceiptDetail(ReceiptDetail receiptDetail) { | |
65 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情添加'", extra = "#extraJsonString", msg = "''", operatorId = "#username", recordReturnValue = true) public Result saveReceiptDetail(ReceiptDetail receiptDetail) { | |
67 | 66 | ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); |
68 | 67 | if (receiptHeader == null) { |
69 | 68 | return Result.error("添加失败,没有找到入库单头"); |
... | ... | @@ -100,11 +99,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
100 | 99 | if (!success) { |
101 | 100 | throw new ServiceException("添加失败, 保存入库单详失败"); |
102 | 101 | } |
103 | - // 操作日志收集 | |
104 | - List<ReceiptDetail> receiptDetailList = new ArrayList<ReceiptDetail>(); | |
105 | - receiptDetailList.add(receiptDetail); | |
106 | - LogRecordContext.putVariable("username", HuahengJwtUtil.getCurrentOperator()); | |
107 | - LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptDetailList)); | |
102 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 | |
108 | 103 | return Result.OK("添加成功!"); |
109 | 104 | } |
110 | 105 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... | ... | @@ -66,12 +66,14 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
66 | 66 | */ |
67 | 67 | @Override |
68 | 68 | @Transactional |
69 | - public boolean delMain(String id,String reason) { | |
69 | + @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库单删除'", | |
70 | + msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", recordReturnValue = true) | |
71 | + public boolean delMain(String id, String reason) { | |
70 | 72 | ReceiptHeader receiptHeader = getById(id); |
71 | 73 | if (receiptHeader.getFirstStatus().intValue() > QuantityConstant.RECEIPT_HEADER_BUILD) { |
72 | 74 | throw new ServiceException("不能删除非新建状态单据"); |
73 | 75 | } |
74 | - receiptHeaderHistoryService.saveById(id,reason); | |
76 | + receiptHeaderHistoryService.saveById(id, reason); | |
75 | 77 | boolean success = receiptDetailMapper.deleteByMainId(id); |
76 | 78 | |
77 | 79 | if (!success) { |
... | ... | @@ -97,7 +99,7 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
97 | 99 | @Override |
98 | 100 | @Transactional |
99 | 101 | @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库单生成'", |
100 | - msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", operatorId = "#username", recordReturnValue = true) | |
102 | + msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", recordReturnValue = true) | |
101 | 103 | public Result<ReceiptHeader> saveReceiptHeader(ReceiptHeader receiptHeader) { |
102 | 104 | LambdaQueryWrapper<ReceiptType> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
103 | 105 | lambdaQueryWrapper.eq(ReceiptType::getCode, receiptHeader.getType()).eq(ReceiptType::getWarehouseCode, receiptHeader.getWarehouseCode()); |
... | ... | @@ -116,14 +118,12 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
116 | 118 | if (!success) { |
117 | 119 | return Result.OK("添加失败!"); |
118 | 120 | } |
119 | - LogRecordContext.putVariable("username", HuahengJwtUtil.getCurrentOperator()); | |
120 | 121 | return Result.OK("添加成功!", receiptHeader); |
121 | 122 | } |
122 | 123 | |
123 | 124 | @Override |
124 | 125 | @Transactional |
125 | 126 | public String createCode(String receiptType) { |
126 | - int i = 0; | |
127 | 127 | String code = null; |
128 | 128 | Date now = new Date(); |
129 | 129 | SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
... | ... | @@ -88,8 +88,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl |
88 | 88 | */ |
89 | 89 | @Override |
90 | 90 | @Transactional(rollbackFor = ServiceException.class) |
91 | - @OperationLog(bizId = "''", bizType = "'物料追踪'", tag = "'入库组盘'", extra = "#extraJsonString", msg = "''", | |
92 | - operatorId = "#username", recordReturnValue = true) | |
91 | + @OperationLog(bizId = "''", bizType = "'物料追踪'", tag = "'入库组盘'", extra = "#extraJsonString1", msg = "''", recordReturnValue = true) | |
92 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库组盘'", extra = "#extraJsonString2", msg = "'容器编码:' + #receiveList.get(0).getContainerCode()", recordReturnValue = true) | |
93 | 93 | public Result<ReceiptContainerHeader> receiving(List<Receive> receiveList, String warehouseCode) { |
94 | 94 | boolean result = false; |
95 | 95 | if (receiveList == null || receiveList.size() == 0) { |
... | ... | @@ -237,8 +237,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl |
237 | 237 | throw new ServiceException("保存入库组盘详情失败"); |
238 | 238 | } |
239 | 239 | } |
240 | - LogRecordContext.putVariable("username", HuahengJwtUtil.getCurrentOperator()); | |
241 | - LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList)); | |
240 | + LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(receiptContainerDetailList)); | |
241 | + LogRecordContext.putVariable("extraJsonString2", JSON.toJSONString(receiptDetailList)); | |
242 | 242 | return Result.OK("收货成功", receiptContainerHeader); |
243 | 243 | } |
244 | 244 | } |
... | ... |