|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
|
|
|
using DocumentFormat.OpenXml.Wordprocessing;
|
|
|
|
|
using Infrastructure;
|
|
|
|
@ -19,9 +20,12 @@ using OpenAuth.WebApi.CloudSdk;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System.Dynamic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using Hopetry.App.Common;
|
|
|
|
|
using NPOI.HSSF.Record;
|
|
|
|
|
using OpenAuth.App.Request;
|
|
|
|
|
using OpenAuth.App.ServiceApp.AirLine.Request;
|
|
|
|
|
using OpenAuth.App.ServiceApp.FlyTask.Response;
|
|
|
|
|
using Image = NetModular.DocX.Core.Image;
|
|
|
|
|
|
|
|
|
|
namespace OpenAuth.App.ServiceApp
|
|
|
|
|
{
|
|
|
|
@ -1519,7 +1523,7 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
return rootNodes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<Response<LasaMediaFile>> GetTaskPicList(string flightId, long timestamp)
|
|
|
|
|
public async Task<Response<CommandPictureResponse>> GetTaskPicList(string flightId, long timestamp)
|
|
|
|
|
{
|
|
|
|
|
var lasaMediaFile = await Repository.ChangeRepository<SugarRepositiry<LasaMediaFile>>()
|
|
|
|
|
.AsQueryable()
|
|
|
|
@ -1529,18 +1533,54 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
.SingleAsync();
|
|
|
|
|
if (lasaMediaFile == null)
|
|
|
|
|
{
|
|
|
|
|
return new Response<LasaMediaFile>()
|
|
|
|
|
return new Response<CommandPictureResponse>()
|
|
|
|
|
{
|
|
|
|
|
Result = new LasaMediaFile()
|
|
|
|
|
Result = new CommandPictureResponse()
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lasaMediaFile.PicLink = "http://" + _minioService.endPoint + "/" + _minioService._bucketName + "/" +
|
|
|
|
|
lasaMediaFile.ObjectKey;
|
|
|
|
|
return new Response<LasaMediaFile>()
|
|
|
|
|
/*lasaMediaFile.PicLink = "http://" + _minioService.endPoint + "/" + _minioService._bucketName + "/" +
|
|
|
|
|
lasaMediaFile.ObjectKey;*/
|
|
|
|
|
var tempPath = Path.Combine(Path.GetTempPath(),"lasa");
|
|
|
|
|
if (!Directory.Exists(tempPath))
|
|
|
|
|
{
|
|
|
|
|
Result = lasaMediaFile
|
|
|
|
|
Directory.CreateDirectory(tempPath);
|
|
|
|
|
}
|
|
|
|
|
await _minioService
|
|
|
|
|
.DownLoadObject(_minioService._bucketName, lasaMediaFile.ObjectKey, tempPath, "");
|
|
|
|
|
var picPath = Path.Combine(tempPath, lasaMediaFile.ObjectKey);
|
|
|
|
|
var dimensions = GetImageDimensions(picPath);
|
|
|
|
|
return new Response<CommandPictureResponse>()
|
|
|
|
|
{
|
|
|
|
|
Result = new CommandPictureResponse()
|
|
|
|
|
{
|
|
|
|
|
Issuccess = true,
|
|
|
|
|
// minio 下载图片,并取得图片二进制数据
|
|
|
|
|
imgBlob = await File.ReadAllBytesAsync(picPath),
|
|
|
|
|
zpkzxx = new ExtData()
|
|
|
|
|
{
|
|
|
|
|
imgHeight = dimensions.height,
|
|
|
|
|
imgWidth = dimensions.width,
|
|
|
|
|
imgOriginHeight = dimensions.height,
|
|
|
|
|
imgOriginWidth = dimensions.width,
|
|
|
|
|
psjj = 0, // 等效焦距
|
|
|
|
|
time = lasaMediaFile.CreateTime,
|
|
|
|
|
height = lasaMediaFile.Height,
|
|
|
|
|
lon = lasaMediaFile.Lng,
|
|
|
|
|
lat = lasaMediaFile.Lat,
|
|
|
|
|
pitch = 0,
|
|
|
|
|
roll = 0,
|
|
|
|
|
yaw = lasaMediaFile.GimbalYawDegree
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
public (int width, int height) GetImageDimensions(string imagePath)
|
|
|
|
|
{
|
|
|
|
|
using (var bmp = new Bitmap(imagePath))
|
|
|
|
|
{
|
|
|
|
|
return (bmp.Width, bmp.Height);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|