diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs index 5bd82b7f..08e8406c 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs @@ -35,4 +35,15 @@ public class TrackPullService : ApplicationService, ITransientDependency { return await _trackPullConfigRepository.GetPageAsync(input); } + + /// + /// 轨迹拉取配置内容列表 + /// + /// + /// + [HttpPost("GetContentPage")] + public async Task> GetContentPageAsync([FromBody] GetTrackPullContentPageInputVO input) + { + return await _trackPullConfigRepository.GetContentPageAsync(input); + } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPullAggregate/ITrackPullConfigRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackPullAggregate/ITrackPullConfigRepository.cs index 0b8173e3..8229f27c 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPullAggregate/ITrackPullConfigRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPullAggregate/ITrackPullConfigRepository.cs @@ -11,4 +11,11 @@ public interface ITrackPullConfigRepository : IBasicRepository /// Task> GetPageAsync(KeywordsInputVO input); + + /// + /// 轨迹拉取配置内容列表 + /// + /// + /// + Task> GetContentPageAsync(GetTrackPullContentPageInputVO input); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentPageInputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentPageInputVO.cs new file mode 100644 index 00000000..ca31153a --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentPageInputVO.cs @@ -0,0 +1,9 @@ +namespace SJZY.Track.Domain.Dtos.TrackPull; + +public class GetTrackPullContentPageInputVO : PageInfoInput +{ + /// + /// 轨迹拉取配置id + /// + public int TrackPullConfigId { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentPageOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentPageOutputVO.cs new file mode 100644 index 00000000..c05a0375 --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackPull/GetTrackPullContentPageOutputVO.cs @@ -0,0 +1,61 @@ +namespace SJZY.Track.Domain.Dtos.TrackPull; + +public class GetTrackPullContentPageOutputVO +{ + /// + /// 轨迹内容代码 + /// + public string Code { get; set; } + + /// + /// 轨迹内容 + /// + public string Content { get; set; } + + /// + /// 轨迹内容英文 + /// + public string EnContent { get; set; } + + public int? Id { get; set; } + + /// + /// 拉取轨迹内容代码 + /// + public string TrackContentCodeValue { get; set; } + + /// + /// 拉取轨迹内容 + /// + public bool? TrackContentValue { get; set; } + + /// + /// 拉取轨迹关键字(正向) + /// + public string TrackKeyword { get; set; } + + /// + /// 拉取轨迹关键字(正向) + /// + public List TrackKeywords { get; set; } + + /// + /// 拉取轨迹关键字(反向) + /// + public string TrackKeywordReverse { get; set; } + + /// + /// 拉取轨迹关键字(反向) + /// + public List TrackKeywordsReverse { get; set; } + + /// + /// 轨迹发生地 + /// + public string TrackPlaceValue { get; set; } + + /// + /// 拉取轨迹状态 + /// + public string TrackStatusValue { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/TrackPullConfigRepository.cs b/src/SJZY.Track.Repository/TrackPullConfigRepository.cs index 3082bafe..43b0d367 100644 --- a/src/SJZY.Track.Repository/TrackPullConfigRepository.cs +++ b/src/SJZY.Track.Repository/TrackPullConfigRepository.cs @@ -1,4 +1,5 @@ -using SJZY.Track.Domain.Aggregates.TrackPullAggregate; +using SJZY.Track.Domain.Aggregates.TrackContentAggregate; +using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPull; @@ -30,4 +31,24 @@ public class TrackPullConfigRepository : BasicRepository, }) .ToPagedListAsync(input.PageIndex, input.PageSize); } + + public async Task> GetContentPageAsync(GetTrackPullContentPageInputVO input) + { + return await Context.Queryable() + .InnerJoin((pullContent, trackContent) => pullContent.TrackContentId == trackContent.Id) + .InnerJoin((pullContent, trackContent, trackPull) => pullContent.TrackPullConfigId == trackPull.Id) + .InnerJoin((pullContent, trackContent, trackPull, templateContent) => trackPull.TrackTemplateId == templateContent.TrackTemplateId && pullContent.TrackContentId == templateContent.TrackContentId) + .Where(pullContent => pullContent.TrackPullConfigId == input.TrackPullConfigId) + .OrderBy((pullContent, trackContent, trackPull, templateContent) => templateContent.Sort) + .Select((pullContent, trackContent, trackPull, templateContent) => new GetTrackPullContentPageOutputVO + { + Id = pullContent.Id + }, true) + .Mapper(x => + { + x.TrackKeywords = [.. x.TrackKeyword.Split(',')]; + x.TrackKeywordsReverse = [.. x.TrackKeywordReverse.Split(',')]; + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + } } \ No newline at end of file