fix(firstleg): start loading when PDA task is claimed

This commit is contained in:
2026-08-11 15:20:41 +08:00
parent 386eae6785
commit 16a2f83da6
2 changed files with 38 additions and 3 deletions
@@ -127,6 +127,7 @@ public class LoadingPickService {
throw conflict("PDA任务分配版本已变化");
}
}
startPickingIfNeeded(task, operatorId, operatorName);
insertOperation(taskId, operationId, requestHash, "CLAIM", operatorId, operatorName);
return view(task, null);
}
@@ -384,7 +385,7 @@ public class LoadingPickService {
}
}
/** 首笔实际拣货才将预装柜计划推进为拣货中;领取、跳拣和任务创建均不改变货柜状态。 */
/** 进入PDA拣货任务即将预装柜计划推进为拣货中;状态推进和历史写入保持幂等。 */
private void startPickingIfNeeded(LoadingPickTaskEntity task, long operatorId, String operatorName) {
if (smartLoadingRepository.startPicking(task.getLoadingPlanId(), operatorId, operatorName) != 1) {
return;
@@ -399,7 +400,7 @@ public class LoadingPickService {
history.setAfterSnapshot("{\"source\":\"PDA\",\"status\":\"LOADING\"}");
history.setOperatorId(operatorId);
history.setOperatorName(operatorName);
history.setOperationReason("首笔实际拣货");
history.setOperationReason("进入PDA拣货任务");
smartLoadingRepository.insert(history);
}