fix(lastleg): return persisted grouped dispatch replay facts

This commit is contained in:
2026-10-06 00:52:48 +08:00
parent 60543adf63
commit bc8c1467ee
2 changed files with 34 additions and 5 deletions
@@ -556,7 +556,12 @@ public class DispatchService {
drafts.updateById(draft);
}
}
return response(dispatch, items.findByDispatchOrder(customerId, dispatch.getId()));
// Exact grouped replay must return the same persisted timestamp precision
// on the initial call as on later reads from DATETIME(3).
DispatchOrder responseOrder = preserveExactReplay
? Objects.requireNonNull(orders.lockById(customerId, dispatch.getId()), "Saved dispatch is missing")
: dispatch;
return response(responseOrder, items.findByDispatchOrder(customerId, dispatch.getId()));
}
@Transactional