|
@@ -42,6 +42,7 @@ using Hotline.Share.Enums.Push;
|
|
|
using XF.Domain.Cache;
|
|
|
using Hotline.Api.Filter;
|
|
|
using Hotline.Push.Notifies;
|
|
|
+using Hotline.Users;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -96,6 +97,7 @@ public class OrderController : BaseController
|
|
|
private readonly ILogger<OrderController> _logger;
|
|
|
private readonly ITypedCache<EnterpriseVo> _cacheResponse;
|
|
|
private readonly IRepository<OrderSendBackAudit> _orderSendBackAuditRepository;
|
|
|
+ private readonly IRepository<User> _userRepository;
|
|
|
|
|
|
public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
@@ -143,7 +145,8 @@ public class OrderController : BaseController
|
|
|
IPushDomainService pushDomainService,
|
|
|
ILogger<OrderController> logger,
|
|
|
ITypedCache<EnterpriseVo> cacheResponse,
|
|
|
- IRepository<OrderSendBackAudit> orderSendBackAuditRepository
|
|
|
+ IRepository<OrderSendBackAudit> orderSendBackAuditRepository,
|
|
|
+ IRepository<User> userRepository
|
|
|
)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
@@ -192,7 +195,7 @@ public class OrderController : BaseController
|
|
|
_pushDomainService = pushDomainService;
|
|
|
_cacheResponse = cacheResponse;
|
|
|
_orderSendBackAuditRepository = orderSendBackAuditRepository;
|
|
|
-
|
|
|
+ _userRepository = userRepository;
|
|
|
}
|
|
|
|
|
|
#region 工单发布
|
|
@@ -1604,7 +1607,32 @@ public class OrderController : BaseController
|
|
|
|
|
|
if (dto.AcceptSms)
|
|
|
{
|
|
|
- //TODO 发送短信
|
|
|
+ //发送短信
|
|
|
+ try
|
|
|
+ {
|
|
|
+ //查询部门所有账号
|
|
|
+ var userlist = await _userRepository.Queryable().Where(x => x.OrgId == model.OrgId).ToListAsync();
|
|
|
+ //发送短信
|
|
|
+ foreach (var user in userlist)
|
|
|
+ {
|
|
|
+ var messageDto = new MessageDto
|
|
|
+ {
|
|
|
+ PushBusiness = EPushBusiness.OrderSupervise,
|
|
|
+ ExternalId = order.Id,
|
|
|
+ OrderId = order.Id,
|
|
|
+ PushPlatform = EPushPlatform.Sms,
|
|
|
+ Remark = order.Title,
|
|
|
+ Name = user.PhoneNo,
|
|
|
+ TemplateCode = "1003",
|
|
|
+ Params = new List<string>() { order.No },
|
|
|
+ TelNumber = user.PhoneNo,
|
|
|
+
|
|
|
+ };
|
|
|
+ await _mediator.Publish(new PushMessageNotify(messageDto), HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
}
|
|
|
|
|
|
//推省上
|
|
@@ -1689,6 +1717,7 @@ public class OrderController : BaseController
|
|
|
// _logger.LogError("_provinceService.SendSuperviseProcessInfo throw exception: {ex}", e.Message);
|
|
|
//}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1822,7 +1851,29 @@ public class OrderController : BaseController
|
|
|
await _orderUrgeRepository.AddAsync(model, HttpContext.RequestAborted);
|
|
|
if (dto.AcceptSms)
|
|
|
{
|
|
|
- //TODO 发送短信
|
|
|
+ try
|
|
|
+ {
|
|
|
+ //查询部门所有账号
|
|
|
+ var userlist = await _userRepository.Queryable().Where(x => x.OrgId == model.OrgId).ToListAsync();
|
|
|
+ foreach (var user in userlist)
|
|
|
+ {
|
|
|
+ //发送短信
|
|
|
+ var messageDto = new MessageDto
|
|
|
+ {
|
|
|
+ PushBusiness = EPushBusiness.OrderUrge,
|
|
|
+ ExternalId = order.Id,
|
|
|
+ OrderId = order.Id,
|
|
|
+ PushPlatform = EPushPlatform.Sms,
|
|
|
+ Remark = order.Title,
|
|
|
+ Name = user.PhoneNo,
|
|
|
+ TemplateCode = "1002",
|
|
|
+ Params = new List<string>() { order.No },
|
|
|
+ TelNumber = user.PhoneNo,
|
|
|
+ };
|
|
|
+ await _mediator.Publish(new PushMessageNotify(messageDto), HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch{}
|
|
|
}
|
|
|
|
|
|
//推省上
|
|
@@ -1869,6 +1920,8 @@ public class OrderController : BaseController
|
|
|
if (dto.Files.Any())
|
|
|
urge.ReplyFileJson = await _fileRepository.AddFileAsync(dto.Files, urge.Id, "", HttpContext.RequestAborted);
|
|
|
await _orderUrgeRepository.UpdateAsync(urge, HttpContext.RequestAborted);
|
|
|
+
|
|
|
+ //发送短信TODO
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -2099,10 +2152,12 @@ public class OrderController : BaseController
|
|
|
ExternalId = order.Id,
|
|
|
OrderId = order.Id,
|
|
|
PushPlatform = EPushPlatform.Sms,
|
|
|
- Content =
|
|
|
- $"温馨提示:您的来电已受理(流水号:{order.No};提取码:{order.Password},可通过网站(http://hotline.12345lm.cn)进行查询,谢谢。【宜宾12345热线平台】)",
|
|
|
+ //Content =
|
|
|
+ // $"温馨提示:您的来电已受理(流水号:{order.No};提取码:{order.Password},可通过网站(http://hotline.12345lm.cn)进行查询,谢谢。【宜宾12345热线平台】)",
|
|
|
Remark = order.Title,
|
|
|
Name = order.FromName,
|
|
|
+ TemplateCode = "1005",
|
|
|
+ Params = new List<string>() { order.No, order.Password },
|
|
|
TelNumber = order.Contact,
|
|
|
|
|
|
};
|
|
@@ -2459,11 +2514,13 @@ public class OrderController : BaseController
|
|
|
if (sendBackOrg.IsCenter && applyOrg.IsCenter)
|
|
|
{
|
|
|
await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
|
+ //发送短信TODO
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
await _workflowApplication.PreviousAsync(dto, HttpContext.RequestAborted);
|
|
|
+ //发送短信TODO
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2494,6 +2551,8 @@ public class OrderController : BaseController
|
|
|
if (sendBack.State == ESendBackAuditState.End)
|
|
|
{
|
|
|
await _workflowApplication.OrderPreviousAsync(sendBack.SendBackData, sendBack.WorkflowUserId, HttpContext.RequestAborted);
|
|
|
+ //发送短信TODO
|
|
|
+
|
|
|
}
|
|
|
await _orderSendBackAuditRepository.UpdateAsync(sendBack, HttpContext.RequestAborted);
|
|
|
}
|