1、优化考勤记录导入,优化出入记录写实名制推送记录表。2、优化考试答题,交卷接口方法。3、优化写入培训记录。
This commit is contained in:
@@ -40,67 +40,60 @@ namespace BLL
|
||||
/// <param name="PersonInOut"></param>
|
||||
public static void InsertPersonInOutNowNow(Model.SitePerson_PersonInOutNow PersonInOut)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var getNow = db.SitePerson_PersonInOutNow.FirstOrDefault(x => x.PersonInOutId == PersonInOut.PersonInOutId);
|
||||
if (getNow == null)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.SitePerson_PersonInOutNow newPersonInOut = new Model.SitePerson_PersonInOutNow
|
||||
var getNow = db.SitePerson_PersonInOutNow.FirstOrDefault(x => x.PersonInOutId == PersonInOut.PersonInOutId);
|
||||
if (getNow == null)
|
||||
{
|
||||
PersonInOutId = PersonInOut.PersonInOutId,
|
||||
ProjectId = PersonInOut.ProjectId,
|
||||
UnitId = PersonInOut.UnitId,
|
||||
PersonId = PersonInOut.PersonId,
|
||||
IsIn = PersonInOut.IsIn,
|
||||
ChangeTime = PersonInOut.ChangeTime,
|
||||
WorkPostId = PersonInOut.WorkPostId,
|
||||
PostType = PersonInOut.PostType,
|
||||
ProCode = PersonInOut.ProCode,
|
||||
Name = PersonInOut.Name,
|
||||
IdcardType = PersonInOut.IdcardType ?? "SHENFEN_ZHENGJIAN",
|
||||
IdcardNumber = PersonInOut.IdcardNumber,
|
||||
CheckType = "ZHENGCHANG_KAOQINLEIBIE",
|
||||
CheckWay = "FACE_FANGSHI",
|
||||
};
|
||||
db.SitePerson_PersonInOutNow.InsertOnSubmit(newPersonInOut);
|
||||
db.SubmitChanges();
|
||||
/// 监理 业主 不进入
|
||||
var getPUnit = db.Project_ProjectUnit.FirstOrDefault(x => x.ProjectId == newPersonInOut.ProjectId && x.UnitId == newPersonInOut.UnitId);
|
||||
if (getPUnit.IsSynchro == true)
|
||||
{
|
||||
var getRealNameP = db.RealName_Project.FirstOrDefault(x => x.ProCode == newPersonInOut.ProCode);
|
||||
if (getRealNameP != null)
|
||||
Model.SitePerson_PersonInOutNow newPersonInOut = new Model.SitePerson_PersonInOutNow
|
||||
{
|
||||
Model.RealName_PersonInOutNow newR = new Model.RealName_PersonInOutNow
|
||||
PersonInOutId = PersonInOut.PersonInOutId,
|
||||
ProjectId = PersonInOut.ProjectId,
|
||||
UnitId = PersonInOut.UnitId,
|
||||
PersonId = PersonInOut.PersonId,
|
||||
IsIn = PersonInOut.IsIn,
|
||||
ChangeTime = PersonInOut.ChangeTime,
|
||||
WorkPostId = PersonInOut.WorkPostId,
|
||||
PostType = PersonInOut.PostType,
|
||||
ProCode = PersonInOut.ProCode,
|
||||
Name = PersonInOut.Name,
|
||||
IdcardType = PersonInOut.IdcardType ?? "SHENFEN_ZHENGJIAN",
|
||||
IdcardNumber = PersonInOut.IdcardNumber,
|
||||
CheckType = "ZHENGCHANG_KAOQINLEIBIE",
|
||||
CheckWay = "FACE_FANGSHI",
|
||||
};
|
||||
db.SitePerson_PersonInOutNow.InsertOnSubmit(newPersonInOut);
|
||||
db.SubmitChanges();
|
||||
/// 监理 业主 不进入
|
||||
var getPUnit = db.Project_ProjectUnit.FirstOrDefault(x => x.ProjectId == newPersonInOut.ProjectId && x.UnitId == newPersonInOut.UnitId);
|
||||
if (getPUnit.IsSynchro == true)
|
||||
{
|
||||
var getRealNameP = db.RealName_Project.FirstOrDefault(x => x.ProCode == newPersonInOut.ProCode);
|
||||
if (getRealNameP != null)
|
||||
{
|
||||
PersonInOutId = newPersonInOut.PersonInOutId,
|
||||
ProjectId = newPersonInOut.ProjectId,
|
||||
UnitId = newPersonInOut.UnitId,
|
||||
PersonId = newPersonInOut.PersonId,
|
||||
IsIn = newPersonInOut.IsIn,
|
||||
ChangeTime = newPersonInOut.ChangeTime,
|
||||
WorkPostId = newPersonInOut.WorkPostId,
|
||||
PostType = newPersonInOut.PostType,
|
||||
ProCode = newPersonInOut.ProCode,
|
||||
Name = newPersonInOut.Name,
|
||||
IdcardType = newPersonInOut.IdcardType ?? "SHENFEN_ZHENGJIAN",
|
||||
IdcardNumber = newPersonInOut.IdcardNumber,
|
||||
CheckType = "ZHENGCHANG_KAOQINLEIBIE",
|
||||
CheckWay = "FACE_FANGSHI",
|
||||
};
|
||||
db.RealName_PersonInOutNow.InsertOnSubmit(newR);
|
||||
db.SubmitChanges();
|
||||
Model.RealName_PersonInOutNow newR = new Model.RealName_PersonInOutNow
|
||||
{
|
||||
PersonInOutId = newPersonInOut.PersonInOutId,
|
||||
ProjectId = newPersonInOut.ProjectId,
|
||||
UnitId = newPersonInOut.UnitId,
|
||||
PersonId = newPersonInOut.PersonId,
|
||||
IsIn = newPersonInOut.IsIn,
|
||||
ChangeTime = newPersonInOut.ChangeTime,
|
||||
WorkPostId = newPersonInOut.WorkPostId,
|
||||
PostType = newPersonInOut.PostType,
|
||||
ProCode = newPersonInOut.ProCode,
|
||||
Name = newPersonInOut.Name,
|
||||
IdcardType = newPersonInOut.IdcardType ?? "SHENFEN_ZHENGJIAN",
|
||||
IdcardNumber = newPersonInOut.IdcardNumber,
|
||||
CheckType = "ZHENGCHANG_KAOQINLEIBIE",
|
||||
CheckWay = "FACE_FANGSHI",
|
||||
};
|
||||
db.RealName_PersonInOutNow.InsertOnSubmit(newR);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var getLastList = from x in db.SitePerson_PersonInOutNow
|
||||
where x.ChangeTime <= PersonInOut.ChangeTime.Value.AddHours(-48)
|
||||
select x;
|
||||
if (getLastList.Count() > 0)
|
||||
{
|
||||
db.SitePerson_PersonInOutNow.DeleteAllOnSubmit(getLastList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -109,18 +102,20 @@ namespace BLL
|
||||
/// <param name="personId"></param>
|
||||
public static void DeletePersonInOutByPersonId(string personId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var personInOut = from x in db.SitePerson_PersonInOut where x.PersonId == personId select x;
|
||||
if (personInOut.Count() > 0)
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
db.SitePerson_PersonInOut.DeleteAllOnSubmit(personInOut);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
var rpersonInOut = from x in db.RealName_PersonInOutNow where x.PersonId == personId select x;
|
||||
if (rpersonInOut.Count() > 0)
|
||||
{
|
||||
db.RealName_PersonInOutNow.DeleteAllOnSubmit(rpersonInOut);
|
||||
db.SubmitChanges();
|
||||
var personInOut = from x in db.SitePerson_PersonInOut where x.PersonId == personId select x;
|
||||
if (personInOut.Count() > 0)
|
||||
{
|
||||
db.SitePerson_PersonInOut.DeleteAllOnSubmit(personInOut);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
var rpersonInOut = from x in db.RealName_PersonInOutNow where x.PersonId == personId select x;
|
||||
if (rpersonInOut.Count() > 0)
|
||||
{
|
||||
db.RealName_PersonInOutNow.DeleteAllOnSubmit(rpersonInOut);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,16 +125,18 @@ namespace BLL
|
||||
/// <param name="personId"></param>
|
||||
public static void UpdateRealNameInOut(string personId, string oldCardNo, string newIdCardNo)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var personInOuts = from x in db.RealName_PersonInOutNow
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var personInOuts = from x in db.RealName_PersonInOutNow
|
||||
where x.PersonId == personId && x.IdcardNumber == oldCardNo
|
||||
select x;
|
||||
if (personInOuts.Count() > 0)
|
||||
{
|
||||
foreach (var item in personInOuts)
|
||||
if (personInOuts.Count() > 0)
|
||||
{
|
||||
item.IdcardNumber = newIdCardNo;
|
||||
db.SubmitChanges();
|
||||
foreach (var item in personInOuts)
|
||||
{
|
||||
item.IdcardNumber = newIdCardNo;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user