补充完整预警明细反参
- 缺失轨迹状态更改为id+描述
This commit is contained in:
parent
5053ede806
commit
d8929fb41f
@ -1,7 +1,9 @@
|
||||
using SJZY.Track.Application.Contract.Dtos.Warning.Return;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Warning.Complete;
|
||||
|
||||
/// <summary>
|
||||
/// 完整预警
|
||||
/// 完整预警明细
|
||||
/// </summary>
|
||||
public class CompleteWarningDetailsDto
|
||||
{
|
||||
@ -59,7 +61,7 @@ public class CompleteWarningDetailsDto
|
||||
/// <summary>
|
||||
/// 缺失轨迹状态
|
||||
/// </summary>
|
||||
public string MissingTrackStatus { get; set; } // todo:id换名称
|
||||
public List<TrackStatusDto> MissingTrackStatus { get; set; }
|
||||
|
||||
|
||||
//视图属性 tips:从es即时拿取
|
||||
|
||||
@ -194,18 +194,23 @@ public class CompleteWarningService : ApplicationService
|
||||
return string.Join(',', notifyUsers.ToObject<List<NotifyUserDto>>().Select(x => x.UserName));
|
||||
}
|
||||
|
||||
string BuildMissingTrackStatus(string statusIds)
|
||||
List<TrackStatusDto> BuildMissingTrackStatus(string statusIds)
|
||||
{
|
||||
var trackStatus = statusIds.Split(',').Select(x =>
|
||||
{
|
||||
if (int.TryParse(x, out var id))
|
||||
return trackStatusDict.GetValueOrDefault(id)
|
||||
?? $"丢失{id}轨迹状态";
|
||||
if (!int.TryParse(x, out var id)) return null;
|
||||
|
||||
var trackStatusName = trackStatusDict.GetValueOrDefault(id);
|
||||
if (string.IsNullOrWhiteSpace(trackStatusName)) return null;
|
||||
return new TrackStatusDto
|
||||
{
|
||||
TrackStatusId = id,
|
||||
TrackStatus = trackStatusName
|
||||
};
|
||||
|
||||
return null;
|
||||
}).Where(x => x != null);
|
||||
|
||||
return string.Join(',', trackStatus);
|
||||
return trackStatus.ToList()!;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user