refactor(workflow): 优化工作流引擎代码结构
- 将ZyFlowVariable实例化语法简化为对象初始化器 - 修正附件路径组合逻辑,从当前目录切换到基础目录 - 移除不必要的wwwroot前缀并改进路径构建方式main
parent
cbe0e794db
commit
21f676155d
|
|
@ -129,9 +129,9 @@ public class WorkflowEngineApp : SqlSugarBaseApp<SysCategoryType, SugarDbContext
|
|||
var attachmentPaths = SaveAttachments(requestDto.Attachments);
|
||||
var flowVariables = new List<ZyFlowVariable>
|
||||
{
|
||||
new ZyFlowVariable { InstanceId = instanceId, VarKey = "Title", VarValue = requestDto.Title },
|
||||
new ZyFlowVariable { InstanceId = instanceId, VarKey = "AttachmentPaths", VarValue = attachmentPaths },
|
||||
new ZyFlowVariable
|
||||
new() { InstanceId = instanceId, VarKey = "Title", VarValue = requestDto.Title },
|
||||
new() { InstanceId = instanceId, VarKey = "AttachmentPaths", VarValue = attachmentPaths },
|
||||
new()
|
||||
{
|
||||
InstanceId = instanceId, VarKey = "SubmitTime",
|
||||
VarValue = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
|
|
@ -862,7 +862,8 @@ public class WorkflowEngineApp : SqlSugarBaseApp<SysCategoryType, SugarDbContext
|
|||
return string.Empty;
|
||||
|
||||
// 定义附件存储目录
|
||||
var uploadDir = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/Attachments/FlowAttachments");
|
||||
var uploadDir = Path
|
||||
.Combine(AppContext.BaseDirectory, "Attachments/FlowAttachments");
|
||||
if (!Directory.Exists(uploadDir))
|
||||
Directory.CreateDirectory(uploadDir);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue