田爽 hace 1 año
padre
commit
81e83aab15
Se han modificado 2 ficheros con 14 adiciones y 8 borrados
  1. 6 5
      src/Hotline.Api/Controllers/OrderController.cs
  2. 8 3
      src/Hotline/Orders/Order.cs

+ 6 - 5
src/Hotline.Api/Controllers/OrderController.cs

@@ -1696,20 +1696,21 @@ public class OrderController : BaseController
         var order = _mapper.Map<Order>(dto);
         order.SignerId = _sessionContext.UserId;
         order.SignerName = _sessionContext.UserName;
-        var orderId = await _orderDomainService.AddAsync(order, HttpContext.RequestAborted);
+        order.InitId();
+        if (dto.Files.Any()) order.FileJson = await _fileRepository.AddFileAsync(dto.Files, order.Id, HttpContext.RequestAborted);
+		await _orderDomainService.AddAsync(order, HttpContext.RequestAborted);
         //if (dto.Tags.Any()) await _repositoryts.AddVectorAsync(orderId, DateTime.Now, dto.Tags, HttpContext.RequestAborted);
-        if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, orderId, HttpContext.RequestAborted);
         if (dto.RepeatableEventDetails?.Any() ?? false)
         {
-            dto.RepeatableEventDetails.ForEach(x => x.OrderId = orderId);
+            dto.RepeatableEventDetails.ForEach(x => x.OrderId = order.Id);
             List<RepeatableEventDetail> repeatables =
                 _mapper.Map<List<RepeatableEventDetail>>(dto.RepeatableEventDetails);
             await _repeatableEventDetailRepository.AddRangeAsync(repeatables, HttpContext.RequestAborted);
         }
 
         //内容分词
-        await _orderRepository.OrderParticiple(dto.Content, orderId, HttpContext.RequestAborted);
-        return orderId;
+        await _orderRepository.OrderParticiple(dto.Content, order.Id, HttpContext.RequestAborted);
+        return order.Id;
     }
 
     /// <summary>

+ 8 - 3
src/Hotline/Orders/Order.cs

@@ -575,10 +575,15 @@ namespace Hotline.Orders
         /// </summary>
         public string? TagNames { get; set; }
 
-        #endregion
-    }
+		#endregion
+
+		#region 附件冗余
+		[SugarColumn(ColumnDataType = "json", IsJson = true, IsNullable = true)]
+		public string FileJson { get; set; }
+		#endregion
+	}
 
-    public partial class Order
+	public partial class Order
     {
         /// <summary>
         /// 受理人