轨迹推送配置关系对外接口

This commit is contained in:
moyongzhen 2024-04-11 15:14:01 +08:00
parent 93417db522
commit 3aecf92eb7
6 changed files with 212 additions and 0 deletions

View File

@ -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
{
/// <summary>
/// 查询轨迹推送映射关系入参
/// </summary>
public class QueryTrackPullMappingsInput
{
/// <summary>
/// 子系统id
/// </summary>
public int SubsystemsId { get; set; }
/// <summary>
/// 客户id
/// </summary>
public int CustomerId { get; set; }
}
/// <summary>
/// 查询轨迹推送映射关系返参项
/// </summary>
public class QueryTrackPullMappingsInfo
{
/// <summary>
/// 轨迹代码
/// </summary>
public string? Code { get; set; }
/// <summary>
/// 订单类型
/// </summary>
public int OrderType { get; set; }
/// <summary>
/// 服务商轨迹代码
/// </summary>
public string? ServiceCode { get; set; }
/// <summary>
/// 服务商轨迹状态
/// </summary>
public string? Status { get; set; }
/// <summary>
/// 服务商轨迹内容
/// </summary>
public string? Content { get; set; }
/// <summary>
/// 服务商轨迹内容英文
/// </summary>
public string? ContentEn { get; set; }
}
}

View File

@ -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<QueryTrackPullMappingsInput, QueryTrackPullMappingsInputVO>(MemberList.None);
CreateMap<QueryTrackPullMappingsInfoVO, QueryTrackPullMappingsInfo>(MemberList.None);
}
}
}

View File

@ -0,0 +1,44 @@
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
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
{
/// <summary>
/// 轨迹推送配置服务
/// </summary>
[ApiExplorerSettings(GroupName = "提供接口")]
[Route("/ProviderService")]
public class TrackPushConfigService : ApplicationService
{
private readonly ITrackPushConfigRepository _trackPushConfigRepository;
public TrackPushConfigService(
ITrackPushConfigRepository trackPushConfigRepository
)
{
_trackPushConfigRepository = trackPushConfigRepository;
}
/// <summary>
/// 查询轨迹推送配置关系
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("Track/QueryTrackPullMappings")]
public async Task<UnifyResultDto> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInput input)
{
var vo = ObjectMapper.Map<QueryTrackPullMappingsInput, QueryTrackPullMappingsInputVO>(input);
var result = await _trackPushConfigRepository.QueryTrackPullMappingsAsync(vo);
var output = ObjectMapper.Map<List<QueryTrackPullMappingsInfoVO>, List<QueryTrackPullMappingsInfo>>(result);
return new UnifyResultDto(true, output, "操作成功");
}
}
}

View File

@ -35,4 +35,5 @@ public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEn
Task<bool> UpdateContentAsync(Expression<Func<TrackPushContentConfigEntity, bool>> columns,
Expression<Func<TrackPushContentConfigEntity, bool>> whereExpression);
Task<List<QueryTrackPullMappingsInfoVO>> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInputVO input);
}

View File

@ -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
{
/// <summary>
/// 查询轨迹推送关系入参
/// </summary>
public class QueryTrackPullMappingsInfoVO
{
/// <summary>
/// 轨迹代码
/// </summary>
public string? Code { get; set; }
/// <summary>
/// 订单类型
/// </summary>
public int OrderType { get; set; }
/// <summary>
/// 服务商轨迹代码
/// </summary>
public string? ServiceCode { get; set; }
/// <summary>
/// 服务商轨迹状态
/// </summary>
public string? Status { get; set; }
/// <summary>
/// 服务商轨迹内容
/// </summary>
public string? Content { get; set; }
/// <summary>
/// 服务商轨迹内容英文
/// </summary>
public string? ContentEn { get; set; }
}
/// <summary>
/// 查询轨迹推送关系返参项
/// </summary>
public class QueryTrackPullMappingsInputVO
{
/// <summary>
/// 子系统id
/// </summary>
public int SubsystemsId { get; set; }
/// <summary>
/// 客户id
/// </summary>
public int CustomerId { get; set; }
}
}

View File

@ -166,4 +166,29 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
return await Context.Updateable<TrackPushContentConfigEntity>().SetColumns(columns).Where(whereExpression)
.ExecuteCommandHasChangeAsync();
}
/// <summary>
/// 查询轨迹推送关系
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<List<QueryTrackPullMappingsInfoVO>> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInputVO input)
{
var result = await Context.Queryable<TrackPushConfigEntity>().LeftJoin<TrackPushContentConfigEntity>((a, b) => a.Id == b.TrackPushConfigId && !b.IsDeleted)
.LeftJoin<TrackContentEntity>((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;
}
}