@ -25,7 +25,7 @@ namespace OpenAuth.App.ServiceApp
private readonly IConfiguration _configuration ;
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 )
public AirportMaintenanceApp ( MinioService minioService , ISqlSugarClient client , ISugarUnitOfWork < SugarDbContext > unitWork , IConfiguration configuration , ISimpleClient < LasaDronePort > repository , IAuth auth ) : base ( unitWork , repository , auth )
{
_configuration = configuration ;
_client = client ;
@ -308,7 +308,7 @@ namespace OpenAuth.App.ServiceApp
}
}
//根据时间获取告警信息列表
public async Task < Response < PageInfo < List < LasaManageDeviceHms > > > > GetManageDeviceHmsList ( int level , int model , DateTime startTime , DateTime endTime , int page , int limit , string message )
public async Task < Response < PageInfo < List < LasaManageDeviceHms > > > > GetManageDeviceHmsList ( int level , int model , DateTime startTime , DateTime endTime , int page , int limit , string message , string getway )
{
RefAsync < int > totalCount = 0 ;
using ( var db = UnitWork . CreateContext ( ) )
@ -318,6 +318,7 @@ namespace OpenAuth.App.ServiceApp
. WhereIF ( level ! = 0 , x = > x . Level = = level )
. WhereIF ( model ! = 0 , x = > x . Module = = model )
. WhereIF ( ! string . IsNullOrEmpty ( message ) , x = > x . MessageZh . Contains ( message ) )
. WhereIF ( ! string . IsNullOrEmpty ( getway ) , x = > x . Sn = = getway )
. OrderBy ( x = > x . CreateTime , OrderByType . Desc )
. ToPageListAsync ( page , limit , totalCount ) ;
return new Response < PageInfo < List < LasaManageDeviceHms > > >
@ -383,7 +384,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 ( ! "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 ) ;
@ -397,7 +398,7 @@ namespace OpenAuth.App.ServiceApp
public async Task < Response < string > > UpdatePicStatus ( string id , int showOnMap , int display , string fileTags , string graffitiJson )
{
string sql = "update lasa_mediafile set \"ShowOnMap\"=" + showOnMap + ",display=" + display + ",\"FileTags\"='" + fileTags + "',\"GraffitiJson\"='" + graffitiJson + "' where \"Id\"='" + id + "'" ;
string sql = "update lasa_mediafile set \"ShowOnMap\"=" + showOnMap + ",display=" + display + ",\"FileTags\"='" + fileTags + "',\"GraffitiJson\"='" + graffitiJson + "' where \"Id\"='" + id + "'" ;
await _client . Ado . ExecuteCommandAsync ( sql ) ;
return new Response < string > { Result = "修改成功!" } ;
}
@ -405,15 +406,15 @@ namespace OpenAuth.App.ServiceApp
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 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 ] + "'" ;
string sql = "delete from lasa_mediafile where \"Id\"='" + idarray [ i ] + "'" ;
await _client . Ado . ExecuteCommandAsync ( sql ) ;
await _minioService . DeleteFile ( objectkey ) ;
}
return new Response < string > { Result = "删除成功!" } ;