20210618
This commit is contained in:
@@ -254,6 +254,7 @@
|
||||
<Compile Include="CQMS\WBS\WorkPackageProjectService.cs" />
|
||||
<Compile Include="CQMS\WBS\WorkPackageService.cs" />
|
||||
<Compile Include="DigData\HSEDataCollectService.cs" />
|
||||
<Compile Include="DoorServer\InOutService.cs" />
|
||||
<Compile Include="DoorServer\DoorServerService.cs" />
|
||||
<Compile Include="DropListService.cs" />
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
|
||||
@@ -4683,6 +4683,20 @@ namespace BLL
|
||||
public const string UndergroundPipeCompletionMenuId = "C7037A5D-D8A6-4C1C-A5B8-2083C31C0A7B";
|
||||
#endregion
|
||||
|
||||
#region 项目考勤
|
||||
/// <summary>
|
||||
/// 同步设置
|
||||
/// </summary>
|
||||
public const string ServerRealNameSynchroSetMenuId = "ECC3A343-A0CC-48BB-BA81-904FE2BE8D9B";
|
||||
/// <summary>
|
||||
/// 基础数据
|
||||
/// </summary>
|
||||
public const string ServerRealNameBasicDataMenuId = "86369F0D-0E01-4206-BF62-60A29B880EF5";
|
||||
/// <summary>
|
||||
/// 同步记录
|
||||
/// </summary>
|
||||
public const string ServerRealNameSynchroRecordMenuId = "46B15547-BB67-43F8-86AE-D8DB8928EFE4";
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 不参与规则设置菜单
|
||||
/// </summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Text;
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 事故类型
|
||||
/// 考勤
|
||||
/// </summary>
|
||||
public static class DoorServerService
|
||||
{
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 考勤
|
||||
/// </summary>
|
||||
public static class InOutService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.T_d_facerecord> qq = from x in db.T_d_facerecord
|
||||
orderby x.DateTimeRecord descending
|
||||
select x;
|
||||
private static IQueryable<Model.T_d_validcardevent> qq1 = from x in db.T_d_validcardevent
|
||||
orderby x.RecordDateTime descending
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projectId, string type, string unitId, string name, string startDate, string endDate, int PageIndex, int PageSize)
|
||||
{
|
||||
if (type == "1")
|
||||
{
|
||||
IQueryable<Model.T_d_validcardevent> q1 = qq1.Where(x => x.ProjectId == projectId);
|
||||
|
||||
if (!string.IsNullOrEmpty(startDate))
|
||||
{
|
||||
q1 = q1.Where(e => e.RecordDateTime >= Funs.GetNewDateTime(startDate));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(endDate))
|
||||
{
|
||||
q1 = q1.Where(e => e.RecordDateTime <= Funs.GetNewDateTime(endDate));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
q1 = from x in q1
|
||||
join y in db.SitePerson_Person on x.IDCardNo equals y.IdentityCard
|
||||
where y.UnitId == unitId
|
||||
select x;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
q1 = q1.Where(e => e.EmployName.Contains(name));
|
||||
}
|
||||
count = q1.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return from x in q1.Skip(PageSize * PageIndex).Take(PageSize)
|
||||
select new
|
||||
{
|
||||
x.NewID,
|
||||
x.ProjectId,
|
||||
x.EmployName,
|
||||
x.DepartmentID,
|
||||
DepartName = x.DepartmentName,
|
||||
x.AreaID,
|
||||
x.AreaName,
|
||||
x.EmployNO,
|
||||
CardID = x.CardNO,
|
||||
DateTimeRecord = x.RecordDateTime,
|
||||
RecordDes = x.RecordAll,
|
||||
InOrOut = (x.InOrOut == 2 ? "出门" : "进门"),
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
IQueryable<Model.T_d_facerecord> q = qq.Where(x => x.ProjectId == projectId);
|
||||
if (type == "2")
|
||||
{
|
||||
q = q.Where(e => e.RoleID == "微信端");
|
||||
}
|
||||
else
|
||||
{
|
||||
q = q.Where(e => e.RoleID != "微信端");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(startDate))
|
||||
{
|
||||
q = q.Where(e => e.DateTimeRecord >= Funs.GetNewDateTime(startDate));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(endDate))
|
||||
{
|
||||
q = q.Where(e => e.DateTimeRecord <= Funs.GetNewDateTime(endDate));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
q = from x in q
|
||||
join y in db.SitePerson_Person on x.EmployNO equals y.IdentityCard
|
||||
where y.UnitId == unitId
|
||||
select x;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
q = q.Where(e => e.EmployName.Contains(name));
|
||||
}
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return from x in q.Skip(PageSize * PageIndex).Take(PageSize)
|
||||
select new
|
||||
{
|
||||
x.NewID,
|
||||
x.ProjectId,
|
||||
x.EmployName,
|
||||
x.DepartmentID,
|
||||
x.DepartName,
|
||||
x.AreaID,
|
||||
x.AreaName,
|
||||
x.EmployNO,
|
||||
x.CardID,
|
||||
x.DateTimeRecord,
|
||||
x.RecordDes,
|
||||
x.InOrOut,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -681,7 +681,7 @@ namespace BLL
|
||||
foreach (var item in getUnit)
|
||||
{
|
||||
item.RealNamePushTime = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user