This commit is contained in:
2026-08-28 11:28:30 +08:00
parent 1e5ce54858
commit f998bed09c
9 changed files with 140 additions and 31 deletions
@@ -706,9 +706,20 @@ public class LoadingPickService {
/** 进入PDA拣货任务即将预装柜计划推进为拣货中;状态推进和历史写入保持幂等。 */
private void startPickingIfNeeded(LoadingPickTaskEntity task, long operatorId, String operatorName) {
if (smartLoadingRepository.startPicking(task.getLoadingPlanId(), operatorId, operatorName) == 1) {
String operationId = "PDA-START-" + task.getId();
LoadingPlanHistoryEntity existing = smartLoadingRepository.operation(operationId);
if (existing != null) {
if (!Objects.equals(existing.getLoadingPlanId(), task.getLoadingPlanId())
|| !"START_LOADING".equals(existing.getActionType())
|| !"EDITING".equals(existing.getFromStatus())
|| !"LOADING".equals(existing.getToStatus())) {
throw conflict("PDA开始装柜历史与当前任务不一致");
}
return;
}
LoadingPlanHistoryEntity history = new LoadingPlanHistoryEntity();
history.setLoadingPlanId(task.getLoadingPlanId());
history.setOperationId("PDA-START-" + task.getId());
history.setOperationId(operationId);
history.setActionType("START_LOADING");
history.setFromStatus("EDITING");
history.setToStatus("LOADING");