Merge pull request '完成 轨迹推送配置列表 接口' (#1) from S01-轨迹中台 into dev
Reviewed-on: http://192.168.80.50:3000/Dotnet/SJZY.Track.Api/pulls/1
This commit is contained in:
commit
7636c6a100
@ -3,8 +3,8 @@ using SJZY.Track.Application.Dtos.TrackPull;
|
|||||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
using Volo.Abp.AutoMapper;
|
using Volo.Abp.AutoMapper;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.AutoMapper
|
namespace SJZY.Track.Application.AutoMapper;
|
||||||
{
|
|
||||||
public class TrackPullAutoMapperProfile : Profile
|
public class TrackPullAutoMapperProfile : Profile
|
||||||
{
|
{
|
||||||
public TrackPullAutoMapperProfile()
|
public TrackPullAutoMapperProfile()
|
||||||
@ -15,4 +15,3 @@ namespace SJZY.Track.Application.AutoMapper
|
|||||||
CreateMap<UpdateTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None);
|
CreateMap<UpdateTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.AutoMapper;
|
||||||
|
|
||||||
|
public class TrackPushAutoMapperProfile : Profile
|
||||||
|
{
|
||||||
|
public TrackPushAutoMapperProfile()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,7 +2,6 @@
|
|||||||
using SJZY.Expand.ABP.Core.Localization;
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
using SJZY.Track.Application.Dtos.TrackPull;
|
using SJZY.Track.Application.Dtos.TrackPull;
|
||||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
|
|||||||
@ -0,0 +1,38 @@
|
|||||||
|
using Microsoft.Extensions.Localization;
|
||||||
|
using SJZY.Track.Application.Localization;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
|
using SJZY.Track.Domain.Dtos.Common;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||||
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Services.TrackPush;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹推送
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(GroupName = "轨迹推送")]
|
||||||
|
[Route("/Track/PushConfig")]
|
||||||
|
public class TrackPushService : ApplicationService, ITransientDependency
|
||||||
|
{
|
||||||
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
|
private readonly ITrackPushConfigRepository _trackPushConfigRepository;
|
||||||
|
|
||||||
|
public TrackPushService(
|
||||||
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
|
ITrackPushConfigRepository trackPushConfigRepository)
|
||||||
|
{
|
||||||
|
_stringLocalizer = stringLocalizer;
|
||||||
|
_trackPushConfigRepository = trackPushConfigRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹推送配置列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("GetPage")]
|
||||||
|
public async Task<UnifyPageResultDto<GetTrackPushConfigPageOutputVO>> GetPageAsync([FromBody] KeywordsInputVO input)
|
||||||
|
{
|
||||||
|
return await _trackPushConfigRepository.GetPageAsync(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,9 @@
|
|||||||
namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
using SJZY.Track.Domain.Dtos.Common;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
|
|
||||||
public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEntity>
|
public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEntity>
|
||||||
{
|
{
|
||||||
|
Task<UnifyPageResultDto<GetTrackPushConfigPageOutputVO>> GetPageAsync(KeywordsInputVO input);
|
||||||
}
|
}
|
||||||
@ -7,7 +7,7 @@ public class GetTrackPullConfigPageOutputVO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
public int? Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 服务商名称
|
/// 服务商名称
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||||
|
|
||||||
|
public class GetTrackPushConfigPageOutputVO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户名称
|
||||||
|
/// </summary>
|
||||||
|
public string CustomName { get; set; }
|
||||||
|
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统名称
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 模板名称
|
||||||
|
/// </summary>
|
||||||
|
public string TrackTemplate { get; set; }
|
||||||
|
}
|
||||||
@ -1,8 +1,37 @@
|
|||||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
|
using SJZY.Track.Domain.Dtos.Common;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||||
|
using SJZY.Track.Domain.VEntities;
|
||||||
|
using SJZY.Track.Repository.VData.Entitys;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>, ITrackPushConfigRepository,
|
public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>, ITrackPushConfigRepository,
|
||||||
IScopedDependency
|
IScopedDependency
|
||||||
{
|
{
|
||||||
|
public async Task<UnifyPageResultDto<GetTrackPushConfigPageOutputVO>> GetPageAsync(KeywordsInputVO input)
|
||||||
|
{
|
||||||
|
return await AsQueryable()
|
||||||
|
.LeftJoin<VSystemEntity>((trackPush, system) => trackPush.SubSystemId == system.Id && !system.IsDeleted)
|
||||||
|
.LeftJoin<VExternalSubjectEntity>((trackPush, system, externalSubject) => trackPush.CustomId == externalSubject.Id && !externalSubject.IsDeleted)
|
||||||
|
.LeftJoin<TrackTemplateEntity>((trackPush, system, externalSubject, template) => SqlFunc.SplitIn(trackPush.TrackTemplateId, template.Id.ToString()) && !template.IsDeleted)
|
||||||
|
.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))
|
||||||
|
.OrderByDescending(trackPush => trackPush.CreateTime)
|
||||||
|
.Select((trackPush, system, externalSubject, template) => new GetTrackPushConfigPageOutputVO
|
||||||
|
{
|
||||||
|
Id = trackPush.Id,
|
||||||
|
SubSystem = system.CnName,
|
||||||
|
CustomName = externalSubject.Abbreviation,
|
||||||
|
TrackTemplate = SqlFunc.Subqueryable<TrackTemplateEntity>()
|
||||||
|
.Where(template => SqlFunc.SplitIn(trackPush.TrackTemplateId, template.Id.ToString()) && !template.IsDeleted)
|
||||||
|
.SelectStringJoin(template => template.Name, ","),
|
||||||
|
CreateTime = trackPush.CreateTime
|
||||||
|
})
|
||||||
|
.Distinct()
|
||||||
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user