no message
parent
ca22218b8a
commit
fdf940aaf6
|
|
@ -193,23 +193,23 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
|
||||||
for (Task task : list) {
|
for (Task task : list) {
|
||||||
task.setAgvTaskId(agvTask.getId());
|
task.setAgvTaskId(agvTask.getId());
|
||||||
updateToTaskList.add(task);
|
updateToTaskList.add(task);
|
||||||
|
if (TaskTypeEnum.PICK.getValue().equals(task.getTaskType())) {
|
||||||
Inventory inventory = inventoryMap.get(task.getInventoryId());
|
Inventory inventory = inventoryMap.get(task.getInventoryId());
|
||||||
if (inventory != null) {
|
if (inventory != null) {
|
||||||
Integer status = TaskTypeEnum.PICK.getValue().equals(task.getTaskType()) ? InventoryStatusEnum.OUTBOUND.getValue() : InventoryStatusEnum.MOVE.getValue();
|
inventory.setStatus(InventoryStatusEnum.OUTBOUND.getValue());
|
||||||
inventory.setStatus(status);
|
if (!inventoryList.contains(inventory)) {
|
||||||
inventoryList.add(inventory);
|
inventoryList.add(inventory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (CollectionUtils.isNotEmpty(updateToTaskList)) {
|
if (CollectionUtils.isNotEmpty(updateToTaskList)) {
|
||||||
batchUtils.updateBatchTask(updateToTaskList);
|
batchUtils.updateBatchTask(updateToTaskList);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(inventoryList)) {
|
if (CollectionUtils.isNotEmpty(inventoryList)) {
|
||||||
Map<Long, Inventory> distinctInventoryMap = inventoryList.stream()
|
batchUtils.updateBatchInventory(inventoryList);
|
||||||
.collect(Collectors.toMap(Inventory::getId,
|
|
||||||
Function.identity(), (existing, replacement) -> existing));
|
|
||||||
batchUtils.updateBatchInventory(new ArrayList<>(distinctInventoryMap.values()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -981,11 +981,15 @@ public class AllocateProcessor {
|
||||||
Task moveTask = taskService.bulidTask(taskNo, TaskTypeEnum.MOVE.getValue(), moveItem, fromPoint, toPoint, stock, null, null, inv.getItemKeyId(), inv.getId(), inv.getQuantity(), 0);
|
Task moveTask = taskService.bulidTask(taskNo, TaskTypeEnum.MOVE.getValue(), moveItem, fromPoint, toPoint, stock, null, null, inv.getItemKeyId(), inv.getId(), inv.getQuantity(), 0);
|
||||||
moveList.add(moveTask);
|
moveList.add(moveTask);
|
||||||
pointService.bindPoint(toPoint);
|
pointService.bindPoint(toPoint);
|
||||||
|
inv.setStatus(InventoryStatusEnum.MOVE.getValue());
|
||||||
log.info("生成移位任务:{}- 容器:{} - 库位:{} - 库存数量:{}", taskNo, stock.getStockCode(), fromPoint.getPointCode(), inv.getQuantity());
|
log.info("生成移位任务:{}- 容器:{} - 库位:{} - 库存数量:{}", taskNo, stock.getStockCode(), fromPoint.getPointCode(), inv.getQuantity());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(moveInventoryList)){
|
||||||
|
inventoryMapper.updateById(moveInventoryList);
|
||||||
|
}
|
||||||
return moveList;
|
return moveList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue