Commit cbe19d7043ec89420df96d52f7c6130ad9c12bdc
1 parent
99795bb1
入库组盘日志记录提交
Signed-off-by: TanYibin <5491541@qq.com>
Showing
5 changed files
with
31 additions
and
11 deletions
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/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,6 +44,7 @@ import org.springframework.web.multipart.MultipartFile; | @@ -42,6 +44,7 @@ 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 | ||
47 | +import com.alibaba.fastjson.JSON; | ||
45 | import com.aliyun.oss.ServiceException; | 48 | import com.aliyun.oss.ServiceException; |
46 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 49 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
47 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 50 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
@@ -49,6 +52,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | @@ -49,6 +52,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | ||
49 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 52 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
50 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 53 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
51 | 54 | ||
55 | +import cn.monitor4all.logRecord.annotation.OperationLog; | ||
56 | +import cn.monitor4all.logRecord.context.LogRecordContext; | ||
52 | import io.swagger.annotations.Api; | 57 | import io.swagger.annotations.Api; |
53 | import io.swagger.annotations.ApiOperation; | 58 | import io.swagger.annotations.ApiOperation; |
54 | import lombok.extern.slf4j.Slf4j; | 59 | import lombok.extern.slf4j.Slf4j; |
@@ -219,8 +224,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | @@ -219,8 +224,8 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | ||
219 | */ | 224 | */ |
220 | @AutoLog(value = "入库单详情-添加") | 225 | @AutoLog(value = "入库单详情-添加") |
221 | @ApiOperation(value = "入库单详情-添加", notes = "入库单详情-添加") | 226 | @ApiOperation(value = "入库单详情-添加", notes = "入库单详情-添加") |
222 | - @PostMapping(value = "/addReceiptDetail") | ||
223 | @RequiresPermissions("receiptDetail:add") | 227 | @RequiresPermissions("receiptDetail:add") |
228 | + @PostMapping(value = "/addReceiptDetail") | ||
224 | public Result<?> addReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { | 229 | public Result<?> addReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { |
225 | return receiptDetailService.saveReceiptDetail(receiptDetail); | 230 | return receiptDetailService.saveReceiptDetail(receiptDetail); |
226 | } | 231 | } |
@@ -234,8 +239,10 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | @@ -234,8 +239,10 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | ||
234 | @ApiOperation(value = "入库单详情-编辑", notes = "入库单详情-编辑") | 239 | @ApiOperation(value = "入库单详情-编辑", notes = "入库单详情-编辑") |
235 | @RequiresPermissions("receiptDetail:edit") | 240 | @RequiresPermissions("receiptDetail:edit") |
236 | @RequestMapping(value = "/editReceiptDetail", method = {RequestMethod.PUT, RequestMethod.POST}) | 241 | @RequestMapping(value = "/editReceiptDetail", method = {RequestMethod.PUT, RequestMethod.POST}) |
242 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情编辑'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | ||
237 | public Result<String> editReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { | 243 | public Result<String> editReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { |
238 | receiptDetailService.updateById(receiptDetail); | 244 | receiptDetailService.updateById(receiptDetail); |
245 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 | ||
239 | return Result.OK("编辑成功!"); | 246 | return Result.OK("编辑成功!"); |
240 | } | 247 | } |
241 | 248 | ||
@@ -248,6 +255,7 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | @@ -248,6 +255,7 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | ||
248 | @ApiOperation(value = "入库单详情-通过id删除", notes = "入库单详情-通过id删除") | 255 | @ApiOperation(value = "入库单详情-通过id删除", notes = "入库单详情-通过id删除") |
249 | @RequiresPermissions("receiptDetail:delete") | 256 | @RequiresPermissions("receiptDetail:delete") |
250 | @DeleteMapping(value = "/deleteReceiptDetail") | 257 | @DeleteMapping(value = "/deleteReceiptDetail") |
258 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情删除'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | ||
251 | public Result<String> deleteReceiptDetail(@RequestParam(name = "id", required = true) String id) { | 259 | public Result<String> deleteReceiptDetail(@RequestParam(name = "id", required = true) String id) { |
252 | ReceiptDetail receiptDetail = receiptDetailService.getById(id); | 260 | ReceiptDetail receiptDetail = receiptDetailService.getById(id); |
253 | if (receiptDetail == null) { | 261 | if (receiptDetail == null) { |
@@ -268,6 +276,7 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | @@ -268,6 +276,7 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | ||
268 | if (!success) { | 276 | if (!success) { |
269 | throw new ServiceException("更新入库单头数量失败"); | 277 | throw new ServiceException("更新入库单头数量失败"); |
270 | } | 278 | } |
279 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 | ||
271 | return Result.OK("删除成功!"); | 280 | return Result.OK("删除成功!"); |
272 | } | 281 | } |
273 | 282 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java
@@ -16,6 +16,7 @@ import org.jeecg.utils.constant.QuantityConstant; | @@ -16,6 +16,7 @@ import org.jeecg.utils.constant.QuantityConstant; | ||
16 | import org.springframework.stereotype.Service; | 16 | import org.springframework.stereotype.Service; |
17 | 17 | ||
18 | import java.util.ArrayList; | 18 | import java.util.ArrayList; |
19 | +import java.util.Collections; | ||
19 | import java.util.List; | 20 | import java.util.List; |
20 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 21 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
21 | 22 | ||
@@ -88,10 +89,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | @@ -88,10 +89,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | ||
88 | if (!success) { | 89 | if (!success) { |
89 | throw new ServiceException("添加失败, 保存入库单详失败"); | 90 | throw new ServiceException("添加失败, 保存入库单详失败"); |
90 | } | 91 | } |
91 | - // 操作日志收集 | ||
92 | - List<ReceiptDetail> receiptDetailList = new ArrayList<ReceiptDetail>(); | ||
93 | - receiptDetailList.add(receiptDetail); | ||
94 | - LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptDetailList)); | 92 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 |
95 | return Result.OK("添加成功!"); | 93 | return Result.OK("添加成功!"); |
96 | } | 94 | } |
97 | } | 95 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
@@ -124,7 +124,6 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | @@ -124,7 +124,6 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | ||
124 | @Override | 124 | @Override |
125 | @Transactional | 125 | @Transactional |
126 | public String createCode(String receiptType) { | 126 | public String createCode(String receiptType) { |
127 | - int i = 0; | ||
128 | String code = null; | 127 | String code = null; |
129 | Date now = new Date(); | 128 | Date now = new Date(); |
130 | 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,7 +88,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl | @@ -88,7 +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 = "''", 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) | ||
92 | public Result<ReceiptContainerHeader> receiving(List<Receive> receiveList, String warehouseCode) { | 93 | public Result<ReceiptContainerHeader> receiving(List<Receive> receiveList, String warehouseCode) { |
93 | boolean result = false; | 94 | boolean result = false; |
94 | if (receiveList == null || receiveList.size() == 0) { | 95 | if (receiveList == null || receiveList.size() == 0) { |
@@ -236,7 +237,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl | @@ -236,7 +237,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl | ||
236 | throw new ServiceException("保存入库组盘详情失败"); | 237 | throw new ServiceException("保存入库组盘详情失败"); |
237 | } | 238 | } |
238 | } | 239 | } |
239 | - LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptContainerDetailList)); | 240 | + LogRecordContext.putVariable("extraJsonString1", JSON.toJSONString(receiptContainerDetailList)); |
241 | + LogRecordContext.putVariable("extraJsonString2", JSON.toJSONString(receiptDetailList)); | ||
240 | return Result.OK("收货成功", receiptContainerHeader); | 242 | return Result.OK("收货成功", receiptContainerHeader); |
241 | } | 243 | } |
242 | } | 244 | } |