|
@@ -59,7 +59,7 @@ namespace MySystem
|
|
|
|
|
|
string QueryField = "";
|
|
|
List<string> PushField = new List<string>();
|
|
|
- Dictionary<string, string> Trans = new Dictionary<string, string>();;
|
|
|
+ Dictionary<string, string> Trans = new Dictionary<string, string>();
|
|
|
JsonData fieldJson = JsonMapper.ToObject(FieldList);
|
|
|
for (int i = 0; i < fieldJson.Count; i++)
|
|
|
{
|
|
@@ -158,6 +158,10 @@ namespace MySystem
|
|
|
val = num.ToString("f0");
|
|
|
}
|
|
|
}
|
|
|
+ if(dc.DataType == typeof(DateTime))
|
|
|
+ {
|
|
|
+ val = DateTime.Parse(val).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ }
|
|
|
obj.Add(dc.ColumnName, val);
|
|
|
}
|
|
|
}
|
|
@@ -168,7 +172,9 @@ namespace MySystem
|
|
|
if(EncryptMode == 1)
|
|
|
{
|
|
|
PushData = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
|
+ LogHelper.Instance.WriteLog("原始数据:" + PushData, "推送数据日志");
|
|
|
string content = EncryptHelper.Encrypt1(obj, AesSecret);
|
|
|
+ LogHelper.Instance.WriteLog("加密数据:" + content, "推送数据日志");
|
|
|
obj = new SortedList<string, string>();
|
|
|
obj.Add("type", Title);
|
|
|
obj.Add("notice_id", Guid.NewGuid().ToString());
|
|
@@ -176,11 +182,14 @@ namespace MySystem
|
|
|
obj.Add("content", content);
|
|
|
string requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
|
|
|
PushDataEncrypt = requestJson;
|
|
|
- // string result = function.PostWebRequest(NoticeUrl, requestJson, "application/json");
|
|
|
- // if(result.Contains("\"code\":\"200\""))
|
|
|
- // {
|
|
|
- // Status = 1;
|
|
|
- // }
|
|
|
+ LogHelper.Instance.WriteLog("请求参数:" + PushDataEncrypt, "推送数据日志");
|
|
|
+ LogHelper.Instance.WriteLog("请求地址:" + NoticeUrl, "推送数据日志");
|
|
|
+ string result = function.PostWebRequest(NoticeUrl, requestJson, "application/json");
|
|
|
+ LogHelper.Instance.WriteLog("返回报文:" + result + "\n\n", "推送数据日志");
|
|
|
+ if(result.Replace(" ", "").Contains("\"code\":\"200\""))
|
|
|
+ {
|
|
|
+ Status = 1;
|
|
|
+ }
|
|
|
}
|
|
|
PushRecord rec = db.PushRecord.Add(new PushRecord()
|
|
|
{
|