diff --git a/DataBase/版本日志/SGGLDB_V2021-09-09-001.sql b/DataBase/版本日志/已更新脚本/SGGLDB_V2021-09-09-001.sql similarity index 100% rename from DataBase/版本日志/SGGLDB_V2021-09-09-001.sql rename to DataBase/版本日志/已更新脚本/SGGLDB_V2021-09-09-001.sql diff --git a/SGGL/BLL/ZHGL/RealName/SynchroSetService.cs b/SGGL/BLL/ZHGL/RealName/SynchroSetService.cs index 00f36da9..a3649658 100644 --- a/SGGL/BLL/ZHGL/RealName/SynchroSetService.cs +++ b/SGGL/BLL/ZHGL/RealName/SynchroSetService.cs @@ -936,7 +936,7 @@ namespace BLL } } } - InsertRealNamePushLog(null, proCode, "推送项目部/施工队数据", sucess, code, mess, data, pushContent); + InsertRealNamePushLog(null, proCode, "推送项目部/施工队", sucess, code, mess, data, pushContent); } else { @@ -970,10 +970,10 @@ namespace BLL join v in Funs.DB.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId join w in Funs.DB.Base_WorkPost on x.WorkPostId equals w.WorkPostId where (identityCard == null || x.IdentityCard == identityCard) - && y.JTProjectCode == proCode && z.JTproCode != null && x.IsCardNoOK ==true - && v.TeamId.HasValue && x.HeadImage != null && x.HeadImage.Length > 0 - && ((type == Const.BtnModify && !x.RealNameUpdateTime.HasValue - && x.RealNameAddTime.HasValue) || (type != Const.BtnModify && !x.RealNameAddTime.HasValue && x.IsUsed && !x.OutTime.HasValue)) + && y.JTProjectCode == proCode && z.JTproCode != null && x.IsCardNoOK ==true && v.TeamId.HasValue + && ((type == Const.BtnModify && !x.RealNameUpdateTime.HasValue && x.RealNameAddTime.HasValue) + || (type != Const.BtnModify && !x.RealNameAddTime.HasValue && x.IsUsed && !x.OutTime.HasValue + && x.HeadImage != null && x.HeadImage.Length > 0)) && p.UnitType != Const.ProjectUnitType_3 && p.UnitType != Const.ProjectUnitType_4 select new { @@ -1102,8 +1102,8 @@ namespace BLL join w in Funs.DB.Base_WorkPost on x.WorkPostId equals w.WorkPostId join p in Funs.DB.Project_ProjectUnit on new { x.UnitId,x.ProjectId } equals new { p.UnitId,p.ProjectId } where x.IdentityCard == identityCard && y.JTProjectCode == proCode - && v.TeamId.HasValue && x.HeadImage != null && x.HeadImage.Length > 0 - && z.JTproCode != null + && v.TeamId.HasValue && z.JTproCode != null + && ((type ==Const.BtnAdd && x.HeadImage != null && x.HeadImage.Length > 0) || (type == Const.BtnModify && x.RealNameAddTime.HasValue)) && p.UnitType != Const.ProjectUnitType_3 && p.UnitType != Const.ProjectUnitType_4 select new { @@ -1190,8 +1190,28 @@ namespace BLL } } } - InsertRealNamePushLog(null, proCode, "推送人员数据", sucess, code, mess, data, pushContent); + if (data.Contains("已存在") || mess.Contains("已存在")) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + foreach (var item in getData) + { + if (data.Contains(item.idcardNumber) || mess.Contains(item.idcardNumber)) + { + var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == item.PersonId); + if (getPerson != null) + { + if (!getPerson.RealNameAddTime.HasValue) + { + getPerson.RealNameAddTime = DateTime.Now; + } + db.SubmitChanges(); + } + } + } + } + } } else { @@ -1295,11 +1315,11 @@ namespace BLL } } InsertRealNamePushLog(null, proCode, "推送考勤数据", sucess, code, mess, data, pushContent); - if (data.Contains("无法入场")) + if (data.Contains("无法入场") || mess.Contains("班组")) { foreach (var item in getData) { - if (data.Contains(item.idcardNumber)) + if (data.Contains(item.idcardNumber) || mess.Contains(item.idcardNumber)) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { diff --git a/SGGL/FineUIPro.Web/ZHGL/RealName/SynchroRecord.aspx b/SGGL/FineUIPro.Web/ZHGL/RealName/SynchroRecord.aspx index afe0c3d8..fdc9c545 100644 --- a/SGGL/FineUIPro.Web/ZHGL/RealName/SynchroRecord.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/RealName/SynchroRecord.aspx @@ -47,15 +47,15 @@ - - - @@ -63,7 +63,7 @@ HeaderText="时间" HeaderTextAlign="Center" TextAlign="Center"> 0 && !x.RealNameAddTime.HasValue && p.UnitType != Const.ProjectUnitType_3 && p.UnitType != Const.ProjectUnitType_4 @@ -416,6 +416,7 @@ namespace FineUIPro.Web.ZHGL.RealName } } + SynchroSetService.InsertRealNamePushLog(projectId, proCode, "单条批量推送(新增)", "完成", null, message, null, null); if (string.IsNullOrEmpty(message)) { ShowNotify("同步完成!" + count.ToString() + "条", MessageBoxIcon.Success); @@ -441,11 +442,11 @@ namespace FineUIPro.Web.ZHGL.RealName { var getIdentityCards = (from x in Funs.DB.SitePerson_Person join v in Funs.DB.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId - where x.ProjectId == projectId - && x.IdentityCard != null && (x.IdentityCard.Length == 15 || x.IdentityCard.Length == 18) - && v.TeamId.HasValue && x.HeadImage != null && x.HeadImage.Length > 0 - && !x.RealNameUpdateTime.HasValue - select x.IdentityCard).Take(500); + join p in Funs.DB.Project_ProjectUnit on new { x.UnitId, x.ProjectId } equals new { p.UnitId, p.ProjectId } + where x.ProjectId == projectId && x.IsCardNoOK == true && v.TeamId.HasValue + && !x.RealNameUpdateTime.HasValue && x.RealNameAddTime.HasValue + && p.UnitType != Const.ProjectUnitType_3 && p.UnitType != Const.ProjectUnitType_4 + select x.IdentityCard).Take(100); foreach (var item in getIdentityCards) { string mes = BLL.SynchroSetService.PushPersonsByIdentityCard(Const.BtnModify, getRProjects.ProCode, item) ?? ""; @@ -460,6 +461,7 @@ namespace FineUIPro.Web.ZHGL.RealName } } + SynchroSetService.InsertRealNamePushLog(projectId, proCode, "单条批量推送(更新)", "完成", null, message, null, null); if (string.IsNullOrEmpty(message)) { ShowNotify("同步完成!" + count.ToString() + "条", MessageBoxIcon.Success);