增加考勤对接需要人员接口和考勤记录接口
This commit is contained in:
@@ -293,6 +293,133 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据条件获取项目人员信息(支持多条件过滤)
|
||||
/// <summary>
|
||||
/// 根据条件获取项目人员信息(支持多条件过滤)
|
||||
/// </summary>
|
||||
/// <param name="filter">查询过滤条件</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getPersonByFilter(Model.ProjectPersonInput filter)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var query = from x in db.View_SitePerson_Person
|
||||
select x;
|
||||
|
||||
// 添加过滤条件
|
||||
if (filter != null)
|
||||
{
|
||||
// 项目ID过滤
|
||||
if (!string.IsNullOrEmpty(filter.ProjectId))
|
||||
{
|
||||
query = query.Where(x => x.ProjectId == filter.ProjectId);
|
||||
}
|
||||
|
||||
// 人员ID过滤
|
||||
if (!string.IsNullOrEmpty(filter.PersonId))
|
||||
{
|
||||
query = query.Where(x => x.PersonId == filter.PersonId);
|
||||
}
|
||||
|
||||
// 项目人员ID过滤
|
||||
if (!string.IsNullOrEmpty(filter.SitePersonId))
|
||||
{
|
||||
query = query.Where(x => x.SitePersonId == filter.SitePersonId);
|
||||
}
|
||||
|
||||
// 姓名过滤(模糊查询)
|
||||
if (!string.IsNullOrEmpty(filter.PersonName))
|
||||
{
|
||||
query = query.Where(x => x.PersonName.Contains(filter.PersonName));
|
||||
}
|
||||
|
||||
// 身份证号过滤
|
||||
if (!string.IsNullOrEmpty(filter.IdentityCard))
|
||||
{
|
||||
query = query.Where(x => x.IdentityCard == filter.IdentityCard);
|
||||
}
|
||||
|
||||
// 卡号过滤
|
||||
if (!string.IsNullOrEmpty(filter.CardNo))
|
||||
{
|
||||
query = query.Where(x => x.CardNo == filter.CardNo);
|
||||
}
|
||||
|
||||
// 单位名称过滤(模糊查询)
|
||||
if (!string.IsNullOrEmpty(filter.UnitName))
|
||||
{
|
||||
query = query.Where(x => x.UnitName.Contains(filter.UnitName));
|
||||
}
|
||||
|
||||
// 班组名称过滤(模糊查询)
|
||||
if (!string.IsNullOrEmpty(filter.TeamGroupName))
|
||||
{
|
||||
query = query.Where(x => x.TeamGroupName.Contains(filter.TeamGroupName));
|
||||
}
|
||||
|
||||
// 岗位名称过滤(模糊查询)
|
||||
if (!string.IsNullOrEmpty(filter.WorkPostName))
|
||||
{
|
||||
query = query.Where(x => x.WorkPostName.Contains(filter.WorkPostName));
|
||||
}
|
||||
|
||||
// 性别过滤
|
||||
if (!string.IsNullOrEmpty(filter.Sex))
|
||||
{
|
||||
query = query.Where(x => x.Sex == filter.Sex);
|
||||
}
|
||||
|
||||
// 电话号码过滤(模糊查询)
|
||||
if (!string.IsNullOrEmpty(filter.Telephone))
|
||||
{
|
||||
query = query.Where(x => x.Telephone.Contains(filter.Telephone));
|
||||
}
|
||||
}
|
||||
|
||||
// 默认只返回在岗人员
|
||||
query = query.Where(x => x.States == Const.ProjectPersonStates_1);
|
||||
|
||||
var persons = from x in query orderby x.CardNo descending
|
||||
select new Model.PersonItem
|
||||
{
|
||||
PersonId = x.PersonId,
|
||||
SitePersonId = x.SitePersonId,
|
||||
CardNo = x.CardNo,
|
||||
PersonName = x.PersonName,
|
||||
SexName = x.SexName,
|
||||
Sex = x.Sex,
|
||||
IdentityCard = x.IdentityCard,
|
||||
Address = x.Address,
|
||||
ProjectId = x.ProjectId,
|
||||
ProjectCode = x.ProjectCode,
|
||||
ProjectName = x.ProjectName,
|
||||
UnitId = x.UnitId,
|
||||
UnitCode = x.UnitCode,
|
||||
UnitName = x.UnitName,
|
||||
TeamGroupId = x.TeamGroupId,
|
||||
TeamGroupName = x.TeamGroupName,
|
||||
WorkPostId = x.WorkPostId,
|
||||
WorkPostName = x.WorkPostName,
|
||||
InTime = string.Format("{0:yyyy-MM-dd}", x.InTime),
|
||||
OutTime = string.Format("{0:yyyy-MM-dd}", x.OutTime),
|
||||
OutResult = x.OutResult,
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
WorkAreaId = x.WorkAreaId,
|
||||
WorkAreaName = x.WorkAreaName,
|
||||
PostType = x.PostType,
|
||||
IsForeign = x.IsForeign.HasValue ? x.IsForeign : false,
|
||||
PersonType = x.PersonType,
|
||||
PersonTypeName = x.PersonType == "2" ? "外聘" : (x.PersonType == "3" ? "第三方" : "员工"),
|
||||
PostTypeName = db.Sys_Const.FirstOrDefault(z => z.GroupId == ConstValue.Group_PostType && z.ConstValue == x.PostType).ConstText,
|
||||
};
|
||||
|
||||
return persons.ToList();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取在岗、离岗、待审人员列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
|
||||
Reference in New Issue
Block a user