This commit is contained in:
2021-08-26 11:26:04 +08:00
parent 21b3fd1b44
commit d21c25aabb
13 changed files with 607 additions and 17 deletions
@@ -369,5 +369,83 @@ namespace FineUIPro.Web.ZHGL.RealName
return;
}
}
protected void btnAllPushData_Click(object sender, EventArgs e)
{
string message = string.Empty;
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 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.RealNameAddTime.HasValue
select x.IdentityCard).Take(100);
foreach (var item in getIdentityCards)
{
string mes = BLL.SynchroSetService.PushPersonsByIdentityCard(Const.BtnAdd, getRProjects.ProCode, item) ?? "";
if (mes != "请求成功")
{
message += ("身份证号码" + item + "新增失败" + mes);
}
else
{
count++;
}
}
}
if (string.IsNullOrEmpty(message))
{
ShowNotify("同步完成!" + count.ToString() + "条", MessageBoxIcon.Success);
}
else
{
Alert.ShowInParent("同步完成!" + count.ToString() + "条;" + message, MessageBoxIcon.Warning);
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
string message = string.Empty;
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 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(100);
foreach (var item in getIdentityCards)
{
string mes = BLL.SynchroSetService.PushPersonsByIdentityCard(Const.BtnModify, getRProjects.ProCode, item) ?? "";
if (mes != "请求成功")
{
message += ("身份证号码" + item + "更新失败" + mes);
}
else
{
count++;
}
}
}
if (string.IsNullOrEmpty(message))
{
ShowNotify("同步完成!" + count.ToString() + "条", MessageBoxIcon.Success);
}
else
{
Alert.ShowInParent("同步完成!" + count.ToString() + "条;" + message, MessageBoxIcon.Warning);
}
}
}
}