SVN r1013

SVN-Revision: r1013
This commit is contained in:
tdx
2025-10-11 03:45:52 +00:00
parent abf0727509
commit 6b797dde6b
2 changed files with 254 additions and 0 deletions
@@ -57,6 +57,13 @@ namespace Lskj.QueryEssentialInfo
MessageUtil.Show("个税申报完成");
}));
break;
case "2":
YLJQuery();
Invoke(new Action(() =>
{
MessageUtil.Show("个人养老金查询完成");
}));
break;
}
}
catch (Exception ex)
@@ -126,6 +133,22 @@ namespace Lskj.QueryEssentialInfo
SetProcessMsg($"正在查询专项附加数据...");
string getAdditionCode = QueryApiUtil.GetAddition(out string getAdditionResult, out string getAdditionMsg);
if (!getAdditionCode.Equals("0"))
{
if (getAdditionMsg.Equals("还未通过税务共享平台获取专项附加或员工还未上报专项附加"))
{
for (int i = 0; i < 5; i++)
{
getAdditionResult = "";
getAdditionMsg = "";
getAdditionCode = QueryApiUtil.GetAddition(out getAdditionResult, out getAdditionMsg);
if (getAdditionCode.Equals("0"))
{
break;
}
}
}
}
if (!getAdditionCode.Equals("0"))
{
throw new Exception($"查询数据失败\r\n{getAdditionMsg}");
}
@@ -375,6 +398,120 @@ namespace Lskj.QueryEssentialInfo
}));
}
/// <summary>
/// 养老金查询
/// </summary>
private void YLJQuery()
{
QueryApiUtil.Init(out string initResult, out string initMsg);
if (QueryApiUtil.detailTab.AsEnumerable().Where(n => !(n["p_emp_addTag"] + "").Equals("1")).Count() > 0)
{
SetProcessMsg($"正在报送人员...");
string personCode = QueryApiUtil.Person(out string personResult, out string personMsg);
if (!personCode.Equals("0"))
{
throw new Exception($"报送失败\r\n{personMsg}");
}
SetProcessMsg($"正在查询报送人员...");
string personQueryCode = QueryApiUtil.PersonQuery(out string personQueryResult, out string personQueryMsg);
if (!personQueryCode.Equals("0"))
{
throw new Exception($"报送查询失败\r\n{personQueryMsg}");
}
else
{
JObject personQueryJObject = (JObject)JsonConvert.DeserializeObject(personQueryResult);
if (personQueryJObject["data"] is JArray)
{
JArray personQueryJArray = (JArray)personQueryJObject["data"];
foreach (JObject personJObject in personQueryJArray)
{
string name = personJObject["name"] + "";
string sfzh = personJObject["sfzh"] + "";
string bszt = personJObject["bszt"] + "";
string sfyzzt = personJObject["sfyzzt"] + "";
if (bszt.Equals("报送成功") && sfyzzt.Equals("验证成功"))
{
SqlHelper.ExecuteNonQuery($"update p_employeeTab set p_emp_addTag = 1 where p_emp_idcardnum = '{sfzh}'");
}
SetProcessMsg($"已报送:{name}");
}
}
}
}
QueryApiUtil.detailTab = BaseImpl.GetDataTableResult(Model.DetailSourceSql);
Invoke(new Action(() =>
{
progressBarCurrent.Maximum = QueryApiUtil.detailTab.AsEnumerable().Where(n => (n["p_emp_addTag"] + "").Equals("1")).Count();
}));
SetProcessMsg($"正在查询个人养老金数据...");
string yljfqCode = QueryApiUtil.GetYLJFQ(out string yljfqResult, out string yljfqMsg);
if (!yljfqCode.Equals("0"))
{
for (int i = 0; i < 5; i++)
{
yljfqResult = "";
yljfqMsg = "";
yljfqCode = QueryApiUtil.GetYLJFQ(out yljfqResult, out yljfqMsg);
if (yljfqCode.Equals("0"))
{
break;
}
}
}
if (!yljfqCode.Equals("0"))
{
throw new Exception($"发起查询失败\r\n{yljfqMsg}");
}
else
{
string yljmxCode = QueryApiUtil.GetYLJMX(out string yljmxResult, out string yljmxMsg);
if (!yljmxCode.Equals("0"))
{
throw new Exception($"查询数据失败\r\n{yljmxMsg}");
}
else
{
JObject yljJObject = (JObject)JsonConvert.DeserializeObject(yljmxResult);
if (yljJObject.ContainsKey("data") && yljJObject["data"] is JArray)
{
JArray yljDataJArray = (JArray)yljJObject["data"];
foreach (JObject item in yljDataJArray)
{
StringBuilder sqlBuilder = new StringBuilder();
//string peopleName = item["peopleName"] + "";
//string idNumber = item["idNumber"] + "";
//sqlBuilder.AppendLine($"delete from p_gszxfjkctab where idnumber = '{idNumber}' and itemid = '{ysyf}';");
//string sylrAccumulate = item["sylrAccumulate"] + "";
//sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','赡养老人','{sylrAccumulate}','','{idNumber}','{ysyf}');");
//string znjyAccumulate = item["znjyAccumulate"] + "";
//sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','子女教育','{znjyAccumulate}','','{idNumber}','{ysyf}');");
//string xljxjyAccumulate = item["xljxjyAccumulate"] + "";
//sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','学历继续教育','{xljxjyAccumulate}','','{idNumber}','{ysyf}');");
//string zyzgjxjyAccumulate = item["zyzgjxjyAccumulate"] + "";
//sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','专业资格继续教育','{zyzgjxjyAccumulate}','','{idNumber}','{ysyf}');");
//string zfdklxAccumulate = item["zfdklxAccumulate"] + "";
//sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','住房贷款利息','{zfdklxAccumulate}','','{idNumber}','{ysyf}');");
//string zfzjAccumulate = item["zfzjAccumulate"] + "";
//sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','租房租金','{zfzjAccumulate}','','{idNumber}','{ysyf}');");
//string yyezhfAccumulate = item["yyezhfAccumulate"] + "";
//sqlBuilder.AppendLine($"insert into p_gszxfjkctab (employeename,type,money,bak,idnumber,itemid) values ('{peopleName}','婴幼儿照护','{yyezhfAccumulate}','','{idNumber}','{ysyf}');");
if (!string.IsNullOrEmpty(sqlBuilder.ToString()))
{
BaseImpl.ExecSqlValue(sqlBuilder.ToString());
}
//SetProcessMsg($"已查询:{peopleName}");
SetProcessBar();
}
}
}
}
Invoke(new Action(() =>
{
this.Close();
}));
}
/// <summary>
/// 个税申报
/// </summary>
private void GSSBQuery()