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