Commit daf7ae48bbb697e6b643eb5bf99b73ce7b086685
1 parent
c375b1fa
详情入库完成操作记录添加(2)
Signed-off-by: TanYibin <5491541@qq.com>
Showing
5 changed files
with
32 additions
and
22 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
... | ... | @@ -100,7 +100,7 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container |
100 | 100 | if (StringUtils.isNotEmpty(locationCode)) { |
101 | 101 | success = havaLocationCodeByContainer(locationCode, warehouseCode); |
102 | 102 | if (success) { |
103 | - throw new ServiceException("库位表已经存在这个容器号,不能再写入"); | |
103 | + throw new ServiceException("容器表已经存在这个库位号,不能再写入"); | |
104 | 104 | } |
105 | 105 | } |
106 | 106 | container.setStatus(status); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... | ... | @@ -134,10 +134,9 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon |
134 | 134 | @ApiOperation(value = "入库组盘-通过id删除", notes = "入库组盘-通过id删除") |
135 | 135 | @DeleteMapping(value = "/delete") |
136 | 136 | @RequiresPermissions("receiptContainerHeader:delete") |
137 | - public Result<String> delete(@RequestParam(name = "id", required = true) String id) { | |
137 | + public Result<?> delete(@RequestParam(name = "id", required = true) String id) { | |
138 | 138 | // receiptContainerHeaderService.delMain(id); |
139 | - Result result = receiptContainerHeaderService.cancelReceiving(Integer.parseInt(id)); | |
140 | - return result; | |
139 | + return receiptContainerHeaderService.cancelReceiving(Integer.parseInt(id)); | |
141 | 140 | } |
142 | 141 | |
143 | 142 | /** |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -32,11 +32,15 @@ import org.springframework.beans.factory.annotation.Autowired; |
32 | 32 | import org.springframework.stereotype.Service; |
33 | 33 | import org.springframework.transaction.annotation.Transactional; |
34 | 34 | |
35 | +import com.alibaba.fastjson.JSON; | |
35 | 36 | import com.aliyun.oss.ServiceException; |
36 | 37 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
37 | 38 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
38 | 39 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
39 | 40 | |
41 | +import cn.monitor4all.logRecord.annotation.OperationLog; | |
42 | +import cn.monitor4all.logRecord.context.LogRecordContext; | |
43 | + | |
40 | 44 | /** |
41 | 45 | * @Description: 入库组盘 |
42 | 46 | * @Author: jeecg-boot |
... | ... | @@ -326,6 +330,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
326 | 330 | |
327 | 331 | @Override |
328 | 332 | @Transactional(rollbackFor = ServiceException.class) |
333 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情取消组盘'", extra = "#extraJsonString", msg = "'容器编码:' + #receiptContainerHeader.getContainerCode()", recordReturnValue = true) | |
329 | 334 | public Result cancelReceiving(Integer id) { |
330 | 335 | ReceiptContainerHeader receiptContainerHeader = getById(id); |
331 | 336 | if (receiptContainerHeader == null) { |
... | ... | @@ -336,27 +341,30 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
336 | 341 | return Result.error("取消组盘失败,已经生成入库任务"); |
337 | 342 | } |
338 | 343 | List<ReceiptContainerDetail> receiptContainerDetailList = receiptContainerDetailService.getReceiptContainerDetailListByHeaderId(id); |
344 | + List<ReceiptDetail> receiptDetailList = new ArrayList<ReceiptDetail>(); | |
339 | 345 | for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetailList) { |
340 | 346 | ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); |
341 | 347 | if (receiptDetail == null) { |
342 | - throw new ServiceException("取消组盘失败, 没有找到入库组盘详情id是" + receiptContainerDetail.getReceiptDetailId()); | |
348 | + throw new ServiceException("取消组盘失败, 没有找到入库组盘详情,入库详情ID:" + receiptContainerDetail.getReceiptDetailId()); | |
343 | 349 | } |
344 | 350 | receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD); |
345 | 351 | receiptDetail.setTaskQty(receiptDetail.getTaskQty().subtract(receiptContainerDetail.getQty())); |
346 | 352 | if (!receiptDetailService.updateById(receiptDetail)) { |
347 | - throw new ServiceException("取消组盘失败, 更新入库明细失败id是" + receiptContainerDetail.getReceiptDetailId()); | |
353 | + throw new ServiceException("取消组盘失败, 更新入库明细失败,入库详情ID:" + receiptContainerDetail.getReceiptDetailId()); | |
348 | 354 | } |
349 | 355 | if (!receiptContainerDetailService.removeById(receiptContainerDetail.getId())) { |
350 | - throw new ServiceException("取消组盘失败, 删除入库组盘明细表失败id是" + receiptContainerDetail.getId()); | |
356 | + throw new ServiceException("取消组盘失败, 删除入库组盘明细表失败,组盘详情ID:" + receiptContainerDetail.getId()); | |
351 | 357 | } |
352 | 358 | if (!receiptHeaderService.updateReceiptHeaderStatus(receiptDetail.getReceiptId())) { |
353 | - throw new ServiceException("取消组盘失败, 更新入库单头失败"); | |
359 | + throw new ServiceException("取消组盘失败, 更新入库单头失败,入库单ID:" + receiptDetail.getReceiptId()); | |
354 | 360 | } |
361 | + receiptDetailList.add(receiptDetail); | |
355 | 362 | } |
356 | 363 | if (!this.removeById(id)) { |
357 | 364 | throw new ServiceException("取消组盘失败, 删除入库组盘头表失败id是" + id); |
358 | 365 | } |
359 | - | |
366 | + LogRecordContext.putVariable("receiptContainerHeader", receiptContainerHeader); | |
367 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptDetailList)); | |
360 | 368 | return Result.ok("取消组盘成功"); |
361 | 369 | } |
362 | 370 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... | ... | @@ -144,8 +144,10 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
144 | 144 | * @return |
145 | 145 | */ |
146 | 146 | @Override |
147 | - @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库单完成'", | |
148 | - msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", recordReturnValue = true) | |
147 | + @Transactional | |
148 | + @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库完成'", | |
149 | + msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", condition = "#minStatus == 800 && #maxStatus == 800", | |
150 | + recordReturnValue = true) | |
149 | 151 | public boolean updateReceiptHeaderStatus(Integer id) { |
150 | 152 | LambdaQueryWrapper<ReceiptDetail> receiptDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
151 | 153 | receiptDetailLambdaQueryWrapper.eq(ReceiptDetail::getReceiptId, id); |
... | ... | @@ -178,6 +180,8 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
178 | 180 | if (!receiptHeaderService.updateById(receiptHeader)) { |
179 | 181 | throw new ServiceException("更新入库单:" + receiptHeader.getCode() + " 状态失败"); |
180 | 182 | } |
183 | + LogRecordContext.putVariable("minStatus", minStatus); | |
184 | + LogRecordContext.putVariable("maxStatus", maxStatus); | |
181 | 185 | LogRecordContext.putVariable("receiptHeader", receiptHeader); |
182 | 186 | return true; |
183 | 187 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1203,17 +1203,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1203 | 1203 | inventoryTransaction.setQty(receiptQty); |
1204 | 1204 | inventoryTransactionList.add(inventoryTransaction); |
1205 | 1205 | } |
1206 | - if (!receiptDetailService.updateBatchById(receiptDetaiList)) { | |
1207 | - throw new ServiceException("完成入库任务时,更新入库单详情失败"); | |
1208 | - } | |
1209 | - List<Integer> receiptIdList = receiptDetaiList.stream().map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList()); | |
1210 | - for (Integer receiptId : receiptIdList) { | |
1211 | - success = receiptHeaderService.updateReceiptHeaderStatus(receiptId); | |
1212 | - if (!success) { | |
1213 | - throw new ServiceException("完成入库任务时,更新入库单头失败"); | |
1214 | - } | |
1215 | - } | |
1216 | - | |
1217 | 1206 | success = receiptContainerHeaderService.updateStatusById(QuantityConstant.RECEIPT_CONTAINER_FINISHED, taskHeader.getReceiptContainerHeaderId()); |
1218 | 1207 | if (!success) { |
1219 | 1208 | throw new ServiceException("完成入库任务时,更新入库组盘头表状态失败"); |
... | ... | @@ -1245,6 +1234,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1245 | 1234 | if (!combineInventoryDetail(taskHeader)) { |
1246 | 1235 | throw new ServiceException("合并入库库存失败"); |
1247 | 1236 | } |
1237 | + if (!receiptDetailService.updateBatchById(receiptDetaiList)) { | |
1238 | + throw new ServiceException("完成入库任务时,更新入库单详情失败"); | |
1239 | + } | |
1240 | + List<Integer> receiptIdList = receiptDetaiList.stream().map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList()); | |
1241 | + for (Integer receiptId : receiptIdList) { | |
1242 | + success = receiptHeaderService.updateReceiptHeaderStatus(receiptId); | |
1243 | + if (!success) { | |
1244 | + throw new ServiceException("完成入库任务时,更新入库单头失败"); | |
1245 | + } | |
1246 | + } | |
1248 | 1247 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptDetaiList)); |
1249 | 1248 | return Result.ok("完成入库任务"); |
1250 | 1249 | } |
... | ... |