Jelajahi Sumber

修改补充详情查询

tangjiang 1 Minggu lalu
induk
melakukan
8b358cd643

+ 16 - 2
src/Hotline.Api/Controllers/OrderApi/OrderComplementController.cs

@@ -238,11 +238,25 @@ public class OrderComplementController : BaseController
     [HttpGet("get_complement_order_info/{id}")]
     public async Task<ComplementOrderDto> GetComplementOrderInfo(string id)
     {
-        var data = await _orderComplementRepository.GetAsync(p => p.Id == id, cancellationToken: HttpContext.RequestAborted);
+        var data = await _orderComplementRepository.Queryable()
+            .Includes(p => p.Order)
+            .Where(p => p.Id == id)
+            .FirstAsync();
         if (data == null)
             throw UserFriendlyException.SameMessage("补充查询失败!");
 
-        return _mapper.Map<ComplementOrderDto>(data);
+        ComplementOrderDto orderDto = new()
+        {
+            Id = id,
+            OrderId = data.OrderId,
+            Opinion = data.Opinion,
+            SupplyName = data.SupplyName,
+            SupplyOrg = data.SupplyOrg,
+            SupplyTime = data.SupplyTime,
+            No = data.No,
+            Title = data.Order?.Title
+        };
+        return orderDto;
     }
 
     /// <summary>

+ 4 - 2
src/Hotline.Share/Dtos/Order/ComplementOrderDto.cs

@@ -35,6 +35,8 @@
         /// 工单编号
         /// </summary>
         public string? No { get; set; }
+
+        public string? Title { get; set; }
     }
 
     public class ComplementOrderCopDto : ComplementOrderDto
@@ -46,12 +48,12 @@
         /// <summary>
         /// 操作时间
         /// </summary>
-        public DateTime? CreationTime {  get; set; }
+        public DateTime? CreationTime { get; set; }
 
         /// <summary>
         /// 操作人
         /// </summary>
-        public string? CreatorName {  get; set; }
+        public string? CreatorName { get; set; }
     }
 
     public class ComplementOrderCopyDetailDto