20210907
This commit is contained in:
@@ -358,12 +358,13 @@ namespace BLL
|
||||
getPUser = (from x in db.Project_ProjectUser
|
||||
join u in db.Project_ProjectUnit on new { x.ProjectId, x.UnitId } equals new { u.ProjectId, u.UnitId }
|
||||
where x.ProjectId == projectId && (u.UnitId == unitId || u.UnitType == BLL.Const.ProjectUnitType_1 || u.UnitType == BLL.Const.ProjectUnitType_3 || u.UnitType == BLL.Const.ProjectUnitType_4)
|
||||
&& x.IsPost == true
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
getPUser = (from x in db.Project_ProjectUser
|
||||
where x.ProjectId == projectId
|
||||
where x.ProjectId == projectId && x.IsPost == true
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
@@ -372,7 +373,7 @@ namespace BLL
|
||||
foreach (var item in getPUser)
|
||||
{
|
||||
List<string> roleIdList = Funs.GetStrListByStr(item.RoleId, ',');
|
||||
var getRoles = db.Sys_Role.FirstOrDefault(x =>roleIdList.Contains(x.RoleId));
|
||||
var getRoles = db.Sys_Role.FirstOrDefault(x => roleIdList.Contains(x.RoleId));
|
||||
if (getRoles != null)
|
||||
{
|
||||
string userName = RoleService.getRoleNamesRoleIds(item.RoleId) + "-" + UserService.GetUserNameByUserId(item.UserId);
|
||||
@@ -405,7 +406,7 @@ namespace BLL
|
||||
{
|
||||
users = (from x in db.Sys_User
|
||||
join z in db.Sys_Role on x.RoleId equals z.RoleId
|
||||
where x.IsPost == true
|
||||
where x.IsPost == true
|
||||
orderby x.UserCode
|
||||
select new Model.SpSysUserItem
|
||||
{
|
||||
@@ -431,27 +432,24 @@ namespace BLL
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.UnitId == unitId
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.UnitId == unitId && y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
where x.UnitId == unitId
|
||||
where x.UnitId == unitId && x.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
@@ -475,7 +473,7 @@ namespace BLL
|
||||
{
|
||||
users = (from x in users
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId
|
||||
where y.ProjectId == projectId && y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
@@ -499,18 +497,16 @@ namespace BLL
|
||||
if (listRoles.Count() > 0)
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && listRoles.Contains(y.RoleId)
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && listRoles.Contains(y.RoleId) && y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
@@ -518,7 +514,7 @@ namespace BLL
|
||||
else
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
where x.UserId != BLL.Const.hfnbdId && x.UserId != Const.sedinId
|
||||
where x.UserId != BLL.Const.hfnbdId && x.UserId != Const.sedinId && x.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
|
||||
@@ -531,12 +527,12 @@ namespace BLL
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目号和角色Id获取用户下拉选项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Sys_User> GetUserListByProjectIdUnitIdRoleId(string projectId,string unitId, string roleIds)
|
||||
public static List<Model.Sys_User> GetUserListByProjectIdUnitIdRoleId(string projectId, string unitId, string roleIds)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
@@ -547,18 +543,16 @@ namespace BLL
|
||||
if (listRoles.Count() > 0)
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.UnitId == unitId && listRoles.Contains(y.RoleId)
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.UnitId == unitId && listRoles.Contains(y.RoleId) && y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.UnitId == unitId
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.UnitId == unitId && y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
@@ -566,7 +560,8 @@ namespace BLL
|
||||
else
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
where x.UnitId == unitId && x.UserId != BLL.Const.hfnbdId && x.UserId != Const.sedinId
|
||||
where x.UnitId == unitId && x.UserId != BLL.Const.hfnbdId && x.UserId != Const.sedinId
|
||||
&& x.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
|
||||
@@ -665,7 +660,7 @@ namespace BLL
|
||||
{
|
||||
dropName.DataValueField = "UserId";
|
||||
dropName.DataTextField = "UserName";
|
||||
dropName.DataSource = BLL.UserService.GetUserListByProjectIdUnitIdRoleId(projectId,unitId, roleIds);
|
||||
dropName.DataSource = BLL.UserService.GetUserListByProjectIdUnitIdRoleId(projectId, unitId, roleIds);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
@@ -700,12 +695,9 @@ namespace BLL
|
||||
List<Model.Sys_User> users = new List<Model.Sys_User>();
|
||||
//分包用户
|
||||
var q1 = (from x in db.Project_ProjectUser
|
||||
join y in db.Sys_User
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person
|
||||
on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost
|
||||
on z.WorkPostId equals a.WorkPostId
|
||||
join y in db.Sys_User on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost on z.WorkPostId equals a.WorkPostId
|
||||
where x.IsPost == true && x.UnitId == subUnitId
|
||||
&& a.CNCodes.Contains(cNProfessionalCode)
|
||||
&& x.UserId != subUserId
|
||||
@@ -734,12 +726,9 @@ namespace BLL
|
||||
mainUnitId = mainUnit.UnitId;
|
||||
}
|
||||
var q2 = (from x in db.Project_ProjectUser
|
||||
join y in db.Sys_User
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person
|
||||
on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost
|
||||
on z.WorkPostId equals a.WorkPostId
|
||||
join y in db.Sys_User on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost on z.WorkPostId equals a.WorkPostId
|
||||
where x.IsPost == true && x.UnitId == mainUnitId && a.CNCodes.Contains(cNProfessionalCode)
|
||||
&& x.UserId != mainUserId
|
||||
&& x.ProjectId == projectId && z.ProjectId == projectId
|
||||
@@ -807,14 +796,14 @@ namespace BLL
|
||||
{
|
||||
user = (from x in user
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where (y.ProjectId == projectId && y.UnitId == unitId)
|
||||
where (y.ProjectId == projectId && y.UnitId == unitId) && y.IsPost == true
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
user = (from x in user
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where (y.ProjectId == projectId)
|
||||
where (y.ProjectId == projectId) && y.IsPost == true
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
@@ -839,7 +828,8 @@ namespace BLL
|
||||
var user = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
|
||||
where x.IsPost == true && y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == Const.ProjectUnitType_1
|
||||
where x.IsPost == true && y.ProjectId == projectId && z.ProjectId == projectId
|
||||
&& z.UnitType == Const.ProjectUnitType_1 && y.IsPost == true
|
||||
orderby x.UserId
|
||||
select x).ToList();
|
||||
ListItem[] lis = new ListItem[user.Count()];
|
||||
@@ -874,14 +864,11 @@ namespace BLL
|
||||
List<Model.Sys_User> users = new List<Model.Sys_User>();
|
||||
//分包用户
|
||||
var q1 = (from x in db.Project_ProjectUser
|
||||
join y in db.Sys_User
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person
|
||||
on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost
|
||||
on z.WorkPostId equals a.WorkPostId
|
||||
join y in db.Sys_User on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost on z.WorkPostId equals a.WorkPostId
|
||||
where x.IsPost == true && x.UnitId == subUnitId && a.CNCodes.Contains(cNProfessionalCode)
|
||||
&& x.ProjectId == projectId && z.ProjectId == projectId
|
||||
&& x.ProjectId == projectId && z.ProjectId == projectId && y.IsPost == true
|
||||
orderby x.UserId
|
||||
select x).ToList();
|
||||
foreach (var item in q1)
|
||||
@@ -906,14 +893,11 @@ namespace BLL
|
||||
mainUnitId = mainUnit.UnitId;
|
||||
}
|
||||
var q2 = (from x in db.Project_ProjectUser
|
||||
join y in db.Sys_User
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person
|
||||
on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost
|
||||
on z.WorkPostId equals a.WorkPostId
|
||||
join y in db.Sys_User on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost on z.WorkPostId equals a.WorkPostId
|
||||
where x.IsPost == true && x.UnitId == mainUnitId && a.CNCodes.Contains(cNProfessionalCode)
|
||||
&& x.UserId != mainUserId
|
||||
&& x.UserId != mainUserId && y.IsPost == true
|
||||
&& x.ProjectId == projectId && z.ProjectId == projectId
|
||||
orderby x.UserId
|
||||
select x).ToList();
|
||||
@@ -945,14 +929,11 @@ namespace BLL
|
||||
{
|
||||
List<Model.Sys_User> users = new List<Model.Sys_User>();
|
||||
var q1 = (from x in db.Project_ProjectUser
|
||||
join y in db.Sys_User
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person
|
||||
on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost
|
||||
on z.WorkPostId equals a.WorkPostId
|
||||
join y in db.Sys_User on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost on z.WorkPostId equals a.WorkPostId
|
||||
where x.IsPost == true && (x.UnitId == unitId1 || x.UnitId == unitId2) && a.CNCodes.Contains(cNProfessionalCode)
|
||||
&& x.ProjectId == projectId && z.ProjectId == projectId
|
||||
&& x.ProjectId == projectId && z.ProjectId == projectId && y.IsPost == true
|
||||
orderby x.UserId
|
||||
select x).ToList();
|
||||
foreach (var item in q1)
|
||||
@@ -972,14 +953,11 @@ namespace BLL
|
||||
if (!string.IsNullOrEmpty(unitId3))
|
||||
{
|
||||
var q2 = (from x in db.Project_ProjectUser
|
||||
join y in db.Sys_User
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person
|
||||
on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost
|
||||
on z.WorkPostId equals a.WorkPostId
|
||||
join y in db.Sys_User on x.UserId equals y.UserId
|
||||
join z in db.SitePerson_Person on y.IdentityCard equals z.IdentityCard
|
||||
join a in db.Base_WorkPost on z.WorkPostId equals a.WorkPostId
|
||||
where x.IsPost == true && a.CNCodes.Contains(cNProfessionalCode)
|
||||
&& x.ProjectId == projectId && z.ProjectId == projectId
|
||||
&& x.ProjectId == projectId && z.ProjectId == projectId && y.IsPost == true
|
||||
orderby x.UserId
|
||||
select x).ToList();
|
||||
var q3 = (from x in q2
|
||||
@@ -1050,13 +1028,14 @@ namespace BLL
|
||||
user = (from x in user
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where (y.ProjectId == projectId && unitIds.Split(',').Contains(y.UnitId))
|
||||
&& y.IsPost == true
|
||||
select x).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
user = (from x in user
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where (y.ProjectId == projectId)
|
||||
where (y.ProjectId == projectId) && y.IsPost == true
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
@@ -1078,12 +1057,10 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return (from x in db.Sys_User
|
||||
join z in db.Project_ProjectUser
|
||||
on x.UserId equals z.UserId
|
||||
join y in db.Sys_Role
|
||||
on z.RoleId equals y.RoleId
|
||||
join z in db.Project_ProjectUser on x.UserId equals z.UserId
|
||||
join y in db.Sys_Role on z.RoleId equals y.RoleId
|
||||
where x.IsPost == true && x.UnitId == unitId && (y.RoleId == role1 || y.RoleId == role2 || y.RoleId == role3 || y.RoleId == role4)
|
||||
&& z.ProjectId == projectId
|
||||
&& z.ProjectId == projectId && z.IsPost == true
|
||||
orderby x.UserId
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
@@ -1099,18 +1076,16 @@ namespace BLL
|
||||
{
|
||||
List<Model.Sys_User> users = new List<Model.Sys_User>();
|
||||
var q1 = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where x.IsPost == true && x.UnitId == unitId1 && y.ProjectId == projectId
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where x.IsPost == true && x.UnitId == unitId1 && y.ProjectId == projectId && y.IsPost == true
|
||||
orderby x.UserId
|
||||
select x).ToList();
|
||||
users.AddRange(q1);
|
||||
if (!string.IsNullOrEmpty(unitId2))
|
||||
{
|
||||
var q2 = from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.IsPost == true
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.IsPost == true && y.IsPost == true
|
||||
select x;
|
||||
var q3 = (from x in q2 where unitId2.Split(',').Contains(x.UnitId) select x).ToList();
|
||||
users.AddRange(q3);
|
||||
@@ -1118,9 +1093,8 @@ namespace BLL
|
||||
if (!string.IsNullOrEmpty(unitId3))
|
||||
{
|
||||
var q4 = from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.IsPost == true
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId && x.IsPost == true && y.IsPost == true
|
||||
select x;
|
||||
var q5 = (from x in q4 where unitId3.Split(',').Contains(x.UnitId) select x).ToList();
|
||||
users.AddRange(q5);
|
||||
@@ -1157,11 +1131,10 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var user = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.Project_ProjectUnit
|
||||
on y.UnitId equals z.UnitId
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
join z in db.Project_ProjectUnit on y.UnitId equals z.UnitId
|
||||
where x.IsPost == true && y.ProjectId == projectId && z.UnitType == BLL.Const.ProjectUnitType_3
|
||||
&& y.IsPost == true
|
||||
orderby x.UserId
|
||||
select x).ToList();
|
||||
ListItem[] lis = new ListItem[user.Count()];
|
||||
@@ -1201,11 +1174,10 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var user = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.Project_ProjectUnit
|
||||
on y.UnitId equals z.UnitId
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
join z in db.Project_ProjectUnit on y.UnitId equals z.UnitId
|
||||
where x.IsPost == true && y.ProjectId == projectId && z.UnitType == BLL.Const.ProjectUnitType_4
|
||||
&& y.IsPost == true
|
||||
orderby x.UserId
|
||||
select x).ToList();
|
||||
ListItem[] lis = new ListItem[user.Count()];
|
||||
@@ -1246,11 +1218,10 @@ namespace BLL
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
list = (from x in db.Sys_User
|
||||
join y in db.Project_ProjectUser
|
||||
on x.UserId equals y.UserId
|
||||
join z in db.Project_ProjectUnit
|
||||
on x.UnitId equals z.UnitId
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
|
||||
where y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == unitType
|
||||
&& y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
@@ -1307,7 +1278,7 @@ namespace BLL
|
||||
{
|
||||
users = (from x in users
|
||||
join y in db.Project_ProjectUser on x.UserId equals y.UserId
|
||||
where y.ProjectId == projectId
|
||||
where y.ProjectId == projectId && y.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
@@ -1349,6 +1320,7 @@ namespace BLL
|
||||
where y.ProjectId == projectId && z.ProjectId == projectId
|
||||
where unitType == "" || unitTypes.Contains(z.UnitType)
|
||||
where unitId == "" || unitIds.Contains(z.UnitId)
|
||||
where y.IsPost == true
|
||||
orderby z.UnitType descending, x.UserName
|
||||
select x).ToList();
|
||||
}
|
||||
@@ -1446,7 +1418,7 @@ namespace BLL
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id部门获取赛鼎施工部用户下拉选项
|
||||
/// 根据单位Id部门获取施工部用户下拉选项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Sys_User> GetUserListByUnitIdDepartId(string unitId, string DepartId)
|
||||
@@ -1455,7 +1427,7 @@ namespace BLL
|
||||
{
|
||||
List<Model.Sys_User> list = new List<Model.Sys_User>();
|
||||
list = (from x in db.Sys_User
|
||||
where x.UnitId == unitId && x.DepartId == DepartId
|
||||
where x.UnitId == unitId && x.DepartId == DepartId && x.IsPost == true
|
||||
orderby x.UserName
|
||||
select x).ToList();
|
||||
return list;
|
||||
|
||||
Reference in New Issue
Block a user