Dun.Jason před 6 měsíci
rodič
revize
13c61d1b1f

+ 33 - 1
src/Hotline.Api/Controllers/OrderController.cs

@@ -142,6 +142,7 @@ public class OrderController : BaseController
     private readonly ICalcExpireTime _expireTime;
     private readonly IRepository<OrderPushType> _orderPushTypeRepository;
     private readonly IOptions<CityBaseConfiguration> _cityBaseConfiguration;
+    private readonly IRepository<OrderRevoke> _orderRevokeRepository;
 
     public OrderController(
         IOrderDomainService orderDomainService,
@@ -205,7 +206,8 @@ public class OrderController : BaseController
         IRepository<OrderPushType> orderPushTypeRepository,
         IOptions<CityBaseConfiguration> cityBaseConfiguration,
         ICallNativeRepository callNativeRepository,
-        ICallNativeApplication callNativeApplication)
+        ICallNativeApplication callNativeApplication,
+        IRepository<OrderRevoke> orderRevokeRepository)
     {
         _orderDomainService = orderDomainService;
         _orderRepository = orderRepository;
@@ -269,6 +271,7 @@ public class OrderController : BaseController
         _cityBaseConfiguration = cityBaseConfiguration;
         _callNativeRepository = callNativeRepository;
         _callNativeApplication = callNativeApplication;
+        _orderRevokeRepository = orderRevokeRepository;
     }
     #endregion 
 
@@ -3001,6 +3004,35 @@ public class OrderController : BaseController
         {
             dto.IsReturnUnderApproval = true;
         }
+        //省退回
+        var orderSendback = await _orderSendBackRepository.Queryable().Where(x => x.OrderId == order.Id).OrderByDescending(x=>x.AuditTime).FirstAsync();
+        if (orderSendback is not null)
+        {
+            string stateStr = "";
+            // 0  待审核  1 审核通过  2 审核不通过
+            switch (orderSendback.State)
+            {
+                case 0:
+                    stateStr = "待审核";
+                    break;
+                case 1:
+                    stateStr = "审核通过";
+                    break;
+                case 2:
+                    stateStr = "审核不通过";
+                    break;
+                default:
+                    stateStr = "未知";
+                    break;
+            }
+            dto.ProvinceSendBackString = "该工单已向省平台发送退回申请!退回状态:"+ stateStr;
+        }
+
+        var isProvinceorderRevoke = await _orderRevokeRepository.Queryable().AnyAsync(x => x.OrderId == order.Id && x.IsProRevoke == true);
+        if (isProvinceorderRevoke)
+        {
+            dto.ProvinceRevokeString = "该工单已由省平台发送撤单!请直接归档办理!";
+        }
 
         return dto;
     }

+ 12 - 1
src/Hotline.Share/Dtos/Order/OrderDto.cs

@@ -685,7 +685,18 @@ namespace Hotline.Share.Dtos.Order
         /// 退回截至时间
         /// </summary>
         public DateTime? SendBackAuditEndTime { get; set; }
-	}
+
+        /// <summary>
+        /// 省退回信息
+        /// </summary>
+        public string ProvinceSendBackString { get; set; }
+
+        /// <summary>
+        /// 省撤单信息
+        /// </summary>
+        public string ProvinceRevokeString { get; set; }
+
+    }
 
     public class UpdateOrderDto : AddOrderDto
     {