20220220 实名制退场、更新上报优化
This commit is contained in:
@@ -262,8 +262,8 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
if (!string.IsNullOrEmpty(idText))
|
||||
{
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(this.drpProject.SelectedValue);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.ProCode))
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getList = returnCardList();
|
||||
if (getList != null && getList.Count > 0)
|
||||
@@ -418,8 +418,8 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
int count = 0;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.ProCode))
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getIdentityCards = (from x in Funs.DB.SitePerson_Person
|
||||
join v in Funs.DB.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
|
||||
@@ -444,7 +444,12 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
}
|
||||
}
|
||||
|
||||
SynchroSetService.InsertRealNamePushLog(projectId, proCode, "单条批量推送(新增)", "完成", null, message, null, null);
|
||||
string meshow = "新增成功!";
|
||||
if (message.Contains("失败"))
|
||||
{
|
||||
meshow = "存在新增失败数据!";
|
||||
}
|
||||
SynchroSetService.InsertRealNamePushLog(projectId, proCode, "批量单条推送(新增)", "完成", null, meshow, null, null);
|
||||
if (string.IsNullOrEmpty(message))
|
||||
{
|
||||
ShowNotify("同步完成!" + count.ToString() + "条", MessageBoxIcon.Success);
|
||||
@@ -465,14 +470,14 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
int count = 0;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.ProCode))
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getIdentityCards = (from x in Funs.DB.SitePerson_Person
|
||||
join v in Funs.DB.ProjectData_TeamGroup on x.TeamGroupId equals v.TeamGroupId
|
||||
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
|
||||
&& !x.RealNameUpdateTime.HasValue
|
||||
&& p.UnitType != Const.ProjectUnitType_3 && p.UnitType != Const.ProjectUnitType_4
|
||||
select x.IdentityCard).Take(100);
|
||||
foreach (var item in getIdentityCards)
|
||||
@@ -488,8 +493,12 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SynchroSetService.InsertRealNamePushLog(projectId, proCode, "单条批量推送(更新)", "完成", null, message, null, null);
|
||||
string meshow = "更新成功!";
|
||||
if (message.Contains("失败"))
|
||||
{
|
||||
meshow = "存在更新失败数据!";
|
||||
}
|
||||
SynchroSetService.InsertRealNamePushLog(projectId, proCode, "批量单条推送(更新)", "完成", null, meshow, null, null);
|
||||
if (string.IsNullOrEmpty(message))
|
||||
{
|
||||
ShowNotify("同步完成!" + count.ToString() + "条", MessageBoxIcon.Success);
|
||||
@@ -500,5 +509,52 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void btnupdatePersonsExitTime_Click(object sender, EventArgs e)
|
||||
{
|
||||
string message = string.Empty;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
message= SynchroSetService.updatePersonsExitTime(getRProjects.JTproCode);
|
||||
}
|
||||
if (string.IsNullOrEmpty(message))
|
||||
{
|
||||
ShowNotify("同步完成!" + message, MessageBoxIcon.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInParent("同步完成!" + message, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 一键清理更新状态
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnCanelUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getPersons = from x in db.SitePerson_Person
|
||||
where x.ProjectId == this.drpProject.SelectedValue && x.RealNameUpdateTime != null
|
||||
select x;
|
||||
int count = getPersons.Count();
|
||||
if (count > 0)
|
||||
{
|
||||
foreach (var item in getPersons)
|
||||
{
|
||||
item.RealNameUpdateTime = null;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
ShowNotify("操作完成!" + count.ToString() + "条", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user