From 1066f6ae6ff428de318f355a7864e468d5370d88 Mon Sep 17 00:00:00 2001 From: geh <1923421292@qq.com> Date: Fri, 27 Mar 2026 14:41:22 +0800 Subject: [PATCH] 1 --- SUBQHSE/BLL/ProjectData/ProjectService.cs | 38 ++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/SUBQHSE/BLL/ProjectData/ProjectService.cs b/SUBQHSE/BLL/ProjectData/ProjectService.cs index 8577d1a..5587e33 100644 --- a/SUBQHSE/BLL/ProjectData/ProjectService.cs +++ b/SUBQHSE/BLL/ProjectData/ProjectService.cs @@ -469,6 +469,42 @@ return null; } } + + public static List GetProjectByUserIdDropDownList1(string userId) + { + if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId) + { + return (from x in Funs.DB.Base_Project + where (x.IsDelete == null || x.IsDelete == false) && (x.ProjectState == null || x.ProjectState == BLL.Const.ProjectState_1) && (x.ProjectAttribute == "GONGCHENG") + orderby x.ProjectCode descending + select x).ToList(); + } + var getUser = UserService.GetUserByUserId(userId); + if (getUser != null) + { + /// 获取角色类型 + var getRoleP = Funs.DB.Sys_RolePower.FirstOrDefault(x => x.RoleId == getUser.RoleId && x.IsOffice == false); + if (getRoleP != null) + { + return (from x in Funs.DB.Base_Project + where (x.IsDelete == null || x.IsDelete == false) && (x.ProjectState == null || x.ProjectState == BLL.Const.ProjectState_1) && (x.ProjectAttribute == "GONGCHENG") + orderby x.ProjectCode descending + select x).ToList(); + } + else + { + return (from x in Funs.DB.Base_Project + join y in Funs.DB.Project_ProjectUser on x.ProjectId equals y.ProjectId + where y.UserId == userId && (x.IsDelete == null || x.IsDelete == false) && (x.ProjectState == null || x.ProjectState == BLL.Const.ProjectState_1) && (x.ProjectAttribute == "GONGCHENG") + orderby x.ProjectCode descending + select x).Distinct().ToList(); + } + } + else + { + return null; + } + } public static List GetUnEndProjectByUserIdDropDownList(string userId, string needProjectId) { if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId) @@ -714,7 +750,7 @@ { dropName.DataValueField = "ProjectId"; dropName.DataTextField = "ProjectName"; - var projectlist = GetProjectByUserIdDropDownList(userId); + var projectlist = GetProjectByUserIdDropDownList1(userId); dropName.DataSource = projectlist; dropName.DataBind(); if (projectlist.Count() == 0)