Commit b9fdb93eeb6af1bfdcb79eed85593e4b2f1ca0f1
1 parent
6ccc34ae
入库单操作记录优化
Signed-off-by: TanYibin <5491541@qq.com>
Showing
7 changed files
with
58 additions
and
23 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/operation/service/impl/OperationLogServiceImpl.java
... | ... | @@ -49,16 +49,14 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
49 | 49 | "getWarehouseCode", "getContainerCode", "getMaterialCode", "getQty")); |
50 | 50 | } |
51 | 51 | } else if (logDTO.getBizType().equals("入库单追踪")) { |
52 | - if (logDTO.getTag().equals("详情分配库位") || logDTO.getTag().equals("详情组盘") || logDTO.getTag().equals("详情取消组盘")) { | |
52 | + if (logDTO.getTag().equals("详情分配库位") || logDTO.getTag().equals("详情组盘") || logDTO.getTag().equals("详情取消组盘") || logDTO.getTag().equals("入库任务生成") | |
53 | + || logDTO.getTag().equals("入库任务取消")) { | |
53 | 54 | String message = "容器编码:{},物料编码:{},入库数量:{}"; |
54 | 55 | operationLogList.addAll( |
55 | 56 | createOperationLogs(logDTO, ReceiptContainerDetail.class, "getReceiptCode", message, "getContainerCode", "getMaterialCode", "getQty")); |
56 | - } else if (logDTO.getTag().equals("入库任务生成") || logDTO.getTag().equals("入库任务取消")) { | |
57 | + } else if (logDTO.getTag().equals("入库任务完成")) { | |
57 | 58 | String message = "物料编码:{},入库数量:{}"; |
58 | - operationLogList.addAll(createOperationLogs(logDTO, ReceiptContainerDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
59 | - } else if (logDTO.getTag().equals("详情入库")) { | |
60 | - String message = "物料编码:{},入库数量:{}"; | |
61 | - operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getTaskQty")); | |
59 | + operationLogList.addAll(createOperationLogs(logDTO, TaskDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); | |
62 | 60 | } else { |
63 | 61 | String message = "物料编码:{},数量:{}"; |
64 | 62 | operationLogList.addAll(createOperationLogs(logDTO, ReceiptDetail.class, "getReceiptCode", message, "getMaterialCode", "getQty")); |
... | ... | @@ -71,9 +69,9 @@ public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, Ope |
71 | 69 | } else if (logDTO.getTag().equals("出库任务生成") || logDTO.getTag().equals("出库任务取消")) { |
72 | 70 | String message = "物料编码:{},出库数量:{}"; |
73 | 71 | operationLogList.addAll(createOperationLogs(logDTO, ShipmentContainerDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); |
74 | - } else if (logDTO.getTag().equals("详情出库")) { | |
72 | + } else if (logDTO.getTag().equals("出库任务完成")) { | |
75 | 73 | String message = "物料编码:{},出库数量:{}"; |
76 | - operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getTaskQty")); | |
74 | + operationLogList.addAll(createOperationLogs(logDTO, TaskDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); | |
77 | 75 | } else { |
78 | 76 | String message = "物料编码:{},数量:{}"; |
79 | 77 | operationLogList.addAll(createOperationLogs(logDTO, ShipmentDetail.class, "getShipmentCode", message, "getMaterialCode", "getQty")); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/service/impl/ReceiptHeaderServiceImpl.java
... | ... | @@ -145,7 +145,7 @@ public class ReceiptHeaderServiceImpl extends ServiceImpl<ReceiptHeaderMapper, R |
145 | 145 | */ |
146 | 146 | @Override |
147 | 147 | @Transactional |
148 | - @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库完成'", | |
148 | + @OperationLog(bizId = "#receiptHeader.getCode()", bizType = "'入库单追踪'", tag = "'入库单完成'", | |
149 | 149 | msg = "'上游单号:'+ #receiptHeader.getReferCode() + ',仓库编码:' + #receiptHeader.getWarehouseCode()", condition = "#minStatus == 800", recordReturnValue = true) |
150 | 150 | public boolean updateReceiptHeaderStatus(Integer id) { |
151 | 151 | LambdaQueryWrapper<ReceiptDetail> receiptDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -414,7 +414,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
414 | 414 | @Override |
415 | 415 | @Transactional(rollbackFor = ServiceException.class) |
416 | 416 | @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'出库任务生成'", extra = "#extraJsonString", |
417 | - msg = "'任务ID:' + #taskHeaderId + ',库位编码:' + #shipmentContainerHeader.getFromLocationCode() + ',目标出入口:' + #shipmentContainerHeader.getToPort()", | |
417 | + msg = "'任务ID:' + #taskHeaderId + ',库位编码:' + #shipmentContainerHeader.getFromLocationCode() + ',容器编码:' + #shipmentContainerHeader.getContainerCode() + ',目标出入口:' + #shipmentContainerHeader.getToPort()", | |
418 | 418 | condition = "#shipmentContainerDetailList.size() > 0", recordReturnValue = true) |
419 | 419 | public Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber) { |
420 | 420 | Integer preTaskNo = 0; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java
... | ... | @@ -131,8 +131,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
131 | 131 | @Override |
132 | 132 | @Transactional(rollbackFor = Exception.class) |
133 | 133 | @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'出库任务取消'", extra = "#extraJsonString", |
134 | - msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #shipmentContainerHeader.getFromLocationCode() + ',目标出入口:' + #shipmentContainerHeader.getToPort()", | |
135 | - condition = "#shipmentContainerDetailList.size() > 0", recordReturnValue = true) | |
134 | + msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #shipmentContainerHeader.getFromLocationCode() + ',容器编码:' + #shipmentContainerHeader.getContainerCode() + ',目标出入口:' + #shipmentContainerHeader.getToPort()", | |
135 | + condition = "#shipmentContainerDetailList.size() > 0", recordReturnValue = true) | |
136 | 136 | public boolean cancelShipmentTask(TaskHeader taskHeader) { |
137 | 137 | ShipmentContainerHeader shipmentContainerHeader = getById(taskHeader.getShipmentContainerHeaderId()); |
138 | 138 | if (shipmentContainerHeader == null) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -163,7 +163,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
163 | 163 | } |
164 | 164 | |
165 | 165 | @Override |
166 | - @OperationLog(bizId = "#shipmentHeader.getCode()", bizType = "'出库单追踪'", tag = "'出库完成'", | |
166 | + @OperationLog(bizId = "#shipmentHeader.getCode()", bizType = "'出库单追踪'", tag = "'出库单完成'", | |
167 | 167 | msg = "'上游单号:'+ #shipmentHeader.getReferCode() + ',仓库编码:' + #shipmentHeader.getWarehouseCode()", condition = "#minStatus == 800", recordReturnValue = true) |
168 | 168 | public boolean updateShipmentHeaderStatus(Integer shipmentId) { |
169 | 169 | List<ShipmentDetail> shipmentDetailList = shipmentDetailService.getShipmentDetailListByShipmentId(shipmentId); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskDetail.java
... | ... | @@ -8,6 +8,7 @@ import org.jeecg.common.aspect.annotation.Dict; |
8 | 8 | import org.jeecgframework.poi.excel.annotation.Excel; |
9 | 9 | |
10 | 10 | import com.baomidou.mybatisplus.annotation.IdType; |
11 | +import com.baomidou.mybatisplus.annotation.TableField; | |
11 | 12 | import com.baomidou.mybatisplus.annotation.TableId; |
12 | 13 | import com.baomidou.mybatisplus.annotation.TableName; |
13 | 14 | |
... | ... | @@ -31,114 +32,149 @@ public class TaskDetail implements Serializable { |
31 | 32 | @TableId(type = IdType.AUTO) |
32 | 33 | @ApiModelProperty(value = "主键") |
33 | 34 | private Integer id; |
35 | + | |
34 | 36 | /** 任务头ID */ |
35 | 37 | @ApiModelProperty(value = "任务头ID") |
36 | 38 | private Integer taskHeaderId; |
39 | + | |
37 | 40 | /** 任务类型 */ |
38 | 41 | @Excel(name = "任务类型", width = 15) |
39 | 42 | @ApiModelProperty(value = "任务类型") |
40 | 43 | private Integer taskType; |
44 | + | |
41 | 45 | /** 仓库编码 */ |
42 | 46 | @Excel(name = "仓库编码", width = 15) |
43 | 47 | @ApiModelProperty(value = "仓库编码") |
44 | 48 | private String warehouseCode; |
49 | + | |
45 | 50 | /** 货主 */ |
46 | 51 | @Excel(name = "货主", width = 15) |
47 | 52 | @ApiModelProperty(value = "货主") |
48 | 53 | private String companyCode; |
54 | + | |
49 | 55 | /** 出库单id */ |
50 | 56 | @Excel(name = "出库单id", width = 15) |
51 | 57 | @ApiModelProperty(value = "出库单id") |
52 | 58 | private Integer shipmentId; |
59 | + | |
60 | + @TableField(exist = false) | |
61 | + private String shipmentCode; | |
62 | + | |
53 | 63 | /** 出库详情id */ |
54 | 64 | @Excel(name = "出库详情id", width = 15) |
55 | 65 | @ApiModelProperty(value = "出库详情id") |
56 | 66 | private Integer shipmentDetailId; |
67 | + | |
57 | 68 | /** 出库组盘详情id */ |
58 | 69 | @Excel(name = "出库组盘详情id", width = 15) |
59 | 70 | @ApiModelProperty(value = "出库组盘详情id") |
60 | 71 | private Integer shipmentContainerDetailId; |
72 | + | |
61 | 73 | /** 入库单id */ |
62 | 74 | @Excel(name = "入库单id", width = 15) |
63 | 75 | @ApiModelProperty(value = "入库单id") |
64 | 76 | private Integer receiptId; |
77 | + | |
78 | + @TableField(exist = false) | |
79 | + private String receiptCode; | |
80 | + | |
65 | 81 | /** 入库单详情id */ |
66 | 82 | @Excel(name = "入库单详情id", width = 15) |
67 | 83 | @ApiModelProperty(value = "入库单详情id") |
68 | 84 | private Integer receiptDetailId; |
85 | + | |
69 | 86 | /** 入库组盘详情Id */ |
70 | 87 | @Excel(name = "入库组盘详情Id", width = 15) |
71 | 88 | @ApiModelProperty(value = "入库组盘详情Id") |
72 | 89 | private Integer receiptContainerDetailId; |
90 | + | |
73 | 91 | /** 物料编码 */ |
74 | 92 | @Excel(name = "物料编码", width = 15) |
75 | 93 | @ApiModelProperty(value = "物料编码") |
76 | 94 | private String materialCode; |
95 | + | |
77 | 96 | /** 物料名称 */ |
78 | 97 | @Excel(name = "物料名称", width = 15) |
79 | 98 | @ApiModelProperty(value = "物料名称") |
80 | 99 | private String materialName; |
100 | + | |
81 | 101 | /** 物料规格 */ |
82 | 102 | @Excel(name = "物料规格", width = 15) |
83 | 103 | @ApiModelProperty(value = "物料规格") |
84 | 104 | private String materialSpec; |
105 | + | |
85 | 106 | /** 物料单位 */ |
86 | 107 | @Excel(name = "物料单位", width = 15) |
87 | 108 | @ApiModelProperty(value = "物料单位") |
88 | 109 | private String materialUnit; |
110 | + | |
89 | 111 | /** 数量 */ |
90 | 112 | @Excel(name = "数量", width = 15) |
91 | 113 | @ApiModelProperty(value = "数量") |
92 | 114 | private BigDecimal qty; |
115 | + | |
93 | 116 | /** 批次 */ |
94 | 117 | @Excel(name = "批次", width = 15) |
95 | 118 | @ApiModelProperty(value = "批次") |
96 | 119 | private String batch; |
120 | + | |
97 | 121 | /** 批号 */ |
98 | 122 | @Excel(name = "批号", width = 15) |
99 | 123 | @ApiModelProperty(value = "批号") |
100 | 124 | private String lot; |
125 | + | |
101 | 126 | /** 项目号 */ |
102 | 127 | @Excel(name = "项目号", width = 15) |
103 | 128 | @ApiModelProperty(value = "项目号") |
104 | 129 | private String project; |
130 | + | |
105 | 131 | /** 库存状态 */ |
106 | 132 | @Excel(name = "库存状态", width = 15) |
107 | 133 | @Dict(dicCode = "inventory_status") |
108 | 134 | @ApiModelProperty(value = "库存状态") |
109 | 135 | private String inventoryStatus; |
136 | + | |
110 | 137 | /** 出库的库存详情id */ |
111 | 138 | @Excel(name = "出库的库存详情id", width = 15) |
112 | 139 | @ApiModelProperty(value = "出库的库存详情id") |
113 | 140 | private Integer fromInventoryDetailId; |
141 | + | |
114 | 142 | /** 入库的库存详情id */ |
115 | 143 | @Excel(name = "入库的库存详情id", width = 15) |
116 | 144 | @ApiModelProperty(value = "入库的库存详情id") |
117 | 145 | private Integer toInventoryDetailId; |
146 | + | |
118 | 147 | @Excel(name = "唯一号", width = 15) |
119 | 148 | @ApiModelProperty(value = "唯一号") |
120 | 149 | private String uniqueCode; |
150 | + | |
121 | 151 | /** 备用字段1 */ |
122 | 152 | @Excel(name = "备用字段1", width = 15) |
123 | 153 | @ApiModelProperty(value = "备用字段1") |
124 | 154 | private String userdef1; |
155 | + | |
125 | 156 | /** 备用字段2 */ |
126 | 157 | @Excel(name = "备用字段2", width = 15) |
127 | 158 | @ApiModelProperty(value = "备用字段2") |
128 | 159 | private String userdef2; |
160 | + | |
129 | 161 | /** 备用字段3 */ |
130 | 162 | @Excel(name = "备用字段3", width = 15) |
131 | 163 | @ApiModelProperty(value = "备用字段3") |
132 | 164 | private String userdef3; |
165 | + | |
133 | 166 | /** 创建人 */ |
134 | 167 | @ApiModelProperty(value = "创建人") |
135 | 168 | private String createBy; |
169 | + | |
136 | 170 | /** 创建日期 */ |
137 | 171 | @ApiModelProperty(value = "创建日期") |
138 | 172 | private Date createTime; |
173 | + | |
139 | 174 | /** 更新人 */ |
140 | 175 | @ApiModelProperty(value = "更新人") |
141 | 176 | private String updateBy; |
177 | + | |
142 | 178 | /** 更新日期 */ |
143 | 179 | @ApiModelProperty(value = "更新日期") |
144 | 180 | private Date updateTime; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1097,8 +1097,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1097 | 1097 | */ |
1098 | 1098 | @Override |
1099 | 1099 | @Transactional(rollbackFor = Exception.class) |
1100 | - @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'详情入库'", extra = "#extraJsonString", msg = "'库位编码:' + #toLocationCode + ',容器编码:' + #containerCode", | |
1101 | - recordReturnValue = true) | |
1100 | + @OperationLog(bizId = "''", bizType = "'入库单追踪'", tag = "'入库任务完成'", extra = "#extraJsonString", | |
1101 | + msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getToLocationCode() + ',容器编码:' + #taskHeader.getContainerCode()", recordReturnValue = true) | |
1102 | 1102 | public Result completeReceiptTask(TaskHeader taskHeader) { |
1103 | 1103 | if (taskHeader == null) { |
1104 | 1104 | return Result.error("任务未找到,执行中止"); |
... | ... | @@ -1155,8 +1155,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1155 | 1155 | for (TaskDetail taskDetail : taskDetailList) { |
1156 | 1156 | ReceiptDetail receiptDetail = receiptDetailService.getById(taskDetail.getReceiptDetailId()); |
1157 | 1157 | if (receiptDetail == null) { |
1158 | - throw new ServiceException("未找到id:" + taskDetail.getReceiptDetailId() + "入库单明细"); | |
1158 | + throw new ServiceException("未找到ID:" + taskDetail.getReceiptDetailId() + "入库单明细"); | |
1159 | 1159 | } |
1160 | + // 操作记录统计用 | |
1161 | + taskDetail.setReceiptCode(receiptDetail.getReceiptCode()); | |
1160 | 1162 | BigDecimal taskQty = receiptDetail.getTaskQty(); |
1161 | 1163 | BigDecimal qty = receiptDetail.getQty(); |
1162 | 1164 | if (taskQty.compareTo(qty) >= 0) { |
... | ... | @@ -1247,9 +1249,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1247 | 1249 | throw new ServiceException("完成入库任务时,更新入库单头失败"); |
1248 | 1250 | } |
1249 | 1251 | } |
1250 | - LogRecordContext.putVariable("toLocationCode", toLocationCode); | |
1251 | - LogRecordContext.putVariable("containerCode", containerCode); | |
1252 | - LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(receiptDetaiList)); | |
1252 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(taskDetailList)); | |
1253 | 1253 | return Result.ok("完成入库任务"); |
1254 | 1254 | } |
1255 | 1255 | |
... | ... | @@ -1260,7 +1260,9 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1260 | 1260 | */ |
1261 | 1261 | @Override |
1262 | 1262 | @Transactional(rollbackFor = Exception.class) |
1263 | - @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情出库'", extra = "#extraJsonString", msg = "'库位编码:' + #fromLocationCode + ',容器编码:' + #containerCode", recordReturnValue = true) | |
1263 | + @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'出库任务完成'", extra = "#extraJsonString", | |
1264 | + msg = "'任务ID:' + #taskHeader.getId() + ',库位编码:' + #taskHeader.getFromLocationCode() + ',容器编码:' + #taskHeader.getContainerCode() + ',目标出入口:' + #taskHeader.getToPortCode()", | |
1265 | + recordReturnValue = true) | |
1264 | 1266 | public Result completeShipmentTask(TaskHeader taskHeader) { |
1265 | 1267 | if (taskHeader == null) { |
1266 | 1268 | return Result.error("完成出库任务未找到,执行中止"); |
... | ... | @@ -1301,6 +1303,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1301 | 1303 | if (shipmentDetail == null) { |
1302 | 1304 | throw new ServiceException("完成出库任务, 出库任务没有找到出库详情" + taskDetail.getShipmentDetailId()); |
1303 | 1305 | } |
1306 | + taskDetail.setShipmentCode(shipmentDetail.getShipmentCode()); | |
1304 | 1307 | if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) == 0) { |
1305 | 1308 | shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); |
1306 | 1309 | } else if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) > 0) { |
... | ... | @@ -1429,9 +1432,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1429 | 1432 | throw new ServiceException("完成出库任务,更新出库单头失败"); |
1430 | 1433 | } |
1431 | 1434 | } |
1432 | - LogRecordContext.putVariable("fromLocationCode", fromLocationCode); | |
1433 | - LogRecordContext.putVariable("containerCode", containerCode); | |
1434 | - LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(shipmentDetailList)); | |
1435 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(taskDetailList)); | |
1435 | 1436 | return Result.ok("完成出库任务"); |
1436 | 1437 | } |
1437 | 1438 | |
... | ... |