From 3578e82bedf6cf8687ea30eb3bfb1829608f8660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Fri, 1 Mar 2024 09:44:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=20=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=85=8D=E7=BD=AE=E5=86=85=E5=AE=B9=E5=88=97?= =?UTF-8?q?=E8=A1=A8=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackPush/TrackPushService.cs | 11 ++++ .../ITrackPushConfigRepository.cs | 2 + .../GetTrackPushContentPageInputVO.cs | 9 +++ .../GetTrackPushContentPageOutputVO.cs | 56 +++++++++++++++++++ .../TrackPushConfigRepository.cs | 19 ++++++- 5 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentPageInputVO.cs create mode 100644 src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentPageOutputVO.cs diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index b04e1194..4acda516 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -35,4 +35,15 @@ public class TrackPushService : ApplicationService, ITransientDependency { return await _trackPushConfigRepository.GetPageAsync(input); } + + /// + /// 轨迹推送配置内容列表 + /// + /// + /// + [HttpPost("GetContentPage")] + public async Task> GetContentPageAsync([FromBody] GetTrackPushContentPageInputVO input) + { + return await _trackPushConfigRepository.GetContentPageAsync(input); + } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs index 82866c1f..ce41da3b 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs @@ -6,4 +6,6 @@ namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate; public interface ITrackPushConfigRepository : IBasicRepository { Task> GetPageAsync(KeywordsInputVO input); + + Task> GetContentPageAsync(GetTrackPushContentPageInputVO input); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentPageInputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentPageInputVO.cs new file mode 100644 index 00000000..f0558e95 --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentPageInputVO.cs @@ -0,0 +1,9 @@ +namespace SJZY.Track.Domain.Dtos.TrackPush; + +public class GetTrackPushContentPageInputVO : PageInfoInput +{ + /// + /// 轨迹推送配置id + /// + public int TrackPushConfigId { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentPageOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentPageOutputVO.cs new file mode 100644 index 00000000..b3ae2d3f --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentPageOutputVO.cs @@ -0,0 +1,56 @@ +namespace SJZY.Track.Domain.Dtos.TrackPush; + +public class GetTrackPushContentPageOutputVO +{ + /// + /// 轨迹内容代码 + /// + public string Code { get; set; } + + /// + /// 轨迹内容 + /// + public string Content { get; set; } + + /// + /// 轨迹内容英文 + /// + public string EnContent { get; set; } + + /// + /// 推送扩展字段 + /// + public string ExpandFieldsValue { get; set; } + + public int Id { get; set; } + + /// + /// 推送单号类型 + /// + public string OrderNoType { get; set; } + + /// + /// 推送排序 + /// + public int Sort { get; set; } + + /// + /// 推送轨迹内容代码 + /// + public string TrackContentCodeValue { get; set; } + + /// + /// 推送轨迹内容 + /// + public string TrackContentValue { get; set; } + + /// + /// 推送轨迹内容英文 + /// + public string TrackEnContentValue { get; set; } + + /// + /// 推送轨迹状态 + /// + public string TrackStatusValue { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/TrackPushConfigRepository.cs index a69f2406..5d15dab1 100644 --- a/src/SJZY.Track.Repository/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/TrackPushConfigRepository.cs @@ -1,4 +1,5 @@ -using SJZY.Track.Domain.Aggregates.TrackPushAggregate; +using SJZY.Track.Domain.Aggregates.TrackContentAggregate; +using SJZY.Track.Domain.Aggregates.TrackPushAggregate; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPush; @@ -19,7 +20,7 @@ public class TrackPushConfigRepository : BasicRepository, .Filter(null, true) .Where(trackPush => !trackPush.IsDeleted) .WhereIF(input.SubSystemId.HasValue, trackPush => trackPush.SubSystemId == input.SubSystemId) - .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (trackPush, system, externalSubject, template) => externalSubject.Name.Contains(input.Keywords) || template.Name.Contains(input.Keywords)) + .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (trackPush, system, externalSubject, template) => externalSubject.Abbreviation.Contains(input.Keywords) || externalSubject.Name.Contains(input.Keywords) || template.Name.Contains(input.Keywords)) .OrderByDescending(trackPush => trackPush.CreateTime) .Select((trackPush, system, externalSubject, template) => new GetTrackPushConfigPageOutputVO { @@ -34,4 +35,18 @@ public class TrackPushConfigRepository : BasicRepository, .Distinct() .ToPagedListAsync(input.PageIndex, input.PageSize); } + + public async Task> GetContentPageAsync(GetTrackPushContentPageInputVO input) + { + return await Context.Queryable() + .InnerJoin((pushContent, trackContent) => pushContent.TrackContentId == trackContent.Id) + .Where(pushContent => pushContent.TrackPushConfigId == input.TrackPushConfigId) + .OrderBy((pushContent, trackContent) => pushContent.Sort) + .Select((pushContent, trackContent) => new GetTrackPushContentPageOutputVO + { + Id = pushContent.Id, + Sort = pushContent.Sort + }, true) + .ToPagedListAsync(input.PageIndex, input.PageSize); + } } \ No newline at end of file