公司级增加项目筛选,开车看板修改
This commit is contained in:
@@ -167,6 +167,37 @@ namespace BLL
|
||||
return getSiteInOutList;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Model.PageDataPersonInOutItem> getPersonNumByCompany(DateTime dateValue,string[] pids)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<Model.PageDataPersonInOutItem> getSiteInOutList = new List<Model.PageDataPersonInOutItem>();
|
||||
var getDayAll = from x in db.SitePerson_PersonInOutNow
|
||||
join y in db.SitePerson_Person on x.PersonId equals y.PersonId
|
||||
join z in db.Base_WorkPost on y.WorkPostId equals z.WorkPostId
|
||||
where x.ChangeTime.Value.Year == dateValue.Year && x.ChangeTime.Value.Month == dateValue.Month
|
||||
&& x.ChangeTime.Value.Day == dateValue.Day && pids.Contains(x.ProjectId)
|
||||
select new { x.PersonId, x.ChangeTime, x.IsIn, z.PostType };
|
||||
if (getDayAll.Count() > 0)
|
||||
{
|
||||
var getInMaxs = from x in getDayAll
|
||||
group x by x.PersonId into g
|
||||
select new Model.PageDataPersonInOutItem
|
||||
{
|
||||
PersonId = g.First().PersonId,
|
||||
ChangeTime = g.Max(x => x.ChangeTime),
|
||||
IsIn = g.First().IsIn,
|
||||
PostType = g.First().PostType
|
||||
};
|
||||
if (getInMaxs.Count() > 0)
|
||||
{
|
||||
getSiteInOutList = getInMaxs.Where(x => x.IsIn == true).ToList();
|
||||
}
|
||||
}
|
||||
return getSiteInOutList;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,12 +251,23 @@
|
||||
/// 获取项目下拉选项
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_Project> GetAllProjectDropDownList()
|
||||
public static List<Model.Base_Project> GetAllProjectDropDownList(string[] pids = null)
|
||||
{
|
||||
var list = (from x in Funs.DB.Base_Project
|
||||
orderby x.ProjectCode descending
|
||||
select x).ToList();
|
||||
return list;
|
||||
if (pids == null)
|
||||
{
|
||||
var list = (from x in Funs.DB.Base_Project
|
||||
orderby x.ProjectCode descending
|
||||
select x).ToList();
|
||||
return list;
|
||||
}
|
||||
else {
|
||||
var list = (from x in Funs.DB.Base_Project
|
||||
where pids.Contains(x.ProjectId)
|
||||
orderby x.ProjectCode descending
|
||||
select x).ToList();
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -669,5 +680,27 @@
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
#region 加载公司级别项目
|
||||
public static List<Model.Base_Project> GetUnEndProjectByUserIdDropDownList(string projectState,
|
||||
string projectName = null, string projectCode = null) {
|
||||
IQueryable<Model.Base_Project> projects = (from x in Funs.DB.Base_Project
|
||||
where x.ProjectState == projectState
|
||||
orderby x.ProjectCode descending
|
||||
select x);
|
||||
if (!string.IsNullOrEmpty(projectName))
|
||||
{
|
||||
projects = from x in projects where x.ProjectName.Contains(projectName) select x;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(projectCode))
|
||||
{
|
||||
projects = from x in projects where x.ProjectCode.Contains(projectCode) select x;
|
||||
}
|
||||
return (from x in projects
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
select x).Distinct().ToList();
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -686,36 +686,67 @@ namespace BLL
|
||||
/// 获取企业负责人带班检查次数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetCompanyLeadShiftCheckNum()
|
||||
public static int GetCompanyLeadShiftCheckNum(string[] pids=null)
|
||||
{
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
if (pids == null)
|
||||
{
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "1" && x.CheckDate > Const.DtmarkTime
|
||||
&& pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取企业综合检查次数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetCompanyComprehensiveCheckNum()
|
||||
public static int GetCompanyComprehensiveCheckNum(string[] pids = null)
|
||||
{
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
if (pids == null) {
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "2" && x.CheckDate > Const.DtmarkTime
|
||||
&& pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取企业专项检查次数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetCompanySpecialCheckNum()
|
||||
public static int GetCompanySpecialCheckNum(string[] pids = null)
|
||||
{
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
if (pids == null)
|
||||
{
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
var result = (from x in Funs.DB.Supervise_SuperviseCheckReport
|
||||
where x.CheckType == "3" && x.CheckDate > Const.DtmarkTime
|
||||
&& pids.Contains(x.ProjectId)
|
||||
select x).Count();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user