Merge remote-tracking branch 'origin/main'
commit
472bacf0c6
|
|
@ -372,7 +372,7 @@ namespace OpenAuth.App.ServiceApp
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string device, string picname, DateTime? startTime, DateTime? endTime, int page, int limit, int level, string parentKey)
|
||||
public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string device, string picname, DateTime? startTime, DateTime? endTime, int page, int limit, string parentKey)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
using (var db = UnitWork.CreateContext())
|
||||
|
|
@ -383,8 +383,7 @@ namespace OpenAuth.App.ServiceApp
|
|||
.WhereIF(!string.IsNullOrEmpty(device), x => x.DroneModelKey == device)
|
||||
.WhereIF(!string.IsNullOrEmpty(picname), x => x.Name.Contains(picname))
|
||||
.WhereIF(!"0001/1/1 0:00:00".Equal(startTime.ToString()), x => x.CreateTime >= startTime)
|
||||
.WhereIF(!"0001/1/1 0:00:00".Equal(endTime.ToString()), x => x.CreateTime <= endTime)
|
||||
.WhereIF(level >= 0, x => x.Level == level)
|
||||
.WhereIF(!"0001/1/1 0:00:00".Equal(endTime.ToString()), x => x.CreateTime <= endTime)
|
||||
.WhereIF(!string.IsNullOrEmpty(parentKey), x => x.ParentKey == parentKey)
|
||||
.OrderBy(x => x.CreateTime, OrderByType.Asc)
|
||||
.ToPageListAsync(page, limit, totalCount);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ using Microsoft.Extensions.Configuration;
|
|||
using OpenAuth.App.ServiceApp.DroneDocking.Request;
|
||||
using DocumentFormat.OpenXml.Office.CustomUI;
|
||||
using DocumentFormat.OpenXml.EMMA;
|
||||
using OpenAuth.App.ServiceApp.DroneDocking.Response;
|
||||
using DocumentFormat.OpenXml.Math;
|
||||
using static Microsoft.Extensions.Logging.EventSource.LoggingEventSource;
|
||||
using DocumentFormat.OpenXml.Drawing.Charts;
|
||||
|
||||
|
||||
namespace OpenAuth.App.ServiceApp.DroneDocking
|
||||
|
|
@ -356,11 +360,17 @@ namespace OpenAuth.App.ServiceApp.DroneDocking
|
|||
|
||||
//序列化返回数据并处理
|
||||
var task = JsonSerializer.Deserialize<AirPortTaskReq>(data);
|
||||
|
||||
string ids = "";
|
||||
foreach(var item in task.deviceid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//task数据生成
|
||||
DroneDocktask dt= new DroneDocktask();
|
||||
dt.id=Guid.NewGuid().ToString();
|
||||
dt.deviceid=task.deviceid.ToString();
|
||||
dt.deviceid= string.Join(",", task.deviceid);
|
||||
dt.bizidname=task.bizidname.ToString();
|
||||
dt.taskid = task.taskid;
|
||||
dt.taskname = task.taskname;
|
||||
|
|
@ -768,5 +778,93 @@ namespace OpenAuth.App.ServiceApp.DroneDocking
|
|||
|
||||
return null; // 未找到
|
||||
}
|
||||
|
||||
//获取省对接任务信息
|
||||
public async Task<Response<PageInfo<List<DroneDockRes>>>> GetDroneDockInfos(string keyWord, int page, int limit)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
var info = await base.Repository.AsQueryable()
|
||||
.WhereIF(!string.IsNullOrEmpty(keyWord), t => t.taskname.Contains(keyWord)||t.bizidname.Contains(keyWord))
|
||||
.Select(t=>new DroneDockRes
|
||||
{
|
||||
id= t.id,
|
||||
bizidname= t.bizidname,
|
||||
taskname= t.taskname,
|
||||
createtime= t.createtime,
|
||||
state= t.state,
|
||||
datacode= t.datacode,
|
||||
deviceid= t.deviceid,
|
||||
taskid= t.taskid,
|
||||
tasklist=SqlFunc.Subqueryable<DroneDocktaskdetail>().Where(r=>r.taskid==t.id).ToList()
|
||||
})
|
||||
.ToPageListAsync(page, limit, totalCount);
|
||||
return new Response<PageInfo<List<DroneDockRes>>>
|
||||
{
|
||||
Result = new PageInfo<List<DroneDockRes>>
|
||||
{
|
||||
Items = info,
|
||||
Total = totalCount
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//获取飞行数据
|
||||
public async Task<Response<DroneDockflightRes>> GetDroneDockflightInfos(string taskid)
|
||||
{
|
||||
DroneDockflightRes res=new DroneDockflightRes();
|
||||
var detailinfo=await Repository.ChangeRepository<SugarRepositiry<DroneDocktaskdetail>>()
|
||||
.AsQueryable()
|
||||
.Where(r=>r.flighttaskid==taskid)
|
||||
.ToListAsync();
|
||||
if (detailinfo.Count > 0)
|
||||
{
|
||||
var taskId= detailinfo[0].taskid;
|
||||
var taskinfo = await Repository.AsQueryable().Where(r => r.id == taskId).FirstAsync();
|
||||
var flighttaskinfo= await Repository.ChangeRepository<SugarRepositiry<LasaTask>>()
|
||||
.AsQueryable()
|
||||
.Where(r => r.FlightId == taskid)
|
||||
.FirstAsync();
|
||||
if (taskinfo != null)
|
||||
{
|
||||
res.bizidname = taskinfo.bizidname;
|
||||
res.taskname = taskinfo.taskname;
|
||||
}
|
||||
res.tasklist = detailinfo;
|
||||
if(flighttaskinfo != null)
|
||||
{
|
||||
res.taskExecuteTime =Convert.ToDateTime(flighttaskinfo.ExecuteTime).ToString("yyyy-MM-dd HH:mm:ss");
|
||||
res.waylineName=flighttaskinfo.TaskAirLineName;
|
||||
res.flightTaskType=Convert.ToInt32(flighttaskinfo.FlightTaskType);
|
||||
switch (flighttaskinfo.Status)
|
||||
{
|
||||
case 0:
|
||||
res.flightTaskState = 1;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
res.flightTaskState = 2;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
res.flightTaskState = 3;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
res.flightTaskState = 0;
|
||||
break;
|
||||
case null: //交集
|
||||
res.flightTaskState = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return new Response<DroneDockflightRes>
|
||||
{
|
||||
Result = res
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,4 +53,43 @@ namespace OpenAuth.App.ServiceApp.DroneDocking.Response
|
|||
public DateTime? createtime { get; set; }
|
||||
public List<DroneDocktaskdetail> tasklist { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class DroneDockflightRes
|
||||
{
|
||||
/// <summary>
|
||||
/// Desc:业务类型,用于标识数据来源
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string bizidname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:下发任务名称
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string taskname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:任务开始执行时间(yyyy-MM-ddHH:mm:ss)
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string taskExecuteTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:数据类型, 用于后续成果上传获取上传路径
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string waylineName { get; set; }
|
||||
/// <summary>
|
||||
/// 0 计划执行 1 指点飞行
|
||||
/// </summary>
|
||||
public int flightTaskType { get; set; }
|
||||
//0 执行成功 1 待执行 2 执行中 3 执行失败 4 其他错误
|
||||
public int flightTaskState { get; set; }
|
||||
public List<DroneDocktaskdetail> tasklist { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -661,12 +661,12 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string device,string picname, DateTime startTime, DateTime endTime, int page, int limit,int level,string parentKey)
|
||||
public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string device,string picname, DateTime startTime, DateTime endTime, int page, int limit,string parentKey)
|
||||
{
|
||||
var result = new Response<PageInfo<List<LasaMediaFile>>>();
|
||||
try
|
||||
{
|
||||
result = await _app.GetMediaFile(device, picname,startTime, endTime, page, limit, level,parentKey);
|
||||
result = await _app.GetMediaFile(device, picname,startTime, endTime, page, limit,parentKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ using Microsoft.AspNetCore.Authorization;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using OpenAuth.App.ServiceApp.DroneDocking;
|
||||
using OpenAuth.App.ServiceApp.DroneDocking.Request;
|
||||
using OpenAuth.App.ServiceApp.DroneDocking.Response;
|
||||
using OpenAuth.App.ServiceApp.Response;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||
|
|
@ -437,5 +439,33 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取省对接任务列表
|
||||
/// </summary>
|
||||
/// <param name="keyWord">名称筛选</param>
|
||||
/// <param name="page"></param>
|
||||
/// <param name="limit"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<Response<PageInfo<List<DroneDockRes>>>> GetDroneDockInfos(string keyWord, int page, int limit)
|
||||
{
|
||||
return await _app.GetDroneDockInfos(keyWord, page, limit);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 前端任务获取
|
||||
/// </summary>
|
||||
/// <param name="taskid">执行任务id</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<Response<DroneDockflightRes>> GetDroneDockflightInfos(string taskid)
|
||||
{
|
||||
return await _app.GetDroneDockflightInfos(taskid);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue