短信发送
This commit is contained in:
parent
191e1c7d6b
commit
2a35d4efe3
@ -267,6 +267,7 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
{
|
||||
TencentSendSMS tencentSendSMS = new TencentSendSMS();
|
||||
string PhoneText = string.Empty;
|
||||
DateTime now = DateTime.Now;
|
||||
if (!string.IsNullOrEmpty(filter.Parameter1))
|
||||
{
|
||||
PhoneText = filter.Parameter1;
|
||||
@ -277,6 +278,14 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
var result3 = tencentSendSMS.sendSMS("2428708", new string[] { PhoneText }, null);
|
||||
if (result2.SendStatusSet[0].Code.Equals("Ok"))
|
||||
{
|
||||
var task = GetEntity<T_FM_SYNC_TASK>(filter.Keyword);
|
||||
task.CURR_TASK_START_TIME = now;//上次同步结束时间
|
||||
task.UPDATE_SUCCES_TIME = now;//上次同步结束时间
|
||||
task.SYNC_PARAM = "";//清空参数
|
||||
if (task != null)
|
||||
{
|
||||
UpdateEntityNoCommit(task);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -286,14 +295,13 @@ namespace APT.SC.WebApi.Controllers.Api.BI
|
||||
}
|
||||
else
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
var allUsers = GetEntities<T_FM_USER>(t => t.ENABLE_STATUS == 0, new BaseFilter(filter.GetOrgId()));
|
||||
var approveUsers = GetEntities<T_FM_USER>(t => t.Nav_Department.DEPARTMENT_TYPE != 2 && t.ENABLE_STATUS == 0, new BaseFilter(filter.GetOrgId()));
|
||||
var userIds = approveUsers.Select(t => t.ID);
|
||||
List<T_FM_NOTIFICATION_TASK> sendSMSs = null;
|
||||
if (now.Hour >= 7 && now.Hour < 20)
|
||||
{
|
||||
sendSMSs = GetEntities<T_FM_NOTIFICATION_TASK>(t => t.NOTICE_STATUS == 0 && t.TASK_ENDDT >= now && t.CREATE_TIME > now.AddDays(-12) && !t.SOURCE_FORMCODE.Contains("FO005") && t.SENDTIME == DateTime.MinValue, new BaseFilter(filter.GetOrgId())).ToList();//未超期的进行提醒
|
||||
sendSMSs = GetEntities<T_FM_NOTIFICATION_TASK>(t => t.NOTICE_STATUS == 0 && t.TASK_ENDDT >= now && t.CREATE_TIME > now.AddDays(-10) && !t.SOURCE_FORMCODE.Contains("FO005") && t.SENDTIME == DateTime.MinValue, new BaseFilter(filter.GetOrgId())).ToList();//未超期的进行提醒
|
||||
var sendSMSs2 = sendSMSs.Where(t => t.TASK_ENDDT < now.AddHours(1) && t.TASK_ENDDT > t.TASK_STARTDT);
|
||||
foreach (var send in sendSMSs2)//1个小时以内 临超时提醒
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user