|
@@ -93,6 +93,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
private readonly IRepository<SchedulingUser> _schedulingUserRepository;
|
|
|
private readonly IRepository<StatisticsHotspotSatisfied> _statisticsHotspotSatisfiedRepository;
|
|
|
private readonly IRepository<StatisticsDepartSatisfied> _statisticsDepartSatisfiedRepository;
|
|
|
+ private readonly IRepository<OrderTsDetails> _orderTsDetailsRepository;
|
|
|
|
|
|
public OrderApplication(
|
|
|
IOrderDomainService orderDomainService,
|
|
@@ -134,7 +135,8 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
IRepository<SchedulingUser> schedulingUserRepository,
|
|
|
IRepository<StatisticsHotspotSatisfied> statisticsHotspotSatisfiedRepository,
|
|
|
IRepository<StatisticsDepartSatisfied> statisticsDepartSatisfiedRepository,
|
|
|
- IOrderDelayRepository orderDelayRepository)
|
|
|
+ IOrderDelayRepository orderDelayRepository,
|
|
|
+ IRepository<OrderTsDetails> orderTsDetailsRepository)
|
|
|
{
|
|
|
_orderDomainService = orderDomainService;
|
|
|
_workflowDomainService = workflowDomainService;
|
|
@@ -176,7 +178,7 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
_schedulingUserRepository = schedulingUserRepository;
|
|
|
_statisticsHotspotSatisfiedRepository = statisticsHotspotSatisfiedRepository;
|
|
|
_statisticsDepartSatisfiedRepository = statisticsDepartSatisfiedRepository;
|
|
|
-
|
|
|
+ _orderTsDetailsRepository = orderTsDetailsRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -576,8 +578,13 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
/// 工单关键字分词
|
|
|
/// </summary>
|
|
|
/// <param name="inputStr"></param>
|
|
|
+ /// <param name="orderId"></param>
|
|
|
+ /// <param name="no"></param>
|
|
|
+ /// <param name="title"></param>
|
|
|
+ /// <param name="time"></param>
|
|
|
+ /// <param name="cancellationToken"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task OrderParticiple(string inputStr, string orderId, DateTime time, CancellationToken cancellationToken)
|
|
|
+ public async Task OrderParticiple(string inputStr, string orderId, string no, string title, DateTime time, CancellationToken cancellationToken)
|
|
|
{
|
|
|
var seg = new Segment();
|
|
|
ICollection<WordInfo> splitWords = seg.DoSegment(inputStr);
|
|
@@ -594,6 +601,27 @@ public class OrderApplication : IOrderApplication, IScopeDependency
|
|
|
var vector = await _repositoryts.SearchAsync(orderId, cancellationToken);
|
|
|
if (vector != null && vector.Any()) await _repositoryts.UpdateVectorAsync(orderId, words, cancellationToken);
|
|
|
else await _repositoryts.AddVectorAsync(orderId, time, words, cancellationToken);
|
|
|
+
|
|
|
+ //是否开启分词
|
|
|
+ var isOpenWordSegmentation = _systemSettingCacheManager.GetSetting(SettingConstants.IsOpenWordSegmentation)?.SettingValue[0];
|
|
|
+ if (!string.IsNullOrEmpty(isOpenWordSegmentation) && isOpenWordSegmentation == "true")
|
|
|
+ {
|
|
|
+ //先删除历史数据,在添加新数据
|
|
|
+ await _orderTsDetailsRepository.RemoveAsync(p => p.OrderId == orderId, false, cancellationToken);
|
|
|
+ List<OrderTsDetails> orderTsDetails = new();
|
|
|
+ foreach (var item in words)
|
|
|
+ {
|
|
|
+ orderTsDetails.Add(new OrderTsDetails
|
|
|
+ {
|
|
|
+ Terms = item,
|
|
|
+ OrderId = orderId,
|
|
|
+ Title = title,
|
|
|
+ No = no
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (orderTsDetails != null && orderTsDetails.Count > 0)
|
|
|
+ await _orderTsDetailsRepository.AddRangeAsync(orderTsDetails, cancellationToken);
|
|
|
+ }
|
|
|
}
|
|
|
// 结巴分词
|
|
|
//var segmenter = new JiebaSegmenter();
|