20220601 修改Global调用定时器、修改考勤导入列表及导入方法

This commit is contained in:
2022-06-01 14:27:42 +08:00
parent d33b007348
commit 31a7840cda
15 changed files with 365 additions and 210 deletions
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using FineUIPro;
namespace BLL
{
@@ -10,6 +11,72 @@ 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_Checking> getDataLists = from x in db.SitePerson_Checking
select x;
/// <summary>
/// 数据列表
/// </summary>
/// <param name="unitId"></param>
/// <param name="Grid1"></param>
/// <returns></returns>
public static IEnumerable getListData(string projectId, string unitId, string personName, string startDate, string endDate, Grid Grid1)
{
IQueryable<Model.SitePerson_Checking> getDataList = getDataLists.Where(x => x.ProjectId == projectId);
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
{
getDataList = getDataList.Where(x => x.UnitId == unitId);
}
if (!string.IsNullOrEmpty(personName))
{
getDataList = getDataList.Where(x => x.PersonName.Contains(personName));
}
if (!string.IsNullOrEmpty(startDate))
{
DateTime? startDateD = Funs.GetNewDateTime(startDate);
if (startDateD.HasValue)
{
getDataList = getDataList.Where(x => x.IntoOutTime >= startDateD.Value);
}
}
if (!string.IsNullOrEmpty(endDate))
{
DateTime? endDateD = Funs.GetNewDateTime(endDate);
if (endDateD.HasValue)
{
getDataList = getDataList.Where(x => x.IntoOutTime < endDateD.Value);
}
}
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.CheckingId, x.ProjectId, x.UnitId, x.UnitName, x.PersonId,
x.PersonName, x.CardNo, x.IdentityCard, x.WorkAreaId, x.WorkAreaName,
x.IntoOut, x.IntoOutTime, x.Address,
};
}
#endregion
/// <summary>
/// 根据人员考勤主键获取人员考勤管理信息
/// </summary>
@@ -30,12 +97,15 @@ namespace BLL
Model.SitePerson_Checking newPersonInfo = new Model.SitePerson_Checking
{
CheckingId = personInfo.CheckingId,
PersonId = personInfo.PersonId,
CardNo = personInfo.CardNo,
ProjectId = personInfo.ProjectId,
WorkAreaId = personInfo.WorkAreaId,
WorkAreaName = personInfo.WorkAreaName,
UnitId = personInfo.UnitId,
UnitName = personInfo.UnitName,
PersonId = personInfo.PersonId,
PersonName = personInfo.PersonName,
IdentityCard = personInfo.IdentityCard,
CardNo = personInfo.CardNo,
WorkAreaId = personInfo.WorkAreaId,
WorkAreaName = personInfo.WorkAreaName,
IntoOutTime = personInfo.IntoOutTime,
IntoOut = personInfo.IntoOut,
Address = personInfo.Address,
@@ -62,12 +132,14 @@ namespace BLL
Model.SitePerson_Checking newPersonInfo = db.SitePerson_Checking.FirstOrDefault(e => e.CheckingId == personInfo.CheckingId);
if (newPersonInfo != null)
{
newPersonInfo.CardNo = personInfo.CardNo;
newPersonInfo.UnitId = personInfo.UnitId;
newPersonInfo.UnitName = personInfo.UnitName;
newPersonInfo.PersonId = personInfo.PersonId;
newPersonInfo.ProjectId = personInfo.ProjectId;
newPersonInfo.WorkAreaId = personInfo.WorkAreaId;
newPersonInfo.WorkAreaName = personInfo.WorkAreaName;
newPersonInfo.PersonName = personInfo.PersonName;
newPersonInfo.CardNo = personInfo.CardNo;
newPersonInfo.IdentityCard = personInfo.IdentityCard;
newPersonInfo.WorkAreaId = personInfo.WorkAreaId;
newPersonInfo.WorkAreaName = personInfo.WorkAreaName;
newPersonInfo.IntoOutTime = personInfo.IntoOutTime;
newPersonInfo.IntoOut = personInfo.IntoOut;
newPersonInfo.Address = personInfo.Address;