优化
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user