fix(persistence): 差删先按 FDAY 圈定删除成员,修复保留航班明细误删 (ACM2-30)
This commit is contained in:
@@ -232,7 +232,7 @@ class MessageProcessor(
|
||||
if (decision.flightChanges.isNotEmpty()) {
|
||||
val nextStates = decision.flightChanges.map { change ->
|
||||
val current = flightSchd.findNextStateByFlid(change.flid)
|
||||
val commands = FlightStateEngine.commandsFromFields(change.flid, change.fields, snapshotReplace = false)
|
||||
val commands = FlightStateEngine.commandsFromFields(change.flid, change.fields)
|
||||
FlightStateEngine.apply(current, commands, messageId, bumpVersion = true)
|
||||
}
|
||||
flightSchd.persistNextStates(null, nextStates, snapshotReplace = false)
|
||||
|
||||
@@ -78,7 +78,7 @@ class SnapshotFlow(
|
||||
// 锁内读取当前航班态,计算 nextState(单写者互斥下读到的一定是已提交最新态)
|
||||
val nextStates = normalized.map { (flid, fields) ->
|
||||
val current = flightSchd.findNextStateByFlid(flid)
|
||||
val commands = FlightStateEngine.commandsFromFields(flid, fields, snapshotReplace = true)
|
||||
val commands = FlightStateEngine.commandsFromFields(flid, fields)
|
||||
FlightStateEngine.apply(current, commands, messageId, bumpVersion = true)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class GtdtHandler(
|
||||
fields["GTDT"] = mapper.writeValueAsString(gtdtItems)
|
||||
|
||||
val current = flightView[body.flid]?.let { FlightStateEngine.fromFlightFields(body.flid, it) }
|
||||
val commands = FlightStateEngine.commandsFromFields(body.flid, fields, snapshotReplace = false)
|
||||
val commands = FlightStateEngine.commandsFromFields(body.flid, fields)
|
||||
val preview = FlightStateEngine.apply(current, commands, messageId = "", bumpVersion = false)
|
||||
val payloadJson = FlightFieldsJson.toJson(preview.toFlightFields(mapper))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user