Commit 4a46595928e1be72a741816f71cfd1d06f2353eb

Authored by 谭毅彬
1 parent 135d11ce

出库单新建,明细添加,配盘 操作记录记录

Signed-off-by: TanYibin <5491541@qq.com>
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java
... ... @@ -9,6 +9,8 @@ import org.jeecg.modules.wms.monitor.operation.mapper.OperationLogMapper;
9 9 import org.jeecg.modules.wms.monitor.operation.service.IOperationLogService;
10 10 import org.jeecg.modules.wms.receipt.receiptContainerHeader.entity.ReceiptContainerDetail;
11 11 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
  12 +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail;
  13 +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail;
12 14 import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
13 15 import org.jeecg.utils.StringUtils;
14 16 import org.springframework.stereotype.Service;
... ... @@ -50,21 +52,38 @@ public class OperationLogServiceImpl extends ServiceImpl&lt;OperationLogMapper, Ope
50 52 String message = "物料编码:{},数量:{}";
51 53 operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty"));
52 54 } else if (logDTO.getTag().equals("详情分配库位")) {
53   - String message = "容器编码:{},物料编码:{},收货数量:{}";
  55 + String message = "容器编码:{},物料编码:{},入库数量:{}";
54 56 operationLogList.addAll(
55 57 createOperationLogs(logDTO, ReceiptContainerDetail.class, "getReceiptCode", message, "getContainerCode", "getMaterialCode", "getQty"));
56 58 } else if (logDTO.getTag().equals("详情入库")) {
57   - String message = "物料编码:{},收货数量:{}";
58   - operationLogList
59   - .addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getTaskQty"));
  59 + String message = "物料编码:{},入库数量:{}";
  60 + operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getTaskQty"));
60 61 } else if (logDTO.getTag().equals("详情组盘")) {
61   - String message = "物料编码:{},数量:{},收货数量:{}";
  62 + String message = "物料编码:{},数量:{},入库数量:{}";
62 63 operationLogList
63 64 .addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty", "getTaskQty"));
64 65 } else {
65 66 String message = "物料编码:{},数量:{}";
  67 + operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty"));
  68 + }
  69 + } else if (logDTO.getBizType().equals("出库单追踪")) {
  70 + if (logDTO.getTag().equals("详情添加")) {
  71 + String message = "物料编码:{},数量:{}";
  72 + operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty"));
  73 + } else if (logDTO.getTag().equals("详情分配库位")) {
  74 + String message = "容器编码:{},物料编码:{},出库数量:{}";
  75 + operationLogList.addAll(
  76 + createOperationLogs(logDTO, ShipmentContainerDetail.class, "getShipmentCode", message, "getContainerCode", "getMaterialCode", "getQty"));
  77 + } else if (logDTO.getTag().equals("详情出库")) {
  78 + String message = "物料编码:{},收货数量:{}";
  79 + operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getTaskQty"));
  80 + } else if (logDTO.getTag().equals("详情配盘")) {
  81 + String message = "物料编码:{},数量:{},出库数量:{}";
66 82 operationLogList
67   - .addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty"));
  83 + .addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty", "getTaskQty"));
  84 + } else {
  85 + String message = "物料编码:{},数量:{}";
  86 + operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty"));
68 87 }
69 88 }
70 89 } else {
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... ... @@ -86,7 +86,7 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl&lt;ReceiptHeaderMapper, R
86 86  
87 87 @Override
88 88 @Transactional
89   - @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库单生成'",
  89 + @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库单新增'",
90 90 msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", recordReturnValue = true)
91 91 public Result<ReceiptHeader> saveReceiptHeader(ReceiptHeader receiptHeader) {
92 92 LambdaQueryWrapper<ReceiptType> lambdaQueryWrapper = Wrappers.lambdaQuery();
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... ... @@ -2,6 +2,7 @@ package org.jeecg.modules.wms.shipment.shipmentCombination.service.impl;
2 2  
3 3 import java.math.BigDecimal;
4 4 import java.util.ArrayList;
  5 +import java.util.Collections;
5 6 import java.util.List;
6 7  
7 8 import javax.annotation.Resource;
... ... @@ -39,10 +40,14 @@ import org.jeecg.utils.constant.QuantityConstant;
39 40 import org.springframework.stereotype.Service;
40 41 import org.springframework.transaction.annotation.Transactional;
41 42  
  43 +import com.alibaba.fastjson.JSON;
42 44 import com.aliyun.oss.ServiceException;
43 45 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
44 46 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
45 47  
  48 +import cn.monitor4all.logRecord.annotation.OperationLog;
  49 +import cn.monitor4all.logRecord.context.LogRecordContext;
  50 +
46 51 /**
47 52 * @author 游杰
48 53 */
... ... @@ -88,8 +93,6 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
88 93 String companyCode = shipmentDetail.getCompanyCode();
89 94 String materialCode = shipmentDetail.getMaterialCode();
90 95 String inventoryStatus = shipmentDetail.getInventoryStatus();
91   - String batch = shipmentDetail.getBatch();
92   - int shipmentId = shipmentDetail.getShipmentId();
93 96 if (StringUtils.isEmpty(warehouseCode)) {
94 97 throw new ServiceException("寻找库存详情时,出库详情没有仓库编码");
95 98 }
... ... @@ -215,6 +218,8 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
215 218  
216 219 @Override
217 220 @Transactional(rollbackFor = ServiceException.class)
  221 + @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情配盘'", extra = "#extraJsonString",
  222 + msg = "'库位编码:' + #inventoryDetail.getLocationCode() + ',容器编码:' + #inventoryDetail.getContainerCode()", recordReturnValue = true)
218 223 public Result combination(CombinationModel combinationModel) {
219 224 BigDecimal shipmentQty = combinationModel.getShipQty();
220 225 ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail();
... ... @@ -305,6 +310,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
305 310 if (!success) {
306 311 throw new ServiceException("配盘时, 更新出库单失败");
307 312 }
  313 + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentDetail)));
308 314 return Result.ok("配盘成功");
309 315 }
310 316  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... ... @@ -108,11 +108,10 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
108 108 @ApiOperation(value = "出库单-添加", notes = "出库单-添加")
109 109 @PostMapping(value = "/add")
110 110 @RequiresPermissions("shipmentHeader:add")
111   - public Result<String> add(@RequestBody ShipmentHeader shipmentHeader, HttpServletRequest req) {
  111 + public Result<?> add(@RequestBody ShipmentHeader shipmentHeader, HttpServletRequest req) {
112 112 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
113 113 shipmentHeader.setWarehouseCode(warehouseCode);
114   - Result result = shipmentHeaderService.saveShipmentHeader(shipmentHeader);
115   - return result;
  114 + return shipmentHeaderService.saveShipmentHeader(shipmentHeader);
116 115 }
117 116  
118 117 /**
... ... @@ -214,9 +213,8 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
214 213 @ApiOperation(value = "出库单详情-添加", notes = "出库单详情-添加")
215 214 @RequiresPermissions("shipmentDetail:add")
216 215 @PostMapping(value = "/addShipmentDetail")
217   - public Result<String> addShipmentDetail(@RequestBody ShipmentDetail shipmentDetail, HttpServletRequest req) {
218   - Result result = shipmentDetailService.saveShipmentDetail(shipmentDetail);
219   - return result;
  216 + public Result<?> addShipmentDetail(@RequestBody ShipmentDetail shipmentDetail, HttpServletRequest req) {
  217 + return shipmentDetailService.saveShipmentDetail(shipmentDetail);
220 218 }
221 219  
222 220 /**
... ... @@ -297,7 +295,7 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
297 295 String selections = request.getParameter("selections");
298 296 if (oConvertUtils.isNotEmpty(selections)) {
299 297 List<String> selectionList = Arrays.asList(selections.split(","));
300   - exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
  298 + exportList = pageList.stream().filter(item -> selectionList.contains(item.getId().toString())).collect(Collectors.toList());
301 299 } else {
302 300 exportList = pageList;
303 301 }
... ... @@ -359,9 +357,8 @@ public class ShipmentHeaderController extends JeecgController&lt;ShipmentHeader, IS
359 357 @ApiOperation(value = "回传出库单", notes = "回传出库单")
360 358 @RequiresPermissions("shipmentHeader:back")
361 359 @RequestMapping(value = "/backErpShipment", method = {RequestMethod.PUT, RequestMethod.POST})
362   - public Result<String> backErpShipment(@RequestBody ShipmentHeader shipmentHeader) {
363   - Result result = erpService.backShipment(shipmentHeader);
364   - return result;
  360 + public Result<?> backErpShipment(@RequestBody ShipmentHeader shipmentHeader) {
  361 + return erpService.backShipment(shipmentHeader);
365 362 }
366 363  
367 364 @AutoLog(value = "PDA出库-呼叫料盒")
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java
1 1 package org.jeecg.modules.wms.shipment.shipmentHeader.service.impl;
2 2  
  3 +import com.alibaba.fastjson.JSON;
3 4 import com.aliyun.oss.ServiceException;
4 5 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 6 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
... ... @@ -16,8 +17,14 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderServ
16 17 import org.jeecg.utils.StringUtils;
17 18 import org.jeecg.utils.constant.QuantityConstant;
18 19 import org.springframework.stereotype.Service;
  20 +
  21 +import java.util.Collections;
19 22 import java.util.List;
20 23 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  24 +
  25 +import cn.monitor4all.logRecord.annotation.OperationLog;
  26 +import cn.monitor4all.logRecord.context.LogRecordContext;
  27 +
21 28 import org.springframework.beans.factory.annotation.Autowired;
22 29  
23 30 import javax.annotation.Resource;
... ... @@ -46,6 +53,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl&lt;ShipmentDetailMapper,
46 53 }
47 54  
48 55 @Override
  56 + @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情添加'", extra = "#extraJsonString", msg = "''", recordReturnValue = true)
49 57 public Result saveShipmentDetail(ShipmentDetail shipmentDetail) {
50 58 ShipmentHeader shipmentHeader = shipmentHeaderService.getById(shipmentDetail.getShipmentId());
51 59 if (shipmentHeader == null) {
... ... @@ -84,6 +92,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl&lt;ShipmentDetailMapper,
84 92 if (!success) {
85 93 throw new ServiceException("添加失败, 更新出库单失败");
86 94 }
  95 + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentDetail)));// 操作日志收集
87 96 return Result.OK("添加成功!");
88 97 }
89 98  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... ... @@ -32,6 +32,9 @@ import org.jeecg.utils.StringUtils;
32 32 import org.jeecg.utils.constant.QuantityConstant;
33 33 import org.springframework.stereotype.Service;
34 34 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  35 +
  36 +import cn.monitor4all.logRecord.annotation.OperationLog;
  37 +
35 38 import org.springframework.beans.factory.annotation.Autowired;
36 39 import org.springframework.transaction.annotation.Transactional;
37 40  
... ... @@ -106,6 +109,9 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
106 109 }
107 110  
108 111 @Override
  112 + @Transactional
  113 + @OperationLog(bizId = "#shipmentHeader.getCode()", bizType = "'出库单追踪'", tag = "'出库单新增'",
  114 + msg = "'上游单号:'+ #shipmentHeader.getReferCode() + ',仓库编码:' + #shipmentHeader.getWarehouseCode()", recordReturnValue = true)
109 115 public Result saveShipmentHeader(ShipmentHeader shipmentHeader) {
110 116 LambdaQueryWrapper<ShipmentType> lambdaQueryWrapper = Wrappers.lambdaQuery();
111 117 lambdaQueryWrapper.eq(ShipmentType::getCode, shipmentHeader.getType()).eq(ShipmentType::getWarehouseCode, shipmentHeader.getWarehouseCode());
... ... @@ -130,7 +136,6 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
130 136 @Override
131 137 @Transactional
132 138 public String createCode(String shipmentType) {
133   - int i = 0;
134 139 String code = null;
135 140 Date now = new Date();
136 141 SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
... ...