Преглед изворни кода

Merge branch 'master' of http://110.188.24.182:10023/Fengwo/hotline

xf пре 1 година
родитељ
комит
d282c03de9

+ 32 - 28
src/Hotline.Api/Controllers/QualityController.cs

@@ -559,41 +559,45 @@ namespace Hotline.Api.Controllers
 		}
 
 		/// <summary>
-		/// 智能质检结果返回接收
+		/// 智能质检结果返回接收 [FromBody] List<AiQualityResultDto> dto
 		/// </summary>
 		/// <param name="dto"></param>
 		/// <returns></returns>
 		[AllowAnonymous]
 		[HttpPost("AiResult")]
 		[LogFilter("智能质检结果返回接收")]
-		public async Task AiResult([FromBody] List<AiQualityResultDto> dto) 
+		public async Task AiResult() 
 		{
-			foreach (var item in dto)
-			{
-				var quality = await _qualitey.GetAsync(item.record_id);
-				if (quality is { State: EQualityState.Apply } && item.score_items != null && item.score_items.Any())
-				{
-					List<QualityDetail> details = new List<QualityDetail>();
-					foreach (var item2 in item.score_items)
-					{
-						if (item2.score > 0)
-						{
-							QualityDetail detail = new QualityDetail
-							{
-								QualityId = quality.Id,
-								Second = 0,
-								Name = item2.name,
-								Content = item2.description,
-								Intelligent = true,
-								Grade = item2.score,
-								Check = true,
-							};
-							details.Add(detail);
-						}
-					}
-					await _qualiteyDetail.AddRangeAsync(details);
-				}
-			}
+			Request.EnableBuffering();
+			var sr = new StreamReader(Request.Body);
+			var data = await sr.ReadToEndAsync(HttpContext.RequestAborted);
+			_logger.LogInformation(data);
+			//foreach (var item in dto)
+			//{
+			//	var quality = await _qualitey.GetAsync(item.record_id);
+			//	if (quality is { State: EQualityState.Apply } && item.score_items != null && item.score_items.Any())
+			//	{
+			//		List<QualityDetail> details = new List<QualityDetail>();
+			//		foreach (var item2 in item.score_items)
+			//		{
+			//			if (item2.score > 0)
+			//			{
+			//				QualityDetail detail = new QualityDetail
+			//				{
+			//					QualityId = quality.Id,
+			//					Second = 0,
+			//					Name = item2.name,
+			//					Content = item2.description,
+			//					Intelligent = true,
+			//					Grade = item2.score,
+			//					Check = true,
+			//				};
+			//				details.Add(detail);
+			//			}
+			//		}
+			//		await _qualiteyDetail.AddRangeAsync(details);
+			//	}
+			//}
 		}
 
 		/// <summary>

+ 0 - 3
src/Hotline.Share/Dtos/Quality/AiQualityDto.cs

@@ -76,9 +76,6 @@ namespace Hotline.Share.Dtos.Quality
 
 	public class AiQualityResultDto : AiQualitySourceData
 	{
-		//public AiQualitySourceData source_data { get; set; }
-
-		//public AiQualityAnalysisData analysis_data { get; set; }
 	}
 	public class AiQualitySourceData : AiQualityAnalysisData
 	{