Commit e1ba967fd0273a6e230eec509d56da7d866fa4e4
1 parent
662abaaf
注解失效修正
Signed-off-by: TanYibin <5491541@qq.com>
Showing
8 changed files
with
66 additions
and
40 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/servuce/impl/MesServiceImpl.java
... | ... | @@ -192,7 +192,7 @@ public class MesServiceImpl implements IMesService { |
192 | 192 | for (MesShipmentDetail mesShipmentDetail : mesShipmentDetailList) { |
193 | 193 | ShipmentDetail shipmentDetail = mesShipmentDetail.getShipmentDetail(); |
194 | 194 | BigDecimal shipQty = mesShipmentDetail.getShipQty(); |
195 | - Result result = shipmentCombinationService.autoCombination(shipmentDetail, shipQty); | |
195 | + Result result = shipmentCombinationService.autoCombinationDetail(shipmentDetail, shipQty); | |
196 | 196 | if (!result.isSuccess()) { |
197 | 197 | throw new ServiceException("MES下发出库信息," + result.getMessage()); |
198 | 198 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/LogRecordErrorHandlerServiceImpl.java
0 → 100644
1 | +package org.jeecg.modules.wms.monitor.operation.service.impl; | |
2 | + | |
3 | +import org.springframework.stereotype.Component; | |
4 | + | |
5 | +import cn.monitor4all.logRecord.service.LogRecordErrorHandlerService; | |
6 | +import lombok.extern.slf4j.Slf4j; | |
7 | + | |
8 | +@Slf4j | |
9 | +@Component | |
10 | +public class LogRecordErrorHandlerServiceImpl implements LogRecordErrorHandlerService { | |
11 | + | |
12 | + @Override | |
13 | + public void operationLogGetErrorHandler() { | |
14 | + log.error("operation log get service error reached max retryTimes!"); | |
15 | + } | |
16 | + | |
17 | + @Override | |
18 | + public void dataPipelineErrorHandler() { | |
19 | + log.error("data pipeline send log error reached max retryTimes!"); | |
20 | + } | |
21 | +} | |
0 | 22 | \ No newline at end of file |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java
... | ... | @@ -13,6 +13,7 @@ import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentCon |
13 | 13 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
14 | 14 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; |
15 | 15 | import org.jeecg.utils.StringUtils; |
16 | +import org.springframework.stereotype.Component; | |
16 | 17 | import org.springframework.stereotype.Service; |
17 | 18 | import org.springframework.util.CollectionUtils; |
18 | 19 | |
... | ... | @@ -48,10 +49,7 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
48 | 49 | "getWarehouseCode", "getContainerCode", "getMaterialCode", "getQty")); |
49 | 50 | } |
50 | 51 | } else if (logDTO.getBizType().equals("入库单追踪")) { |
51 | - if (logDTO.getTag().equals("详情添加")) { | |
52 | - String message = "物料编码:{},数量:{}"; | |
53 | - operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
54 | - } else if (logDTO.getTag().equals("详情分配库位")) { | |
52 | + if (logDTO.getTag().equals("详情分配库位")) { | |
55 | 53 | String message = "容器编码:{},物料编码:{},入库数量:{}"; |
56 | 54 | operationLogList.addAll( |
57 | 55 | createOperationLogs(logDTO, ReceiptContainerDetail.class, "getReceiptCode", message, "getContainerCode", "getMaterialCode", "getQty")); |
... | ... | @@ -67,10 +65,7 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
67 | 65 | operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); |
68 | 66 | } |
69 | 67 | } 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("详情分配库位")) { | |
68 | + if (logDTO.getTag().equals("详情分配库位")) { | |
74 | 69 | String message = "容器编码:{},物料编码:{},出库数量:{}"; |
75 | 70 | operationLogList.addAll( |
76 | 71 | createOperationLogs(logDTO, ShipmentContainerDetail.class, "getShipmentCode", message, "getContainerCode", "getMaterialCode", "getQty")); |
... | ... | @@ -100,8 +95,7 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
100 | 95 | operationLog.setOperatorName(logDTO.getOperatorId()); |
101 | 96 | operationLogList.add(operationLog); |
102 | 97 | } |
103 | - this.saveBatch(operationLogList); | |
104 | - return true; | |
98 | + return this.saveBatch(operationLogList); | |
105 | 99 | } catch (Exception e) { |
106 | 100 | log.error(">>>>>> create OperationLog error:{} <<<<<<", e.getMessage(), e); |
107 | 101 | return false; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptDetailServiceImpl.java
... | ... | @@ -145,6 +145,6 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
145 | 145 | |
146 | 146 | @Override |
147 | 147 | public boolean batchSave(List<ReceiptDetail> receiptDetailList) { |
148 | - return this.saveBatch(receiptDetailList); | |
148 | + return this.saveBatch(receiptDetailList); | |
149 | 149 | } |
150 | 150 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/IShipmentCombinationService.java
... | ... | @@ -19,11 +19,11 @@ public interface IShipmentCombinationService { |
19 | 19 | |
20 | 20 | public Result autoCombination(String shipmentCode, String warehouseCode); |
21 | 21 | |
22 | - public Result autoCombination(ShipmentDetail shipmentDetail, BigDecimal shipQty); | |
23 | - | |
24 | - public Result combination(CombinationModel combinationModel); | |
25 | - | |
26 | 22 | public Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber); |
27 | 23 | |
28 | 24 | public Result getInventoryFromShipmentDetail(Integer shipmentDetailId); |
25 | + | |
26 | + public Result combination(CombinationModel combinationModel); | |
27 | + | |
28 | + public Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty); | |
29 | 29 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -37,6 +37,7 @@ import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; |
37 | 37 | import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
38 | 38 | import org.jeecg.utils.StringUtils; |
39 | 39 | import org.jeecg.utils.constant.QuantityConstant; |
40 | +import org.springframework.beans.factory.annotation.Autowired; | |
40 | 41 | import org.springframework.stereotype.Service; |
41 | 42 | import org.springframework.transaction.annotation.Transactional; |
42 | 43 | |
... | ... | @@ -54,31 +55,33 @@ import cn.monitor4all.logRecord.context.LogRecordContext; |
54 | 55 | @Service |
55 | 56 | public class ShipmentCombinationServiceImpl implements IShipmentCombinationService { |
56 | 57 | |
57 | - @Resource | |
58 | + @Autowired | |
59 | + private IShipmentCombinationService shipmentCombinationService; | |
60 | + @Autowired | |
58 | 61 | private IInventoryDetailService inventoryDetailService; |
59 | - @Resource | |
62 | + @Autowired | |
60 | 63 | private IShipmentHeaderService shipmentHeaderService; |
61 | - @Resource | |
64 | + @Autowired | |
62 | 65 | private IShipmentDetailService shipmentDetailService; |
63 | - @Resource | |
66 | + @Autowired | |
64 | 67 | private IReceiptContainerHeaderService receiptContainerHeaderService; |
65 | - @Resource | |
68 | + @Autowired | |
66 | 69 | private IShipmentContainerHeaderService shipmentContainerHeaderService; |
67 | - @Resource | |
70 | + @Autowired | |
68 | 71 | private IContainerService containerService; |
69 | - @Resource | |
72 | + @Autowired | |
70 | 73 | private ILocationService locationService; |
71 | - @Resource | |
74 | + @Autowired | |
72 | 75 | private IShipmentContainerDetailService shipmentContainerDetailService; |
73 | - @Resource | |
76 | + @Autowired | |
74 | 77 | private IMaterialService materialService; |
75 | - @Resource | |
78 | + @Autowired | |
76 | 79 | private IParameterConfigurationService parameterConfigurationService; |
77 | - @Resource | |
80 | + @Autowired | |
78 | 81 | private ITaskHeaderService taskHeaderService; |
79 | - @Resource | |
82 | + @Autowired | |
80 | 83 | private ITaskDetailService taskDetailService; |
81 | - @Resource | |
84 | + @Autowired | |
82 | 85 | private IInventoryHeaderService inventoryHeaderService; |
83 | 86 | |
84 | 87 | /** |
... | ... | @@ -132,7 +135,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
132 | 135 | if (shipmentDetail.getTaskQty().compareTo(shipmentDetail.getQty()) < 0) { |
133 | 136 | over = false; |
134 | 137 | } |
135 | - Result result = autoCombination(shipmentDetail, null); | |
138 | + Result result = shipmentCombinationService.autoCombinationDetail(shipmentDetail, null); | |
136 | 139 | if (!result.isSuccess()) { |
137 | 140 | throw new ServiceException(result.getMessage()); |
138 | 141 | } |
... | ... | @@ -145,7 +148,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
145 | 148 | |
146 | 149 | @Override |
147 | 150 | @Transactional(rollbackFor = ServiceException.class) |
148 | - public Result autoCombination(ShipmentDetail shipmentDetail, BigDecimal shipQty) { | |
151 | + public Result autoCombinationDetail(ShipmentDetail shipmentDetail, BigDecimal shipQty) { | |
149 | 152 | // 出库数量 |
150 | 153 | BigDecimal shipmentQty = shipmentDetail.getQty().subtract(shipmentDetail.getTaskQty()); |
151 | 154 | // 判断是否还有需要出库的物料,如果没有就跳过该物料 |
... | ... | @@ -208,7 +211,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
208 | 211 | combinationModel.setShipQty(inventoryQty); |
209 | 212 | shipmentQty = shipmentQty.subtract(inventoryQty); |
210 | 213 | } |
211 | - Result result = combination(combinationModel); | |
214 | + Result result = shipmentCombinationService.combination(combinationModel); | |
212 | 215 | if (!result.isSuccess()) { |
213 | 216 | throw new ServiceException(result.getMessage()); |
214 | 217 | } |
... | ... | @@ -218,8 +221,8 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
218 | 221 | |
219 | 222 | @Override |
220 | 223 | @Transactional(rollbackFor = ServiceException.class) |
221 | - @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情配盘'", extra = "#extraJsonString", | |
222 | - msg = "'库位编码:' + #inventoryDetail.getLocationCode() + ',容器编码:' + #inventoryDetail.getContainerCode()", recordReturnValue = true) | |
224 | + @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情配盘'", extra = "#extraJsonString", msg = "'库位编码:' + #locationCode + ',容器编码:' + #containerCode", | |
225 | + recordReturnValue = true) | |
223 | 226 | public Result combination(CombinationModel combinationModel) { |
224 | 227 | BigDecimal shipmentQty = combinationModel.getShipQty(); |
225 | 228 | ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail(); |
... | ... | @@ -233,9 +236,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
233 | 236 | if (inventoryDetail == null) { |
234 | 237 | return Result.error("配盘时,库存未找到"); |
235 | 238 | } |
239 | + String locationCode = inventoryDetail.getLocationCode(); | |
236 | 240 | String containerCode = inventoryDetail.getContainerCode(); |
237 | 241 | String warehouseCode = inventoryDetail.getWarehouseCode(); |
238 | - String locationCode = inventoryDetail.getLocationCode(); | |
239 | 242 | if (!warehouseCode.equals(shipmentDetail.getWarehouseCode())) { |
240 | 243 | return Result.error("配盘时,库存仓库编码和出库单仓库编码不一致"); |
241 | 244 | } |
... | ... | @@ -310,6 +313,8 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
310 | 313 | if (!success) { |
311 | 314 | throw new ServiceException("配盘时, 更新出库单失败"); |
312 | 315 | } |
316 | + LogRecordContext.putVariable("locationCode", locationCode); | |
317 | + LogRecordContext.putVariable("containerCode", containerCode); | |
313 | 318 | LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentDetail))); |
314 | 319 | return Result.ok("配盘成功"); |
315 | 320 | } |
... | ... | @@ -361,9 +366,9 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
361 | 366 | BigDecimal shipmentQty = combinationModel.getShipQty(); |
362 | 367 | ShipmentDetail shipmentDetail = combinationModel.getShipmentDetail(); |
363 | 368 | InventoryDetail inventoryDetail = combinationModel.getInventoryDetail(); |
369 | + String locationCode = inventoryDetail.getLocationCode(); | |
364 | 370 | String containerCode = inventoryDetail.getContainerCode(); |
365 | 371 | String warehouseCode = inventoryDetail.getWarehouseCode(); |
366 | - String locationCode = inventoryDetail.getLocationCode(); | |
367 | 372 | String materialCode = inventoryDetail.getMaterialCode(); |
368 | 373 | LambdaQueryWrapper<ShipmentContainerDetail> shipmentContainerDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
369 | 374 | shipmentContainerDetailLambdaQueryWrapper.eq(ShipmentContainerDetail::getShipmentContainerId, shipmentContainerHeader.getId()) |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -3,6 +3,7 @@ package org.jeecg.modules.wms.shipment.shipmentHeader.controller; |
3 | 3 | import java.io.IOException; |
4 | 4 | import java.math.BigDecimal; |
5 | 5 | import java.util.Arrays; |
6 | +import java.util.Collections; | |
6 | 7 | import java.util.List; |
7 | 8 | import java.util.Map; |
8 | 9 | import java.util.stream.Collectors; |
... | ... | @@ -44,11 +45,14 @@ import org.springframework.web.multipart.MultipartFile; |
44 | 45 | import org.springframework.web.multipart.MultipartHttpServletRequest; |
45 | 46 | import org.springframework.web.servlet.ModelAndView; |
46 | 47 | |
48 | +import com.alibaba.fastjson.JSON; | |
47 | 49 | import com.aliyun.oss.ServiceException; |
48 | 50 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
49 | 51 | import com.baomidou.mybatisplus.core.metadata.IPage; |
50 | 52 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
51 | 53 | |
54 | +import cn.monitor4all.logRecord.annotation.OperationLog; | |
55 | +import cn.monitor4all.logRecord.context.LogRecordContext; | |
52 | 56 | import io.swagger.annotations.Api; |
53 | 57 | import io.swagger.annotations.ApiOperation; |
54 | 58 | import lombok.extern.slf4j.Slf4j; |
... | ... | @@ -240,6 +244,7 @@ public class ShipmentHeaderController extends JeecgController<ShipmentHeader, IS |
240 | 244 | @ApiOperation(value = "出库单详情-通过id删除", notes = "出库单详情-通过id删除") |
241 | 245 | @RequiresPermissions("shipmentDetail:delete") |
242 | 246 | @DeleteMapping(value = "/deleteShipmentDetail") |
247 | + @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情删除'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) | |
243 | 248 | public Result<String> deleteShipmentDetail(@RequestParam(name = "id", required = true) String id) { |
244 | 249 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(id); |
245 | 250 | if (shipmentDetail == null) { |
... | ... | @@ -260,6 +265,7 @@ public class ShipmentHeaderController extends JeecgController<ShipmentHeader, IS |
260 | 265 | if (!success) { |
261 | 266 | throw new ServiceException("更新出库单头数量失败"); |
262 | 267 | } |
268 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(Collections.singletonList(shipmentDetail)));// 操作日志收集 | |
263 | 269 | return Result.OK("删除成功!"); |
264 | 270 | } |
265 | 271 | |
... | ... |
huaheng-wms-core/src/main/resources/application-dev.yml
... | ... | @@ -204,10 +204,10 @@ jeecg: |
204 | 204 | endpoint: oss-cn-beijing.aliyuncs.com |
205 | 205 | bucketName: jeecgdev |
206 | 206 | # ElasticSearch 6设置 |
207 | - elasticsearch:a | |
208 | - cluster-name: jeecg-ES | |
209 | - cluster-nodes: 127.0.0.1:9200 | |
210 | - check-enabled: false | |
207 | + elasticsearch: | |
208 | + cluster-name: jeecg-ES | |
209 | + cluster-nodes: 127.0.0.1:9200 | |
210 | + check-enabled: false | |
211 | 211 | # 表单设计器配置 |
212 | 212 | desform: |
213 | 213 | # 主题颜色(仅支持 16进制颜色代码) |
... | ... |