|
@@ -151,9 +151,66 @@ namespace MySystem.Controllers
|
|
|
{
|
|
|
// AliyunPushHelper.Instance.DoSomeThing("{\"Account\":\"14726006947\",\"Device\":\"ANDROID\",\"Title\":\"测试推送\",\"Body\":\"客小爽推送功能即将上线\"}");
|
|
|
// AliyunPushHelper.Instance.DoSomeThing("{\"Account\":\"14726006947\",\"Device\":\"IOS\",\"Title\":\"测试推送\",\"Body\":\"客小爽推送功能即将上线\"}");
|
|
|
- string content = "{\"data_type\":\"bind\",\"data_content\":{\"pos_sn\":\"1014BS0023511\",\"mer_no\":\"15608798003\",\"id_card\":null,\"mer_name\":\"15608798003\",\"mer_mobile\":\"15608798003\",\"request_id\":\"2024102310381200098289115\",\"bind_time\":\"2024-10-23 10:38:12\",\"brand\":\"23\"}}";
|
|
|
- PosPushHelper.Instance.DoSomeThing(content);
|
|
|
+ // string content = "{\"data_type\":\"bind\",\"data_content\":{\"pos_sn\":\"1014BS0023511\",\"mer_no\":\"15608798003\",\"id_card\":null,\"mer_name\":\"15608798003\",\"mer_mobile\":\"15608798003\",\"request_id\":\"2024102310381200098289115\",\"bind_time\":\"2024-10-23 10:38:12\",\"brand\":\"23\"}}";
|
|
|
+ // PosPushHelper.Instance.DoSomeThing(content);
|
|
|
+ // SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ // obj.Add("pos_sn", "LDN7HDQM365548961135");
|
|
|
+ // obj.Add("mer_no", "015330849562900");
|
|
|
+ // obj.Add("id_card", "");
|
|
|
+ // obj.Add("mer_name", "");
|
|
|
+ // obj.Add("mer_mobile", "");
|
|
|
+ // obj.Add("request_id", "ac76801a7b0773063ac20ece3f8ca6dc");
|
|
|
+ // obj.Add("bind_time", "2024-12-27 10:16:10");
|
|
|
+ // obj.Add("brand", "29");
|
|
|
+ // jm(obj, "bind");
|
|
|
+
|
|
|
+ // SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ // obj.Add("pos_sn", "LDN7HDQM365548961135");
|
|
|
+ // obj.Add("mer_no", "015330849562900");
|
|
|
+ // obj.Add("request_id", "7440225443200e5c52d1a502074915ab");
|
|
|
+ // obj.Add("deposit_amount", "299.00");
|
|
|
+ // obj.Add("trade_time", "2024-12-27 10:17:11");
|
|
|
+ // obj.Add("card_type", "1");
|
|
|
+ // obj.Add("brand", "29");
|
|
|
+ // jm(obj, "deposit");
|
|
|
+
|
|
|
+ SortedList<string, string> obj = new SortedList<string, string>();
|
|
|
+ obj.Add("pos_sn","LDN7HDQM365548961135");
|
|
|
+ obj.Add("mer_no","015330849562900");
|
|
|
+ obj.Add("request_id","G1241227C03142143729");
|
|
|
+ obj.Add("trade_amount","48.00");
|
|
|
+ obj.Add("trade_time","2024-12-27 00:00:27");
|
|
|
+ obj.Add("brand","29");
|
|
|
+ obj.Add("is_act","0");
|
|
|
+ obj.Add("card_type","1");
|
|
|
+ obj.Add("qr_pay_flag","0");
|
|
|
+ obj.Add("fee_rate","0.63");
|
|
|
+ obj.Add("fee_amt","3");
|
|
|
+ jm(obj, "trade");
|
|
|
+
|
|
|
return "ok";
|
|
|
}
|
|
|
+
|
|
|
+ public string jm(SortedList<string, string> obj, string type)
|
|
|
+ {
|
|
|
+ string NoticeUrl = "http://61.189.43.58:9092/prod-api/space/open/api/commerce/offline/business/data";
|
|
|
+ string PushData = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
|
+ LogHelper.Instance.WriteLog("原始数据:" + PushData, "推送数据日志");
|
|
|
+ string content = EncryptHelper.Encrypt1(obj, "KTVpzn70n3Bv7w04");
|
|
|
+ LogHelper.Instance.WriteLog("加密数据:" + content, "推送数据日志");
|
|
|
+ obj = new SortedList<string, string>();
|
|
|
+ obj.Add("type", type);
|
|
|
+ obj.Add("notice_id", Guid.NewGuid().ToString());
|
|
|
+ obj.Add("timestamp", function.getTimeStamp());
|
|
|
+ obj.Add("content", content);
|
|
|
+ string requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
|
+ string PushDataEncrypt = requestJson;
|
|
|
+ LogHelper.Instance.WriteLog("请求参数:" + PushDataEncrypt, "推送数据日志");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + NoticeUrl, "推送数据日志");
|
|
|
+ string result = function.PostWebRequest(NoticeUrl, requestJson, "application/json");
|
|
|
+ LogHelper.Instance.WriteLog("返回报文:" + result + "\n\n", "推送数据日志");
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
}
|