20220906新增项目劳务人员查看页面、合同信息表、取用户接口修改
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
using System.Web.Security;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -105,7 +107,25 @@ namespace BLL
|
||||
person.OutTime = string.Format("{0:yyyy-MM-dd}", getProjectPerson.OutTime);
|
||||
person.OutResult = getProjectPerson.OutResult;
|
||||
person.AuditorId = getProjectPerson.AuditorId;
|
||||
person.AuditorName = db.Person_Persons.First(z => z.PersonId == getProjectPerson.AuditorId).PersonName;
|
||||
var getAuPerson = db.Person_Persons.FirstOrDefault(z => z.PersonId == getProjectPerson.AuditorId);
|
||||
if (getAuPerson != null)
|
||||
{
|
||||
person.AuditorName = getAuPerson.PersonName;
|
||||
}
|
||||
else
|
||||
{
|
||||
var getAs = Person_PersonsService.GetUserListByProjectIdUnitIdRoleId(getProjectPerson.ProjectId, Const.UnitId_SEDIN, BLL.Const.HSSEManager + "," + BLL.Const.HSSEAssistantManager);
|
||||
if (getAs.Count() > 0)
|
||||
{
|
||||
var getA = getAs.FirstOrDefault();
|
||||
if (getA != null)
|
||||
{
|
||||
person.AuditorId = getA.PersonId;
|
||||
person.AuditorName = getA.PersonName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
person.AuditorDate = string.Format("{0:yyyy-MM-dd}", getProjectPerson.AuditorDate);
|
||||
person.AttachUrl2 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#2", null);
|
||||
person.AttachUrl3 = APIUpLoadFileService.getFileUrl(getProjectPerson.PersonId + "#3", null);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user