Commit c375b1fa356a439d4599ea2ee4c8bab722dfd7af
1 parent
02e47a62
详情入库完成操作记录添加
Signed-off-by: TanYibin <5491541@qq.com>
Showing
6 changed files
with
22 additions
and
10 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
@@ -53,7 +53,7 @@ public class WcsController extends HuahengBaseController { | @@ -53,7 +53,7 @@ public class WcsController extends HuahengBaseController { | ||
53 | } | 53 | } |
54 | Result result = handleMultiProcess("warecellAllocation", new MultiProcessListener() { | 54 | Result result = handleMultiProcess("warecellAllocation", new MultiProcessListener() { |
55 | @Override | 55 | @Override |
56 | - public Result doProcess() { | 56 | + public Result<?> doProcess() { |
57 | Result result = wcsService.warecellAllocation(warecellDomain); | 57 | Result result = wcsService.warecellAllocation(warecellDomain); |
58 | return result; | 58 | return result; |
59 | } | 59 | } |
@@ -78,7 +78,7 @@ public class WcsController extends HuahengBaseController { | @@ -78,7 +78,7 @@ public class WcsController extends HuahengBaseController { | ||
78 | 78 | ||
79 | Result result = handleMultiProcess("manyEmptyIn", new MultiProcessListener() { | 79 | Result result = handleMultiProcess("manyEmptyIn", new MultiProcessListener() { |
80 | @Override | 80 | @Override |
81 | - public Result doProcess() { | 81 | + public Result<?> doProcess() { |
82 | Result result = taskHeaderService.createManyEmptyInTask(containerCode, zoneCode, roadWay, height, warehouseCode); | 82 | Result result = taskHeaderService.createManyEmptyInTask(containerCode, zoneCode, roadWay, height, warehouseCode); |
83 | return result; | 83 | return result; |
84 | } | 84 | } |
@@ -100,7 +100,7 @@ public class WcsController extends HuahengBaseController { | @@ -100,7 +100,7 @@ public class WcsController extends HuahengBaseController { | ||
100 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); | 100 | String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); |
101 | Result result = handleMultiProcess("manyEmptyOut", new MultiProcessListener() { | 101 | Result result = handleMultiProcess("manyEmptyOut", new MultiProcessListener() { |
102 | @Override | 102 | @Override |
103 | - public Result doProcess() { | 103 | + public Result<?> doProcess() { |
104 | Result result = taskHeaderService.createManyEmptyOutTask(containerCode, toPortCode, warehouseCode); | 104 | Result result = taskHeaderService.createManyEmptyOutTask(containerCode, toPortCode, warehouseCode); |
105 | return result; | 105 | return result; |
106 | } | 106 | } |
@@ -120,7 +120,7 @@ public class WcsController extends HuahengBaseController { | @@ -120,7 +120,7 @@ public class WcsController extends HuahengBaseController { | ||
120 | int taskNo = taskFinishEntity.getTaskNo(); | 120 | int taskNo = taskFinishEntity.getTaskNo(); |
121 | Result result = handleMultiProcess("completeTaskByWMS", new MultiProcessListener() { | 121 | Result result = handleMultiProcess("completeTaskByWMS", new MultiProcessListener() { |
122 | @Override | 122 | @Override |
123 | - public Result doProcess() { | 123 | + public Result<?> doProcess() { |
124 | Result result = taskHeaderService.completeTaskByWMS(taskNo); | 124 | Result result = taskHeaderService.completeTaskByWMS(taskNo); |
125 | return result; | 125 | return result; |
126 | } | 126 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
@@ -238,7 +238,7 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | @@ -238,7 +238,7 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec | ||
238 | @ApiOperation(value = "入库单详情-编辑", notes = "入库单详情-编辑") | 238 | @ApiOperation(value = "入库单详情-编辑", notes = "入库单详情-编辑") |
239 | @RequiresPermissions("receiptDetail:edit") | 239 | @RequiresPermissions("receiptDetail:edit") |
240 | @RequestMapping(value = "/editReceiptDetail", method = {RequestMethod.PUT, RequestMethod.POST}) | 240 | @RequestMapping(value = "/editReceiptDetail", method = {RequestMethod.PUT, RequestMethod.POST}) |
241 | - @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情编辑'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | 241 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情编辑'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) |
242 | public Result<String> editReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { | 242 | public Result<String> editReceiptDetail(@RequestBody ReceiptDetail receiptDetail) { |
243 | receiptDetailService.updateById(receiptDetail); | 243 | receiptDetailService.updateById(receiptDetail); |
244 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 | 244 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(receiptDetail)));// 操作日志收集 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java
@@ -60,7 +60,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | @@ -60,7 +60,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | ||
60 | } | 60 | } |
61 | 61 | ||
62 | @Override | 62 | @Override |
63 | - @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情添加'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | 63 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情添加'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) |
64 | public Result saveReceiptDetail(ReceiptDetail receiptDetail) { | 64 | public Result saveReceiptDetail(ReceiptDetail receiptDetail) { |
65 | ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); | 65 | ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); |
66 | if (receiptHeader == null) { | 66 | if (receiptHeader == null) { |
@@ -104,7 +104,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | @@ -104,7 +104,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R | ||
104 | 104 | ||
105 | @Override | 105 | @Override |
106 | @Transactional(rollbackFor = ServiceException.class) | 106 | @Transactional(rollbackFor = ServiceException.class) |
107 | - @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库详情删除'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | 107 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情删除'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) |
108 | public Result removeDetailById(String id) { | 108 | public Result removeDetailById(String id) { |
109 | ReceiptDetail receiptDetail = receiptDetailService.getById(id); | 109 | ReceiptDetail receiptDetail = receiptDetailService.getById(id); |
110 | if (receiptDetail == null) { | 110 | if (receiptDetail == null) { |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
@@ -144,6 +144,8 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | @@ -144,6 +144,8 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | ||
144 | * @return | 144 | * @return |
145 | */ | 145 | */ |
146 | @Override | 146 | @Override |
147 | + @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库单完成'", | ||
148 | + msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", recordReturnValue = true) | ||
147 | public boolean updateReceiptHeaderStatus(Integer id) { | 149 | public boolean updateReceiptHeaderStatus(Integer id) { |
148 | LambdaQueryWrapper<ReceiptDetail> receiptDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | 150 | LambdaQueryWrapper<ReceiptDetail> receiptDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
149 | receiptDetailLambdaQueryWrapper.eq(ReceiptDetail::getReceiptId, id); | 151 | receiptDetailLambdaQueryWrapper.eq(ReceiptDetail::getReceiptId, id); |
@@ -173,8 +175,11 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | @@ -173,8 +175,11 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R | ||
173 | 175 | ||
174 | receiptHeader.setFirstStatus(maxStatus); | 176 | receiptHeader.setFirstStatus(maxStatus); |
175 | receiptHeader.setLastStatus(minStatus); | 177 | receiptHeader.setLastStatus(minStatus); |
176 | - boolean result = receiptHeaderService.updateById(receiptHeader); | ||
177 | - return result; | 178 | + if (!receiptHeaderService.updateById(receiptHeader)) { |
179 | + throw new ServiceException("更新入库单:" + receiptHeader.getCode() + " 状态失败"); | ||
180 | + } | ||
181 | + LogRecordContext.putVariable("receiptHeader", receiptHeader); | ||
182 | + return true; | ||
178 | } | 183 | } |
179 | 184 | ||
180 | @Override | 185 | @Override |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java
@@ -89,7 +89,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl | @@ -89,7 +89,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl | ||
89 | @Override | 89 | @Override |
90 | @Transactional(rollbackFor = ServiceException.class) | 90 | @Transactional(rollbackFor = ServiceException.class) |
91 | @OperationLog(bizId = "''", bizType = "'物料追踪'", tag = "'入库组盘'", extra = "#extraJsonString1", 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 | + @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) { |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
@@ -4,6 +4,7 @@ import java.io.Serializable; | @@ -4,6 +4,7 @@ import java.io.Serializable; | ||
4 | import java.math.BigDecimal; | 4 | import java.math.BigDecimal; |
5 | import java.util.ArrayList; | 5 | import java.util.ArrayList; |
6 | import java.util.Collection; | 6 | import java.util.Collection; |
7 | +import java.util.Collections; | ||
7 | import java.util.Date; | 8 | import java.util.Date; |
8 | import java.util.List; | 9 | import java.util.List; |
9 | import java.util.stream.Collectors; | 10 | import java.util.stream.Collectors; |
@@ -65,12 +66,16 @@ import org.springframework.beans.factory.annotation.Autowired; | @@ -65,12 +66,16 @@ import org.springframework.beans.factory.annotation.Autowired; | ||
65 | import org.springframework.stereotype.Service; | 66 | import org.springframework.stereotype.Service; |
66 | import org.springframework.transaction.annotation.Transactional; | 67 | import org.springframework.transaction.annotation.Transactional; |
67 | 68 | ||
69 | +import com.alibaba.fastjson.JSON; | ||
68 | import com.aliyun.oss.ServiceException; | 70 | import com.aliyun.oss.ServiceException; |
69 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 71 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
70 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 72 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
71 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 73 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
72 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 74 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
73 | 75 | ||
76 | +import cn.monitor4all.logRecord.annotation.OperationLog; | ||
77 | +import cn.monitor4all.logRecord.context.LogRecordContext; | ||
78 | + | ||
74 | /** | 79 | /** |
75 | * @Description: 任务表 | 80 | * @Description: 任务表 |
76 | * @Author: jeecg-boot | 81 | * @Author: jeecg-boot |
@@ -1090,6 +1095,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1090,6 +1095,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1090 | * @return AjaxResult 完成入库任务结果 | 1095 | * @return AjaxResult 完成入库任务结果 |
1091 | */ | 1096 | */ |
1092 | @Transactional(rollbackFor = Exception.class) | 1097 | @Transactional(rollbackFor = Exception.class) |
1098 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情入库'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | ||
1093 | public Result completeReceiptTask(TaskHeader taskHeader) { | 1099 | public Result completeReceiptTask(TaskHeader taskHeader) { |
1094 | if (taskHeader == null) { | 1100 | if (taskHeader == null) { |
1095 | return Result.error("任务未找到,执行中止"); | 1101 | return Result.error("任务未找到,执行中止"); |
@@ -1239,6 +1245,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | @@ -1239,6 +1245,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea | ||
1239 | if (!combineInventoryDetail(taskHeader)) { | 1245 | if (!combineInventoryDetail(taskHeader)) { |
1240 | throw new ServiceException("合并入库库存失败"); | 1246 | throw new ServiceException("合并入库库存失败"); |
1241 | } | 1247 | } |
1248 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptDetaiList)); | ||
1242 | return Result.ok("完成入库任务"); | 1249 | return Result.ok("完成入库任务"); |
1243 | } | 1250 | } |
1244 | 1251 |