From 5f841fa6cacec2b991f663a167503f6674c09e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BC=9F?= <421281095@qq.com> Date: Fri, 27 Feb 2026 10:08:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(workflow):=20=E4=BF=AE=E5=A4=8D=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E5=BC=95=E6=93=8E=E4=B8=AD=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9B=B4=E6=96=B0=E5=92=8C=E6=9F=A5=E8=AF=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 CustomWorkflowController.Detail 方法上添加 AllowAnonymous 特性以允许匿名访问 - 将 Updateable 的 IgnoreNullColumns 替换为更精确的 IgnoreColumns 设置 - 在 ZyFlowWorkitem 查询中添加 NodeId 连接条件以确保正确的数据关联 - 修复多个工作流实例和工作项的状态更新逻辑 - 改进非法建筑评估记录的附件处理和数据保存机制 --- OpenAuth.App/workflow/WorkflowEngineApp.cs | 12 ++++++------ .../ServerController/CustomWorkflowController.cs | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/OpenAuth.App/workflow/WorkflowEngineApp.cs b/OpenAuth.App/workflow/WorkflowEngineApp.cs index b944467..5e07d7d 100644 --- a/OpenAuth.App/workflow/WorkflowEngineApp.cs +++ b/OpenAuth.App/workflow/WorkflowEngineApp.cs @@ -97,7 +97,7 @@ public class WorkflowEngineApp : SqlSugarBaseApp() @@ -109,7 +109,7 @@ public class WorkflowEngineApp : SqlSugarBaseApp() .Where(a => a.InstanceId == instanceId @@ -127,7 +127,7 @@ public class WorkflowEngineApp : SqlSugarBaseApp Forwarded -> 转发之后 Auditing -> 审核之后 Summarized-> 汇总判断之后 Rejected // 驳回之后 Rejected -> 转发之后 Auditing -> 审核之后 Summarized 。。。 flowInstance.Status = GetFlowStatusByNodeType(nextNode.NodeType); - _sqlSugar.Updateable(flowInstance).IgnoreNullColumns().ExecuteCommand(); + _sqlSugar.Updateable(flowInstance).IgnoreColumns(ignoreAllNullColumns:true,ignoreAllDefaultValue:true).ExecuteCommand(); // 为选择的每个审核科创建工作项 if (nextNode.NodeType == "Parallel") { @@ -1287,7 +1287,7 @@ public class WorkflowEngineApp : SqlSugarBaseApp() .LeftJoin((w, a) - => w.InstanceId == a.InstanceId && w.HandlerId == a.AuditorId) + => w.InstanceId == a.InstanceId && w.HandlerId == a.AuditorId && w.NodeId == a.NodeId) .LeftJoin((w, a, n) => w.NodeId == n.NodeId) .Where(w => w.InstanceId == instance.InstanceId && w.Status == "Done") .OrderByDescending(w => w.WorkitemId) diff --git a/OpenAuth.WebApi/Controllers/ServerController/CustomWorkflowController.cs b/OpenAuth.WebApi/Controllers/ServerController/CustomWorkflowController.cs index 57d0113..0d059a4 100644 --- a/OpenAuth.WebApi/Controllers/ServerController/CustomWorkflowController.cs +++ b/OpenAuth.WebApi/Controllers/ServerController/CustomWorkflowController.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using OpenAuth.App.Interface; using OpenAuth.App.workflow; @@ -264,6 +265,7 @@ public class WorkflowController : ControllerBase /// /// [HttpGet] + [AllowAnonymous] public ActionResult> Detail(string businessNo) { var detail = _workflowEngineApp.Detail(businessNo);