diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/QueryTrackPullMappingsInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/QueryTrackPullMappingsInput.cs new file mode 100644 index 00000000..ed0e9da4 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/QueryTrackPullMappingsInput.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices +{ + /// + /// 查询轨迹推送映射关系入参 + /// + public class QueryTrackPullMappingsInput + { + /// + /// 子系统id + /// + public int SubsystemsId { get; set; } + + /// + /// 客户id + /// + public int CustomerId { get; set; } + } + + /// + /// 查询轨迹推送映射关系返参项 + /// + public class QueryTrackPullMappingsInfo + { + /// + /// 轨迹代码 + /// + public string? Code { get; set; } + + /// + /// 订单类型 + /// + public int OrderType { get; set; } + + /// + /// 服务商轨迹代码 + /// + public string? ServiceCode { get; set; } + + /// + /// 服务商轨迹状态 + /// + public string? Status { get; set; } + + /// + /// 服务商轨迹内容 + /// + public string? Content { get; set; } + + /// + /// 服务商轨迹内容英文 + /// + public string? ContentEn { get; set; } + } +} diff --git a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj index 7f1f52a3..7a7f7902 100644 --- a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj +++ b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj @@ -5,7 +5,7 @@ net7.0 True - 7.0.1 + 7.0.2 True diff --git a/src/SJZY.Track.Application.Contract/Services/ITrackPushConfigService.cs b/src/SJZY.Track.Application.Contract/Services/ITrackPushConfigService.cs new file mode 100644 index 00000000..e191f6bb --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Services/ITrackPushConfigService.cs @@ -0,0 +1,20 @@ +using SJZY.Track.Application.Contract.Dtos.ProvideServices; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp; + +namespace SJZY.Track.Application.Contract.Services +{ + public interface ITrackPushConfigService : IRemoteService + { + /// + /// 查询轨迹推送配置关系 + /// + /// + /// + Task QueryTrackPullMappingsAsync(QueryTrackPullMappingsInput input); + } +} diff --git a/src/SJZY.Track.Application/AutoMapper/TrackPushConfigAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackPushConfigAutoMapperProfile.cs new file mode 100644 index 00000000..7cb8ccd2 --- /dev/null +++ b/src/SJZY.Track.Application/AutoMapper/TrackPushConfigAutoMapperProfile.cs @@ -0,0 +1,22 @@ +using AutoMapper; +using SJZY.Track.Application.Contract.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Dtos.TrackPush; +using SJZY.Track.Domain.Aggregates.TrackPushAggregate; +using SJZY.Track.Domain.Dtos.TrackPush; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SJZY.Track.Application.AutoMapper +{ + public class TrackPushConfigAutoMapperProfile : Profile + { + public TrackPushConfigAutoMapperProfile() + { + CreateMap(MemberList.None); + CreateMap(MemberList.None); + } + } +} diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushConfigService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushConfigService.cs new file mode 100644 index 00000000..04a8ea53 --- /dev/null +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushConfigService.cs @@ -0,0 +1,45 @@ +using SJZY.Track.Application.Contract.Dtos.ProvideServices; +using SJZY.Track.Application.Contract.Services; +using SJZY.Track.Domain.Aggregates.TrackPushAggregate; +using SJZY.Track.Domain.Dtos.TrackPush; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.ObjectMapping; + +namespace SJZY.Track.Application.Services.ProvideServices +{ + /// + /// 轨迹推送配置服务 + /// + [ApiExplorerSettings(GroupName = "提供接口")] + [Route("/ProviderService")] + public class TrackPushConfigService : ApplicationService, ITrackPushConfigService + { + private readonly ITrackPushConfigRepository _trackPushConfigRepository; + + public TrackPushConfigService( + ITrackPushConfigRepository trackPushConfigRepository + ) + { + _trackPushConfigRepository = trackPushConfigRepository; + } + + /// + /// 查询轨迹推送配置关系 + /// + /// + /// + [HttpPost("Track/QueryTrackPullMappings")] + public async Task QueryTrackPullMappingsAsync(QueryTrackPullMappingsInput input) + { + var vo = ObjectMapper.Map(input); + var result = await _trackPushConfigRepository.QueryTrackPullMappingsAsync(vo); + var output = ObjectMapper.Map, List>(result); + + return new UnifyResultDto(true, output, "操作成功"); + } + } +} diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs index 641fb386..3983cd7c 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs @@ -35,4 +35,5 @@ public interface ITrackPushConfigRepository : IBasicRepository UpdateContentAsync(Expression> columns, Expression> whereExpression); + Task> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInputVO input); } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/QueryTrackPullMappingsInfoVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/QueryTrackPullMappingsInfoVO.cs new file mode 100644 index 00000000..26f7b4a8 --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/QueryTrackPullMappingsInfoVO.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SJZY.Track.Domain.Dtos.TrackPush +{ + /// + /// 查询轨迹推送关系入参 + /// + public class QueryTrackPullMappingsInfoVO + { + /// + /// 轨迹代码 + /// + public string? Code { get; set; } + + /// + /// 订单类型 + /// + public int OrderType { get; set; } + + /// + /// 服务商轨迹代码 + /// + public string? ServiceCode { get; set; } + + /// + /// 服务商轨迹状态 + /// + public string? Status { get; set; } + + /// + /// 服务商轨迹内容 + /// + public string? Content { get; set; } + + /// + /// 服务商轨迹内容英文 + /// + public string? ContentEn { get; set; } + } + + /// + /// 查询轨迹推送关系返参项 + /// + public class QueryTrackPullMappingsInputVO + { + /// + /// 子系统id + /// + public int SubsystemsId { get; set; } + + /// + /// 客户id + /// + public int CustomerId { get; set; } + } +} diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 43bbae70..c7e21820 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -166,4 +166,29 @@ public class TrackPushConfigRepository : BasicRepository, return await Context.Updateable().SetColumns(columns).Where(whereExpression) .ExecuteCommandHasChangeAsync(); } + + /// + /// 查询轨迹推送关系 + /// + /// + /// + public async Task> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInputVO input) + { + var result = await Context.Queryable().LeftJoin((a, b) => a.Id == b.TrackPushConfigId && !b.IsDeleted) + .LeftJoin((a, b, c) => b.TrackContentId == c.Id && !c.IsDeleted) + .Where((a, b, c) => !a.IsDeleted) + .Where((a, b, c) => a.SubSystemId == input.SubsystemsId && a.CustomId == input.CustomerId) + .Select((a, b, c) => new QueryTrackPullMappingsInfoVO + { + Code = c.Code, + OrderType = b.OrderNoType, + ServiceCode = b.TrackContentCodeValue, + Status = b.TrackStatusValue, + Content = b.TrackContentValue, + ContentEn = b.TrackEnContentValue + }) + .ToListAsync(); + + return result; + } } \ No newline at end of file