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