66 lines
2.2 KiB
C#
66 lines
2.2 KiB
C#
using CRM.Core.BLL.EventBus.EventHandlers;
|
|
using CRM.Core.BLL.EventBus.Events;
|
|
using CRM.Core.BLL.Quality;
|
|
using CRM.Core.Common.EventBus;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using WX.CRM.Common;
|
|
|
|
namespace CRM.Core.CoreService.SmsJob
|
|
{
|
|
/// <summary>
|
|
/// 任务执行
|
|
/// </summary>
|
|
public class HgSmsSendExc
|
|
{
|
|
QC_CUSTOMERCOMPLAIN_BL complainBL = new QC_CUSTOMERCOMPLAIN_BL();
|
|
public HgSmsSendExc()
|
|
{
|
|
EventBus.Instance.Subscribe(new SendHgMessageEventHandler());
|
|
}
|
|
public void Send()
|
|
{
|
|
try
|
|
{
|
|
LogHelper.Info("==================开始合规消息发送Start==============");
|
|
var hgReceiveMobile = ConfigurationManager.AppSettings["HgReceiveMobile"];
|
|
var resList = new List<string>();
|
|
if (!string.IsNullOrWhiteSpace(hgReceiveMobile))
|
|
{
|
|
resList = hgReceiveMobile.Split(',').ToList();
|
|
}
|
|
var list = complainBL.GetUnHandleList();
|
|
if (list != null && list.Count > 0)
|
|
{
|
|
foreach (var resId in resList)
|
|
{
|
|
var sendHgMessageEvent = new SendHgMessageEvent(-1, resId, 10000);
|
|
EventBus.Instance.Publish(sendHgMessageEvent);
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
list = complainBL.GetHandleingList();
|
|
if (list != null && list.Count > 0)
|
|
{
|
|
foreach (var resId in resList)
|
|
{
|
|
var sendHgMessageEvent = new SendHgMessageEvent(0, resId, 10000);
|
|
EventBus.Instance.Publish(sendHgMessageEvent);
|
|
}
|
|
}
|
|
}
|
|
LogHelper.Info("==================结束合规消息发送End==============");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error("合规消息发送错误", ex);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|