20220220 实名制退场、更新上报优化
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
</f:DatePicker>
|
||||
<f:DatePicker ID="txtEndDate" runat="server" Label="结束日期" LabelWidth="80px" Width="220px">
|
||||
</f:DatePicker>
|
||||
<f:TextBox runat="server" ID="txtConet" EmptyText="请输入查询条件" Width="220px"></f:TextBox>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSearch" runat="server" Icon="SystemSearch" ToolTip="查询" OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace FineUIPro.Web.ZHGL.RealName
|
||||
strSql += " AND PushTime < @EndDate";
|
||||
listStr.Add(new SqlParameter("@EndDate", Funs.GetNewDateTime(this.txtEndDate.Text).Value.AddDays(1)));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtConet.Text))
|
||||
{
|
||||
strSql += " AND (Success LIKE @name OR Message LIKE @name OR ReturnData LIKE @name)";
|
||||
listStr.Add(new SqlParameter("@name", "%" + this.txtConet.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
|
||||
@@ -75,6 +75,15 @@ namespace FineUIPro.Web.ZHGL.RealName {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtEndDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtConet 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtConet;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -90,6 +90,12 @@
|
||||
<Items>
|
||||
<f:Label runat="server" ID="lbxx"></f:Label>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnCanelUpdate" Icon="DatabaseAdd" runat="server" Text="清空更新状态" ToolTip="批量清空人员更新状态"
|
||||
OnClick="btnCanelUpdate_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnupdatePersonsExitTime" Icon="DatabaseAdd" runat="server" Text="批量退场人员" ToolTip="批量推送所有退场人员"
|
||||
OnClick="btnupdatePersonsExitTime_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnAllPushData" Icon="DatabaseAdd" runat="server" Text="上报所有人员" ToolTip="单条循环推送(500条)"
|
||||
OnClick="btnAllPushData_Click">
|
||||
</f:Button>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,6 +219,24 @@ namespace FineUIPro.Web.ZHGL.RealName {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbxx;
|
||||
|
||||
/// <summary>
|
||||
/// btnCanelUpdate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnCanelUpdate;
|
||||
|
||||
/// <summary>
|
||||
/// btnupdatePersonsExitTime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnupdatePersonsExitTime;
|
||||
|
||||
/// <summary>
|
||||
/// btnAllPushData 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user