20220906新增项目劳务人员查看页面、合同信息表、取用户接口修改

This commit is contained in:
2022-09-06 14:23:32 +08:00
parent c26e450d67
commit fc4f47dbab
39 changed files with 3809 additions and 307 deletions
+75 -41
View File
@@ -113,7 +113,7 @@ namespace BLL
{
var getUser = (from x in db.Person_Persons
join y in db.Sys_Role on x.RoleIds equals y.RoleId
where x.UnitId == unitId && x.IsPost == true && (strParam == null || x.PersonName.Contains(strParam))
where x.UnitId == unitId && x.IsPost == true && (strParam == null || x.PersonName.Contains(strParam)) && x.RoleIds != null
orderby x.PersonName
select new Model.BaseInfoItem { BaseInfoId = x.PersonId, BaseInfoName = x.PersonName, BaseInfoCode = x.Telephone }).ToList();
@@ -136,11 +136,10 @@ namespace BLL
List<string> roleList = Funs.GetStrListByStr(roleIds, ',');
if (!string.IsNullOrEmpty(projectId))
{
getDataList = (from x in db.Person_Persons
var getDatas = from x in db.Person_Persons
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == projectId && (x.UnitId == unitId || unitId == null) && y.States == Const.State_1
&& (roleIds == null || roleList.Contains(y.RoleIds)) && (strParam == null || x.PersonName.Contains(strParam))
select new Model.UserItem
where y.ProjectId == projectId && y.States == Const.State_1 && x.RoleIds != null
select new Model.UserItem
{
PersonId = x.PersonId,
Account = x.Account,
@@ -158,14 +157,29 @@ namespace BLL
Telephone = x.Telephone,
IsOffice = x.IsOffice,
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
};
if (!string.IsNullOrEmpty(unitId))
{
getDatas = getDatas.Where(x => x.UnitId == unitId);
}
if (!string.IsNullOrEmpty(roleIds))
{
getDatas = getDatas.Where(x => roleList.Contains(x.RoleId));
}
if (!string.IsNullOrEmpty(strParam))
{
getDatas = getDatas.Where(x => x.PersonName.Contains(strParam));
}
}).ToList();
if (getDatas.Count() > 0)
{
getDataList = getDatas.OrderBy(x => x.UnitName).ThenBy(x => x.PersonName).ToList();
}
}
else
{
getDataList = (from x in db.Person_Persons
where x.IsPost == true && (x.UnitId == unitId || unitId == null)
&& (roleIds == null || roleList.Contains(x.RoleIds)) && (strParam == null || x.PersonName.Contains(strParam))
var getPersons =from x in db.Person_Persons
where x.IsPost == true && x.RoleIds != null
select new Model.UserItem
{
PersonId = x.PersonId,
@@ -184,10 +198,28 @@ namespace BLL
Telephone = x.Telephone,
IsOffice = x.IsOffice,
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
}).ToList();
};
if (!string.IsNullOrEmpty(unitId))
{
getPersons = getPersons.Where(x => x.UnitId == unitId);
}
if (!string.IsNullOrEmpty(roleIds))
{
getPersons = getPersons.Where(x => roleList.Contains(x.RoleId));
}
if (!string.IsNullOrEmpty(strParam))
{
getPersons = getPersons.Where(x => x.PersonName.Contains(strParam));
}
if (getPersons.Count() > 0)
{
getDataList = getPersons.OrderBy(x => x.UnitName).ThenBy(x => x.PersonName).ToList();
}
}
return getDataList.OrderBy(x => x.UnitName).ThenBy(x => x.PersonName).ToList();
return getDataList;
}
}
@@ -209,7 +241,7 @@ namespace BLL
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
where y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == unitType && y.States == Const.State_1
&& (strParam == null || x.PersonName.Contains(strParam))
&& (strParam == null || x.PersonName.Contains(strParam)) && x.RoleIds != null
select new Model.UserItem
{
PersonId = x.PersonId,
@@ -241,7 +273,7 @@ namespace BLL
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
join z in db.Project_ProjectUnit on x.UnitId equals z.UnitId
where y.ProjectId == projectId && z.ProjectId == projectId && z.UnitType == unitType && y.States == Const.State_1
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Contains(item)
&& (strParam == null || x.PersonName.Contains(strParam)) && y.RoleIds.Contains(item) && x.RoleIds != null
select new Model.UserItem
{
PersonId = x.PersonId,
@@ -287,7 +319,7 @@ namespace BLL
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var user = from x in db.Person_Persons
where x.IsPost == true
where x.IsPost == true && x.RoleIds != null
select x;
return ObjectMapperManager.DefaultInstance.GetMapper<List<Model.Person_Persons>, List<Model.UserItem>>().Map(user.ToList());
}
@@ -416,31 +448,31 @@ namespace BLL
List<string> userList = Funs.GetStrListByStr(userIds, ',');
if (userList.Count() > 0)
{
var getDataLists = (from x in db.Person_Persons
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == projectId && y.States == Const.State_1
select new Model.UserItem
{
PersonId = x.PersonId,
Account = x.Account,
UserCode = x.JobNum,
Password = x.Password,
PersonName = x.PersonName,
RoleId = y.RoleIds,
RoleName = RoleService.getRoleNamesRoleIds(y.RoleIds),
UnitId = y.UnitId,
UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName,
LoginProjectId = y.ProjectId,
LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName,
IdentityCard = x.IdentityCard,
Email = x.Email,
Telephone = x.Telephone,
IsOffice = x.IsOffice,
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
});
var getDatas = (from x in db.Person_Persons
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
where y.ProjectId == projectId && y.States == Const.State_1 && x.RoleIds != null
select new Model.UserItem
{
PersonId = x.PersonId,
Account = x.Account,
UserCode = x.JobNum,
Password = x.Password,
PersonName = x.PersonName,
RoleId = y.RoleIds,
RoleName = RoleService.getRoleNamesRoleIds(y.RoleIds),
UnitId = y.UnitId,
UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName,
LoginProjectId = y.ProjectId,
LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName,
IdentityCard = x.IdentityCard,
Email = x.Email,
Telephone = x.Telephone,
IsOffice = x.IsOffice,
SignatureUrl = x.SignatureUrl.Replace('\\', '/'),
});
if (!string.IsNullOrEmpty(strParam))
{
getDataLists = getDataLists.Where(x => x.PersonName.Contains(strParam));
getDatas = getDatas.Where(x => x.PersonName.Contains(strParam));
}
string unitId = Const.UnitId_SEDIN;
@@ -448,19 +480,21 @@ namespace BLL
if (unitList.Count() == 1)
{
unitId = unitList.FirstOrDefault();
getDataList = getDataLists.Where(x => x.UnitId == unitId).ToList();
getDatas = getDatas.Where(x => x.UnitId == unitId);
}
else if (!unitList.Contains(unitId))
{
getDataList = getDataLists.Where(x => unitList.Contains(x.UnitId)).ToList();
getDatas = getDatas.Where(x => unitList.Contains(x.UnitId));
}
else
{
getDataList = getDataLists.Where(x => x.UnitId == unitId).ToList();
getDatas = getDatas.Where(x => x.UnitId == unitId);
}
getDataList = getDatas.OrderBy(x => x.UnitName).ThenBy(x => x.PersonName).ToList();
}
return getDataList.OrderBy(x => x.UnitName).ThenBy(x => x.PersonName).ToList();
return getDataList;
}
}
}