From 5818d8ddd87b8829e1ef072f6438452977dd0359 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Fri, 29 Mar 2024 14:39:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E5=A4=96=E6=8E=A5=E5=8F=A3=E8=BF=94?= =?UTF-8?q?=E5=8F=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/ITrackService.cs | 6 +-- .../ProvideServices/OrderService.Link.cs | 4 +- .../Services/ProvideServices/OrderService.cs | 2 +- .../Services/ProvideServices/TrackService.cs | 47 ++++++++++++------- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Services/ITrackService.cs b/src/SJZY.Track.Application.Contract/Services/ITrackService.cs index 1b0ec5b5..31dae617 100644 --- a/src/SJZY.Track.Application.Contract/Services/ITrackService.cs +++ b/src/SJZY.Track.Application.Contract/Services/ITrackService.cs @@ -10,21 +10,21 @@ public interface ITrackService : IRemoteService /// /// /// - Task UpsertTrackAsync(UpsertTrackInput input); + Task UpsertTrackAsync(UpsertTrackInput input); /// /// 删除轨迹 /// /// /// - Task DeleteTrackAsync(DeleteTrackInput input); + Task DeleteTrackAsync(DeleteTrackInput input); /// /// 批量删除轨迹 /// /// /// - Task BatchDeleteTrackAsync(BatchDeleteTrackInput input); + Task BatchDeleteTrackAsync(BatchDeleteTrackInput input); /// /// 根据订单号获取轨迹 diff --git a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.Link.cs b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.Link.cs index 7226ee0f..1f5e0446 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.Link.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.Link.cs @@ -65,7 +65,7 @@ public partial class OrderService }); } - return new UnifyResultDto(true); + return new UnifyResultDto(true, true); } private async Task> DoLinkOrderAsync(LinkOrderInput input, int orderId) @@ -108,6 +108,6 @@ public partial class OrderService // real del await _orderRepository.UnLinkByIdsAsync(unLinkIds); - return new UnifyResultDto(true); + return new UnifyResultDto(true, true); } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs index d562ef9b..d1086bf7 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs @@ -70,7 +70,7 @@ public partial class OrderService : ApplicationService, IOrderService await _orderRepository.DeleteOrderAsync(orderId); - return new UnifyResultDto(true); + return new UnifyResultDto(true, true); } private async Task UpdateOrderAsync(UpdateOrderInput input, OrderEntity order) diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs index 72fe2f20..ab387b25 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackService.cs @@ -38,13 +38,17 @@ public partial class TrackService : ApplicationService, ITrackService /// /// [HttpPost("Track/Upsert")] - public async Task UpsertTrackAsync(UpsertTrackInput input) + public async Task UpsertTrackAsync(UpsertTrackInput input) { var order = await _orderRepository.GetFirstAsync(x => x.OrderType == input.OrderType && x.OrderNo == input.OrderNo, x => new - { - x.Id, x.SubSystemId, x.LatestPushTrackContentId, x.CustomId, x.IsCompleted - }); + { + x.Id, + x.SubSystemId, + x.LatestPushTrackContentId, + x.CustomId, + x.IsCompleted + }); if (order == default) { throw new BusinessException(message: $"订单:{input.OrderNo}不存在"); @@ -59,7 +63,7 @@ public partial class TrackService : ApplicationService, ITrackService @event.IsCompleted = order.IsCompleted; @event.OperationMan = CurrentUserRequest.CurrentUser.Name; await _capPublisher.PublishAsync(GlobalConst.TrackUpsertSubscribe, @event); - return true; + return new UnifyResultDto(true, true); } /// @@ -69,7 +73,7 @@ public partial class TrackService : ApplicationService, ITrackService /// /// [HttpPost("Track/BatchUpsert")] - public async Task BatchUpsertTrackAsync(BatchUpsertTrackInput input) + public async Task BatchUpsertTrackAsync(BatchUpsertTrackInput input) { input.OrderNos = input.OrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList(); // 单号去重、去空 if (input.OrderNos.Count == 0) @@ -79,9 +83,14 @@ public partial class TrackService : ApplicationService, ITrackService var orders = await _orderRepository.GetListAsync(x => x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo), x => new - { - x.Id, x.OrderNo, x.SubSystemId, x.LatestPushTrackContentId, x.CustomId, x.IsCompleted - }); + { + x.Id, + x.OrderNo, + x.SubSystemId, + x.LatestPushTrackContentId, + x.CustomId, + x.IsCompleted + }); foreach (var order in orders) { @@ -105,7 +114,7 @@ public partial class TrackService : ApplicationService, ITrackService await _capPublisher.PublishAsync(GlobalConst.TrackUpsertSubscribe, @event); } - return true; + return new UnifyResultDto(true, true); } /// @@ -115,13 +124,14 @@ public partial class TrackService : ApplicationService, ITrackService /// /// [HttpPost("Track/Delete")] - public async Task DeleteTrackAsync(DeleteTrackInput input) + public async Task DeleteTrackAsync(DeleteTrackInput input) { var order = await _orderRepository.GetFirstAsync(x => x.OrderType == input.OrderType && x.OrderNo == input.OrderNo, x => new - { - x.Id, x.SubSystemId - }); + { + x.Id, + x.SubSystemId + }); if (order == default) { throw new BusinessException(message: $"订单:{input.OrderNo}不存在"); @@ -144,7 +154,7 @@ public partial class TrackService : ApplicationService, ITrackService }; await _capPublisher.PublishAsync(GlobalConst.TrackDeleteSubscribe, @event); - return true; + return new UnifyResultDto(true, true); } /// @@ -154,13 +164,14 @@ public partial class TrackService : ApplicationService, ITrackService /// /// [HttpPost("Track/BatchDelete")] - public async Task BatchDeleteTrackAsync(BatchDeleteTrackInput input) + public async Task BatchDeleteTrackAsync(BatchDeleteTrackInput input) { var orders = await _orderRepository.GetListAsync(x => x.OrderType == input.OrderType && input.OrderNos.Contains(x.OrderNo) , x => new { - x.Id, x.SubSystemId + x.Id, + x.SubSystemId }); var codes = await _provideQueries.GetCanDeleteTrackCodesAsync( @@ -185,6 +196,6 @@ public partial class TrackService : ApplicationService, ITrackService await _capPublisher.PublishAsync(GlobalConst.TrackDeleteSubscribe, @event); } - return true; + return new UnifyResultDto(true, true); } } \ No newline at end of file