|
@@ -10,6 +10,7 @@ using Hotline.Orders;
|
|
|
using Hotline.Orders.Notifications;
|
|
|
using Hotline.Permissions;
|
|
|
using Hotline.Repository.SqlSugar.Extensions;
|
|
|
+using Hotline.Repository.SqlSugar.Ts;
|
|
|
using Hotline.Settings;
|
|
|
using Hotline.Settings.Hotspots;
|
|
|
using Hotline.Settings.TimeLimits;
|
|
@@ -23,7 +24,9 @@ using MapsterMapper;
|
|
|
using MediatR;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.IdentityModel.Tokens;
|
|
|
+using MongoDB.Driver;
|
|
|
using SqlSugar;
|
|
|
+using System.Threading;
|
|
|
using XF.Domain.Authentications;
|
|
|
using XF.Domain.Constants;
|
|
|
using XF.Domain.Exceptions;
|
|
@@ -63,9 +66,10 @@ public class OrderController : BaseController
|
|
|
private readonly IFileRepository _fileRepository;
|
|
|
private readonly IRepository<OrderScreen> _orderScreenRepository;
|
|
|
private readonly IRepository<OrderPublishHistory> _orderPublishHistoryRepository;
|
|
|
+ private readonly IRepositoryTextSearch<OrderTs> _repositoryts;
|
|
|
|
|
|
|
|
|
- public OrderController(
|
|
|
+ public OrderController(
|
|
|
IOrderDomainService orderDomainService,
|
|
|
IOrderRepository orderRepository,
|
|
|
IWorkflowApplication workflowApplication,
|
|
@@ -90,8 +94,9 @@ public class OrderController : BaseController
|
|
|
IRepository<OrderUrge> orderUrgeRepository,
|
|
|
IFileRepository fileRepository,
|
|
|
IRepository<OrderScreen> orderScreenRepository,
|
|
|
- IRepository<OrderPublishHistory> orderPublishHistoryRepository
|
|
|
- )
|
|
|
+ IRepository<OrderPublishHistory> orderPublishHistoryRepository,
|
|
|
+ IRepositoryTextSearch<OrderTs> repositoryts
|
|
|
+ )
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_orderRepository = orderRepository;
|
|
@@ -118,8 +123,9 @@ public class OrderController : BaseController
|
|
|
_fileRepository = fileRepository;
|
|
|
_orderScreenRepository = orderScreenRepository;
|
|
|
_orderPublishHistoryRepository = orderPublishHistoryRepository;
|
|
|
+ _repositoryts = repositoryts;
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
#region 工单发布
|
|
|
|
|
@@ -1083,7 +1089,8 @@ public class OrderController : BaseController
|
|
|
{
|
|
|
var order = _mapper.Map<Order>(dto);
|
|
|
var orderId = await _orderDomainService.AddAsync(order, HttpContext.RequestAborted);
|
|
|
- if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, orderId, HttpContext.RequestAborted);
|
|
|
+ if (dto.Tags.Any()) await _repositoryts.AddVectorAsync(orderId, DateTime.Now, dto.Tags, HttpContext.RequestAborted);
|
|
|
+ if (dto.Files.Any()) await _fileRepository.AddFileAsync(dto.Files, orderId, HttpContext.RequestAborted);
|
|
|
return orderId;
|
|
|
}
|
|
|
|
|
@@ -1125,8 +1132,9 @@ public class OrderController : BaseController
|
|
|
await _orderRepository.RemoveOrderComplainAsync(order.OrderComplain, HttpContext.RequestAborted);
|
|
|
if (order?.OrderReport is not null)
|
|
|
await _orderRepository.RemoveOrderReportAsync(order.OrderReport, HttpContext.RequestAborted);
|
|
|
+ if (dto.Tags.Any()) await _repositoryts.UpdateVectorAsync(dto.Id, dto.Tags, HttpContext.RequestAborted);
|
|
|
|
|
|
- _mapper.Map(dto, order);
|
|
|
+ _mapper.Map(dto, order);
|
|
|
await _orderRepository.UpdateOrderNavAsync(order, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|