From 9f9154c857e4f10bfb07f3bd772e36d8968b2eb3 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Wed, 15 Jan 2025 16:29:50 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#IARNBG=20=E6=B5=81=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=BD=93=E5=89=8D=E5=BE=85=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E7=9A=84=E4=BA=BA=E5=91=98=E6=88=96=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenAuth.App/FlowInstance/FlowInstanceApp.cs | 54 ++++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/OpenAuth.App/FlowInstance/FlowInstanceApp.cs b/OpenAuth.App/FlowInstance/FlowInstanceApp.cs index 627324b2..1a798947 100644 --- a/OpenAuth.App/FlowInstance/FlowInstanceApp.cs +++ b/OpenAuth.App/FlowInstance/FlowInstanceApp.cs @@ -2,7 +2,7 @@ * @Author: yubaolee | ahfu~ <954478625@qq.com> * @Date: 2024-12-13 16:55:17 * @Description: 工作流实例表操作 - * @LastEditTime: 2024-12-24 10:58:01 + * @LastEditTime: 2025-01-15 16:19:31 * Copyright (c) 2024 by yubaolee | ahfu~ , All Rights Reserved. */ @@ -595,7 +595,22 @@ namespace OpenAuth.App { //包括加签人包含当前用户,审批人包含当前用户且没有加签节点的 var query = SugarClient.SqlQueryable($@" - SELECT fi.* + SELECT fi.Id, + fi.CreateUserName, + fi.ActivityName, + fi.CreateDate, + fi.CustomName, + fi.Code, + fi.Description, + fi.IsFinish, + (SELECT Account As Account FROM `User` + where Id in (fi.MakerList) + UNION ALL + SELECT '所有人' AS Account from dual + WHERE fi.MakerList = '1' + UNION ALL + SELECT 'System' AS Account from dual + WHERE fi.MakerList = '00000000-0000-0000-0000-000000000000') as MakerList FROM FlowInstance fi JOIN (SELECT fith.Id FROM FlowInstance fith @@ -621,7 +636,22 @@ namespace OpenAuth.App else if (request.type == "disposed") //已办事项(即我参与过的流程) { var finalQuery = SugarClient.SqlQueryable($@" - SELECT fi.* + SELECT fi.Id, + fi.CreateUserName, + fi.ActivityName, + fi.CreateDate, + fi.CustomName, + fi.Code, + fi.Description, + fi.IsFinish, + (SELECT Account As Account FROM `User` + where Id in (fi.MakerList) + UNION ALL + SELECT '所有人' AS Account from dual + WHERE fi.MakerList = '1' + UNION ALL + SELECT 'System' AS Account from dual + WHERE fi.MakerList = '00000000-0000-0000-0000-000000000000') as MakerList FROM FlowInstance fi JOIN (SELECT fith.InstanceId FROM FlowInstanceOperationHistory fith @@ -642,7 +672,22 @@ namespace OpenAuth.App else //我的流程(包含知会我的) { var sql = $@" - SELECT fi.* + SELECT fi.Id, + fi.CreateUserName, + fi.ActivityName, + fi.CreateDate, + fi.CustomName, + fi.Code, + fi.Description, + fi.IsFinish, + (SELECT Account As Account FROM `User` + where Id in (fi.MakerList) + UNION ALL + SELECT '所有人' AS Account from dual + WHERE fi.MakerList = '1' + UNION ALL + SELECT 'System' AS Account from dual + WHERE fi.MakerList = '00000000-0000-0000-0000-000000000000') as MakerList FROM FlowInstance fi JOIN (select Id as InstanceId from FlowInstance @@ -668,6 +713,7 @@ namespace OpenAuth.App if (SugarClient.CurrentConnectionConfig.DbType == DbType.SqlServer) { sql = sql.Replace("`Key`", "[Key]"); + sql = sql.Replace("from dual", ""); } else if (SugarClient.CurrentConnectionConfig.DbType == DbType.Oracle) {