change 整合轨迹服务、订单服务
This commit is contained in:
parent
be45223b94
commit
ba78ba46ae
@ -11,4 +11,18 @@ public interface IOrderService : IRemoteService
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<string> UpsertAsync(UpsertOrderInput input);
|
Task<string> UpsertAsync(UpsertOrderInput input);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除订单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> DeleteOrderAsync(DeleteOrderInput input);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关联订单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> LinkOrderAsync(LinkOrderInput input);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
|
using Volo.Abp;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Contract.Services;
|
||||||
|
|
||||||
|
public interface ITrackService : IRemoteService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 新增/更新订单轨迹接口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> UpsertTrackAsync(UpsertTrackInput input);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除轨迹
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> DeleteTrackAsync(DeleteTrackInput input);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批量删除轨迹
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> BatchDeleteTrackAsync(BatchDeleteTrackInput input);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据订单号获取轨迹
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<GetTrackOutput>> QueryAsync(GetTrackInput input);
|
||||||
|
}
|
||||||
@ -9,27 +9,11 @@ namespace SJZY.Track.Application.Services.ProvideServices;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单关联服务
|
/// 订单关联服务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
public partial class OrderService
|
||||||
[Route("/ProviderService")]
|
|
||||||
public class OrderLinkService : ApplicationService
|
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
|
||||||
private readonly IBasicQuery<OrderLinkEntity> _orderLinkQuery;
|
private readonly IBasicQuery<OrderLinkEntity> _orderLinkQuery;
|
||||||
private readonly ICapPublisher _capPublisher;
|
private readonly ICapPublisher _capPublisher;
|
||||||
|
|
||||||
public OrderLinkService(IBasicQuery<OrderLinkEntity> orderLinkQuery, IOrderRepository orderRepository,
|
|
||||||
ICapPublisher capPublisher)
|
|
||||||
{
|
|
||||||
_orderLinkQuery = orderLinkQuery;
|
|
||||||
_orderRepository = orderRepository;
|
|
||||||
_capPublisher = capPublisher;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 关联订单
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost("Order/Link")]
|
[HttpPost("Order/Link")]
|
||||||
public async Task<bool> LinkOrderAsync(LinkOrderInput input)
|
public async Task<bool> LinkOrderAsync(LinkOrderInput input)
|
||||||
{
|
{
|
||||||
@ -1,6 +1,8 @@
|
|||||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
using DotNetCore.CAP;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
using SJZY.Track.Application.Contract.Services;
|
using SJZY.Track.Application.Contract.Services;
|
||||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
using SJZY.Track.Domain.Queries;
|
||||||
using SJZY.UserCenter.HttpApi.Services;
|
using SJZY.UserCenter.HttpApi.Services;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||||
@ -10,21 +12,18 @@ namespace SJZY.Track.Application.Services.ProvideServices;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
[ApiExplorerSettings(GroupName = "提供接口")]
|
||||||
[Route("/ProviderService")]
|
[Route("/ProviderService")]
|
||||||
public class OrderService : ApplicationService, IOrderService
|
public partial class OrderService : ApplicationService, IOrderService
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
|
||||||
public OrderService(IOrderRepository orderRepository)
|
public OrderService(IOrderRepository orderRepository, IBasicQuery<OrderLinkEntity> orderLinkQuery,
|
||||||
|
ICapPublisher capPublisher)
|
||||||
{
|
{
|
||||||
_orderRepository = orderRepository;
|
_orderRepository = orderRepository;
|
||||||
|
_capPublisher = capPublisher;
|
||||||
|
_orderLinkQuery = orderLinkQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建订单,订单已存在则视为更新
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="BusinessException"></exception>
|
|
||||||
[HttpPost("Order/Upsert")]
|
[HttpPost("Order/Upsert")]
|
||||||
public async Task<string> UpsertAsync(UpsertOrderInput input)
|
public async Task<string> UpsertAsync(UpsertOrderInput input)
|
||||||
{
|
{
|
||||||
@ -46,12 +45,6 @@ public class OrderService : ApplicationService, IOrderService
|
|||||||
return "创建成功";
|
return "创建成功";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 删除订单
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="BusinessException"></exception>
|
|
||||||
[HttpPost("Order/Delete")]
|
[HttpPost("Order/Delete")]
|
||||||
public async Task<bool> DeleteOrderAsync(DeleteOrderInput input)
|
public async Task<bool> DeleteOrderAsync(DeleteOrderInput input)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,16 +8,16 @@ using Volo.Abp.Http.Client.DynamicProxying;
|
|||||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹拉取服务
|
/// 轨迹推送、拉取服务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
[ApiExplorerSettings(GroupName = "提供接口")]
|
||||||
[Route("/ProviderService")]
|
[Route("/ProviderService")]
|
||||||
public class TrackPullService : ApplicationService
|
public class TrackPushPullService : ApplicationService
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly IHttpClientProxy<IInterfaceForwardService> _httpClientProxy;
|
private readonly IHttpClientProxy<IInterfaceForwardService> _httpClientProxy;
|
||||||
|
|
||||||
public TrackPullService(IOrderRepository orderRepository,
|
public TrackPushPullService(IOrderRepository orderRepository,
|
||||||
IHttpClientProxy<IInterfaceForwardService> httpClientProxy)
|
IHttpClientProxy<IInterfaceForwardService> httpClientProxy)
|
||||||
{
|
{
|
||||||
_orderRepository = orderRepository;
|
_orderRepository = orderRepository;
|
||||||
@ -49,6 +49,7 @@ public class TrackPullService : ApplicationService
|
|||||||
x.OrderNo
|
x.OrderNo
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
// 批量获取轨迹
|
||||||
await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||||
"A012", group.Key.ServiceProviderCode, 42, data,
|
"A012", group.Key.ServiceProviderCode, 42, data,
|
||||||
GlobalConst.TrackRefreshSubscribe, JsonConvert.SerializeObject(group.Key));
|
GlobalConst.TrackRefreshSubscribe, JsonConvert.SerializeObject(group.Key));
|
||||||
@ -1,11 +0,0 @@
|
|||||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 轨迹推送服务
|
|
||||||
/// </summary>
|
|
||||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
|
||||||
[Route("/ProviderService")]
|
|
||||||
public class TrackPushService: ApplicationService
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,36 +1,15 @@
|
|||||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
|
||||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
using SJZY.Track.Domain.Queries;
|
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹查询服务
|
/// 轨迹查询服务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
public partial class TrackService
|
||||||
[Route("/ProviderService")]
|
|
||||||
public class TrackQueryService : ApplicationService
|
|
||||||
{
|
{
|
||||||
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
||||||
private readonly IOrderRepository _orderRepository;
|
|
||||||
private readonly IProvideQueries _provideQueries;
|
|
||||||
|
|
||||||
public TrackQueryService(ITrackDetailsRepository trackDetailsRepository,
|
|
||||||
IOrderRepository orderRepository,
|
|
||||||
IProvideQueries provideQueries)
|
|
||||||
{
|
|
||||||
_trackDetailsRepository = trackDetailsRepository;
|
|
||||||
_orderRepository = orderRepository;
|
|
||||||
_provideQueries = provideQueries;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 根据订单号获取轨迹
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="BusinessException"></exception>
|
|
||||||
[HttpPost("Track/Query")]
|
[HttpPost("Track/Query")]
|
||||||
public async Task<List<GetTrackOutput>> QueryAsync(GetTrackInput input)
|
public async Task<List<GetTrackOutput>> QueryAsync(GetTrackInput input)
|
||||||
{
|
{
|
||||||
@ -1,7 +1,9 @@
|
|||||||
using DotNetCore.CAP;
|
using DotNetCore.CAP;
|
||||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
using SJZY.Track.Application.Contract.Events;
|
using SJZY.Track.Application.Contract.Events;
|
||||||
|
using SJZY.Track.Application.Contract.Services;
|
||||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
using SJZY.Track.Domain.Queries;
|
using SJZY.Track.Domain.Queries;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||||
@ -11,25 +13,22 @@ namespace SJZY.Track.Application.Services.ProvideServices;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
[ApiExplorerSettings(GroupName = "提供接口")]
|
||||||
[Route("/ProviderService")]
|
[Route("/ProviderService")]
|
||||||
public class TrackService : ApplicationService
|
public partial class TrackService : ApplicationService, ITrackService
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly IProvideQueries _provideQueries;
|
private readonly IProvideQueries _provideQueries;
|
||||||
private readonly ICapPublisher _capPublisher;
|
private readonly ICapPublisher _capPublisher;
|
||||||
|
|
||||||
public TrackService(IOrderRepository orderRepository, IProvideQueries provideQueries, ICapPublisher capPublisher)
|
public TrackService(IOrderRepository orderRepository, IProvideQueries provideQueries, ICapPublisher capPublisher,
|
||||||
|
ITrackDetailsRepository trackDetailsRepository)
|
||||||
{
|
{
|
||||||
_orderRepository = orderRepository;
|
_orderRepository = orderRepository;
|
||||||
_provideQueries = provideQueries;
|
_provideQueries = provideQueries;
|
||||||
|
_provideQueries = provideQueries;
|
||||||
_capPublisher = capPublisher;
|
_capPublisher = capPublisher;
|
||||||
|
_trackDetailsRepository = trackDetailsRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 新增/更新订单轨迹接口
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="BusinessException"></exception>
|
|
||||||
[HttpPost("Track/Upsert")]
|
[HttpPost("Track/Upsert")]
|
||||||
public async Task<bool> UpsertTrackAsync(UpsertTrackInput input)
|
public async Task<bool> UpsertTrackAsync(UpsertTrackInput input)
|
||||||
{
|
{
|
||||||
@ -53,12 +52,6 @@ public class TrackService : ApplicationService
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 删除轨迹
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
/// <exception cref="BusinessException"></exception>
|
|
||||||
[HttpPost("Track/Delete")]
|
[HttpPost("Track/Delete")]
|
||||||
public async Task<bool> DeleteTrackAsync(DeleteTrackInput input)
|
public async Task<bool> DeleteTrackAsync(DeleteTrackInput input)
|
||||||
{
|
{
|
||||||
@ -97,7 +90,7 @@ public class TrackService : ApplicationService
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("Track/BatchDelete")]
|
[HttpPost("Track/BatchDelete")]
|
||||||
public async Task<bool> BatchTrackAsync(BatchDeleteTrackInput input)
|
public async Task<bool> BatchDeleteTrackAsync(BatchDeleteTrackInput input)
|
||||||
{
|
{
|
||||||
var orders = await _orderRepository.GetListAsync(x =>
|
var orders = await _orderRepository.GetListAsync(x =>
|
||||||
x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo) && !x.IsPushCompleted
|
x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo) && !x.IsPushCompleted
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user