Merge branch 'S01-轨迹中台' of http://192.168.80.50:3000/Dotnet/SJZY.Track.Api into S01-轨迹中台

This commit is contained in:
moyongzhen 2024-02-28 20:00:02 +08:00
commit 95f92b3865
8 changed files with 124 additions and 7 deletions

View File

@ -8,8 +8,11 @@
</PropertyGroup>
<ItemGroup>
<Compile Remove="Services\TrackMap\**" />
<Compile Remove="Validations\Docuai\**" />
<EmbeddedResource Remove="Services\TrackMap\**" />
<EmbeddedResource Remove="Validations\Docuai\**" />
<None Remove="Services\TrackMap\**" />
<None Remove="Validations\Docuai\**" />
</ItemGroup>
@ -26,8 +29,4 @@
<ProjectReference Include="..\SJZY.Track.Domain\SJZY.Track.Domain.csproj" />
<ProjectReference Include="..\SJZY.Track.HttpApi\SJZY.Track.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Services\TrackMap\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,38 @@
using Microsoft.Extensions.Localization;
using SJZY.Track.Application.Localization;
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
using SJZY.Track.Domain.Dtos.Common;
using SJZY.Track.Domain.Dtos.TrackPull;
using Volo.Abp.DependencyInjection;
namespace SJZY.Track.Application.Services.TrackPull;
/// <summary>
/// 轨迹拉取
/// </summary>
[ApiExplorerSettings(GroupName = "轨迹拉取")]
[Route("/Track/PullConfig")]
public class TrackPullService : ApplicationService, ITransientDependency
{
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
private readonly ITrackPullConfigRepository _trackPullConfigRepository;
public TrackPullService(
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
ITrackPullConfigRepository trackPullConfigRepository)
{
_stringLocalizer = stringLocalizer;
_trackPullConfigRepository = trackPullConfigRepository;
}
/// <summary>
/// 轨迹拉取配置列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("GetPage")]
public async Task<UnifyPageResultDto<GetTrackPullConfigPageOutputVO>> GetPageAsync([FromBody] KeywordsInputVO input)
{
return await _trackPullConfigRepository.GetPageAsync(input);
}
}

View File

@ -1,5 +1,14 @@
namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate;
using SJZY.Track.Domain.Dtos.Common;
using SJZY.Track.Domain.Dtos.TrackPull;
namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate;
public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEntity>
{
/// <summary>
/// 轨迹拉取配置列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<UnifyPageResultDto<GetTrackPullConfigPageOutputVO>> GetPageAsync(KeywordsInputVO input);
}

View File

@ -0,0 +1,19 @@
namespace SJZY.Track.Domain.Dtos.Common;
public class KeywordsInputVO : PageInfoInput
{
/// <summary>
/// 子系统id
/// </summary>
public int? SubSystemId { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string Keywords { get; set; }
/// <summary>
/// 选中项
/// </summary>
public int? SelectedId { get; set; }
}

View File

@ -0,0 +1,26 @@
namespace SJZY.Track.Domain.Dtos.TrackPull;
public class GetTrackPullConfigPageOutputVO
{
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
public int? Id { get; set; }
/// <summary>
/// 服务商名称
/// </summary>
public string ServiceProvider { get; set; }
/// <summary>
/// 子系统名称
/// </summary>
public string SubSystem { get; set; }
/// <summary>
/// 模板名称
/// </summary>
public string TrackTemplate { get; set; }
}

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../common.props" />

View File

@ -1,8 +1,33 @@
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
using SJZY.Track.Domain.Dtos.Common;
using SJZY.Track.Domain.Dtos.TrackPull;
using SJZY.Track.Domain.VEntities;
namespace SJZY.Track.Repository;
public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>, ITrackPullConfigRepository,
IScopedDependency
{
public async Task<UnifyPageResultDto<GetTrackPullConfigPageOutputVO>> GetPageAsync(KeywordsInputVO input)
{
return await AsQueryable()
.LeftJoin<VSystemEntity>((trackPull, system) => trackPull.SubSystemId == system.Id && !system.IsDeleted)
.LeftJoin<VServiceProviderEntity>((trackPull, system, service) => trackPull.ServiceProviderId == service.Id && !service.IsDeleted)
.LeftJoin<TrackTemplateEntity>((trackPull, system, service, template) => trackPull.TrackTemplateId == template.Id && !template.IsDeleted)
.Filter(null, true)
.Where(trackPull => !trackPull.IsDeleted)
.WhereIF(input.SubSystemId.HasValue, trackPull => trackPull.SubSystemId == input.SubSystemId)
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (trackPull, system, service, template) => service.Name.Contains(input.Keywords) || template.Name.Contains(input.Keywords))
.OrderByDescending(trackPull => trackPull.CreateTime)
.Select((trackPull, system, service, template) => new GetTrackPullConfigPageOutputVO
{
Id = trackPull.Id,
SubSystem = system.CnName,
ServiceProvider = service.Name,
TrackTemplate = template.Name,
CreateTime = trackPull.CreateTime
})
.ToPagedListAsync(input.PageIndex, input.PageSize);
}
}

View File

@ -54,7 +54,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
.WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId)
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
(a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
.OrderByIF(input.TrackTemplateId>0, (a, b) => SqlFunc.IIF(a.Id==input.TrackTemplateId, SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
.OrderByIF(input.TrackTemplateId > 0, (a, b) => SqlFunc.IIF(a.Id == input.TrackTemplateId, SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
.Select((a, b) => new GetTrackTemplateListVO
{
Id = a.Id,
@ -90,6 +90,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
.Filter(null, true)
.Where(templateContent =>
templateContent.TrackTemplateId == input.TrackTemplateId && !templateContent.IsDeleted)
.OrderByDescending(templateContent => templateContent.CreateTime)
.Select((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
new GetTrackTemplateContentPageOutputVO
{