using System;
|
using System.Text.RegularExpressions;
|
using JiepeiWMS.Common;
|
using JiepeiWMS.Extends;
|
using log4net;
|
|
namespace JiepeiWMS.Common
|
{
|
public static class SmsHelper
|
{
|
private static readonly ILog log = LogManager.GetLogger(typeof(SmsHelper));
|
/// <summary>
|
/// 添加发送短信
|
/// </summary>
|
public static bool Send(string note, string tel)
|
{
|
try
|
{
|
if (tel.IsCanSendMobile())
|
{
|
YiMeiMsmHelper.Send(tel, note);
|
return true;
|
}
|
return false;
|
}
|
catch (Exception ex)
|
{
|
//LogHelper.Error(ex);
|
log.Error(ex);
|
return false;
|
}
|
}
|
|
|
/// <summary>
|
/// 添加定时发送短信
|
/// </summary>
|
public static bool SendTimerSms(string note, string tel, string sendTime)
|
{
|
try
|
{
|
if (tel.IsCanSendMobile())
|
{
|
YiMeiMsmHelper.SendTimerSms(tel, note, sendTime);
|
return true;
|
}
|
return false;
|
}
|
catch (Exception ex)
|
{
|
log.Error(ex);
|
return false;
|
}
|
}
|
|
|
/// <summary>
|
/// 发送语音短信
|
/// add by wangyongbo 2020-11-18
|
/// </summary>
|
/// <param name="note"></param>
|
/// <param name="tel"></param>
|
/// <returns></returns>
|
public static bool SendVoice(string note, string tel)
|
{
|
try
|
{
|
if (tel.IsCanSendMobile())
|
{
|
YiMeiMsmHelper.SendVoice(tel, note);
|
return true;
|
}
|
|
return false;
|
}
|
catch (Exception ex)
|
{
|
log.Error(ex);
|
return false;
|
}
|
|
}
|
|
/// <summary>
|
/// 添加发送语音验证
|
/// </summary>
|
public static bool SendVote(string note, string tel)
|
{
|
try
|
{
|
if (tel.IsCanSendMobile())
|
{
|
|
//Pcb.Common.WKSms.smsSoapClient sms = new Pcb.Common.WKSms.smsSoapClient();
|
// note = "(捷配)" + note;
|
bool isSend = false;
|
YiMeiMsmHelper.Send(tel, note);
|
return isSend;
|
}
|
return false;
|
}
|
catch (Exception ex)
|
{
|
log.Error(ex);
|
return false;
|
}
|
}
|
|
|
|
|
}
|
}
|