|
@@ -21,7 +21,6 @@ using Hotline.Share.Dtos.Settings;
|
|
using Hotline.Share.Enums.Order;
|
|
using Hotline.Share.Enums.Order;
|
|
using Hotline.Share.Enums.Quality;
|
|
using Hotline.Share.Enums.Quality;
|
|
using Hotline.Share.Enums.Settings;
|
|
using Hotline.Share.Enums.Settings;
|
|
-using Hotline.Share.Mq;
|
|
|
|
using Hotline.Share.Requests;
|
|
using Hotline.Share.Requests;
|
|
using MapsterMapper;
|
|
using MapsterMapper;
|
|
using MediatR;
|
|
using MediatR;
|
|
@@ -40,6 +39,9 @@ using Hotline.Share.Dtos.File;
|
|
using Hotline.Application.Quality;
|
|
using Hotline.Application.Quality;
|
|
using Hotline.Enterprise;
|
|
using Hotline.Enterprise;
|
|
using Hotline.Share.Dtos.Enterprise;
|
|
using Hotline.Share.Dtos.Enterprise;
|
|
|
|
+using Hotline.Push.FWMessage;
|
|
|
|
+using Hotline.Share.Dtos.Push;
|
|
|
|
+using Hotline.Share.Enums.Push;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
|
@@ -89,11 +91,12 @@ public class OrderController : BaseController
|
|
private readonly IRepository<OrderSpecial> _orderSpecialRepository;
|
|
private readonly IRepository<OrderSpecial> _orderSpecialRepository;
|
|
private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
|
|
private readonly IRepository<WorkflowTrace> _workflowTraceRepository;
|
|
private readonly IRepository<TrCallRecord> _trCallRecordRepository;
|
|
private readonly IRepository<TrCallRecord> _trCallRecordRepository;
|
|
- private readonly ILogger<OrderController> _logger;
|
|
|
|
private readonly IOrderApplication _orderApplication;
|
|
private readonly IOrderApplication _orderApplication;
|
|
private readonly IEnterpriseService _enterpriseService;
|
|
private readonly IEnterpriseService _enterpriseService;
|
|
|
|
+ private readonly IPushDomainService _pushDomainService;
|
|
|
|
+ private readonly ILogger<OrderController> _logger;
|
|
|
|
|
|
- public OrderController(
|
|
|
|
|
|
+ public OrderController(
|
|
IOrderDomainService orderDomainService,
|
|
IOrderDomainService orderDomainService,
|
|
IOrderRepository orderRepository,
|
|
IOrderRepository orderRepository,
|
|
IWorkflowApplication workflowApplication,
|
|
IWorkflowApplication workflowApplication,
|
|
@@ -135,9 +138,11 @@ public class OrderController : BaseController
|
|
IRepository<OrderSpecial> orderSpecialRepository,
|
|
IRepository<OrderSpecial> orderSpecialRepository,
|
|
IRepository<WorkflowTrace> workflowTraceRepository,
|
|
IRepository<WorkflowTrace> workflowTraceRepository,
|
|
IRepository<TrCallRecord> trCallRecordRepository,
|
|
IRepository<TrCallRecord> trCallRecordRepository,
|
|
- ILogger<OrderController> logger,
|
|
|
|
IOrderApplication orderApplication,
|
|
IOrderApplication orderApplication,
|
|
- IEnterpriseService enterpriseService)
|
|
|
|
|
|
+ IEnterpriseService enterpriseService,
|
|
|
|
+ IPushDomainService pushDomainService,
|
|
|
|
+ ILogger<OrderController> logger
|
|
|
|
+ )
|
|
{
|
|
{
|
|
_orderDomainService = orderDomainService;
|
|
_orderDomainService = orderDomainService;
|
|
_orderRepository = orderRepository;
|
|
_orderRepository = orderRepository;
|
|
@@ -183,8 +188,8 @@ public class OrderController : BaseController
|
|
_logger = logger;
|
|
_logger = logger;
|
|
_orderApplication = orderApplication;
|
|
_orderApplication = orderApplication;
|
|
_enterpriseService = enterpriseService;
|
|
_enterpriseService = enterpriseService;
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ _pushDomainService = pushDomainService;
|
|
|
|
+ }
|
|
|
|
|
|
#region 工单发布
|
|
#region 工单发布
|
|
|
|
|
|
@@ -1796,7 +1801,7 @@ public class OrderController : BaseController
|
|
.Includes(d => d.OrderDelays)
|
|
.Includes(d => d.OrderDelays)
|
|
.Includes(d => d.OrderScreens)
|
|
.Includes(d => d.OrderScreens)
|
|
.Includes(d => d.OrderVisits, x => x.OrderVisitDetails)
|
|
.Includes(d => d.OrderVisits, x => x.OrderVisitDetails)
|
|
- .Includes(d=> d.OrderVisits,x=>x.Employee)
|
|
|
|
|
|
+ .Includes(d => d.OrderVisits, x => x.Employee)
|
|
.FirstAsync(d => d.Id == id);
|
|
.FirstAsync(d => d.Id == id);
|
|
if (order == null)
|
|
if (order == null)
|
|
return new();
|
|
return new();
|
|
@@ -1864,6 +1869,30 @@ public class OrderController : BaseController
|
|
|
|
|
|
//内容分词
|
|
//内容分词
|
|
await _orderApplication.OrderParticiple(dto.Content, order.Id, HttpContext.RequestAborted);
|
|
await _orderApplication.OrderParticiple(dto.Content, order.Id, HttpContext.RequestAborted);
|
|
|
|
+
|
|
|
|
+ //sms
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ if (order.SmsSended)
|
|
|
|
+ {
|
|
|
|
+ await _pushDomainService.PushAsync(new MessageDto
|
|
|
|
+ {
|
|
|
|
+ PushBusiness = EPushBusiness.OrderAccept,
|
|
|
|
+ ExternalId = order.Id,
|
|
|
|
+ OrderId = order.Id,
|
|
|
|
+ PushPlatform = EPushPlatform.Sms,
|
|
|
|
+ Content =
|
|
|
|
+ $"温馨提示:您的来电已受理(流水号:{order.No};提取码:{order.Password},可通过网站(http://hotline.12345lm.cn)进行查询,谢谢。【宜宾12345热线平台】)",
|
|
|
|
+ Remark = order.Title,
|
|
|
|
+ Name = order.FromName,
|
|
|
|
+ TelNumber = order.Contact
|
|
|
|
+ }, HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e)
|
|
|
|
+ {
|
|
|
|
+ _logger.LogError("新增工单发送短信失败,Error:{err}", e.Message);
|
|
|
|
+ }
|
|
return order.Id;
|
|
return order.Id;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3105,18 +3134,18 @@ public class OrderController : BaseController
|
|
await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
await _orderRepository.UpdateAsync(order, HttpContext.RequestAborted);
|
|
}
|
|
}
|
|
|
|
|
|
- #endregion
|
|
|
|
|
|
+ #endregion
|
|
|
|
|
|
- #region 获取企业信息
|
|
|
|
|
|
+ #region 获取企业信息
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 获取企业信息
|
|
/// 获取企业信息
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- [HttpGet("enterprise/List")]
|
|
|
|
- public async Task<EnterpriseListData> GetEnterpriseList([FromQuery] PagedKeywordRequest dto)
|
|
|
|
- {
|
|
|
|
- return await _enterpriseService.GetEnterpriseList(dto.Keyword!, dto.PageIndex,dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
- }
|
|
|
|
- #endregion
|
|
|
|
|
|
+ [HttpGet("enterprise/List")]
|
|
|
|
+ public async Task<EnterpriseListData> GetEnterpriseList([FromQuery] PagedKeywordRequest dto)
|
|
|
|
+ {
|
|
|
|
+ return await _enterpriseService.GetEnterpriseList(dto.Keyword!, dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
|
|
|
|
+ }
|
|
|
|
+ #endregion
|
|
}
|
|
}
|