From 7b9de2b9ec0d287674d6a169143a825ab6b53598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=BE=99=20=E7=8E=8B?= Date: Fri, 22 Nov 2024 16:10:10 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E8=8E=B7=E5=8F=96=E5=8F=AF=E7=94=A8?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E5=86=85=E5=AE=B9=E6=8E=A5=E5=8F=A3=E5=8F=8D?= =?UTF-8?q?=E5=8F=82=E5=A2=9E=E5=8A=A0=EF=BC=8C=E3=80=90=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E3=80=91=E3=80=90=E8=BD=A8=E8=BF=B9=E5=8F=91?= =?UTF-8?q?=E7=94=9F=E6=97=B6=E9=97=B4=E3=80=91=E3=80=90=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E6=97=B6=E5=8C=BA=E3=80=91=E5=B9=B6=E4=BF=9D?= =?UTF-8?q?=E8=AF=81=E3=80=90=E8=BD=A8=E8=BF=B9=E5=86=85=E5=AE=B9=E3=80=91?= =?UTF-8?q?=E3=80=90=E8=BD=A8=E8=BF=B9=E8=8B=B1=E6=96=87=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=80=91=E5=92=8C=E6=96=B0=E5=A2=9E=E7=9A=84=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=B8=8E=E8=BD=A8=E8=BF=B9=E6=98=8E=E7=BB=86=E8=A1=A8=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetAvailableContentOutput.cs | 15 ++++++++ .../TrackContents/TrackContentService.cs | 38 ++++++++++++++++++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetAvailableContentOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetAvailableContentOutput.cs index 69e77773..f1c9300c 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetAvailableContentOutput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/GetAvailableContentOutput.cs @@ -26,4 +26,19 @@ public class GetAvailableContentOutput /// 是否对外 /// public bool IsExternal { get; set; } + + /// + /// 轨迹来源 + /// + public int? Source { get; set; } + + /// + /// 轨迹发生时间 + /// + public DateTime? TrackTime { get; set; } + + /// + /// 轨迹发生时区 + /// + public float? TrackTimeZone { get; set; } } diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs index 8cb91e48..4aa023da 100644 --- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs +++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs @@ -266,7 +266,7 @@ public class TrackContentService : ApplicationService if (!item.IsAllowManuallyCreate && input.TrackOptionType == TrackOptionType.创建) //跳过不允许手动创建的轨迹内容 continue; - if (!item.IsAllowManuallyUpdate && input.TrackOptionType == TrackOptionType.修改) //跳过不允许手动创建的轨迹内容 + if (!item.IsAllowManuallyUpdate && input.TrackOptionType == TrackOptionType.修改) //跳过不允许手动修改的轨迹内容 continue; res.Data.Add(new GetAvailableContentOutput() @@ -279,6 +279,42 @@ public class TrackContentService : ApplicationService }); } + if (input.TrackOptionType == TrackOptionType.创建 + || trackDetails == null + || trackDetails.Count == 0) + { + return res; + } + + + //修改操作,查轨迹内容列表反映明细表数据,重新构造响应数据 + var matchContent = new List(); + var contents = res.Data.Select(x => new + { + x.Id, + x.IsExternal, + x.Code + }); + + foreach (var content in contents) + { + var match = trackDetails + .Where(x => x.TrackCode == content.Code) + .Select(matchItem => new GetAvailableContentOutput + { + IsExternal = content.IsExternal, + Id = content.Id, + EnContent = matchItem.TrackEnContent, + Content = matchItem.TrackContent, + Code = matchItem.TrackCode, + TrackTime = matchItem.TrackTime, + TrackTimeZone = matchItem.TrackTimeZone, + Source = matchItem.Source + }); + matchContent.AddRange(match); + } + + res.Data = matchContent; return res; }