/// <summary> /// 互亿无线群发 /// </summary> /// <param name="request"></param> /// <returns></returns> internal static Result MassSMSMessage(DataContract.Request request) { string url = WebConfigurationManager.AppSettings["MassSMSURL"].ToString(); var para = request.GetParameters <SendSmsReqPara>(); SMSSendBLL bll = new SMSSendBLL(new JIT.Utility.BasicUserInfo()); var entity = new SMSSendEntity() { MobileNO = para.MobileNO, Sign = para.Sign, SMSContent = para.SMSContent, Account = "cf_znxx", Password = "******" }; //调用短信接口直接发送 var result = GetResult(entity.GetSMS().Send2(SendType.Get, url));//GetSMS确定了是用的HuYiSMS if (result.IsSuccess) { entity.Status = 1; entity.SendCount = (entity.SendCount ?? 0) + 1; entity.Mtmsgid = result.SMSID; entity.RegularlySendTime = DateTime.Now; // Loggers.Debug(new DebugLogInfo() { Message = "【发送成功】{0}【手机号】:{1}{0}【内容】:{2}{0}【返回码】:{3}".Fmt(Environment.NewLine, entity.MobileNO, entity.SMSContent, result.ToJSON()) }); } else { entity.SendCount = (entity.SendCount ?? 0) + 1; //Loggers.Debug(new DebugLogInfo() { Message = "【发送失败】{0}【手机号】:{1}{0}【内容】:{2}{0}【错误信息】:{3}".Fmt(Environment.NewLine, entity.MobileNO, entity.SMSContent, result.ToJSON()) }); } return(result); }
/// <summary> /// 阿里大鱼 /// </summary> /// <param name="request"></param> /// <returns></returns> internal static BizResult AlidayuMessage(DataContract.Request request) { var para = request.GetParameters <SendSmsReqPara>(); //配置模板ID var tplId = string.IsNullOrEmpty(ConfigurationManager.AppSettings["TemplateID"]) ? "SMS_7730051" : ConfigurationManager.AppSettings["TemplateID"]; AlibabaAliqinFcSmsNumSendResponse rsp = new AlibabaAliqinFcSmsNumSendResponse(); string pSMSContent = "{\"code\":\"" + para.SMSContent + " \"}"; rsp = AlidatySendMessage(para.Sign, pSMSContent, para.MobileNO, tplId); return(rsp.Result); }
/// <summary> /// 阿里大鱼(发送取件码) /// </summary> /// <param name="request"></param> /// <returns></returns> internal static BizResult AlidayuMessagePickupCode(DataContract.Request request) { return(null); //以下代码少文件 /* * var para = request.GetParameters<PickupCodeReqPara>(); * * AlibabaAliqinFcSmsNumSendResponse rsp = new AlibabaAliqinFcSmsNumSendResponse(); * * string pSMSContent = "{\"orderNo\":\"" + para.OrderNo + " \",\"pickupCode\":\"" + para.PickupCode + " \"}"; * rsp = AlidatySendMessage(para.Sign, pSMSContent, para.MobileNO, "SMS_14265183"); * return rsp.Result; */ }
/// <summary> /// 互亿无线 /// </summary> /// <param name="request"></param> /// <returns></returns> internal static Result SendMessage(DataContract.Request request) { string url = WebConfigurationManager.AppSettings["SMSSendURL"].ToString(); var para = request.GetParameters <SendSmsReqPara>(); SMSSendBLL bll = new SMSSendBLL(new JIT.Utility.BasicUserInfo()); SMSCustomerBLL smsCustomerBll = new SMSCustomerBLL(new JIT.Utility.BasicUserInfo()); var smsCustomer = smsCustomerBll.GetByID(null, para.Sign); var entity = new SMSSendEntity() { MobileNO = para.MobileNO, Sign = para.Sign, SMSContent = para.SMSContent, Account = smsCustomer.Account, Password = smsCustomer.Password }; //调用短信接口直接发送 var result = GetResult(entity.GetSMS().Send2(JIT.Utility.SMS.Base.SendType.Get, url));//GetSMS确定了是用的HuYiSMS if (result.IsSuccess) { entity.Status = 1; entity.SendCount = (entity.SendCount ?? 0) + 1; entity.Mtmsgid = result.SMSID; entity.RegularlySendTime = DateTime.Now; Loggers.Debug(new DebugLogInfo() { Message = "【发送成功】{0}【手机号】:{1}{0}【内容】:{2}{0}【返回码】:{3}".Fmt(Environment.NewLine, entity.MobileNO, entity.SMSContent, result.ToJSON()) }); } else { entity.SendCount = (entity.SendCount ?? 0) + 1; Loggers.Debug(new DebugLogInfo() { Message = "【发送失败】{0}【手机号】:{1}{0}【内容】:{2}{0}【错误信息】:{3}".Fmt(Environment.NewLine, entity.MobileNO, entity.SMSContent, result.ToJSON()) }); } //保存数据库 bll.Create(entity); return(result); }