|
|
|
@ -446,6 +446,7 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
{
|
|
|
|
|
aiInspection.WarningContent = task.WarningContent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await db.LasaAiInspection.InsertAsync(aiInspection);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2404,7 +2405,7 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
db.Ado.BeginTran();
|
|
|
|
|
if (task.FlightTaskType.Equals(1))
|
|
|
|
|
if (task.FlightTaskType.Equals(1)) // 手飞任务
|
|
|
|
|
{
|
|
|
|
|
var aiInspection = new LasaAiInspection
|
|
|
|
|
{
|
|
|
|
@ -2416,18 +2417,20 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
{
|
|
|
|
|
aiInspection.WarningTitle = req.WarningTitle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(req.WarningContent))
|
|
|
|
|
{
|
|
|
|
|
aiInspection.WarningContent = req.WarningContent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新
|
|
|
|
|
await db.Updateable(aiInspection).IgnoreNullColumns().ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var aiInspection = Repository
|
|
|
|
|
var aiInspection = await Repository
|
|
|
|
|
.ChangeRepository<SugarRepositiry<LasaAiInspection>>()
|
|
|
|
|
.AsQueryable().Where(x => x.TaskId == req.TaskId).First();
|
|
|
|
|
.AsQueryable().Where(x => x.TaskId == req.TaskId).FirstAsync();
|
|
|
|
|
req.AlgoInstanceId = aiInspection.AlgoInstanceId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2436,6 +2439,7 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
.Where(x => x.Id == req.AlgoInstanceId)
|
|
|
|
|
.ToListAsync();
|
|
|
|
|
var tagsIds = algoInstances.Select(x => x.Tags).ToList();
|
|
|
|
|
// todo 关于存在多个算法的处理
|
|
|
|
|
var algoIds = algoInstances.First().AlgoIds.Split(",").ToArray();
|
|
|
|
|
var algo = await db
|
|
|
|
|
.Queryable<LasaAlgorithmsRepository>()
|
|
|
|
@ -2469,7 +2473,7 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
json.tag = new int [0, 1, 2, 3, 4, 5];
|
|
|
|
|
var content = new StringContent(JsonConvert.SerializeObject(json), Encoding.UTF8, "application/json");
|
|
|
|
|
using var httpClient = new HttpClient();
|
|
|
|
|
var response = await httpClient.PostAsync("http://123.132.248.154:9309/start_detection", content);
|
|
|
|
|
var response = await httpClient.PostAsync("http://192.168.10.131:9025/start_detection", content);
|
|
|
|
|
//var response = await httpClient.PostAsync("http://192.168.10.131:9025/start_detection", content);
|
|
|
|
|
_logger.LogDebug($"成功调用{response.IsSuccessStatusCode}");
|
|
|
|
|
db.Ado.CommitTran();
|
|
|
|
@ -2606,8 +2610,8 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
if (!string.IsNullOrEmpty(task.AIInspection) && task.AIInspection.Equals(true) &&
|
|
|
|
|
!string.IsNullOrEmpty(task.PushUrl))
|
|
|
|
|
{
|
|
|
|
|
// todo 停止直播
|
|
|
|
|
// todo 停止 aimodel 运行
|
|
|
|
|
// 停止直播
|
|
|
|
|
// 停止 aimodel 运行
|
|
|
|
|
var para = @$"{{
|
|
|
|
|
""bid"": ""{Guid.NewGuid().ToString()}"",
|
|
|
|
|
""data"": {{
|
|
|
|
@ -2661,5 +2665,22 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
var charsToRemove = new char[] { ' ', '\r', '\n', '\t' };
|
|
|
|
|
return string.Concat(input.Where(c => !charsToRemove.Contains(c)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<Response<dynamic>> GetLastHandFlyTask()
|
|
|
|
|
{
|
|
|
|
|
var result = await Repository.ChangeRepository<SugarRepositiry<LasaTask>>()
|
|
|
|
|
.AsQueryable().Where(r => r.FlightTaskType == 1)
|
|
|
|
|
.OrderByDescending(r => r.CreateTime)
|
|
|
|
|
.Select<dynamic>(r => new
|
|
|
|
|
{
|
|
|
|
|
r.Id,
|
|
|
|
|
r.Status
|
|
|
|
|
})
|
|
|
|
|
.FirstAsync();
|
|
|
|
|
return new Response<dynamic>
|
|
|
|
|
{
|
|
|
|
|
Result = result
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|