xf 2 年之前
父节点
当前提交
c1e5d33eb6
共有 2 个文件被更改,包括 27 次插入1 次删除
  1. 11 0
      src/Hotline.Api/Controllers/OrderController.cs
  2. 16 1
      src/Hotline/FileStorage/File.cs

+ 11 - 0
src/Hotline.Api/Controllers/OrderController.cs

@@ -1,4 +1,5 @@
 using Hotline.Application.FlowEngine;
+using Hotline.FlowEngine.Definitions;
 using Hotline.FlowEngine.Workflows;
 using Hotline.Orders;
 using Hotline.Repository.SqlSugar.Extensions;
@@ -30,6 +31,7 @@ public class OrderController : BaseController
     private readonly IHotspotTypeRepository _hotspotTypeRepository;
     private readonly ISystemDomainService _systemDomainService;
     private readonly ISystemOrganizeRepository _organizeRepository;
+    private readonly IDefinitionDomainService _definitionDomainService;
     private readonly ISessionContext _sessionContext;
     private readonly IMapper _mapper;
 
@@ -41,6 +43,7 @@ public class OrderController : BaseController
         IHotspotTypeRepository hotspotTypeRepository,
         ISystemDomainService systemDomainService,
         ISystemOrganizeRepository organizeRepository,
+        IDefinitionDomainService definitionDomainService,
         ISessionContext sessionContext,
         IMapper mapper)
     {
@@ -51,6 +54,7 @@ public class OrderController : BaseController
         _hotspotTypeRepository = hotspotTypeRepository;
         _systemDomainService = systemDomainService;
         _organizeRepository = organizeRepository;
+        _definitionDomainService = definitionDomainService;
         _sessionContext = sessionContext;
         _mapper = mapper;
     }
@@ -182,6 +186,13 @@ public class OrderController : BaseController
             throw UserFriendlyException.SameMessage("无效工单编号");
         if (order.Status != EOrderStatus.Temporary || !string.IsNullOrEmpty(order.WorkflowId))
             throw UserFriendlyException.SameMessage("工单已发起流程");
+
+        var definition = await _definitionDomainService.GetLastVersionDefinitionByModuleCodeAsync(
+            WorkflowModuleConsts.TelRestApply, HttpContext.RequestAborted);
+        if (definition is null)
+            throw UserFriendlyException.SameMessage("未配置流程模板");
+        dto.DefinitionCode = definition.Code;
+        dto.Title = order.Title;
         var workflowId = await _workflowApplication.StartWorkflowAsync(dto, HttpContext.RequestAborted);
         order.StartFlow(workflowId);
         await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);

+ 16 - 1
src/Hotline/FileStorage/File.cs

@@ -9,7 +9,22 @@ namespace Hotline.FileStorage
 {
     public class File //: FullStateEntity
     {
-        public EFileSType FileSType { get; set; }   
+        public EFileSType FileSType { get; set; }
+
+        public string Name { get; set; }
+
+        public string Extention { get; set; }
+
+        public string FullName { get; set; }
+
+        /// <summary>
+        /// 相对路劲
+        /// </summary>
+        public string Path { get; set; }
+
+        public string FullPath { get; set; }
+
+        public string Size { get; set; }
     }
 
     public enum EFileSType