|
|
|
@ -15,15 +15,20 @@ using NPOI.SS.Formula.Functions;
|
|
|
|
|
using Infrastructure.Extensions;
|
|
|
|
|
using DocumentFormat.OpenXml.Math;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Infrastructure.CloudSdk.minio;
|
|
|
|
|
|
|
|
|
|
namespace OpenAuth.App.ServiceApp
|
|
|
|
|
{
|
|
|
|
|
public class AirportMaintenanceApp : SqlSugarBaseApp<LasaDronePort, SugarDbContext>
|
|
|
|
|
{
|
|
|
|
|
private readonly IConfiguration _configuration;
|
|
|
|
|
public AirportMaintenanceApp(ISugarUnitOfWork<SugarDbContext> unitWork, IConfiguration configuration, ISimpleClient<LasaDronePort> repository, IAuth auth) : base(unitWork, repository, auth)
|
|
|
|
|
private readonly ISqlSugarClient _client;
|
|
|
|
|
private readonly MinioService _minioService;
|
|
|
|
|
public AirportMaintenanceApp(MinioService minioService,ISqlSugarClient client,ISugarUnitOfWork<SugarDbContext> unitWork, IConfiguration configuration, ISimpleClient<LasaDronePort> repository, IAuth auth) : base(unitWork, repository, auth)
|
|
|
|
|
{
|
|
|
|
|
_configuration = configuration;
|
|
|
|
|
_client = client;
|
|
|
|
|
_minioService = minioService;
|
|
|
|
|
}
|
|
|
|
|
//获取设备绑定码
|
|
|
|
|
public async Task<Response<LasaDeviceBindingCode>> GetDeviceBindingCode()
|
|
|
|
@ -351,6 +356,30 @@ namespace OpenAuth.App.ServiceApp
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<Response<string>> UpdatePicStatus(string id, int showOnMap, int display)
|
|
|
|
|
{
|
|
|
|
|
string sql = "update lasa_mediafile set \"ShowOnMap\"=" + showOnMap + ",display=" + display + " where \"Id\"='" + id+"'";
|
|
|
|
|
await _client.Ado.ExecuteCommandAsync(sql);
|
|
|
|
|
return new Response<string> { Result = "修改成功!" };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<Response<string>> deletepic(string ids)
|
|
|
|
|
{
|
|
|
|
|
string[] idarray = ids.Split(",");
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < idarray.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
string sqlselect = "select \"ObjectKey\" from lasa_mediafile where \"Id\"='"+idarray[i]+"'";
|
|
|
|
|
string objectkey = _client.Ado.SqlQuerySingle<string>(sqlselect);
|
|
|
|
|
string sql = "delete from lasa_mediafile where \"Id\"='"+idarray[i]+"'";
|
|
|
|
|
await _client.Ado.ExecuteCommandAsync(sql);
|
|
|
|
|
await _minioService.DeleteFile(objectkey);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return new Response<string> { Result = "删除成功!" };
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|