diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Process/NWFProcessSerivce.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Process/NWFProcessSerivce.cs index 429283fb7..57810624f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Process/NWFProcessSerivce.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Process/NWFProcessSerivce.cs @@ -373,7 +373,8 @@ namespace Learun.Application.WorkFlow p.F_ParentProcessId, p.F_CreateUserId, p.F_CreateUserName, - p.F_IsStart + p.F_IsStart, + d.F_DepartmentId,d.F_FullName FROM ( SELECT @@ -399,6 +400,9 @@ namespace Learun.Application.WorkFlow ) r LEFT JOIN LR_NWF_Task t ON t.F_Id = r.F_TaskId LEFT JOIN LR_NWF_Process p ON p.F_Id = t.F_ProcessId + LEFT JOIN( + SELECT t.F_DepartmentId,t.F_FullName,u.F_RealName,u.F_UserId + FROM LR_Base_Department t left join LR_BASE_USER u on t.F_DepartmentId = u.F_DepartmentId) d ON d.F_UserId=t.F_CreateUserId WHERE t.F_IsFinished = 0 AND (p.F_IsFinished = 0 OR t.F_Type = 2 OR t.F_Type = 4 OR t.F_Type = 6)"); @@ -415,7 +419,7 @@ namespace Learun.Application.WorkFlow if (!queryParam["keyword"].IsEmpty()) { keyword = "%" + queryParam["keyword"].ToString() + "%"; - strSql.Append(" AND ( p.F_Title like @keyword OR p.F_SchemeName like @keyword ) "); + strSql.Append(" AND ( p.F_Title like @keyword OR p.F_SchemeName like @keyword OR p.F_CreateUserName like @keyword OR d.F_FullName like @keyword ) "); } if (!string.IsNullOrEmpty(schemeCode)) @@ -428,16 +432,16 @@ namespace Learun.Application.WorkFlow strSql.Append(" AND t.F_IsBatchAudit = 1 "); } var data = this.BaseRepository().FindList(strSql.ToString(), new { userId, startTime, endTime, keyword, schemeCode }, pagination); - if (data.Count() > 0) - { - foreach (var item in data) - { - if (!string.IsNullOrEmpty(item.F_CreateUserName)) - { - item.F_DepartmentId = this.BaseRepository().FindEntity(x => x.F_UserId == item.F_CreateUserId)?.F_DepartmentId; - } - } - } + //if (data.Count() > 0) + //{ + // foreach (var item in data) + // { + // if (!string.IsNullOrEmpty(item.F_CreateUserName)) + // { + // item.F_DepartmentId = this.BaseRepository().FindEntity(x => x.F_UserId == item.F_CreateUserId)?.F_DepartmentId; + // } + // } + //} return data; } catch (Exception ex) @@ -588,11 +592,17 @@ namespace Learun.Application.WorkFlow p.F_CreateUserId, p.F_CreateUserName, p.F_IsStart, - t.F_NodeId + t.F_NodeId, + d.F_DepartmentId,d.F_FullName FROM LR_NWF_Task t LEFT JOIN LR_NWF_TaskRelation r on r.F_TaskId = t.F_Id LEFT JOIN LR_NWF_Process p ON t.F_ProcessId = p.F_Id + LEFT JOIN( + SELECT t.F_DepartmentId,t.F_FullName,u.F_RealName,u.F_UserId + FROM LR_Base_Department t + left join LR_BASE_USER u on t.F_DepartmentId = u.F_DepartmentId + ) d ON d.F_UserId=t.F_CreateUserId WHERE (r.F_Result = 1 OR r.F_Result = 2 OR r.F_Result = 4) AND r.F_UserId = @userId "); @@ -611,7 +621,7 @@ namespace Learun.Application.WorkFlow if (!queryParam["keyword"].IsEmpty()) { keyword = "%" + queryParam["keyword"].ToString() + "%"; - strSql.Append(" AND ( p.F_ProcessName like @keyword OR p.F_SchemeName like @keyword ) "); + strSql.Append(" AND ( p.F_Title like @keyword OR p.F_SchemeName like @keyword OR p.F_CreateUserName like @keyword OR p.F_CreateUserName like @keyword OR d.F_FullName like @keyword) "); } if (!string.IsNullOrEmpty(schemeCode)) { @@ -627,10 +637,10 @@ namespace Learun.Application.WorkFlow { item.NextNodeIsAudited = true; } - if (!string.IsNullOrEmpty(item.F_CreateUserName)) - { - item.F_DepartmentId = this.BaseRepository().FindEntity(x => x.F_UserId == item.F_CreateUserId)?.F_DepartmentId; - } + //if (!string.IsNullOrEmpty(item.F_CreateUserName)) + //{ + // item.F_DepartmentId = this.BaseRepository().FindEntity(x => x.F_UserId == item.F_CreateUserId)?.F_DepartmentId; + //} } return data; }