fix:修复修改轨迹推送配置后引发的预警计算没有处于事务之后进行

This commit is contained in:
hardstylewyl 2025-05-07 09:51:02 +08:00
parent c163a3bcc7
commit d0c1ee8bc5
2 changed files with 13 additions and 8 deletions

View File

@ -90,7 +90,7 @@ public class BroadcastingService : IBroadcastingService
OperationMan = log.OperationMan, OperationMan = log.OperationMan,
PushTime = log.PushTime, PushTime = log.PushTime,
OptionType = log.OptionType, OptionType = log.OptionType,
IsManualPush = log.IsManualPush, //操作人不为系统用户,则认为是仍推送 IsManualPush = log.IsManualPush, //操作人不为系统用户,则认为是人推送
PushContent = log.PushContent, PushContent = log.PushContent,
OrderNo = log.OrderNo, OrderNo = log.OrderNo,
TrackStatus = log.TrackStatus, TrackStatus = log.TrackStatus,

View File

@ -270,10 +270,11 @@ public class TrackPushService : ApplicationService, ISingletonDependency
await _trackPushCacheService.SetPushContentConfigsAsync(pushConfig.SubSystemId, pushConfig.CustomId); await _trackPushCacheService.SetPushContentConfigsAsync(pushConfig.SubSystemId, pushConfig.CustomId);
} }
// 引发预警计算
await WarningCalc_PushContentConfigChanged(pushConfig, oldContentConfig, postContentConfig);
ts.Complete(); ts.Complete();
// 引发预警计算
WarningCalc_PushContentConfigChanged(pushConfig, oldContentConfig, postContentConfig);
return true; return true;
} }
@ -285,7 +286,7 @@ public class TrackPushService : ApplicationService, ISingletonDependency
[HttpPost("SortContent")] [HttpPost("SortContent")]
public async Task<bool> SortContentAsync([FromBody] SortTrackPushContentInput input) public async Task<bool> SortContentAsync([FromBody] SortTrackPushContentInput input)
{ {
List<int> ids = input.SortInfo.Select(x => int.Parse(x.Key)).ToList(); var ids = input.SortInfo.Select(x => int.Parse(x.Key)).ToList();
var trackPushContentEntities = await _trackPushConfigRepository.GetContentListAsync(x => ids.Contains(x.Id)); var trackPushContentEntities = await _trackPushConfigRepository.GetContentListAsync(x => ids.Contains(x.Id));
@ -297,9 +298,13 @@ public class TrackPushService : ApplicationService, ISingletonDependency
await _trackPushConfigRepository.UpdateContentRangeAsync(trackPushContentEntities); await _trackPushConfigRepository.UpdateContentRangeAsync(trackPushContentEntities);
var pushConfig = var pushConfig = await _trackPushConfigRepository.GetFirstAsync(
await _trackPushConfigRepository.GetFirstAsync(x => x => x.Id == trackPushContentEntities[0].TrackPushConfigId,
x.Id == trackPushContentEntities[0].TrackPushConfigId); y => new
{
y.SubSystemId,
y.CustomId
});
if (pushConfig != null) if (pushConfig != null)
{ {
await _trackPushCacheService.SetPushContentConfigsAsync(pushConfig.SubSystemId, pushConfig.CustomId); await _trackPushCacheService.SetPushContentConfigsAsync(pushConfig.SubSystemId, pushConfig.CustomId);
@ -312,7 +317,7 @@ public class TrackPushService : ApplicationService, ISingletonDependency
} }
private async Task WarningCalc_PushContentConfigChanged(TrackPushConfigEntity? pushConfig, TrackPushContentConfigEntity? oldContentConfig, TrackPushContentConfigEntity? postContentConfig) private void WarningCalc_PushContentConfigChanged(TrackPushConfigEntity? pushConfig, TrackPushContentConfigEntity? oldContentConfig, TrackPushContentConfigEntity? postContentConfig)
{ {
// 推送配置主体不存在? // 推送配置主体不存在?
if (pushConfig == null) return; if (pushConfig == null) return;