SVN r1070
SVN-Revision: r1070
This commit is contained in:
@@ -88,7 +88,8 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
private void ZXFJQuery()
|
private void ZXFJQuery()
|
||||||
{
|
{
|
||||||
QueryApiUtil.Init(out string initResult, out string initMsg);
|
QueryApiUtil.Init(out string initResult, out string initMsg);
|
||||||
if (QueryApiUtil.detailTab.AsEnumerable().Where(n => !(n["p_emp_addTag"] + "").Equals("1")).Count() > 0)
|
var rowsEnumerable = QueryApiUtil.detailTab.AsEnumerable();
|
||||||
|
if (rowsEnumerable.Where(n => !(n["p_emp_addTag"] + "").Equals("1")).Count() > 0)
|
||||||
{
|
{
|
||||||
SetProcessMsg($"正在报送人员...");
|
SetProcessMsg($"正在报送人员...");
|
||||||
string personCode = QueryApiUtil.Person(out string personResult, out string personMsg);
|
string personCode = QueryApiUtil.Person(out string personResult, out string personMsg);
|
||||||
@@ -97,7 +98,7 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
throw new Exception($"报送失败\r\n{personMsg}");
|
throw new Exception($"报送失败\r\n{personMsg}");
|
||||||
}
|
}
|
||||||
SetProcessMsg($"正在查询报送人员...");
|
SetProcessMsg($"正在查询报送人员...");
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
SetProcessMsg($"正在查询报送人员...({i + 1}秒)");
|
SetProcessMsg($"正在查询报送人员...({i + 1}秒)");
|
||||||
@@ -121,17 +122,30 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
string sfyzzt = personJObject["sfyzzt"] + "";
|
string sfyzzt = personJObject["sfyzzt"] + "";
|
||||||
if (bszt.Equals("报送成功") && sfyzzt.Equals("验证成功"))
|
if (bszt.Equals("报送成功") && sfyzzt.Equals("验证成功"))
|
||||||
{
|
{
|
||||||
SqlHelper.ExecuteNonQuery($"update p_employeeTab set p_emp_addTag = 1 where p_emp_idcardnum = '{sfzh}'");
|
DataRow selectRow = rowsEnumerable.Where(n => (n["idNumber"] + "").Equals(sfzh)).FirstOrDefault();
|
||||||
|
if (selectRow != null)
|
||||||
|
{
|
||||||
|
selectRow["p_emp_addTag"] = "1";
|
||||||
|
}
|
||||||
|
//SqlHelper.ExecuteNonQuery($"update p_employeeTab set p_emp_addTag = 1 where p_emp_idcardnum = '{sfzh}'");
|
||||||
}
|
}
|
||||||
SetProcessMsg($"已报送:{name}");
|
SetProcessMsg($"已报送:{name}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QueryApiUtil.detailTab = BaseImpl.GetDataTableResult(Model.DetailSourceSql);
|
//QueryApiUtil.detailTab = BaseImpl.GetDataTableResult(Model.DetailSourceSql);
|
||||||
Invoke(new Action(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
progressBarCurrent.Maximum = QueryApiUtil.detailTab.AsEnumerable().Where(n => (n["p_emp_addTag"] + "").Equals("1")).Count();
|
int maxCount = rowsEnumerable.Where(n => (n["p_emp_addTag"] + "").Equals("1")).Count();
|
||||||
|
if (maxCount > 0)
|
||||||
|
{
|
||||||
|
progressBarCurrent.Maximum = rowsEnumerable.Where(n => (n["p_emp_addTag"] + "").Equals("1")).Count();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception($"人员报送失败,员工未成功上报专项附加");
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
SetProcessMsg($"正在同步专项附加数据...");
|
SetProcessMsg($"正在同步专项附加数据...");
|
||||||
string postAdditionCode = QueryApiUtil.PostAddition(out string postAdditionResult, out string postAdditionMsg);
|
string postAdditionCode = QueryApiUtil.PostAddition(out string postAdditionResult, out string postAdditionMsg);
|
||||||
@@ -176,6 +190,9 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
StringBuilder sqlBuilder = new StringBuilder();
|
StringBuilder sqlBuilder = new StringBuilder();
|
||||||
string peopleName = item["peopleName"] + "";
|
string peopleName = item["peopleName"] + "";
|
||||||
string idNumber = item["idNumber"] + "";
|
string idNumber = item["idNumber"] + "";
|
||||||
|
DataRow selectRow = rowsEnumerable.Where(n => (n["idNumber"] + "").Equals(idNumber)).FirstOrDefault();
|
||||||
|
if (selectRow != null && (selectRow["p_emp_addTag"] + "").Equals("1"))
|
||||||
|
{
|
||||||
sqlBuilder.AppendLine($"delete from p_gszxfjkctab where idnumber = '{idNumber}' and itemid = '{ysyf}' and type <> '个人养老金';");
|
sqlBuilder.AppendLine($"delete from p_gszxfjkctab where idnumber = '{idNumber}' and itemid = '{ysyf}' and type <> '个人养老金';");
|
||||||
string sylrAccumulate = item["sylrAccumulate"] + "";
|
string sylrAccumulate = item["sylrAccumulate"] + "";
|
||||||
sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','赡养老人','{sylrAccumulate}','','{idNumber}','{ysyf}');");
|
sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','赡养老人','{sylrAccumulate}','','{idNumber}','{ysyf}');");
|
||||||
@@ -201,6 +218,7 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#region 已弃用
|
#region 已弃用
|
||||||
//string token = "";
|
//string token = "";
|
||||||
//string aggOrgId = "";
|
//string aggOrgId = "";
|
||||||
@@ -412,7 +430,8 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
private void YLJQuery()
|
private void YLJQuery()
|
||||||
{
|
{
|
||||||
QueryApiUtil.Init(out string initResult, out string initMsg);
|
QueryApiUtil.Init(out string initResult, out string initMsg);
|
||||||
if (QueryApiUtil.detailTab.AsEnumerable().Where(n => !(n["p_emp_addTag"] + "").Equals("1")).Count() > 0)
|
var rowsEnumerable = QueryApiUtil.detailTab.AsEnumerable();
|
||||||
|
if (rowsEnumerable.Where(n => !(n["p_emp_addTag"] + "").Equals("1")).Count() > 0)
|
||||||
{
|
{
|
||||||
SetProcessMsg($"正在报送人员...");
|
SetProcessMsg($"正在报送人员...");
|
||||||
string personCode = QueryApiUtil.Person(out string personResult, out string personMsg);
|
string personCode = QueryApiUtil.Person(out string personResult, out string personMsg);
|
||||||
@@ -421,6 +440,11 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
throw new Exception($"报送失败\r\n{personMsg}");
|
throw new Exception($"报送失败\r\n{personMsg}");
|
||||||
}
|
}
|
||||||
SetProcessMsg($"正在查询报送人员...");
|
SetProcessMsg($"正在查询报送人员...");
|
||||||
|
for (int i = 0; i < 5; i++)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
SetProcessMsg($"正在查询报送人员...({i + 1}秒)");
|
||||||
|
}
|
||||||
string personQueryCode = QueryApiUtil.PersonQuery(out string personQueryResult, out string personQueryMsg);
|
string personQueryCode = QueryApiUtil.PersonQuery(out string personQueryResult, out string personQueryMsg);
|
||||||
if (!personQueryCode.Equals("0"))
|
if (!personQueryCode.Equals("0"))
|
||||||
{
|
{
|
||||||
@@ -440,17 +464,30 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
string sfyzzt = personJObject["sfyzzt"] + "";
|
string sfyzzt = personJObject["sfyzzt"] + "";
|
||||||
if (bszt.Equals("报送成功") && sfyzzt.Equals("验证成功"))
|
if (bszt.Equals("报送成功") && sfyzzt.Equals("验证成功"))
|
||||||
{
|
{
|
||||||
SqlHelper.ExecuteNonQuery($"update p_employeeTab set p_emp_addTag = 1 where p_emp_idcardnum = '{sfzh}'");
|
DataRow selectRow = rowsEnumerable.Where(n => (n["idNumber"] + "").Equals(sfzh)).FirstOrDefault();
|
||||||
|
if (selectRow != null)
|
||||||
|
{
|
||||||
|
selectRow["p_emp_addTag"] = "1";
|
||||||
|
}
|
||||||
|
//SqlHelper.ExecuteNonQuery($"update p_employeeTab set p_emp_addTag = 1 where p_emp_idcardnum = '{sfzh}'");
|
||||||
}
|
}
|
||||||
SetProcessMsg($"已报送:{name}");
|
SetProcessMsg($"已报送:{name}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QueryApiUtil.detailTab = BaseImpl.GetDataTableResult(Model.DetailSourceSql);
|
//QueryApiUtil.detailTab = BaseImpl.GetDataTableResult(Model.DetailSourceSql);
|
||||||
Invoke(new Action(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
progressBarCurrent.Maximum = QueryApiUtil.detailTab.AsEnumerable().Where(n => (n["p_emp_addTag"] + "").Equals("1")).Count();
|
int maxCount = rowsEnumerable.Where(n => (n["p_emp_addTag"] + "").Equals("1")).Count();
|
||||||
|
if (maxCount > 0)
|
||||||
|
{
|
||||||
|
progressBarCurrent.Maximum = rowsEnumerable.Where(n => (n["p_emp_addTag"] + "").Equals("1")).Count();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception($"人员报送失败,员工未成功上报专项附加");
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
SetProcessMsg($"正在查询个人养老金数据...");
|
SetProcessMsg($"正在查询个人养老金数据...");
|
||||||
string yljfqCode = QueryApiUtil.GetYLJFQ(out string yljfqResult, out string yljfqMsg);
|
string yljfqCode = QueryApiUtil.GetYLJFQ(out string yljfqResult, out string yljfqMsg);
|
||||||
@@ -491,7 +528,6 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
if (yljJObject.ContainsKey("data") && yljJObject["data"] is JArray)
|
if (yljJObject.ContainsKey("data") && yljJObject["data"] is JArray)
|
||||||
{
|
{
|
||||||
JArray yljDataJArray = (JArray)yljJObject["data"];
|
JArray yljDataJArray = (JArray)yljJObject["data"];
|
||||||
|
|
||||||
foreach (JObject item in yljDataJArray)
|
foreach (JObject item in yljDataJArray)
|
||||||
{
|
{
|
||||||
StringBuilder sqlBuilder = new StringBuilder();
|
StringBuilder sqlBuilder = new StringBuilder();
|
||||||
@@ -503,6 +539,9 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
string jcje = item["jcje"] + "";
|
string jcje = item["jcje"] + "";
|
||||||
string jcsj = item["jcsj"] + "";
|
string jcsj = item["jcsj"] + "";
|
||||||
string xgrq = item["xgrq"] + "";
|
string xgrq = item["xgrq"] + "";
|
||||||
|
DataRow selectRow = rowsEnumerable.Where(n => (n["idNumber"] + "").Equals(zjhm)).FirstOrDefault();
|
||||||
|
if (selectRow != null && (selectRow["p_emp_addTag"] + "").Equals("1"))
|
||||||
|
{
|
||||||
sqlBuilder.AppendLine($"delete from p_gszxfjkctab where idnumber = '{zjhm}' and itemid = '{ysyf}' and type = '个人养老金';");
|
sqlBuilder.AppendLine($"delete from p_gszxfjkctab where idnumber = '{zjhm}' and itemid = '{ysyf}' and type = '个人养老金';");
|
||||||
sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{name}','个人养老金','{jcje}','','{zjhm}','{ysyf}');");
|
sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{name}','个人养老金','{jcje}','','{zjhm}','{ysyf}');");
|
||||||
if (!string.IsNullOrEmpty(sqlBuilder.ToString()))
|
if (!string.IsNullOrEmpty(sqlBuilder.ToString()))
|
||||||
@@ -515,6 +554,7 @@ namespace Lskj.QueryEssentialInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Invoke(new Action(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
this.Close();
|
this.Close();
|
||||||
|
|||||||
Reference in New Issue
Block a user