protected void Page_Load(object sender, EventArgs e) { try { //{"ext":"\"11\"","msg":"","result":"Exec successful,0/1 is error!ReplicateCount is1"} SortedDictionary <string, string> pams = GetRequestPost(Request.RequestContext.HttpContext.Request); // CoreHelper.CreateFile(System.Configuration.ConfigurationManager.AppSettings["NotifyErrLogPath"] + "\\Qunar\\" + System.Guid.NewGuid() + ".txt", JsonConvert.SerializeObject(pams));//创建文件 JsonConvert.SerializeObject(pams); string result = pams["result"] == null ? "" : pams["result"].ToString(); SuccessStatus notifyResult = SuccessStatus.Other; bool isSucess = true; if (result.IndexOf("successful") > -1) { isSucess = true; notifyResult = SuccessStatus.Success; } else { isSucess = false; notifyResult = SuccessStatus.Failed; CoreHelper.CreateFile(System.Configuration.ConfigurationManager.AppSettings["NotifyErrLogPath"] + "\\Qunar\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", JsonConvert.SerializeObject(pams));//创建文件 } UpdateNotifyRequest request = new UpdateNotifyRequest() { UpdateStatusId = pams["ext"] == null || string.IsNullOrEmpty(pams["ext"])? "0" : pams["ext"].ToString().Replace("\\", ""), ResponseParams = JsonConvert.SerializeObject(pams), NotifyResult = notifyResult, IsSucess = isSucess }; IPolicyNotify notify = new DefaultPolicyNotify(); EmptyResponse res = notify.UpdateNotify(request); if (res.ErrCode == PolicyService.Enums.ResultType.Failed) { string log = DateTime.Now + ":回调内容:" + JsonConvert.SerializeObject(pams) + ",更新回调结果:" + JsonConvert.SerializeObject(res); CoreHelper.CreateFile(System.Configuration.ConfigurationManager.AppSettings["NotifyErrLogPath"] + "\\Qunar\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", log);//创建文件 Response.Write("F"); //Response.End(); } else { Response.Write("S"); } //Response.End(); } catch (Exception ex) { CoreHelper.CreateFile(System.Configuration.ConfigurationManager.AppSettings["NotifyErrLogPath"] + "\\Qunar\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", JsonConvert.SerializeObject(ex));//创建文件 } }
public DtoModel.SearchNotifyResponse SearchNotifyList(DtoModel.SearchNotifyRequest request) { IPolicyNotify notify = new DefaultPolicyNotify(); return(notify.SearchNotifyList(request)); }
public SaveNotifyResponse SaveNotify(PolicyNotifyRequest request) { IPolicyNotify notify = new DefaultPolicyNotify(); return(notify.SaveNotify(request)); }
public DtoModel.EmptyResponse UpdateNotify(DtoModel.UpdateNotifyRequest request) { IPolicyNotify notify = new DefaultPolicyNotify(); return(notify.UpdateNotify(request)); }