Commit 481e8eb97f833162ca4368e53b82938024e4245c
1 parent
2b401af4
增加任务各个状态时间
Showing
7 changed files
with
160 additions
and
48 deletions
ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue
ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue
... | ... | @@ -278,6 +278,26 @@ export default { |
278 | 278 | dataIndex: 'updateTime' |
279 | 279 | }, |
280 | 280 | { |
281 | + title: '执行时间', | |
282 | + align: "center", | |
283 | + dataIndex: 'executeTime' | |
284 | + }, | |
285 | + { | |
286 | + title: '库位分配时间', | |
287 | + align: "center", | |
288 | + dataIndex: 'allocationTime' | |
289 | + }, | |
290 | + { | |
291 | + title: '到达分拣口时间', | |
292 | + align: "center", | |
293 | + dataIndex: 'arrivalTime' | |
294 | + }, | |
295 | + { | |
296 | + title: '完成时间', | |
297 | + align: "center", | |
298 | + dataIndex: 'completeTime' | |
299 | + }, | |
300 | + { | |
281 | 301 | title: '操作', |
282 | 302 | dataIndex: 'action', |
283 | 303 | align: "center", |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... | ... | @@ -273,6 +273,26 @@ export default { |
273 | 273 | dataIndex: 'updateTime' |
274 | 274 | }, |
275 | 275 | { |
276 | + title: '执行时间', | |
277 | + align: "center", | |
278 | + dataIndex: 'executeTime' | |
279 | + }, | |
280 | + { | |
281 | + title: '库位分配时间', | |
282 | + align: "center", | |
283 | + dataIndex: 'allocationTime' | |
284 | + }, | |
285 | + { | |
286 | + title: '到达分拣口时间', | |
287 | + align: "center", | |
288 | + dataIndex: 'arrivalTime' | |
289 | + }, | |
290 | + { | |
291 | + title: '完成时间', | |
292 | + align: "center", | |
293 | + dataIndex: 'completeTime' | |
294 | + }, | |
295 | + { | |
276 | 296 | title: '操作', |
277 | 297 | dataIndex: 'action', |
278 | 298 | align: "center", |
... | ... |
ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue
... | ... | @@ -273,6 +273,26 @@ export default { |
273 | 273 | dataIndex: 'updateTime' |
274 | 274 | }, |
275 | 275 | { |
276 | + title: '执行时间', | |
277 | + align: "center", | |
278 | + dataIndex: 'executeTime' | |
279 | + }, | |
280 | + { | |
281 | + title: '库位分配时间', | |
282 | + align: "center", | |
283 | + dataIndex: 'allocationTime' | |
284 | + }, | |
285 | + { | |
286 | + title: '到达分拣口时间', | |
287 | + align: "center", | |
288 | + dataIndex: 'arrivalTime' | |
289 | + }, | |
290 | + { | |
291 | + title: '完成时间', | |
292 | + align: "center", | |
293 | + dataIndex: 'completeTime' | |
294 | + }, | |
295 | + { | |
276 | 296 | title: '操作', |
277 | 297 | dataIndex: 'action', |
278 | 298 | align: "center", |
... | ... |
ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue
... | ... | @@ -281,6 +281,26 @@ export default { |
281 | 281 | dataIndex: 'updateTime' |
282 | 282 | }, |
283 | 283 | { |
284 | + title: '执行时间', | |
285 | + align: "center", | |
286 | + dataIndex: 'executeTime' | |
287 | + }, | |
288 | + { | |
289 | + title: '库位分配时间', | |
290 | + align: "center", | |
291 | + dataIndex: 'allocationTime' | |
292 | + }, | |
293 | + { | |
294 | + title: '到达分拣口时间', | |
295 | + align: "center", | |
296 | + dataIndex: 'arrivalTime' | |
297 | + }, | |
298 | + { | |
299 | + title: '完成时间', | |
300 | + align: "center", | |
301 | + dataIndex: 'completeTime' | |
302 | + }, | |
303 | + { | |
284 | 304 | title: '操作', |
285 | 305 | dataIndex: 'action', |
286 | 306 | align: "center", |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/entity/InventoryTransaction.java
1 | 1 | package org.jeecg.modules.wms.inventory.inventoryTransaction.entity; |
2 | 2 | |
3 | 3 | import java.io.Serializable; |
4 | -import java.io.UnsupportedEncodingException; | |
5 | -import java.util.Date; | |
6 | 4 | import java.math.BigDecimal; |
5 | +import java.util.Date; | |
6 | + | |
7 | +import org.jeecg.common.aspect.annotation.Dict; | |
8 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
9 | + | |
7 | 10 | import com.baomidou.mybatisplus.annotation.IdType; |
8 | 11 | import com.baomidou.mybatisplus.annotation.TableId; |
9 | 12 | import com.baomidou.mybatisplus.annotation.TableName; |
10 | -import lombok.Data; | |
11 | -import com.fasterxml.jackson.annotation.JsonFormat; | |
12 | -import org.springframework.format.annotation.DateTimeFormat; | |
13 | -import org.jeecgframework.poi.excel.annotation.Excel; | |
14 | -import org.jeecg.common.aspect.annotation.Dict; | |
13 | + | |
15 | 14 | import io.swagger.annotations.ApiModel; |
16 | 15 | import io.swagger.annotations.ApiModelProperty; |
16 | +import lombok.Data; | |
17 | 17 | import lombok.EqualsAndHashCode; |
18 | 18 | import lombok.experimental.Accessors; |
19 | 19 | |
... | ... | @@ -109,6 +109,10 @@ public class InventoryTransaction implements Serializable { |
109 | 109 | @Excel(name = "数量", width = 15) |
110 | 110 | @ApiModelProperty(value = "数量") |
111 | 111 | private BigDecimal qty; |
112 | + /** 库存数量 */ | |
113 | + @Excel(name = "库存数量", width = 15) | |
114 | + @ApiModelProperty(value = "库存数量") | |
115 | + private BigDecimal inventoryQty; | |
112 | 116 | /** 批次 */ |
113 | 117 | @Excel(name = "批次", width = 15) |
114 | 118 | @ApiModelProperty(value = "批次") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -66,7 +66,6 @@ import org.springframework.transaction.annotation.Propagation; |
66 | 66 | import org.springframework.transaction.annotation.Transactional; |
67 | 67 | |
68 | 68 | import com.alibaba.fastjson.JSON; |
69 | -import com.aliyun.oss.ServiceException; | |
70 | 69 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
71 | 70 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
72 | 71 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
... | ... | @@ -1011,12 +1010,22 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1011 | 1010 | if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { |
1012 | 1011 | return Result.ok("入库任务(" + taskHeader.getId() + ")已经是完成的!"); |
1013 | 1012 | } |
1014 | -// if (taskDetailList.isEmpty()) { | |
1015 | -// throw new JeecgBootException("完成入库任务时, 入库任务明细为空"); | |
1016 | -// } | |
1013 | + if (taskDetailList.isEmpty()) { | |
1014 | +// return Result.error("完成入库任务时, 入库任务明细为空"); | |
1015 | + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, | |
1016 | + toLocationCode, warehouseCode); | |
1017 | + if (!result.isSuccess()) { | |
1018 | + throw new JeecgBootException(result.getMessage()); | |
1019 | + } | |
1020 | + success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); | |
1021 | + if (!success) { | |
1022 | + throw new JeecgBootException("完成入库任务时,保存任务头失败"); | |
1023 | + } | |
1024 | + return Result.ok("完成入库任务"); | |
1025 | + } | |
1017 | 1026 | Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); |
1018 | 1027 | if (toLocation == null) { |
1019 | - throw new JeecgBootException("完成入库任务时,没有找到目的库位"); | |
1028 | + return Result.error("完成入库任务时,没有找到目的库位"); | |
1020 | 1029 | } |
1021 | 1030 | InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); |
1022 | 1031 | if (inventoryHeader != null) { |
... | ... | @@ -1035,7 +1044,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1035 | 1044 | inventoryDetailList1.add(inventoryDetail1); |
1036 | 1045 | } |
1037 | 1046 | if (!inventoryDetailService.updateBatchById(inventoryDetailList1)) { |
1038 | - throw new ServiceException("完成入库任务时,更新库存详情失败"); | |
1047 | + throw new JeecgBootException("完成入库任务时,更新库存详情失败"); | |
1039 | 1048 | } |
1040 | 1049 | } |
1041 | 1050 | } |
... | ... | @@ -1116,45 +1125,46 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1116 | 1125 | inventoryTransaction.setProject(taskDetail.getProject()); |
1117 | 1126 | inventoryTransaction.setInventoryStatus(taskDetail.getInventoryStatus()); |
1118 | 1127 | inventoryTransaction.setQty(receiptQty); |
1128 | + // 获得库存数量 | |
1129 | + BigDecimal inventoryQty = inventoryDetailService.getSumQty(inventoryDetail); | |
1130 | + inventoryQty = inventoryQty.add(receiptQty); | |
1131 | + inventoryTransaction.setInventoryQty(inventoryQty); | |
1119 | 1132 | inventoryTransactionList.add(inventoryTransaction); |
1120 | 1133 | } |
1121 | 1134 | |
1122 | - if (!taskDetailList.isEmpty()) { | |
1123 | - success = receiptContainerHeaderService.updateStatusById(QuantityConstant.RECEIPT_CONTAINER_FINISHED, taskHeader.getReceiptContainerHeaderId()); | |
1124 | - if (!success) { | |
1125 | - throw new JeecgBootException("完成入库任务时,更新入库组盘头表状态失败"); | |
1126 | - } | |
1127 | - success = inventoryDetailService.saveBatch(inventoryDetailList); | |
1128 | - if (!success) { | |
1129 | - throw new JeecgBootException("完成入库任务时,保存库存详情失败"); | |
1130 | - } | |
1131 | - success = inventoryTransactionService.saveBatch(inventoryTransactionList); | |
1135 | + success = receiptContainerHeaderService.updateStatusById(QuantityConstant.RECEIPT_CONTAINER_FINISHED, taskHeader.getReceiptContainerHeaderId()); | |
1136 | + if (!success) { | |
1137 | + throw new JeecgBootException("完成入库任务时,更新入库组盘头表状态失败"); | |
1138 | + } | |
1139 | + success = inventoryDetailService.saveBatch(inventoryDetailList); | |
1140 | + if (!success) { | |
1141 | + throw new JeecgBootException("完成入库任务时,保存库存详情失败"); | |
1142 | + } | |
1143 | + success = inventoryTransactionService.saveBatch(inventoryTransactionList); | |
1144 | + if (!success) { | |
1145 | + throw new JeecgBootException("完成入库任务时,保存库存交易失败"); | |
1146 | + } | |
1147 | + if (!taskHeaderService.combineInventoryDetail(taskHeader)) { | |
1148 | + throw new JeecgBootException("完成入库任务时, 合并入库库存失败"); | |
1149 | + } | |
1150 | + if (!receiptDetailService.updateBatchById(receiptDetaiList)) { | |
1151 | + throw new JeecgBootException("完成入库任务时,更新入库单详情失败"); | |
1152 | + } | |
1153 | + List<Integer> receiptIdList = receiptDetaiList.stream().map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList()); | |
1154 | + for (Integer receiptId : receiptIdList) { | |
1155 | + success = receiptHeaderService.updateReceiptHeaderStatus(receiptId); | |
1132 | 1156 | if (!success) { |
1133 | - throw new JeecgBootException("完成入库任务时,保存库存交易失败"); | |
1134 | - } | |
1135 | - if (!taskHeaderService.combineInventoryDetail(taskHeader)) { | |
1136 | - throw new JeecgBootException("合并入库库存失败"); | |
1137 | - } | |
1138 | - if (!receiptDetailService.updateBatchById(receiptDetaiList)) { | |
1139 | - throw new JeecgBootException("完成入库任务时,更新入库单详情失败"); | |
1140 | - } | |
1141 | - List<Integer> receiptIdList = receiptDetaiList.stream().map(ReceiptDetail::getReceiptId).distinct().collect(Collectors.toList()); | |
1142 | - for (Integer receiptId : receiptIdList) { | |
1143 | - success = receiptHeaderService.updateReceiptHeaderStatus(receiptId); | |
1144 | - if (!success) { | |
1145 | - throw new JeecgBootException("完成入库任务时,更新入库单头失败"); | |
1146 | - } | |
1157 | + throw new JeecgBootException("完成入库任务时,更新入库单头失败"); | |
1147 | 1158 | } |
1148 | 1159 | } |
1149 | - | |
1160 | + if (!inventoryHeaderService.updateInventoryContainerStatusByContainerCode(containerCode, warehouseCode)) { | |
1161 | + throw new JeecgBootException("完成入库任务时,更新托盘状态失败"); | |
1162 | + } | |
1150 | 1163 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, |
1151 | 1164 | toLocationCode, warehouseCode); |
1152 | 1165 | if (!result.isSuccess()) { |
1153 | 1166 | throw new JeecgBootException(result.getMessage()); |
1154 | 1167 | } |
1155 | - if (!inventoryHeaderService.updateInventoryContainerStatusByContainerCode(containerCode, warehouseCode)) { | |
1156 | - throw new JeecgBootException("完成入库任务时,更新托盘状态失败"); | |
1157 | - } | |
1158 | 1168 | success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); |
1159 | 1169 | if (!success) { |
1160 | 1170 | throw new JeecgBootException("完成入库任务时,保存任务头失败"); |
... | ... | @@ -1198,9 +1208,20 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1198 | 1208 | if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { |
1199 | 1209 | return Result.ok("完成出库任务,(" + taskHeader.getId() + ")任务已经是完成的!"); |
1200 | 1210 | } |
1201 | -// if (taskDetailList.isEmpty()) { | |
1211 | + // 如果任务详情为空,那么就是呼叫料盒,但是又没入库进去。 | |
1212 | + if (taskDetailList.isEmpty()) { | |
1202 | 1213 | // return Result.error("完成出库任务,任务明细为空"); |
1203 | -// } | |
1214 | + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, | |
1215 | + toLocationCode, warehouseCode); | |
1216 | + if (!result.isSuccess()) { | |
1217 | + throw new JeecgBootException(result.getMessage()); | |
1218 | + } | |
1219 | + success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); | |
1220 | + if (!success) { | |
1221 | + throw new JeecgBootException("完成出库任务,保存任务头失败"); | |
1222 | + } | |
1223 | + return Result.ok("完成出库任务"); | |
1224 | + } | |
1204 | 1225 | if (StringUtils.isEmpty(fromLocationCode)) { |
1205 | 1226 | return Result.error("完成出库任务" + taskHeader.getId() + "没有起始库位,执行中止"); |
1206 | 1227 | } |
... | ... | @@ -1285,6 +1306,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1285 | 1306 | inventoryTransaction.setLot(inventoryDetail.getLot()); |
1286 | 1307 | inventoryTransaction.setProject(inventoryDetail.getProject()); |
1287 | 1308 | inventoryTransaction.setQty(taskDetail.getQty()); |
1309 | + BigDecimal inventoryQty = inventoryDetailService.getSumQty(inventoryDetail); | |
1310 | + inventoryTransaction.setInventoryQty(inventoryQty); | |
1288 | 1311 | inventoryTransactionList.add(inventoryTransaction); |
1289 | 1312 | shipmentIdList.add(taskDetail.getShipmentId()); |
1290 | 1313 | } |
... | ... | @@ -1309,11 +1332,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1309 | 1332 | if (!success) { |
1310 | 1333 | throw new JeecgBootException("完成出库任务,保存库存详情失败"); |
1311 | 1334 | } |
1312 | - Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, | |
1313 | - toLocationCode, warehouseCode); | |
1314 | - if (!result.isSuccess()) { | |
1315 | - throw new JeecgBootException(result.getMessage()); | |
1316 | - } | |
1317 | 1335 | ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(taskHeader.getShipmentContainerHeaderId()); |
1318 | 1336 | if (shipmentContainerHeader == null) { |
1319 | 1337 | throw new JeecgBootException("完成出库任务,获取出库组盘头失败"); |
... | ... | @@ -1344,6 +1362,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1344 | 1362 | throw new JeecgBootException("完成出库任务,更新库存状态失败"); |
1345 | 1363 | } |
1346 | 1364 | } |
1365 | + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, | |
1366 | + toLocationCode, warehouseCode); | |
1367 | + if (!result.isSuccess()) { | |
1368 | + throw new JeecgBootException(result.getMessage()); | |
1369 | + } | |
1347 | 1370 | success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); |
1348 | 1371 | if (!success) { |
1349 | 1372 | throw new JeecgBootException("完成出库任务,保存任务头失败"); |
... | ... |