This commit is contained in:
杨红卫 2021-07-20 16:02:27 +08:00
parent b3d23a52d9
commit 7700a66999
16 changed files with 178 additions and 90 deletions

View File

@ -0,0 +1,45 @@
ALTER VIEW [dbo].[View_SitePerson_Checking]
AS
/*ÈËÔ±¿¼ÇÚÊÓͼ*/
SELECT ch.CheckingId,person.CardNo,ch.ProjectId,person.IdentityCard,ch.WorkAreaId,ch.IntoOutTime,ch.IntoOut,
ch.[Address],ch.WorkAreaName,person.PersonName,person.UnitId,unit.UnitName,ch.States
from dbo.SitePerson_Checking ch
left join dbo.SitePerson_Person person on ch.PersonId=person.PersonId
left join dbo.Base_Unit unit on person.UnitId=unit.UnitId
GO
UPDATE SitePerson_Checking SET IntoOut=0 WHERE IntoOut !=1
GO
/****** Object: Index [NonClusteredIndex-20210720-112756] Script Date: 2021/7/20 11:31:47 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20210720-112756] ON [dbo].[t_d_facerecord]
(
[ProjectId] ASC,
[EmployNO] ASC,
[RoleID] ASC,
[DateTimeRecord] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object: Index [NonClusteredIndex-20210720-113607] Script Date: 2021/7/20 11:36:59 ******/
CREATE NONCLUSTERED INDEX [NonClusteredIndex-20210720-113607] ON [dbo].[t_d_EmployInOutRecord]
(
[ProjectId] ASC,
[RecordDate] ASC,
[IDCardNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object: Index [SitePerson_PersonInOut_PersonIdChangeTime] Script Date: 2021/7/20 11:38:07 ******/
DROP INDEX [SitePerson_PersonInOut_PersonIdChangeTime] ON [dbo].[SitePerson_PersonInOut]
GO
/****** Object: Index [SitePerson_PersonInOut_PersonIdChangeTime] Script Date: 2021/7/20 11:38:07 ******/
CREATE NONCLUSTERED INDEX [SitePerson_PersonInOut_PersonIdChangeTime] ON [dbo].[SitePerson_PersonInOut]
(
[ProjectId] ASC,
[PersonId] ASC,
[ChangeTime] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

View File

@ -380,7 +380,7 @@ GO
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('12F7123B-C2ED-4011-9859-83260AC91F09','现场人员考勤管理','HSSE/SitePerson/PersonInfo.aspx',50,'EE260447-028F-46AF-8864-9A5DC9DAA5BD','Menu_HSSE',0,1,1)
VALUES('12F7123B-C2ED-4011-9859-83260AC91F09','现场人员手动考勤','HSSE/SitePerson/PersonInfo.aspx',50,'EE260447-028F-46AF-8864-9A5DC9DAA5BD','Menu_HSSE',0,1,1)
GO
--
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)

View File

@ -0,0 +1,68 @@
using EmitMapper;
using System;
using System.Collections.Generic;
using System.Linq;
namespace BLL
{
public static class APIDoorServerService
{
/// <summary>
/// 保存 出入记录
/// </summary>
/// <param name="projectId">项目ID</param>
/// <param name="idCard">身份证号码</param>
/// <param name="isIn">1进0出</param>
/// <param name="changeTime">进出时间</param>
/// <param name="changeTime">进出方式</param>
public static void SaveDoorInOutRecord(string projectId, string idCard, int isIn, DateTime changeTime, string Intype)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
int maxId = 0;
var getmax = db.T_d_facerecord.Where(x => x.ProjectId == projectId && x.RoleID == Intype).Select(x => x.ID);
if (getmax.Count() > 0)
{
maxId = getmax.Max() + 1;
}
string name = string.Empty;
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == idCard && x.ProjectId ==projectId);
if (getPerson != null)
{
name = getPerson.PersonName;
}
Model.T_d_facerecord newFacerecord = new Model.T_d_facerecord()
{
NewID = SQLHelper.GetNewID(),
ProjectId = projectId,
ID = maxId + 1,
EmployName = name,
EmployNO = idCard,
RoleID = Intype,
DateTimeRecord = changeTime,
RecordDes = Intype,
InOrOut = (isIn == 1 ? "进门" : "出门"),
};
db.T_d_facerecord.InsertOnSubmit(newFacerecord);
db.SubmitChanges();
///// 根据出入记录 写入考勤记录
Model.t_d_facerecordItem facerecord = new Model.t_d_facerecordItem
{
ID = maxId + 1,
EmployName = name,
IDCardNo = idCard,
EmployNO = idCard,
ProjectId = projectId,
RoleID = Intype,
DateTimeRecord = changeTime,
RecordDes = Intype,
InOrOut = (isIn == 1 ? "进门" : "出门"),
};
DoorServerService.InsertEmployInOutRecord(facerecord);
}
APIPersonService.getPersonInOut(projectId, idCard, isIn, changeTime);
}
}
}

View File

@ -91,6 +91,7 @@
<Compile Include="API\APIProjectService.cs" />
<Compile Include="API\APIUnitService.cs" />
<Compile Include="API\APIUpLoadFileService.cs" />
<Compile Include="API\APIDoorServerService.cs" />
<Compile Include="API\APIUserService.cs" />
<Compile Include="API\HJGL\APIHotProcessHardService.cs" />
<Compile Include="API\HJGL\APINDETrustService.cs" />

View File

@ -27,9 +27,9 @@ namespace BLL
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;
private static IQueryable<Model.T_d_validcardevent> qq1 = from x in db.T_d_validcardevent
orderby x.RecordDateTime descending
select x;
/// <summary>
/// 获取分页列表
@ -42,7 +42,7 @@ namespace BLL
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));
@ -55,8 +55,8 @@ namespace BLL
{
q1 = from x in q1
join y in db.SitePerson_Person on x.IDCardNo equals y.IdentityCard
where y.UnitId == unitId
select x;
where y.UnitId == unitId
select x;
}
if (!string.IsNullOrEmpty(name))
{
@ -75,14 +75,14 @@ namespace BLL
x.ProjectId,
x.EmployName,
x.DepartmentID,
DepartName=x.DepartmentName,
DepartName = x.DepartmentName,
x.AreaID,
x.AreaName,
x.EmployNO,
CardID=x.CardNO,
DateTimeRecord=x.RecordDateTime,
RecordDes=x.RecordAll,
InOrOut=(x.InOrOut ==2? "出门" : "进门"),
CardID = x.CardNO,
DateTimeRecord = x.RecordDateTime,
RecordDes = x.RecordAll,
InOrOut = (x.InOrOut == 2 ? "出门" : "进门"),
};
}
else
@ -92,9 +92,13 @@ namespace BLL
{
q = q.Where(e => e.RoleID == "微信端");
}
else if (type == "3")
{
q = q.Where(e => e.RoleID == "手动");
}
else
{
q = q.Where(e => e.RoleID != "微信端");
q = q.Where(e => e.RoleID == "白名单");
}
if (!string.IsNullOrEmpty(startDate))
{
@ -107,9 +111,9 @@ namespace BLL
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;
join y in db.SitePerson_Person on x.EmployNO equals y.IdentityCard
where y.UnitId == unitId
select x;
}
if (!string.IsNullOrEmpty(name))
{
@ -135,7 +139,7 @@ namespace BLL
x.CardID,
x.DateTimeRecord,
x.RecordDes,
x.InOrOut,
x.InOrOut,
};
}
}

View File

@ -44,6 +44,12 @@ namespace BLL
db.SitePerson_Checking.InsertOnSubmit(newPersonInfo);
db.SubmitChanges();
if (!string.IsNullOrEmpty(personInfo.ProjectId) && !string.IsNullOrEmpty(personInfo.IdentityCard) && personInfo.IntoOutTime.HasValue)
{
int inOut = personInfo.IntoOut == "1" ? 1 : 0;
APIDoorServerService.SaveDoorInOutRecord(personInfo.ProjectId, personInfo.IdentityCard, inOut, personInfo.IntoOutTime.Value, "手动");
}
}
/// <summary>
@ -53,18 +59,21 @@ namespace BLL
public static void UpdatePersonInfo(Model.SitePerson_Checking personInfo)
{
Model.SGGLDB db = Funs.DB;
Model.SitePerson_Checking newPersonInfo = db.SitePerson_Checking.First(e => e.CheckingId == personInfo.CheckingId);
newPersonInfo.CardNo = personInfo.CardNo;
newPersonInfo.PersonId = personInfo.PersonId;
newPersonInfo.ProjectId = personInfo.ProjectId;
newPersonInfo.WorkAreaId = personInfo.WorkAreaId;
newPersonInfo.WorkAreaName = personInfo.WorkAreaName;
newPersonInfo.IdentityCard = personInfo.IdentityCard;
newPersonInfo.IntoOutTime = personInfo.IntoOutTime;
newPersonInfo.IntoOut = personInfo.IntoOut;
newPersonInfo.Address = personInfo.Address;
Model.SitePerson_Checking newPersonInfo = db.SitePerson_Checking.FirstOrDefault(e => e.CheckingId == personInfo.CheckingId);
if (newPersonInfo != null)
{
newPersonInfo.CardNo = personInfo.CardNo;
newPersonInfo.PersonId = personInfo.PersonId;
newPersonInfo.ProjectId = personInfo.ProjectId;
newPersonInfo.WorkAreaId = personInfo.WorkAreaId;
newPersonInfo.WorkAreaName = personInfo.WorkAreaName;
newPersonInfo.IdentityCard = personInfo.IdentityCard;
newPersonInfo.IntoOutTime = personInfo.IntoOutTime;
newPersonInfo.IntoOut = personInfo.IntoOut;
newPersonInfo.Address = personInfo.Address;
db.SubmitChanges();
db.SubmitChanges();
}
}
/// <summary>

View File

@ -49,11 +49,12 @@
</f:Toolbar>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:RadioButtonList runat="server" ID="rbCheckType" Width="210px" LabelWidth="0px"
<f:RadioButtonList runat="server" ID="rbCheckType" Width="300px" LabelWidth="0px"
AutoPostBack="true" OnSelectedIndexChanged="btnSearch_Click">
<f:RadioItem Value="0" Text="人脸" Selected="true" />
<f:RadioItem Value="1" Text="刷卡" />
<f:RadioItem Value="2" Text="微信端" />
<f:RadioItem Value="3" Text="手动" />
</f:RadioButtonList>
</Items>
</f:Toolbar>

View File

@ -77,7 +77,7 @@
SortField="EmployName" FieldType="String" HeaderText="姓名" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="IDCardNo" DataField="IDCardNo"
<f:RenderField Width="170px" ColumnID="IDCardNo" DataField="IDCardNo"
SortField="IDCardNo" FieldType="String" HeaderText="身份证" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -64,7 +64,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
this.drpUnit.Enabled = false;
}
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddMonths(-1));
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1));
// 绑定表格
BindGrid();
}
@ -307,18 +307,14 @@ namespace FineUIPro.Web.HSSE.SitePerson
{
if (intoOut != null)
{
if (intoOut.ToString() == "True")
if (intoOut.ToString() == "1")
{
return "进场";
}
else if (intoOut.ToString() == "False")
else
{
return "出场";
}
else
{
return "";
}
}
return "";
}

View File

@ -70,12 +70,12 @@
</f:Grid>
</PopPanel>
</f:DropDownBox>
<f:TextBox ID="txtIdCard" Label="身份证号码" Readonly="true" runat="server" ></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="40% 25% 35%">
<Items>
<f:TextBox ID="txtWorkArea" runat="server" Label="单位工程" MaxLength="100" ShowRedStar="true"
Required="true" LabelAlign="Right">
<f:TextBox ID="txtWorkArea" runat="server" Label="单位工程" MaxLength="100" LabelAlign="Right">
</f:TextBox>
<f:DropDownList ID="drpWorkArea" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drpWorkArea_SelectedIndexChanged">
</f:DropDownList>
@ -95,7 +95,7 @@
</f:Label>--%>
<f:DropDownList ID="drpType" runat="server" Label="进出时间">
<f:ListItem Value="1" Text="入场时间" />
<f:ListItem Value="2" Text="出场时间" />
<f:ListItem Value="0" Text="出场时间" />
</f:DropDownList>
<f:DatePicker ID="txtTime" runat="server" >
</f:DatePicker>

View File

@ -102,6 +102,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
var person = BLL.PersonService.GetPersonById(this.drpPersonId.Value);
if (person != null)
{
this.txtIdCard.Text = person.IdentityCard;
if (!string.IsNullOrEmpty(person.WorkAreaId))
{
this.drpWorkArea.SelectedValue = person.WorkAreaId;
@ -198,6 +199,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
Model.SitePerson_Checking personInfo = new Model.SitePerson_Checking
{
PersonId = this.drpPersonId.Value,
IdentityCard = this.txtIdCard.Text,
ProjectId = this.ProjectId,
WorkAreaName = this.txtWorkArea.Text.Trim(),
Address = this.txtAddress.Text.Trim()
@ -215,8 +217,8 @@ namespace FineUIPro.Web.HSSE.SitePerson
}
else
{
string newKeyID = SQLHelper.GetNewID(typeof(Model.SitePerson_Checking));
personInfo.CheckingId = newKeyID;
this.CheckingId = SQLHelper.GetNewID();
personInfo.CheckingId = this.CheckingId;
BLL.SitePerson_CheckingService.AddPersonInfo(personInfo);
BLL.LogService.AddSys_Log(this.CurrUser, personInfo.CardNo, personInfo.CheckingId, BLL.Const.PersonalInfoMenuId, BLL.Const.BtnDelete);
}

View File

@ -120,6 +120,15 @@ namespace FineUIPro.Web.HSSE.SitePerson {
/// </remarks>
protected global::FineUIPro.TextBox txtIdentityCard;
/// <summary>
/// txtIdCard 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtIdCard;
/// <summary>
/// txtWorkArea 控件。
/// </summary>

View File

@ -756,54 +756,7 @@ namespace WebAPI.Controllers
var responeData = new Model.ResponeData();
try
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
int maxId = 0;
var getmax = db.T_d_facerecord.Where(x => x.ProjectId == projectId && x.RoleID == "白名单").Select(x => x.ID);
if (getmax.Count() > 0)
{
maxId = getmax.Max() + 1;
}
string name = string.Empty;
string cardNo = string.Empty;
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == idCard);
if (getPerson != null)
{
name = getPerson.PersonName;
cardNo = getPerson.CardNo;
}
Model.T_d_facerecord newFacerecord = new Model.T_d_facerecord()
{
NewID = SQLHelper.GetNewID(),
ProjectId = projectId,
ID = maxId + 1,
EmployName = name,
EmployNO = idCard,
RoleID = "白名单",
DateTimeRecord = changeTime,
RecordDes = "白名单:允许通行",
InOrOut = (isIn == 1 ? "进门" : "出门"),
};
db.T_d_facerecord.InsertOnSubmit(newFacerecord);
db.SubmitChanges();
///// 根据出入记录 写入考勤记录
Model.t_d_facerecordItem facerecord = new Model.t_d_facerecordItem
{
ID = maxId + 1,
EmployName = name,
IDCardNo = idCard,
EmployNO = idCard,
ProjectId = projectId,
RoleID = "白名单",
DateTimeRecord = changeTime,
RecordDes = "白名单:允许通行",
InOrOut = (isIn == 1 ? "进门" : "出门"),
};
DoorServerService.InsertEmployInOutRecord(facerecord);
}
APIPersonService.getPersonInOut(projectId, idCard, isIn, changeTime);
APIDoorServerService.SaveDoorInOutRecord(projectId, idCard, isIn, changeTime, "白名单");
}
catch (Exception ex)
{