|
|
@@ -52,15 +52,17 @@ namespace PTMedicalInsurance.Helper
|
|
|
JObject joRtn = new JObject();
|
|
|
try
|
|
|
{
|
|
|
- if (Global.curEvt.funNo.Contains("CFYLJG"))
|
|
|
- {
|
|
|
- //Global.curEvt.URL = "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/" + Global.curEvt.funNo;
|
|
|
|
|
|
- //电子处方测试
|
|
|
- Global.inf.apiSecretKey = "4poYlzt2jteX1pT3tijh7BqyWH4Lp0zN";
|
|
|
- Global.inf.passid = "sztest_hosp";
|
|
|
- Global.curEvt.URL = "http://hosp-sz.gd.hsip.gov.cn/ebus/sztest_hosp/poc/hsa/hgs/" + Global.curEvt.funNo;
|
|
|
- }
|
|
|
+ //if (Global.curEvt.funNo.Contains("CFYLJG"))
|
|
|
+ //{
|
|
|
+ // //Global.curEvt.URL = "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/" + Global.curEvt.funNo;
|
|
|
+
|
|
|
+ // //电子处方测试
|
|
|
+ // Global.inf.apiSecretKey = "4poYlzt2jteX1pT3tijh7BqyWH4Lp0zN";
|
|
|
+ // Global.inf.passid = "sztest_hosp";
|
|
|
+ // Global.curEvt.URL = "http://hosp-sz.gd.hsip.gov.cn/ebus/sztest_hosp/poc/hsa/hgs/" + Global.curEvt.funNo;
|
|
|
+ //}
|
|
|
+
|
|
|
//创建一个HTTP请求
|
|
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Global.curEvt.URL);
|
|
|
//Post请求方式
|
|
|
@@ -87,11 +89,11 @@ namespace PTMedicalInsurance.Helper
|
|
|
//Sha256 加密生成的签名 x-tif-signature = sha256(x-tif-timestamp + secretKey+ x-tif-nonce + xtif-timestamp)
|
|
|
string signature = Encrypt.SHA256EncryptStr(sTemp);
|
|
|
|
|
|
-
|
|
|
nonce = GetRandomString(32); // 随机数
|
|
|
//timestamp = GetCurrentUnixSeconds().ToString();
|
|
|
signature = GetSHA256Str($"{timestamp}{secretKey}{nonce}{timestamp}"); // 签名
|
|
|
|
|
|
+
|
|
|
//Global.writeLog($"nonce:{nonce}\ntimestamp:{timestamp}\nsecretKey:{secretKey}\npassid:{passid}\nsignature:{signature}");
|
|
|
|
|
|
//增加头部信息
|
|
|
@@ -117,7 +119,7 @@ namespace PTMedicalInsurance.Helper
|
|
|
try
|
|
|
{
|
|
|
//获得响应流
|
|
|
- response = (HttpWebResponse)request.GetResponse();
|
|
|
+ response = (HttpWebResponse)request.GetResponse();
|
|
|
}
|
|
|
catch (WebException ex)
|
|
|
{
|
|
|
@@ -286,7 +288,7 @@ namespace PTMedicalInsurance.Helper
|
|
|
if (response != null)
|
|
|
{
|
|
|
Stream s = response.GetResponseStream();
|
|
|
- StreamReader sRead = new StreamReader(s,Encoding.GetEncoding("UTF-8"));
|
|
|
+ StreamReader sRead = new StreamReader(s, Encoding.GetEncoding("UTF-8"));
|
|
|
data = sRead.ReadToEnd();
|
|
|
sRead.Close();
|
|
|
response.Close();
|
|
|
@@ -294,5 +296,7 @@ namespace PTMedicalInsurance.Helper
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|