SVN r970
SVN-Revision: r970
This commit is contained in:
@@ -80,6 +80,7 @@ namespace Lskj.QueryEssentialInfo
|
||||
/// </summary>
|
||||
private void ZXFJQuery()
|
||||
{
|
||||
QueryApiUtil.Init(out string initResult, out string initMsg);
|
||||
if (QueryApiUtil.detailTab.AsEnumerable().Where(n => !(n["p_emp_addTag"] + "").Equals("1")).Count() > 0)
|
||||
{
|
||||
SetProcessMsg($"正在报送人员...");
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
<Reference Include="DevExpress.Data.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Utils.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\工作\lserp_cs_6.0\引用DLL\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\..\引用DLL\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -342,6 +342,50 @@ namespace Lskj.QueryEssentialInfo
|
||||
return code;
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化
|
||||
/// </summary>
|
||||
public static string Init(out string resultRead, out string resultMsg)
|
||||
{
|
||||
string code = "-9999";
|
||||
resultRead = "";
|
||||
resultMsg = "";
|
||||
try
|
||||
{
|
||||
string url = "http://swgxs.poc.htjs.net:9019/v2/web/sbmk/personal-tax/api/v1/gsmycsh";
|
||||
HttpTools.setting("application/json", null, null, HttpTools.Encode.UTF8);
|
||||
Dictionary<string, string> headerDic = new Dictionary<string, string>();
|
||||
DateTime utcNow = DateTime.UtcNow;
|
||||
string date = utcNow.ToString("r", CultureInfo.InvariantCulture);
|
||||
string host = "api.baiwangjs.com";
|
||||
string x_htjs_nonce = Guid.NewGuid().ToString().ToLower();
|
||||
string x_htjs_ua = "1.8.0_181 64 bit, sdk-ver=1.0.0";
|
||||
headerDic.Add("Date", DateTime.UtcNow.ToString());
|
||||
headerDic.Add("host", host);
|
||||
headerDic.Add("x-htjs-nonce", x_htjs_nonce);
|
||||
headerDic.Add("x-htjs-ua", x_htjs_ua);
|
||||
headerDic.Add("Authorization", $"{GetAuthorization(date, host, x_htjs_nonce, x_htjs_ua)}");
|
||||
JObject pmsJObject = new JObject();
|
||||
pmsJObject.Add("requestId", Guid.NewGuid().ToString().Replace("-", "").ToLower());
|
||||
pmsJObject.Add("accountId", "1");
|
||||
pmsJObject.Add("busiTypeCode", mainRow["busiTypeCode"] + "");
|
||||
pmsJObject.Add("qysh", mainRow["qysh"] + "");
|
||||
pmsJObject.Add("operator", mainRow["operator"] + "");
|
||||
HttpWebResponse webResponse = HttpTools.Post(url, JsonConvert.SerializeObject(pmsJObject), null, headerDic, HttpTools.Method.POST);
|
||||
resultRead = new StreamReader(webResponse.GetResponseStream(), Encoding.UTF8).ReadToEnd();
|
||||
if (webResponse != null && !string.IsNullOrEmpty(resultRead))
|
||||
{
|
||||
JObject resultJObject = (JObject)JsonConvert.DeserializeObject(resultRead);
|
||||
code = resultJObject["code"] + "";
|
||||
resultMsg = resultJObject["msg"] + "";
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
/// <summary>
|
||||
/// 同步人员
|
||||
/// </summary>
|
||||
public static string Person(out string resultRead, out string resultMsg)
|
||||
|
||||
Reference in New Issue
Block a user