提供接口
This commit is contained in:
parent
02533696ec
commit
22ebcda424
@ -0,0 +1,19 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class GetTrackTemplateListInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
/// </summary>
|
||||
public int? CustomerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版分类
|
||||
/// </summary>
|
||||
public int? TemplateType { get; set; }
|
||||
}
|
||||
@ -2,6 +2,11 @@ namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class RefreshTrackInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class TrackTemplateOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 模版名称
|
||||
/// </summary>
|
||||
public string TemplateName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版code
|
||||
/// </summary>
|
||||
public string TemplateCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版内容
|
||||
/// </summary>
|
||||
public List<TemplateContentDto> TemplateContents { get; set; }
|
||||
}
|
||||
|
||||
public class TemplateContentDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹code
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容中文
|
||||
/// </summary>
|
||||
public string ContentCn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容中文
|
||||
/// </summary>
|
||||
public string ContentEn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹节点
|
||||
/// </summary>
|
||||
public string Node { get; set; }
|
||||
}
|
||||
@ -65,6 +65,8 @@ public class UpdateOrderInput : OrderNoInfo
|
||||
/// <summary>
|
||||
/// 业务key
|
||||
/// </summary>
|
||||
[Required]
|
||||
[MaxLength(64)]
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class UpdateServiceProviderPullConfigsInput : PullConfigInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务唯一key
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string Key { get; set; }
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
|
||||
public class TrackPushContentDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <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; }
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using Volo.Abp;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Services;
|
||||
namespace SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
|
||||
public interface IOrderService : IRemoteService
|
||||
{
|
||||
@ -25,4 +25,11 @@ public interface IOrderService : IRemoteService
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<UnifyResultDto> LinkOrderAsync(LinkOrderInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 修改服务商拉取信息
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public Task<UnifyResultDto> UpdateServiceProviderPullConfigsAsync(UpdateServiceProviderPullConfigsInput input);
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using Volo.Abp;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
|
||||
public interface ITrackPullService : IRemoteService
|
||||
{
|
||||
/// <summary>
|
||||
/// 刷新轨迹
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public Task<bool> RefreshTrackAsync(RefreshTrackInput input);
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
using Volo.Abp;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
|
||||
public interface ITrackPushService : IRemoteService
|
||||
{
|
||||
/// <summary>
|
||||
/// 推送轨迹
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public Task<string> PushTrackAsync(PushTrackInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹推送内容
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <param name="subSystemId">子系统id</param>
|
||||
/// <param name="customerId">客户id</param>
|
||||
public Task<List<TrackPushContentDto>> GetTrackPushContentListAsync(int subSystemId, int customerId);
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using Volo.Abp;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Services;
|
||||
namespace SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
|
||||
public interface ITrackService : IRemoteService
|
||||
{
|
||||
@ -0,0 +1,7 @@
|
||||
using Volo.Abp;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
|
||||
public interface ITrackTemplateService : IRemoteService
|
||||
{
|
||||
}
|
||||
@ -15,7 +15,9 @@ public class OrderAutoMapperProfile : Profile
|
||||
{
|
||||
public OrderAutoMapperProfile()
|
||||
{
|
||||
CreateMap<UpsertOrderInput, OrderEntity>(MemberList.None);
|
||||
CreateMap<UpsertOrderInput, OrderEntity>(MemberList.None)
|
||||
.ForMember(dest => dest.BusinessKey,
|
||||
opt => opt.MapFrom(source => source.Key));
|
||||
CreateMap<UpdateOrderInput, OrderEntity>(MemberList.None);
|
||||
|
||||
CreateMap<OrderFlightInfo, OrderFlightEntity>(MemberList.None);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
@ -10,5 +11,7 @@ public class TrackPushConfigAutoMapperProfile : Profile
|
||||
{
|
||||
CreateMap<QueryTrackPullMappingsInput, QueryTrackPullMappingsInputVO>(MemberList.None);
|
||||
CreateMap<QueryTrackPullMappingsInfoVO, QueryTrackPullMappingsInfo>(MemberList.None);
|
||||
|
||||
CreateMap<GetTrackPushContentListVo, TrackPushContentDto>(MemberList.None);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
@ -19,5 +20,9 @@ public class TrackTemplateAutoMapperProfile : Profile
|
||||
CreateMap<GetTrackTemplateListVO, GetTrackTemplateListDto>(MemberList.None);
|
||||
CreateMap<UnifyPageResultDto<GetTrackTemplateListVO>, UnifyPageResultDto<GetTrackTemplateListDto>>(MemberList
|
||||
.None);
|
||||
|
||||
CreateMap<GetTrackTemplateListInput, GetTrackTemplateListInputVo>(MemberList.None);
|
||||
CreateMap<TrackTemplateOutputVo, TrackTemplateOutput>(MemberList.None);
|
||||
CreateMap<TemplateContentDtoVo, TemplateContentDto>(MemberList.None);
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ public class OrderPullStatusScanner : BackgroundService
|
||||
}
|
||||
|
||||
// real del
|
||||
count = await _orderRepository.ClearPullStatus();
|
||||
count = await _orderRepository.ClearPullStatusAsync();
|
||||
LogHelper.Info($"{nameof(OrderPullStatusScanner)}本次扫描删除了{count}条订单拉取状态");
|
||||
|
||||
await Task.Delay(TimeSpan.FromMinutes(1), stoppingToken);
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
using SJZY.Expand.ABP.Core.Logger;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using SJZY.UserCenter.HttpApi.Services;
|
||||
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
|
||||
public partial class OrderService
|
||||
{
|
||||
/// <summary>
|
||||
/// 修改服务商拉取信息(轻易勿动)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Order/UpdateServiceProviderPullConfigs")]
|
||||
public async Task<UnifyResultDto> UpdateServiceProviderPullConfigsAsync(UpdateServiceProviderPullConfigsInput input)
|
||||
{
|
||||
var orderIds = await _orderRepository.GetArrayAsync(
|
||||
x => x.SubSystemId == input.SubSystemId && x.BusinessKey == input.Key,
|
||||
x => x.Id);
|
||||
var inputVo = ObjectMapper
|
||||
.Map<UpdateServiceProviderPullConfigsInput, UpdateOrderPullConfigForServiceProviderInputVo>(input);
|
||||
inputVo.OrderIds = orderIds;
|
||||
var cnt = await _orderRepository.UpdateOrderPullConfigForServiceProviderAsync(inputVo);
|
||||
|
||||
LogHelper.Warn(
|
||||
$"{CurrentUserRequest.CurrentUser.UserId}正在修改服务商拉取信息,本次共计影响了{orderIds.Length}个订单、{cnt}段拉取,请求参数是:{input.ToJson()}",
|
||||
true);
|
||||
|
||||
return new UnifyResultDto(true);
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
using DotNetCore.CAP;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Services;
|
||||
using SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
@ -125,16 +125,28 @@ public partial class OrderService : ApplicationService, IOrderService
|
||||
{
|
||||
if (pullConfigInfos == null) return new List<OrderPullStatusEntity>();
|
||||
|
||||
return pullConfigInfos.Select(x => new OrderPullStatusEntity
|
||||
return pullConfigInfos.Select(x =>
|
||||
{
|
||||
ServiceProviderCode = x.ServiceCode,
|
||||
PullStatus = TrackPullStatus.Init,
|
||||
StartTrackCode = x.StartCode ?? GlobalConst.EmptyString,
|
||||
EndTrackCode = x.EndCode ?? GlobalConst.EmptyString,
|
||||
SilenceBeforeStart = x.SilenceTime,
|
||||
SilenceAfterEnd = x.StopTime,
|
||||
StartTime = GlobalConst.MaxDateTime,
|
||||
EndTime = GlobalConst.MaxDateTime,
|
||||
var status = new OrderPullStatusEntity
|
||||
{
|
||||
ServiceProviderCode = x.ServiceCode,
|
||||
PullStatus = TrackPullStatus.Init,
|
||||
StartTrackCode = x.StartCode ?? GlobalConst.EmptyString,
|
||||
EndTrackCode = x.EndCode ?? GlobalConst.EmptyString,
|
||||
SilenceBeforeStart = x.SilenceTime,
|
||||
SilenceAfterEnd = x.StopTime,
|
||||
StartTime = GlobalConst.MaxDateTime,
|
||||
EndTime = GlobalConst.MaxDateTime,
|
||||
};
|
||||
|
||||
// 没有开始轨迹则立即进入拉取前静默期
|
||||
if (x.StartCode == null)
|
||||
{
|
||||
status.PullStatus = TrackPullStatus.SilenceBeforeStart; // 会被定时任务扫描到并启动
|
||||
status.StartTime = DateTime.Now.AddHours(x.SilenceTime);
|
||||
}
|
||||
|
||||
return status;
|
||||
}).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ using SJZY.InterfaceRelay.Application.Contracts;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||
using SJZY.Track.Application.Contract.Services;
|
||||
using SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
using SJZY.Track.Application.Helpers;
|
||||
using SJZY.Track.Application.Rabbit;
|
||||
using SJZY.Track.Application.Track2InterfaceRelay;
|
||||
@ -20,7 +21,7 @@ namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
||||
[Route("/ProviderService")]
|
||||
public class TrackPullService : ApplicationService
|
||||
public class TrackPullService : ApplicationService, ITrackPullService
|
||||
{
|
||||
private readonly IHttpClientProxy<IInterfaceForwardServiceV2> _httpClientProxy;
|
||||
private readonly IProvideQueries _provideQueries;
|
||||
@ -47,7 +48,7 @@ public class TrackPullService : ApplicationService
|
||||
input.OrderNos = input.OrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList(); // 单号去重、去空
|
||||
|
||||
// tips:这里没有区分订单类型,就算的不同类型的单一起刷新了也无所谓
|
||||
var orders = await _provideQueries.FindOrderWithServiceProviderAsync(input.OrderNos);
|
||||
var orders = await _provideQueries.FindOrderWithServiceProviderAsync(input.SubSystemId, input.OrderNos);
|
||||
|
||||
if (orders.Count == 0)
|
||||
{
|
||||
|
||||
@ -3,9 +3,12 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using SJZY.Expand.ABP.Core;
|
||||
using SJZY.Expand.ABP.Core.Logger;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
using SJZY.Track.Application.Contract.Events;
|
||||
using SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||
using SJZY.UserCenter.HttpApi.Services;
|
||||
using Volo.Abp.Http.Client.DynamicProxying;
|
||||
|
||||
@ -16,22 +19,25 @@ namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
||||
[Route("/ProviderService")]
|
||||
public class TrackPushService : ApplicationService
|
||||
public class TrackPushService : ApplicationService, ITrackPushService
|
||||
{
|
||||
private readonly ICapPublisher _capPublisher;
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private readonly IHttpClientProxy<IRequestCurrentUserService> _requestCurrentUserService;
|
||||
private readonly ITrackPushConfigRepository _trackPushConfigRepository;
|
||||
private readonly ITrackPushRecordEsRepository _trackPushRecordEsRepository;
|
||||
|
||||
public TrackPushService(IOrderRepository orderRepository
|
||||
, ICapPublisher capPublisher
|
||||
, ITrackPushRecordEsRepository trackPushRecordEsRepository,
|
||||
IHttpClientProxy<IRequestCurrentUserService> requestCurrentUserService)
|
||||
, ITrackPushRecordEsRepository trackPushRecordEsRepository
|
||||
, IHttpClientProxy<IRequestCurrentUserService> requestCurrentUserService
|
||||
, ITrackPushConfigRepository trackPushConfigRepository)
|
||||
{
|
||||
_orderRepository = orderRepository;
|
||||
_capPublisher = capPublisher;
|
||||
_trackPushRecordEsRepository = trackPushRecordEsRepository;
|
||||
_requestCurrentUserService = requestCurrentUserService;
|
||||
_trackPushConfigRepository = trackPushConfigRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -84,6 +90,15 @@ public class TrackPushService : ApplicationService
|
||||
return $"即将推送轨迹代码{input.TrackCode}给{orders.Length}个订单";
|
||||
}
|
||||
|
||||
public async Task<List<TrackPushContentDto>> GetTrackPushContentListAsync(int subSystemId, int customerId)
|
||||
{
|
||||
var list = await _trackPushConfigRepository.GetTrackPushContentListAsync(subSystemId, customerId);
|
||||
|
||||
var result = ObjectMapper.Map<List<GetTrackPushContentListVo>, List<TrackPushContentDto>>(list);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 定时任务推送预警(》12小时没有推送的)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
using DotNetCore.CAP;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Events;
|
||||
using SJZY.Track.Application.Contract.Services;
|
||||
using SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Services.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模版服务
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
||||
[Route("/ProviderService")]
|
||||
public class TrackTemplateService : ApplicationService, ITrackTemplateService
|
||||
{
|
||||
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
||||
|
||||
public TrackTemplateService(ITrackTemplateRepository trackTemplateRepository)
|
||||
{
|
||||
_trackTemplateRepository = trackTemplateRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹模版列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessException"></exception>
|
||||
[HttpPost("Template/GetTrackTemplateList")]
|
||||
public async Task<List<TrackTemplateOutput>> GetTrackTemplateListAsync(GetTrackTemplateListInput input)
|
||||
{
|
||||
var inputVo = ObjectMapper.Map<GetTrackTemplateListInput, GetTrackTemplateListInputVo>(input);
|
||||
var templates = await _trackTemplateRepository.GetTrackTemplateListAsync(inputVo);
|
||||
var res = ObjectMapper.Map<List<TrackTemplateOutputVo>, List<TrackTemplateOutput>>(templates);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@ -100,7 +100,14 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
||||
/// 清理拉取状态
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<int> ClearPullStatus();
|
||||
Task<int> ClearPullStatusAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 更新订单拉取配置,根据服务商
|
||||
/// </summary>
|
||||
/// <param name="inputVo"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> UpdateOrderPullConfigForServiceProviderAsync(UpdateOrderPullConfigForServiceProviderInputVo inputVo);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@ -168,6 +168,12 @@ public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
[SugarColumn(ColumnName = "ArrivalProvince")]
|
||||
public string? ArrivalProvince { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务key(用于区分轨迹拉取配置)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "BusinessKey")]
|
||||
public string BusinessKey { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)] public List<OrderFlightEntity> OrderFlights { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)] public List<OrderPullStatusEntity> OrderPullStatus { get; set; }
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
namespace SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
|
||||
/*
|
||||
* 订单轨迹拉取状态:
|
||||
* 【0初始态,表示订单数据刚刚录入】【1开始前的静默】【2拉取中】【3结束后的静默】【4拉取完成】
|
||||
1.轨迹发生时,将init状态改为silenceBeforeStart,将pulling改为silenceAfterEnd(状态计算及时计算)
|
||||
2.定时任务扫描,将符合开始结束的范围订单筛选出来,去拉取轨迹(轨迹拉取最小延迟30min)
|
||||
3.定时任务扫描,将silenceBeforeStart改为pulling,将silenceAfterEnd改为completed(状态计算最小延迟1min)
|
||||
4.定时任务扫描,将已经拉取完成的订单拉取删除,将开启了30天的订单拉取删除(清理最小延迟1min)
|
||||
*/
|
||||
public enum TrackPullStatus
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@ -22,11 +22,11 @@ public class TrackNodeEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
/// 节点名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "NodeName", Length = 32, ColumnDescription = "节点名称")]
|
||||
public string? NodeName { get; set; }
|
||||
public string NodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点英文名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "NodeEnName", Length = 32, ColumnDescription = "节点英文名称")]
|
||||
public string? NodeEnName { get; set; }
|
||||
public string NodeEnName { get; set; }
|
||||
}
|
||||
|
||||
@ -37,4 +37,5 @@ public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEn
|
||||
Expression<Func<TrackPushContentConfigEntity, bool>> whereExpression);
|
||||
|
||||
Task<List<QueryTrackPullMappingsInfoVO>> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInputVO input);
|
||||
Task<List<GetTrackPushContentListVo>> GetTrackPushContentListAsync(int subSystemId, int customerId);
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
|
||||
namespace SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
|
||||
@ -43,4 +43,6 @@ public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity
|
||||
|
||||
Task<bool> UpdateContentAsync(Expression<Func<TrackTemplateContentEntity, bool>> columns,
|
||||
Expression<Func<TrackTemplateContentEntity, bool>> whereExpression);
|
||||
|
||||
Task<List<TrackTemplateOutputVo>> GetTrackTemplateListAsync(GetTrackTemplateListInputVo input);
|
||||
}
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
namespace SJZY.Track.Domain.Dtos.Order;
|
||||
|
||||
public class UpdateOrderPullConfigForServiceProviderInputVo
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单id
|
||||
/// </summary>
|
||||
public int[] OrderIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商code
|
||||
/// </summary>
|
||||
public string ServiceCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始轨迹code
|
||||
/// </summary>
|
||||
public string? StartCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束轨迹code
|
||||
/// </summary>
|
||||
public string? EndCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 静默多久后拉取(小时)
|
||||
/// </summary>
|
||||
public int SilenceTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束多久后停止拉取(小时)
|
||||
/// </summary>
|
||||
public int StopTime { get; set; }
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||
|
||||
public class GetTrackPushContentListVo
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <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; }
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
|
||||
public class GetTrackTemplateListInputVo
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
/// </summary>
|
||||
public int? CustomerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版分类
|
||||
/// </summary>
|
||||
public int? TemplateType { get; set; }
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
|
||||
public class TrackTemplateOutputVo
|
||||
{
|
||||
/// <summary>
|
||||
/// 模版id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版名称
|
||||
/// </summary>
|
||||
public string TemplateName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版code
|
||||
/// </summary>
|
||||
public string TemplateCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版内容
|
||||
/// </summary>
|
||||
public List<TemplateContentDtoVo> TemplateContents { get; set; }
|
||||
}
|
||||
|
||||
public class TemplateContentDtoVo
|
||||
{
|
||||
/// <summary>
|
||||
/// 模版id
|
||||
/// </summary>
|
||||
public int TemplateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹code
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容中文
|
||||
/// </summary>
|
||||
public string ContentCn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容中文
|
||||
/// </summary>
|
||||
public string ContentEn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹节点
|
||||
/// </summary>
|
||||
public string Node { get; set; }
|
||||
}
|
||||
@ -21,9 +21,10 @@ public interface IProvideQueries
|
||||
/// <summary>
|
||||
/// 根据订单模板找对应服务商
|
||||
/// </summary>
|
||||
/// <param name="subSystemId"></param>
|
||||
/// <param name="orderNos"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(List<string> orderNos);
|
||||
Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(int subSystemId, List<string> orderNos);
|
||||
|
||||
/// <summary>
|
||||
/// 获取服务商下所有单(未完成的)
|
||||
|
||||
@ -34,13 +34,16 @@ public class ProvideQueries : ISugarRepository, IProvideQueries, ITransientDepen
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(List<string> orderNos)
|
||||
public async Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(int subSystemId,
|
||||
List<string> orderNos)
|
||||
{
|
||||
return await Context.Queryable<OrderEntity>()
|
||||
.InnerJoin<OrderPullStatusEntity>((a, b) => a.Id == b.OrderId)
|
||||
.LeftJoin<VServiceProviderEntity>((a, b, c) => b.ServiceProviderCode == c.Code)
|
||||
.LeftJoin<VSystemEntity>((a, b, c, d) => a.SubSystemId == d.Id)
|
||||
.Where(a => !a.IsCompleted && orderNos.Contains(a.OrderNo))
|
||||
.WhereIF(subSystemId > 0, a => a.SubSystemId == subSystemId)
|
||||
.Where((a, b) => !a.IsCompleted && orderNos.Contains(a.OrderNo)
|
||||
&& b.StartTime <= DateTime.Now && b.EndTime >= DateTime.Now)
|
||||
.Select((a, b, c, d) => new OrderWithServiceProviderVO
|
||||
{
|
||||
OrderNo = a.OrderNo,
|
||||
@ -53,8 +56,8 @@ public class ProvideQueries : ISugarRepository, IProvideQueries, ITransientDepen
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(int serviceProviderId,
|
||||
public async Task<List<OrderWithServiceProviderVO>> FindOrderWithServiceProviderAsync(
|
||||
int serviceProviderId,
|
||||
int pageIndex, int pageSize = 1000)
|
||||
{
|
||||
return await Context.Queryable<OrderEntity>()
|
||||
|
||||
@ -161,6 +161,51 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
return res.Select(x => (x.Key, x.Id)).ToList();
|
||||
}
|
||||
|
||||
private int UpdateOrderQuestionType(int questionType, IEnumerable<int> ids)
|
||||
{
|
||||
var idsString = string.Join(",", ids);
|
||||
return Context.Ado.ExecuteCommand(
|
||||
$"UPDATE `t_order` SET `QuestionType` = @questionType ,UpdateTime= current_timestamp WHERE `Id` IN ({idsString})",
|
||||
new
|
||||
{
|
||||
questionType
|
||||
});
|
||||
}
|
||||
|
||||
#region 订单关联
|
||||
|
||||
public async Task<List<LinkedOrderVO>> GetLinkedOrdersAsync(int[] orderIds)
|
||||
{
|
||||
return await Context.Queryable<OrderLinkEntity>()
|
||||
.LeftJoin<OrderEntity>((a, b) => a.LinkOrderId == b.Id)
|
||||
.Where(a => orderIds.Contains(a.OrderId))
|
||||
.Select((a, b) => new LinkedOrderVO
|
||||
{
|
||||
OwnerOrderId = a.OrderId,
|
||||
OrderId = b.Id,
|
||||
OrderNo = b.OrderNo,
|
||||
OrderType = b.OrderType,
|
||||
SubSystemId = b.SubSystemId,
|
||||
CustomId = b.CustomId
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task LinkOrderAsync(List<OrderLinkEntity> orderLinkEntities)
|
||||
{
|
||||
await Context.Insertable(orderLinkEntities).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UnLinkByIdsAsync(List<int> linkIds)
|
||||
{
|
||||
await Context.Deleteable<OrderLinkEntity>(linkIds).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 订单拉取
|
||||
|
||||
public async Task UpdatePullStatusToSilenceAsync(List<int> orderIds, string trackCode)
|
||||
{
|
||||
// var status = await Context.Queryable<OrderPullStatusEntity>()
|
||||
@ -215,65 +260,41 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
{
|
||||
var cnt1 = await Context.Updateable<OrderPullStatusEntity>()
|
||||
.SetColumns(x => x.PullStatus == TrackPullStatus.Pulling)
|
||||
.Where(x => x.PullStatus == TrackPullStatus.SilenceBeforeStart && x.StartTime > DateTime.Now)
|
||||
.Where(x => x.PullStatus == TrackPullStatus.SilenceBeforeStart && x.StartTime < DateTime.Now)
|
||||
.ExecuteCommandAsync();
|
||||
LogHelper.Info($"{cnt1}条订单的拉取状态由SilenceBeforeStart更新为Pulling");
|
||||
LogHelper.Info(
|
||||
$"{cnt1}条订单的拉取状态由{nameof(TrackPullStatus.SilenceBeforeStart)}更新为{nameof(TrackPullStatus.Pulling)}");
|
||||
|
||||
var cnt2 = await Context.Updateable<OrderPullStatusEntity>()
|
||||
.SetColumns(x => x.PullStatus == TrackPullStatus.Completed)
|
||||
.Where(x => x.PullStatus == TrackPullStatus.SilenceAfterEnd && x.EndTime < DateTime.Now)
|
||||
.ExecuteCommandAsync();
|
||||
LogHelper.Info($"{cnt2}条订单的拉取状态由SilenceAfterEnd更新为Completed");
|
||||
LogHelper.Info(
|
||||
$"{cnt2}条订单的拉取状态由{nameof(TrackPullStatus.SilenceAfterEnd)}更新为{nameof(TrackPullStatus.Completed)}");
|
||||
|
||||
return cnt1 + cnt2;
|
||||
}
|
||||
|
||||
public Task<int> ClearPullStatus()
|
||||
public async Task<int> ClearPullStatusAsync()
|
||||
{
|
||||
var time = DateTime.Now.Subtract(TimeSpan.FromDays(30));
|
||||
return Context.Deleteable<OrderPullStatusEntity>().Where(x =>
|
||||
return await Context.Deleteable<OrderPullStatusEntity>().Where(x =>
|
||||
x.PullStatus == TrackPullStatus.Completed || x.StartTime < time)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
private int UpdateOrderQuestionType(int questionType, IEnumerable<int> ids)
|
||||
public async Task<int> UpdateOrderPullConfigForServiceProviderAsync(
|
||||
UpdateOrderPullConfigForServiceProviderInputVo inputVo)
|
||||
{
|
||||
var idsString = string.Join(",", ids);
|
||||
return Context.Ado.ExecuteCommand(
|
||||
$"UPDATE `t_order` SET `QuestionType` = @questionType ,UpdateTime= current_timestamp WHERE `Id` IN ({idsString})",
|
||||
new
|
||||
{
|
||||
questionType
|
||||
});
|
||||
}
|
||||
|
||||
#region 订单关联
|
||||
|
||||
public async Task<List<LinkedOrderVO>> GetLinkedOrdersAsync(int[] orderIds)
|
||||
{
|
||||
return await Context.Queryable<OrderLinkEntity>()
|
||||
.LeftJoin<OrderEntity>((a, b) => a.LinkOrderId == b.Id)
|
||||
.Where(a => orderIds.Contains(a.OrderId))
|
||||
.Select((a, b) => new LinkedOrderVO
|
||||
{
|
||||
OwnerOrderId = a.OrderId,
|
||||
OrderId = b.Id,
|
||||
OrderNo = b.OrderNo,
|
||||
OrderType = b.OrderType,
|
||||
SubSystemId = b.SubSystemId,
|
||||
CustomId = b.CustomId
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task LinkOrderAsync(List<OrderLinkEntity> orderLinkEntities)
|
||||
{
|
||||
await Context.Insertable(orderLinkEntities).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UnLinkByIdsAsync(List<int> linkIds)
|
||||
{
|
||||
await Context.Deleteable<OrderLinkEntity>(linkIds).ExecuteCommandAsync();
|
||||
// todo:如此更新,影响范围是否可控?状态是否正确?
|
||||
return await Context.Updateable<OrderPullStatusEntity>()
|
||||
.SetColumns(x => x.ServiceProviderCode == inputVo.ServiceCode)
|
||||
.SetColumns(x => x.StartTrackCode == inputVo.StartCode)
|
||||
.SetColumns(x => x.EndTrackCode == inputVo.EndCode)
|
||||
.SetColumns(x => x.SilenceBeforeStart == inputVo.SilenceTime)
|
||||
.SetColumns(x => x.SilenceAfterEnd == inputVo.StopTime)
|
||||
.Where(x => inputVo.OrderIds.Contains(x.OrderId))
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -198,4 +198,24 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<List<GetTrackPushContentListVo>> GetTrackPushContentListAsync(int subSystemId, int customerId)
|
||||
{
|
||||
return await Context.Queryable<TrackPushConfigEntity>()
|
||||
.LeftJoin<TrackPushContentConfigEntity>((a, b) => a.Id == b.TrackPushConfigId)
|
||||
.LeftJoin<TrackContentEntity>((a, b, c) => b.TrackContentId == c.Id)
|
||||
.Where(a => a.SubSystemId == subSystemId && a.CustomId == customerId)
|
||||
.OrderBy((a, b) => b.Sort)
|
||||
.Select((a, b, c) => new GetTrackPushContentListVo
|
||||
{
|
||||
Id = a.Id,
|
||||
Code = c.Code,
|
||||
OrderType = b.OrderNoType,
|
||||
ServiceCode = b.TrackContentCodeValue,
|
||||
Status = b.TrackStatusValue,
|
||||
Content = b.TrackContentValue,
|
||||
ContentEn = b.TrackEnContentValue
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ using System.Linq.Expressions;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackNodeAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
@ -43,14 +44,14 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
/// <returns></returns>
|
||||
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
||||
{
|
||||
UnifyPageResultDto<GetTrackTemplateListVO> pagedList = await Context.Queryable<TrackTemplateEntity>()
|
||||
var pagedList = await Context.Queryable<TrackTemplateEntity>()
|
||||
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false)
|
||||
.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))
|
||||
(a, b) => a.Name.Contains(input.Keywords!) || a.Code.Contains(input.Keywords!))
|
||||
.OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b) => a.CreateTime, OrderByType.Desc)
|
||||
.OrderByIF(!input.SelectIds.IsNullOrEmpty(),
|
||||
(a, b) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1),
|
||||
(a, b) => SqlFunc.IIF(input.SelectIds!.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1),
|
||||
a.CreateTime), OrderByType.Desc)
|
||||
.Select((a, b) => new GetTrackTemplateListVO
|
||||
{
|
||||
@ -182,4 +183,46 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
return await Context.Updateable<TrackTemplateContentEntity>().SetColumns(columns).Where(whereExpression)
|
||||
.ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<List<TrackTemplateOutputVo>> GetTrackTemplateListAsync(GetTrackTemplateListInputVo input)
|
||||
{
|
||||
var templates = await Context.Queryable<TrackTemplateEntity>()
|
||||
.Where(x => x.SubSystemId == input.SubSystemId)
|
||||
.WhereIF(input.CustomerId.HasValue, x => x.CustomerId == input.CustomerId)
|
||||
.WhereIF(input.TemplateType.HasValue, x => x.CategoryId == input.TemplateType)
|
||||
.Select(x => new TrackTemplateOutputVo
|
||||
{
|
||||
Id = x.Id,
|
||||
TemplateName = x.Name,
|
||||
TemplateCode = x.Code,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
if (templates == default) return new List<TrackTemplateOutputVo>();
|
||||
var templateIds = templates.Select(x => x.Id).ToArray();
|
||||
var contents = await Context.Queryable<TrackTemplateContentEntity>()
|
||||
.LeftJoin<TrackContentEntity>((a, b) => a.TrackContentId == b.Id)
|
||||
.LeftJoin<TrackStatusEntity>((a, b, c) => b.TrackStatusId == c.Id)
|
||||
.LeftJoin<TrackNodeEntity>((a, b, c, d) => c.Node == d.Id)
|
||||
.Where(a => templateIds.Contains(a.TrackTemplateId))
|
||||
.Select((a, b, c, d) => new TemplateContentDtoVo
|
||||
{
|
||||
TemplateId = a.TrackTemplateId,
|
||||
Code = b.Code,
|
||||
ContentCn = b.Content,
|
||||
ContentEn = b.EnContent,
|
||||
Status = c.Status,
|
||||
Node = d.NodeName
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var template in templates)
|
||||
{
|
||||
var templateContents = contents.Where(x => x.TemplateId == template.Id).ToList();
|
||||
|
||||
template.TemplateContents = templateContents;
|
||||
}
|
||||
|
||||
return templates;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user