Merge branch 'S03-轨迹中台' into dev
This commit is contained in:
commit
3457ad64f3
@ -0,0 +1,11 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class UpdateOrderStatusInput
|
||||
{
|
||||
public int OrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单是否完成
|
||||
/// </summary>
|
||||
public bool IsCompleted { get; set; }
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
using System.Diagnostics;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackOrder;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
@ -15,18 +16,21 @@ namespace SJZY.Track.Application.Services.TrackOrders;
|
||||
[Route("/Track/Order")]
|
||||
public class TrackOrderService : ApplicationService
|
||||
{
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private readonly ITrackOrderQueries _trackOrderQueries;
|
||||
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
||||
private readonly ITrackContentRepository _trackContentRepository;
|
||||
private readonly ITrackPushRecordsRepository _trackPushRecordsRepository;
|
||||
|
||||
public TrackOrderService(
|
||||
IOrderRepository orderRepository,
|
||||
ITrackOrderQueries trackOrderQueries,
|
||||
ITrackDetailsRepository trackDetailsRepository,
|
||||
ITrackContentRepository trackContentRepository,
|
||||
ITrackPushRecordsRepository trackPushRecordsRepository
|
||||
)
|
||||
{
|
||||
_orderRepository = orderRepository;
|
||||
_trackOrderQueries = trackOrderQueries;
|
||||
_trackDetailsRepository = trackDetailsRepository;
|
||||
_trackContentRepository = trackContentRepository;
|
||||
@ -121,6 +125,16 @@ public class TrackOrderService : ApplicationService
|
||||
|
||||
#endregion
|
||||
|
||||
[HttpPost("UpdateOrderStatus")]
|
||||
public async Task<bool> UpdateOrderStatus(UpdateOrderStatusInput input)
|
||||
{
|
||||
var order = await _orderRepository.GetFirstAsync(x => x.Id == input.OrderId);
|
||||
|
||||
if (order == default) throw new BusinessException(message: "订单不存在");
|
||||
|
||||
return await _orderRepository.UpdateColumnAsync(order, x => x.IsCompleted == input.IsCompleted);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹计数器
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user