1、优化考勤记录导入,优化出入记录写实名制推送记录表。2、优化考试答题,交卷接口方法。3、优化写入培训记录。
This commit is contained in:
@@ -280,80 +280,97 @@ namespace BLL
|
||||
{
|
||||
try
|
||||
{
|
||||
/// 清理出入记录
|
||||
var getRecords = from x in Funs.DB.T_d_facerecord where x.DateTimeRecord.Value.AddDays(1) < DateTime.Now select x;
|
||||
if (getRecords.Count() > 0)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
foreach (var item in getRecords)
|
||||
/// 清理实名制未同步历史数据
|
||||
var getLastList = from x in db.SitePerson_PersonInOutNow
|
||||
where x.ChangeTime <= DateTime.Now.AddHours(-48)
|
||||
select x;
|
||||
if (getLastList.Count() > 0)
|
||||
{
|
||||
if (item.InOrOut == "进门")
|
||||
db.SitePerson_PersonInOutNow.DeleteAllOnSubmit(getLastList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
/// 清理出入记录
|
||||
var getRecords = from x in db.T_d_facerecord where x.DateTimeRecord.Value.AddDays(1) < DateTime.Now select x;
|
||||
if (getRecords.Count() > 0)
|
||||
{
|
||||
foreach (var item in getRecords)
|
||||
{
|
||||
var getDelRecordsIn = from x in Funs.DB.T_d_facerecord
|
||||
where x.ProjectId == item.ProjectId && x.EmployNO == item.EmployNO && x.InOrOut == item.InOrOut
|
||||
&& x.DateTimeRecord.Value.Year == item.DateTimeRecord.Value.Year
|
||||
&& x.DateTimeRecord.Value.Month == item.DateTimeRecord.Value.Month
|
||||
&& x.DateTimeRecord.Value.Day == item.DateTimeRecord.Value.Day
|
||||
&& x.DateTimeRecord > item.DateTimeRecord
|
||||
select x;
|
||||
if (getDelRecordsIn.Count() > 0)
|
||||
if (item.InOrOut == "进门")
|
||||
{
|
||||
Funs.DB.T_d_facerecord.DeleteAllOnSubmit(getDelRecordsIn);
|
||||
Funs.DB.SubmitChanges();
|
||||
var getDelRecordsIn = from x in db.T_d_facerecord
|
||||
where x.ProjectId == item.ProjectId && x.EmployNO == item.EmployNO && x.InOrOut == item.InOrOut
|
||||
&& x.DateTimeRecord.Value.Year == item.DateTimeRecord.Value.Year
|
||||
&& x.DateTimeRecord.Value.Month == item.DateTimeRecord.Value.Month
|
||||
&& x.DateTimeRecord.Value.Day == item.DateTimeRecord.Value.Day
|
||||
&& x.DateTimeRecord > item.DateTimeRecord
|
||||
select x;
|
||||
if (getDelRecordsIn.Count() > 0)
|
||||
{
|
||||
db.T_d_facerecord.DeleteAllOnSubmit(getDelRecordsIn);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDelRecordsOut = from x in Funs.DB.T_d_facerecord
|
||||
where x.ProjectId == item.ProjectId && x.EmployNO == item.EmployNO && x.InOrOut == item.InOrOut
|
||||
&& x.DateTimeRecord.Value.Year == item.DateTimeRecord.Value.Year
|
||||
&& x.DateTimeRecord.Value.Month == item.DateTimeRecord.Value.Month
|
||||
&& x.DateTimeRecord.Value.Day == item.DateTimeRecord.Value.Day
|
||||
&& x.DateTimeRecord < item.DateTimeRecord
|
||||
select x;
|
||||
if (getDelRecordsOut.Count() > 0)
|
||||
else
|
||||
{
|
||||
Funs.DB.T_d_facerecord.DeleteAllOnSubmit(getDelRecordsOut);
|
||||
Funs.DB.SubmitChanges();
|
||||
var getDelRecordsOut = from x in db.T_d_facerecord
|
||||
where x.ProjectId == item.ProjectId && x.EmployNO == item.EmployNO && x.InOrOut == item.InOrOut
|
||||
&& x.DateTimeRecord.Value.Year == item.DateTimeRecord.Value.Year
|
||||
&& x.DateTimeRecord.Value.Month == item.DateTimeRecord.Value.Month
|
||||
&& x.DateTimeRecord.Value.Day == item.DateTimeRecord.Value.Day
|
||||
&& x.DateTimeRecord < item.DateTimeRecord
|
||||
select x;
|
||||
if (getDelRecordsOut.Count() > 0)
|
||||
{
|
||||
db.T_d_facerecord.DeleteAllOnSubmit(getDelRecordsOut);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var getVRecords = from x in Funs.DB.T_d_validcardevent
|
||||
where x.RecordDateTime.Value.AddDays(1) < DateTime.Now
|
||||
select x;
|
||||
if (getVRecords.Count() > 0)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
foreach (var item in getVRecords)
|
||||
var getVRecords = from x in db.T_d_validcardevent
|
||||
where x.RecordDateTime.Value.AddDays(1) < DateTime.Now
|
||||
select x;
|
||||
if (getVRecords.Count() > 0)
|
||||
{
|
||||
if (item.InOrOut == 1)
|
||||
foreach (var item in getVRecords)
|
||||
{
|
||||
var getDelVRecordsIn = from x in Funs.DB.T_d_validcardevent
|
||||
where x.ProjectId == item.ProjectId && x.IDCardNo == item.IDCardNo && x.InOrOut == item.InOrOut
|
||||
&& x.RecordDateTime.Value.Year == item.RecordDateTime.Value.Year
|
||||
&& x.RecordDateTime.Value.Month == item.RecordDateTime.Value.Month
|
||||
&& x.RecordDateTime.Value.Day == item.RecordDateTime.Value.Day
|
||||
&& x.RecordDateTime > item.RecordDateTime
|
||||
select x;
|
||||
if (getDelVRecordsIn.Count() > 0)
|
||||
if (item.InOrOut == 1)
|
||||
{
|
||||
Funs.DB.T_d_validcardevent.DeleteAllOnSubmit(getDelVRecordsIn);
|
||||
Funs.DB.SubmitChanges();
|
||||
var getDelVRecordsIn = from x in db.T_d_validcardevent
|
||||
where x.ProjectId == item.ProjectId && x.IDCardNo == item.IDCardNo && x.InOrOut == item.InOrOut
|
||||
&& x.RecordDateTime.Value.Year == item.RecordDateTime.Value.Year
|
||||
&& x.RecordDateTime.Value.Month == item.RecordDateTime.Value.Month
|
||||
&& x.RecordDateTime.Value.Day == item.RecordDateTime.Value.Day
|
||||
&& x.RecordDateTime > item.RecordDateTime
|
||||
select x;
|
||||
if (getDelVRecordsIn.Count() > 0)
|
||||
{
|
||||
db.T_d_validcardevent.DeleteAllOnSubmit(getDelVRecordsIn);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDelVRecordsOut = from x in Funs.DB.T_d_validcardevent
|
||||
where x.ProjectId == item.ProjectId && x.IDCardNo == item.IDCardNo && x.InOrOut == item.InOrOut
|
||||
&& x.RecordDateTime.Value.Year == item.RecordDateTime.Value.Year
|
||||
&& x.RecordDateTime.Value.Month == item.RecordDateTime.Value.Month
|
||||
&& x.RecordDateTime.Value.Day == item.RecordDateTime.Value.Day
|
||||
&& x.RecordDateTime < item.RecordDateTime
|
||||
select x;
|
||||
if (getDelVRecordsOut.Count() > 0)
|
||||
else
|
||||
{
|
||||
Funs.DB.T_d_validcardevent.DeleteAllOnSubmit(getDelVRecordsOut);
|
||||
Funs.DB.SubmitChanges();
|
||||
var getDelVRecordsOut = from x in db.T_d_validcardevent
|
||||
where x.ProjectId == item.ProjectId && x.IDCardNo == item.IDCardNo && x.InOrOut == item.InOrOut
|
||||
&& x.RecordDateTime.Value.Year == item.RecordDateTime.Value.Year
|
||||
&& x.RecordDateTime.Value.Month == item.RecordDateTime.Value.Month
|
||||
&& x.RecordDateTime.Value.Day == item.RecordDateTime.Value.Day
|
||||
&& x.RecordDateTime < item.RecordDateTime
|
||||
select x;
|
||||
if (getDelVRecordsOut.Count() > 0)
|
||||
{
|
||||
db.T_d_validcardevent.DeleteAllOnSubmit(getDelVRecordsOut);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user