完成 轨迹拉取配置内容列表 接口
This commit is contained in:
parent
1e9d4fdd6f
commit
eddd529718
@ -35,4 +35,15 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
return await _trackPullConfigRepository.GetPageAsync(input);
|
return await _trackPullConfigRepository.GetPageAsync(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹拉取配置内容列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("GetContentPage")]
|
||||||
|
public async Task<UnifyPageResultDto<GetTrackPullContentPageOutputVO>> GetContentPageAsync([FromBody] GetTrackPullContentPageInputVO input)
|
||||||
|
{
|
||||||
|
return await _trackPullConfigRepository.GetContentPageAsync(input);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -11,4 +11,11 @@ public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEn
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<UnifyPageResultDto<GetTrackPullConfigPageOutputVO>> GetPageAsync(KeywordsInputVO input);
|
Task<UnifyPageResultDto<GetTrackPullConfigPageOutputVO>> GetPageAsync(KeywordsInputVO input);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹拉取配置内容列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UnifyPageResultDto<GetTrackPullContentPageOutputVO>> GetContentPageAsync(GetTrackPullContentPageInputVO input);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackPull;
|
||||||
|
|
||||||
|
public class GetTrackPullContentPageInputVO : PageInfoInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹拉取配置id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackPullConfigId { get; set; }
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackPull;
|
||||||
|
|
||||||
|
public class GetTrackPullContentPageOutputVO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string TrackContentCodeValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public bool? TrackContentValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹关键字(正向)
|
||||||
|
/// </summary>
|
||||||
|
public string TrackKeyword { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹关键字(正向)
|
||||||
|
/// </summary>
|
||||||
|
public List<string> TrackKeywords { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹关键字(反向)
|
||||||
|
/// </summary>
|
||||||
|
public string TrackKeywordReverse { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹关键字(反向)
|
||||||
|
/// </summary>
|
||||||
|
public List<string> TrackKeywordsReverse { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生地
|
||||||
|
/// </summary>
|
||||||
|
public string TrackPlaceValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatusValue { get; set; }
|
||||||
|
}
|
||||||
@ -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.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.Common;
|
using SJZY.Track.Domain.Dtos.Common;
|
||||||
using SJZY.Track.Domain.Dtos.TrackPull;
|
using SJZY.Track.Domain.Dtos.TrackPull;
|
||||||
@ -30,4 +31,24 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
|||||||
})
|
})
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<UnifyPageResultDto<GetTrackPullContentPageOutputVO>> GetContentPageAsync(GetTrackPullContentPageInputVO input)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackPullContentConfigEntity>()
|
||||||
|
.InnerJoin<TrackContentEntity>((pullContent, trackContent) => pullContent.TrackContentId == trackContent.Id)
|
||||||
|
.InnerJoin<TrackPullConfigEntity>((pullContent, trackContent, trackPull) => pullContent.TrackPullConfigId == trackPull.Id)
|
||||||
|
.InnerJoin<TrackTemplateContentEntity>((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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user