Merge branch 'master' of https://gitee.com/frane-yang/SGGL_SeDin_New
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
using System.Linq;
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -9,6 +13,62 @@ namespace BLL
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region 获取安全巡检列表信息
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.SitePerson_Person> getDataLists = from x in db.SitePerson_Person
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="personName"></param>
|
||||
/// <param name="Grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projectId, string personName, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.SitePerson_Person> getDataList = getDataLists;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(personName))
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.PersonName.Contains(personName));
|
||||
}
|
||||
|
||||
count = getDataList.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
x.ProjectId,
|
||||
ProjectName = db.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName,
|
||||
x.UnitId,
|
||||
UnitName = db.Base_Unit.First(p => p.UnitId == x.UnitId).UnitName,
|
||||
x.SitePersonId,
|
||||
x.PersonId,
|
||||
x.CardNo,
|
||||
x.PersonName,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取体检管理
|
||||
/// </summary>
|
||||
|
||||
@@ -560,7 +560,7 @@ namespace BLL
|
||||
select x;
|
||||
if (listUnitIds.Count() > 0)
|
||||
{
|
||||
getProjectPersons = getProjectPersons.Where(x => listUnitIds.Contains(x.UnitId));
|
||||
getProjectPersons = getProjectPersons.Where(x => listUnitIds.Contains(x.UnitId)).OrderBy(x => x.PersonName);
|
||||
}
|
||||
if (listRoles.Count() > 0)
|
||||
{
|
||||
@@ -579,6 +579,7 @@ namespace BLL
|
||||
{
|
||||
list = (from x in getProjectPersons
|
||||
join y in db.Person_Persons on x.PersonId equals y.PersonId
|
||||
orderby x.PersonName
|
||||
select y).ToList();
|
||||
}
|
||||
}
|
||||
@@ -586,11 +587,11 @@ namespace BLL
|
||||
{
|
||||
var getPersons = from x in db.Person_Persons
|
||||
where x.PersonId != Const.hfnbdId && x.PersonId != Const.sedinId
|
||||
&& (x.IsPost == true || !x.IsPost.HasValue) && x.Account != null
|
||||
&& (x.IsPost == true || !x.IsPost.HasValue) && x.Account != null
|
||||
select x;
|
||||
if (listUnitIds.Count() > 0)
|
||||
{
|
||||
getPersons = getPersons.Where(x => listUnitIds.Contains(x.UnitId));
|
||||
getPersons = getPersons.Where(x => listUnitIds.Contains(x.UnitId)).OrderBy(x=>x.PersonName);
|
||||
}
|
||||
if (listRoles.Count() > 0)
|
||||
{
|
||||
@@ -605,11 +606,11 @@ namespace BLL
|
||||
}
|
||||
else
|
||||
{
|
||||
list = getPersons.ToList();
|
||||
list = getPersons.OrderBy(x => x.PersonName).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
return list.OrderBy(x => x.PersonName).ToList();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
namespace BLL
|
||||
{
|
||||
using Model;
|
||||
using NPOI.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -361,17 +362,20 @@
|
||||
group x by x.ProjectId into g
|
||||
select new { g.First().ProjectId, count = g.Count() }).Distinct();
|
||||
|
||||
List<Model.Base_Project> getList = new List<Base_Project>();
|
||||
|
||||
if (getProjects.Count() > 0)
|
||||
{
|
||||
getList = (from x in getProjects
|
||||
join y in pcount on x.ProjectId equals y.ProjectId into PP
|
||||
from p in PP.DefaultIfEmpty()
|
||||
orderby p.count descending
|
||||
select x).ToList();
|
||||
var getList = (from x in getProjects
|
||||
join y in pcount on x.ProjectId equals y.ProjectId into PP
|
||||
from p in PP.DefaultIfEmpty()
|
||||
orderby p.count descending
|
||||
select x);
|
||||
return getList.ToList();
|
||||
}
|
||||
|
||||
return getList;
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user