|
@@ -3,6 +3,7 @@ using Hotline.Article;
|
|
|
using Hotline.Caching.Interfaces;
|
|
|
using Hotline.FlowEngine.Workflows;
|
|
|
using Hotline.Orders;
|
|
|
+using Hotline.Push.Notifies;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
using Hotline.Settings;
|
|
|
using Hotline.Settings.Hotspots;
|
|
@@ -14,10 +15,14 @@ using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Enums.Article;
|
|
|
using Hotline.Share.Enums.FlowEngine;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
+using Hotline.Share.Enums.Push;
|
|
|
using MapsterMapper;
|
|
|
+using MediatR;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using SqlSugar;
|
|
|
+using System.Threading;
|
|
|
+using XF.Domain.Exceptions;
|
|
|
using XF.Domain.Repository;
|
|
|
|
|
|
namespace Hotline.Api.Controllers
|
|
@@ -34,14 +39,27 @@ namespace Hotline.Api.Controllers
|
|
|
private readonly ISystemDicDataCacheManager _sysDicDataCacheManager;
|
|
|
private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
|
|
|
private readonly IRepository<Hotspot> _hotspotTypeRepository;
|
|
|
+ private readonly IMediator _mediator;
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="mapper"></param>
|
|
|
+ /// <param name="orderRepository"></param>
|
|
|
+ /// <param name="bulletinRepository"></param>
|
|
|
+ /// <param name="bulletinApplication"></param>
|
|
|
+ /// <param name="sysDicDataCacheManager"></param>
|
|
|
+ /// <param name="workflowTraceRepository"></param>
|
|
|
+ /// <param name="hotspotTypeRepository"></param>
|
|
|
+ /// <param name="mediator"></param>
|
|
|
public DataSharingController(IMapper mapper,
|
|
|
IOrderRepository orderRepository,
|
|
|
IRepository<Bulletin> bulletinRepository,
|
|
|
IBulletinApplication bulletinApplication,
|
|
|
ISystemDicDataCacheManager sysDicDataCacheManager,
|
|
|
IRepository<WorkflowTrace> workflowTraceRepository,
|
|
|
- IRepository<Hotspot> hotspotTypeRepository)
|
|
|
+ IRepository<Hotspot> hotspotTypeRepository,
|
|
|
+ IMediator mediator)
|
|
|
{
|
|
|
_mapper = mapper;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -50,6 +68,7 @@ namespace Hotline.Api.Controllers
|
|
|
_sysDicDataCacheManager = sysDicDataCacheManager;
|
|
|
_workflowTraceRepository = workflowTraceRepository;
|
|
|
_hotspotTypeRepository = hotspotTypeRepository;
|
|
|
+ _mediator = mediator;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -330,5 +349,39 @@ namespace Hotline.Api.Controllers
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 随手拍网格员-短信接口
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("grid_operator_send_sms")]
|
|
|
+ [AllowAnonymous]
|
|
|
+ public async Task<string> GridOperatorSendSms([FromBody] GridOperatorSendSmsDto dto)
|
|
|
+ {
|
|
|
+ if (dto == null)
|
|
|
+ return "数据获取失败";
|
|
|
+ var order = await _orderRepository.GetAsync(p => p.No == dto.ReplyCode, HttpContext.RequestAborted);
|
|
|
+ if (order == null)
|
|
|
+ return "工单查询失败";
|
|
|
+
|
|
|
+ var messageDto = new Share.Dtos.Push.MessageDto
|
|
|
+ {
|
|
|
+ PushBusiness = EPushBusiness.OrderSend,
|
|
|
+ ExternalId = order.Id,
|
|
|
+ OrderId = order.Id,
|
|
|
+ PushPlatform = EPushPlatform.Sms,
|
|
|
+ Remark = order.Title,
|
|
|
+ Name = dto.MemberName,
|
|
|
+ TemplateCode = "1010",
|
|
|
+ Params = new List<string>() { dto.AppealNumber },
|
|
|
+ TelNumber = dto.MemberMobile,
|
|
|
+
|
|
|
+ };
|
|
|
+ if (dto.SendType == "2")
|
|
|
+ messageDto.TemplateCode = "1011";
|
|
|
+
|
|
|
+ await _mediator.Publish(new PushMessageNotify(messageDto), HttpContext.RequestAborted);
|
|
|
+ return "提交成功";
|
|
|
+ }
|
|
|
}
|
|
|
}
|