/// <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 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); }