|
@@ -2,6 +2,7 @@
|
|
|
using Hotline.Ai.Jths.OrderVisits;
|
|
|
using Hotline.Ai.Visit;
|
|
|
using Hotline.Orders;
|
|
|
+using Hotline.Share.Dtos.Order;
|
|
|
using Hotline.Share.Enums.Order;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
using Newtonsoft.Json;
|
|
@@ -85,13 +86,13 @@ namespace Hotline.Ai.Jths
|
|
|
}
|
|
|
requestData.TaskDataList = taskDataList;
|
|
|
var response = await ExecuteAsync<AiVisitServiceRequest, AiVisitServiceResponse>(_baseUrl + "/edas/batchTask",Method.Post, requestData,cancellationToken);
|
|
|
- if (response.Result.TaskInfoList!=null && !string.IsNullOrEmpty(response.Result.BatchUid))
|
|
|
+ if (response.TaskInfoList!=null && !string.IsNullOrEmpty(response.BatchUid))
|
|
|
{
|
|
|
//拼对象
|
|
|
- aiOrderVisit.BatchUid = response.Result.BatchUid;
|
|
|
+ aiOrderVisit.BatchUid = response.BatchUid;
|
|
|
for (int i = 0; i < aiOrderVisit.AiOrderVisitDetails.Count; i++)
|
|
|
{
|
|
|
- var taskInfo = response.Result.TaskInfoList.FirstOrDefault(x => x.CalledNumber == aiOrderVisit.AiOrderVisitDetails[i].OuterNo);
|
|
|
+ var taskInfo = response.TaskInfoList.FirstOrDefault(x => x.CalledNumber == aiOrderVisit.AiOrderVisitDetails[i].OuterNo);
|
|
|
if (taskInfo != null)
|
|
|
{
|
|
|
aiOrderVisit.AiOrderVisitDetails[i].AiOrderVisitState = Share.Enums.Ai.EAiOrderVisitState.NoStarted;
|
|
@@ -108,18 +109,19 @@ namespace Hotline.Ai.Jths
|
|
|
}
|
|
|
|
|
|
|
|
|
- public async Task QueryAiVisitTask(AiVisitServiceQueryRequest dto,CancellationToken cancellationToken)
|
|
|
+ public async Task<AiVisitQueryData> QueryAiVisitTask(string batchId, string taskId, CancellationToken cancellationToken)
|
|
|
{
|
|
|
+ var dto = new AiVisitServiceQueryRequest() { BatchUid = batchId, TaskUid = taskId,PageNo=1, PageSize=100 };
|
|
|
var response = await ExecuteAsync<AiVisitServiceQueryRequest, AiVisitServiceQueryResponse>(_baseUrl + "/edas/task/status/real", Method.Get, dto, cancellationToken);
|
|
|
- if (response.Result!=null)
|
|
|
+ if (response!=null && response.Result.Result.Count>0)
|
|
|
{
|
|
|
-
|
|
|
+ return new AiVisitQueryData() { Uid = response.Result.Result[0].Uid, Status = response.Result.Result[0].Status };
|
|
|
}
|
|
|
-
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
- public async Task<ApiResponse<TResponse>> ExecuteAsync<TRequest,TResponse>(string path, Method httpMethod, TRequest request,
|
|
|
+ public async Task<TResponse> ExecuteAsync<TRequest,TResponse>(string path, Method httpMethod, TRequest request,
|
|
|
CancellationToken cancellationToken)
|
|
|
where TRequest : class
|
|
|
{
|
|
@@ -138,12 +140,13 @@ namespace Hotline.Ai.Jths
|
|
|
}
|
|
|
try
|
|
|
{
|
|
|
- var response = await _client.ExecuteAsync<ApiResponse<TResponse>>(req, cancellationToken);
|
|
|
+ var response = await _client.ExecuteAsync<TResponse>(req, cancellationToken);
|
|
|
+ var t = JsonConvert.DeserializeObject<TResponse>(response.Content);
|
|
|
return response.Data;
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
- throw new HttpRequestException($"智能质检平台错误,Error: {e.Message}");
|
|
|
+ throw new HttpRequestException($"智能回访平台错误,Error: {e.Message}");
|
|
|
}
|
|
|
}
|
|
|
}
|