Compare commits
2 Commits
81236eb987
...
0d9db50c3a
| Author | SHA1 | Date |
|---|---|---|
|
|
0d9db50c3a | |
|
|
0b6ec8263e |
|
|
@ -1,12 +1,68 @@
|
||||||
using System;
|
using System.Net;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using Infrastructure;
|
||||||
|
using Infrastructure.Extensions;
|
||||||
|
using Infrastructure.Helpers;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace OpenAuth.App.ServiceApp.DroneDockManage
|
namespace OpenAuth.App.ServiceApp.DroneDockManage
|
||||||
{
|
{
|
||||||
public class AirportMaintenanceApp
|
public class AirportMaintenanceApp
|
||||||
{
|
{
|
||||||
|
public Response<dynamic> GetdTsgzProjectId()
|
||||||
|
{
|
||||||
|
var conf = ConfigHelper.GetConfigRoot();
|
||||||
|
var projectId = conf["TaiShiGanZhi:ProjectId"];
|
||||||
|
return new Response<dynamic>()
|
||||||
|
{
|
||||||
|
Result = new
|
||||||
|
{
|
||||||
|
ProjectId = projectId
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<Response<dynamic>> GetTsgzAccessToken()
|
||||||
|
{
|
||||||
|
using var client = new HttpClient();
|
||||||
|
var conf = ConfigHelper.GetConfigRoot();
|
||||||
|
var apiUrl = conf["TaiShiGanZhi:ApiUrl"];
|
||||||
|
var loginUrl = conf["TaiShiGanZhi:LoginUrl"];
|
||||||
|
var param = new
|
||||||
|
{
|
||||||
|
account = conf["TaiShiGanZhi:Username"],
|
||||||
|
password = conf["TaiShiGanZhi:Password"]
|
||||||
|
};
|
||||||
|
var content = new StringContent(JsonConvert.SerializeObject(param), Encoding.UTF8,
|
||||||
|
"application/json");
|
||||||
|
// 执行创建数据存储
|
||||||
|
var response = await client.PostAsync(apiUrl + loginUrl, content);
|
||||||
|
if (response.StatusCode != HttpStatusCode.OK)
|
||||||
|
{
|
||||||
|
return new Response<dynamic>()
|
||||||
|
{
|
||||||
|
Result = false,
|
||||||
|
Message = "登录失败"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var jsonObject = JObject.Parse(await response.Content.ReadAsStringAsync());
|
||||||
|
if (jsonObject["code"].ToInt() == 200)
|
||||||
|
{
|
||||||
|
return new Response<dynamic>()
|
||||||
|
{
|
||||||
|
Result = new
|
||||||
|
{
|
||||||
|
AccessToken = jsonObject["result"]["token"].ToString()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response<dynamic>()
|
||||||
|
{
|
||||||
|
Code = 500,
|
||||||
|
Message = "获取态势感知token失败"
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,45 +1,29 @@
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Reflection.PortableExecutable;
|
using System.IO.Compression;
|
||||||
using ClosedXML.Excel;
|
using System.Text;
|
||||||
using System.Text.Json.Nodes;
|
using DocumentFormat.OpenXml.InkML;
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using Infrastructure.Utils;
|
using Infrastructure.Utils;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using NetTopologySuite;
|
using NetTopologySuite;
|
||||||
|
using NetTopologySuite.Features;
|
||||||
using NetTopologySuite.Geometries;
|
using NetTopologySuite.Geometries;
|
||||||
|
using NetTopologySuite.IO;
|
||||||
using NPOI.HSSF.UserModel;
|
using NPOI.HSSF.UserModel;
|
||||||
using NPOI.SS.UserModel;
|
using NPOI.SS.UserModel;
|
||||||
using NPOI.XSSF.UserModel;
|
using NPOI.XSSF.UserModel;
|
||||||
using OpenAuth.App.BaseApp.Base;
|
using OpenAuth.App.BaseApp.Base;
|
||||||
using OpenAuth.App.FormModule;
|
using OpenAuth.App.FormScheme.FormHelpers;
|
||||||
using OpenAuth.App.Interface;
|
using OpenAuth.App.Interface;
|
||||||
|
using OpenAuth.App.Request;
|
||||||
using OpenAuth.App.ServiceApp.LayerManagerApp.Request;
|
using OpenAuth.App.ServiceApp.LayerManagerApp.Request;
|
||||||
using OpenAuth.Repository;
|
using OpenAuth.Repository;
|
||||||
using OpenAuth.Repository.Domain;
|
using OpenAuth.Repository.Domain;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using DocumentFormat.OpenXml.Bibliography;
|
|
||||||
using OpenAuth.App.Request;
|
|
||||||
using System.IO;
|
|
||||||
using DocumentFormat.OpenXml.Math;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using NPOI.SS.Formula.Functions;
|
|
||||||
using OpenAuth.App.FormScheme.FormHelpers;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO.Compression;
|
|
||||||
using NetTopologySuite.IO;
|
|
||||||
using NetTopologySuite.Features;
|
|
||||||
using OSGeo.OGR;
|
|
||||||
using Shapefile = NetTopologySuite.IO.Esri.Shapefile;
|
using Shapefile = NetTopologySuite.IO.Esri.Shapefile;
|
||||||
using Org.BouncyCastle.Ocsp;
|
|
||||||
using Infrastructure.Extensions;
|
|
||||||
using SQLitePCL;
|
|
||||||
using DocumentFormat.OpenXml.Spreadsheet;
|
|
||||||
using NPOI.Util;
|
|
||||||
using DocumentFormat.OpenXml.ExtendedProperties;
|
|
||||||
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
|
|
||||||
using static NPOI.POIFS.Crypt.CryptoFunctions;
|
|
||||||
using DocumentFormat.OpenXml.InkML;
|
|
||||||
namespace OpenAuth.App.ServiceApp.LayerManagerApp;
|
namespace OpenAuth.App.ServiceApp.LayerManagerApp;
|
||||||
|
|
||||||
public class LayerApp : SqlSugarBaseApp<DmLayer, SugarDbContext>
|
public class LayerApp : SqlSugarBaseApp<DmLayer, SugarDbContext>
|
||||||
|
|
@ -431,7 +415,7 @@ public class LayerApp : SqlSugarBaseApp<DmLayer, SugarDbContext>
|
||||||
attributes.Add(header, 11);
|
attributes.Add(header, 11);
|
||||||
}
|
}
|
||||||
|
|
||||||
IFeature feature = new NetTopologySuite.Features.Feature(geometry, attributes);
|
IFeature feature = new Feature(geometry, attributes);
|
||||||
features.Add(feature);
|
features.Add(feature);
|
||||||
// 导出 SHP 文件及其关联文件
|
// 导出 SHP 文件及其关联文件
|
||||||
ExportToShapefileFour(shpFilePath, features);
|
ExportToShapefileFour(shpFilePath, features);
|
||||||
|
|
@ -441,7 +425,7 @@ public class LayerApp : SqlSugarBaseApp<DmLayer, SugarDbContext>
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
public NetTopologySuite.Geometries.Geometry ParseGeometry(string wkt)
|
public Geometry ParseGeometry(string wkt)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(wkt))
|
if (string.IsNullOrEmpty(wkt))
|
||||||
{
|
{
|
||||||
|
|
@ -1301,7 +1285,7 @@ public class LayerApp : SqlSugarBaseApp<DmLayer, SugarDbContext>
|
||||||
}
|
}
|
||||||
if (colName.ToLower().Equals("geometry"))
|
if (colName.ToLower().Equals("geometry"))
|
||||||
{
|
{
|
||||||
var geometry = (NetTopologySuite.Geometries.Geometry)dataReader.GetValue(i);
|
var geometry = (Geometry)dataReader.GetValue(i);
|
||||||
|
|
||||||
var geometryForWgs84 = GeometryFactory.Default.WithSRID(4326)
|
var geometryForWgs84 = GeometryFactory.Default.WithSRID(4326)
|
||||||
.CreateGeometry(geometry);
|
.CreateGeometry(geometry);
|
||||||
|
|
@ -1433,7 +1417,7 @@ public class LayerApp : SqlSugarBaseApp<DmLayer, SugarDbContext>
|
||||||
}
|
}
|
||||||
if (colName.ToLower().Equals("geometry"))
|
if (colName.ToLower().Equals("geometry"))
|
||||||
{
|
{
|
||||||
var geometry = (NetTopologySuite.Geometries.Geometry)dataReader.GetValue(i);
|
var geometry = (Geometry)dataReader.GetValue(i);
|
||||||
|
|
||||||
var geometryForWgs84 = GeometryFactory.Default.WithSRID(4326)
|
var geometryForWgs84 = GeometryFactory.Default.WithSRID(4326)
|
||||||
.CreateGeometry(geometry);
|
.CreateGeometry(geometry);
|
||||||
|
|
@ -1641,7 +1625,7 @@ public class LayerApp : SqlSugarBaseApp<DmLayer, SugarDbContext>
|
||||||
}
|
}
|
||||||
if (colName.ToLower().Equals("geometry"))
|
if (colName.ToLower().Equals("geometry"))
|
||||||
{
|
{
|
||||||
var geometry = (NetTopologySuite.Geometries.Geometry)dataReader.GetValue(i);
|
var geometry = (Geometry)dataReader.GetValue(i);
|
||||||
|
|
||||||
var geometryForWgs84 = GeometryFactory.Default.WithSRID(4326)
|
var geometryForWgs84 = GeometryFactory.Default.WithSRID(4326)
|
||||||
.CreateGeometry(geometry);
|
.CreateGeometry(geometry);
|
||||||
|
|
@ -1670,7 +1654,7 @@ public class LayerApp : SqlSugarBaseApp<DmLayer, SugarDbContext>
|
||||||
}
|
}
|
||||||
if (colName.ToLower().Equals("geometry"))
|
if (colName.ToLower().Equals("geometry"))
|
||||||
{
|
{
|
||||||
var geometry = (NetTopologySuite.Geometries.Geometry)dataReader.GetValue(i);
|
var geometry = (Geometry)dataReader.GetValue(i);
|
||||||
|
|
||||||
var geometryForWgs84 = GeometryFactory.Default.WithSRID(4326)
|
var geometryForWgs84 = GeometryFactory.Default.WithSRID(4326)
|
||||||
.CreateGeometry(geometry);
|
.CreateGeometry(geometry);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using Infrastructure.Cache;
|
using Infrastructure.Cache;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using OpenAuth.App.ServiceApp.DroneDockManage;
|
using OpenAuth.App.ServiceApp.DroneDockManage;
|
||||||
using OpenAuth.App.ServiceApp.DroneDockManage.Response;
|
using OpenAuth.App.ServiceApp.DroneDockManage.Response;
|
||||||
|
|
@ -146,5 +147,24 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers.DroneDockManage
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
// todo 查询项目id,获取token token失效 token刷新
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取态势感知项目id
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public Response<dynamic> GetTsgzProjectId()
|
||||||
|
{
|
||||||
|
return _app.GetdTsgzProjectId();
|
||||||
|
}
|
||||||
|
[HttpGet]
|
||||||
|
public Task<Response<dynamic>> GetTsgzAccessToken()
|
||||||
|
{
|
||||||
|
return _app.GetTsgzAccessToken();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
//附件上传的路径,如果为空则保存在站点根目录
|
//附件上传的路径,如果为空则保存在站点根目录
|
||||||
"RedisConf": {
|
"RedisConf": {
|
||||||
//"Conn": "192.168.10.163:6379,password=123456",
|
//"Conn": "192.168.10.163:6379,password=123456",
|
||||||
"Conn": "127.0.0.1:6379,password=123456",
|
"Conn": "127.0.0.1:9205",
|
||||||
"Database": 7
|
"Database": 7
|
||||||
},
|
},
|
||||||
//redis配置
|
//redis配置
|
||||||
|
|
@ -74,5 +74,12 @@
|
||||||
"Password": ""
|
"Password": ""
|
||||||
},
|
},
|
||||||
"FlyImageDir": "e:/fly",
|
"FlyImageDir": "e:/fly",
|
||||||
"WebSocket": "ws://192.168.10.106:5698/ws"
|
"WebSocket": "ws://192.168.10.106:5698/ws",
|
||||||
|
"TaiShiGanZhi": {
|
||||||
|
"ApiUrl": "http://192.168.10.163:9024/api",
|
||||||
|
"ProjectId": "9679e92f-fa9c-4f51-92b9-dd97aaac7d64",
|
||||||
|
"LoginUrl": "/api/Check/Login",
|
||||||
|
"Username": "17853305028",
|
||||||
|
"Password": "123456"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue