|
@@ -266,7 +266,7 @@ namespace Hotline.Repository.SqlSugar.Orders
|
|
|
//关键词
|
|
|
var tags = participles.Select(x=>x.Tag).ToList();
|
|
|
var tagsStr = string.Join(",", tags);
|
|
|
- await Db.Updateable<Order>().UpdateColumns(x=>x.TagNames == tagsStr).Where(x=>x.Id == orderId).ExecuteCommandAsync(cancellationToken);
|
|
|
+ await Db.Updateable<Order>().SetColumns(x=>x.TagNames == tagsStr).Where(x=>x.Id == orderId).ExecuteCommandAsync(cancellationToken);
|
|
|
List<string> synonyms = participles.Select(x => x.Synonym).ToList();
|
|
|
if (synonyms.Any())
|
|
|
{
|
|
@@ -274,7 +274,9 @@ namespace Hotline.Repository.SqlSugar.Orders
|
|
|
synonyms = synonymsStr.Split(",").Distinct().ToList();
|
|
|
tags.AddRange(synonyms);
|
|
|
}
|
|
|
- await _repositoryts.AddVectorAsync(orderId, DateTime.Now, tags, cancellationToken);
|
|
|
+ var vector = await Db.Queryable<OrderTs>().Where(x=>x.Id == orderId).ToListAsync(cancellationToken);
|
|
|
+ if (vector.Any()) await _repositoryts.UpdateVectorAsync(orderId, tags, cancellationToken);
|
|
|
+ else await _repositoryts.AddVectorAsync(orderId, DateTime.Now, tags, cancellationToken);
|
|
|
}
|
|
|
}
|
|
|
|