|
|
@@ -106,18 +106,21 @@ namespace Learun.Application.WorkFlow |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var expression = LinqExtensions.True<NWFProcessEntity>(); |
|
|
|
var strSql = new StringBuilder(); |
|
|
|
strSql.Append("select p.*,u.F_DepartmentId from LR_NWF_Process p "); |
|
|
|
strSql.Append("left join LR_Base_User u on p.F_CreateUserId=u.F_UserId "); |
|
|
|
strSql.Append("where 1=1 "); |
|
|
|
var queryParam = queryJson.ToJObject(); |
|
|
|
// 分类 |
|
|
|
if (!queryParam["categoryId"].IsEmpty()) // 1:未完成 2:已完成 |
|
|
|
{ |
|
|
|
if (queryParam["categoryId"].ToString() == "1") |
|
|
|
{ |
|
|
|
expression = expression.And(t => t.F_IsFinished == 0); |
|
|
|
strSql.Append("and p.F_IsFinished=0 "); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
expression = expression.And(t => t.F_IsFinished == 1); |
|
|
|
strSql.Append("and p.F_IsFinished=1 "); |
|
|
|
} |
|
|
|
} |
|
|
|
//流程类别 |
|
|
@@ -128,7 +131,7 @@ namespace Learun.Application.WorkFlow |
|
|
|
|
|
|
|
if (codeList.Count() > 0) |
|
|
|
{ |
|
|
|
expression = expression.And(a => codeList.Contains(a.F_SchemeCode)); |
|
|
|
strSql.Append($"and p.F_SchemeCode in ('{String.Join("','", codeList.ToArray())}') "); |
|
|
|
} |
|
|
|
} |
|
|
|
// 操作时间 |
|
|
@@ -136,13 +139,13 @@ namespace Learun.Application.WorkFlow |
|
|
|
{ |
|
|
|
DateTime startTime = queryParam["StartTime"].ToDate(); |
|
|
|
DateTime endTime = queryParam["EndTime"].ToDate(); |
|
|
|
expression = expression.And(t => t.F_CreateDate >= startTime && t.F_CreateDate <= endTime); |
|
|
|
strSql.Append($"and p.F_CreateDate>='{startTime}' and p.F_CreateDate<='{endTime}' "); |
|
|
|
} |
|
|
|
// 关键字 |
|
|
|
if (!queryParam["keyword"].IsEmpty()) |
|
|
|
{ |
|
|
|
string keyword = queryParam["keyword"].ToString(); |
|
|
|
expression = expression.And(t => t.F_Title.Contains(keyword) || t.F_SchemeName.Contains(keyword) || t.F_CreateUserName.Contains(keyword)); |
|
|
|
strSql.Append($"and (p.F_Title like '%{keyword}%' or p.F_SchemeName like '%{keyword}%' or p.F_CreateUserName like '%{keyword}%' ) "); |
|
|
|
} |
|
|
|
// 状态 |
|
|
|
if (!queryParam["F_EnabledMark"].IsEmpty()) // 1:未完成 2:已完成 |
|
|
@@ -150,35 +153,25 @@ namespace Learun.Application.WorkFlow |
|
|
|
if (queryParam["F_EnabledMark"].ToString() == "1") |
|
|
|
{ |
|
|
|
//运行中 |
|
|
|
expression = expression.And(t => t.F_EnabledMark == 1); |
|
|
|
strSql.Append("and p.F_EnabledMark=1 "); |
|
|
|
} |
|
|
|
else if (queryParam["F_EnabledMark"].ToString() == "2") |
|
|
|
{ |
|
|
|
//作废 |
|
|
|
expression = expression.And(t => t.F_EnabledMark != 1); |
|
|
|
strSql.Append("and p.F_EnabledMark<>1 "); |
|
|
|
} |
|
|
|
else if (queryParam["F_EnabledMark"].ToString() == "3") |
|
|
|
{ |
|
|
|
//结束 已完成 |
|
|
|
expression = expression.And(t => t.F_IsFinished == 1); |
|
|
|
strSql.Append("and p.F_IsFinished=1 "); |
|
|
|
} |
|
|
|
} |
|
|
|
expression = expression.And(t => t.F_EnabledMark != 2); |
|
|
|
strSql.Append("and p.F_EnabledMark<>2 "); |
|
|
|
////20221125增加作废不显示liang |
|
|
|
//expression = expression.And(t => t.F_EnabledMark != 3); |
|
|
|
expression = expression.And(t => t.F_IsChild == 0); |
|
|
|
//expression = expression.And(t => p.F_EnabledMark != 3); |
|
|
|
strSql.Append("and p.F_IsChild=0 "); |
|
|
|
|
|
|
|
var result = this.BaseRepository().FindList<NWFProcessEntity>(expression, pagination); |
|
|
|
if (result.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in result) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(item.F_CreateUserName)) |
|
|
|
{ |
|
|
|
item.F_DepartmentId = this.BaseRepository().FindEntity<UserEntity>(x => x.F_UserId == item.F_CreateUserId)?.F_DepartmentId; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var result = this.BaseRepository().FindList<NWFProcessEntity>(strSql.ToString(), pagination); |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|