Compare commits
2 Commits
89686f639a
...
f996d26928
| Author | SHA1 | Date |
|---|---|---|
|
|
f996d26928 | |
|
|
edf602bf38 |
|
|
@ -22,4 +22,21 @@ namespace OpenAuth.App.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SecretKey { get; set; }
|
public string SecretKey { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class KikvisionConfig2
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 综合安防管理平台 url
|
||||||
|
/// </summary>
|
||||||
|
public string Url { get; set; }
|
||||||
|
public int Port { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// AppKey
|
||||||
|
/// </summary>
|
||||||
|
public string AppKey { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// SecretKey
|
||||||
|
/// </summary>
|
||||||
|
public string SecretKey { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,16 @@ namespace OpenAuth.App.ServiceApp.FireManagement
|
||||||
private ClientWebSocket _socket;
|
private ClientWebSocket _socket;
|
||||||
private IConfiguration _configuration;
|
private IConfiguration _configuration;
|
||||||
IOptions<KikvisionConfig> _options;
|
IOptions<KikvisionConfig> _options;
|
||||||
|
IOptions<KikvisionConfig2> _options2;
|
||||||
IOptions<JPushClientConfig> _jpoptions;
|
IOptions<JPushClientConfig> _jpoptions;
|
||||||
|
|
||||||
public FireManagementApp(IConfiguration configuration, IOptions<KikvisionConfig> options,
|
public FireManagementApp(IConfiguration configuration, IOptions<KikvisionConfig> options, IOptions<KikvisionConfig2> options2,
|
||||||
IOptions<JPushClientConfig> jpoptions, ISugarUnitOfWork<SugarDbContext> unitWork,
|
IOptions<JPushClientConfig> jpoptions, ISugarUnitOfWork<SugarDbContext> unitWork,
|
||||||
ISimpleClient<FmFireclueTask> repository, IAuth auth) : base(unitWork, repository, auth)
|
ISimpleClient<FmFireclueTask> repository, IAuth auth) : base(unitWork, repository, auth)
|
||||||
{
|
{
|
||||||
_auth = auth;
|
_auth = auth;
|
||||||
_options = options;
|
_options = options;
|
||||||
|
_options2 = options2;
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
_jpoptions = jpoptions;
|
_jpoptions = jpoptions;
|
||||||
}
|
}
|
||||||
|
|
@ -1220,6 +1222,38 @@ namespace OpenAuth.App.ServiceApp.FireManagement
|
||||||
return "fail";
|
return "fail";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取单个设备的视频流---海康平台2
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cameraIndexCode">视频标识</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public string GetPreviewURLs2(string cameraIndexCode, string protocol)
|
||||||
|
{
|
||||||
|
HttpUtillib.SetPlatformInfo(_options2.Value.AppKey, _options2.Value.SecretKey, _options2.Value.Url,
|
||||||
|
_options2.Value.Port, true);
|
||||||
|
|
||||||
|
var obj = new
|
||||||
|
{
|
||||||
|
cameraIndexCode,
|
||||||
|
streamType = 0,
|
||||||
|
protocol = protocol,
|
||||||
|
transmode = 1,
|
||||||
|
expand = "transcode=0",
|
||||||
|
streamform = "ps"
|
||||||
|
};
|
||||||
|
string body = JsonConvert.SerializeObject(obj);
|
||||||
|
string uri = "/artemis/api/video/v2/cameras/previewURLs";
|
||||||
|
byte[] result = HttpUtillib.HttpPost(uri, body, 15, 1);
|
||||||
|
if (null != result)
|
||||||
|
{
|
||||||
|
return Encoding.UTF8.GetString(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "fail";
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 人员类型统计
|
#region 人员类型统计
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@ namespace OpenAuth.App.ServiceApp.FireManagement
|
||||||
{
|
{
|
||||||
var usertime = await db.FmUserTimeSlot.AsQueryable().Where(a => a.CreateId == id).ToListAsync();
|
var usertime = await db.FmUserTimeSlot.AsQueryable().Where(a => a.CreateId == id).ToListAsync();
|
||||||
var user = await db.User.GetFirstAsync(r => r.Id == id);
|
var user = await db.User.GetFirstAsync(r => r.Id == id);
|
||||||
|
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
TimeSpan timeSpan = endTime.AddDays(1).Subtract(beginTime);
|
TimeSpan timeSpan = endTime.AddDays(1).Subtract(beginTime);
|
||||||
int days = (int)timeSpan.TotalDays;
|
int days = (int)timeSpan.TotalDays;
|
||||||
List<UserPatrolInfoResp> upinfo = new List<UserPatrolInfoResp>();
|
List<UserPatrolInfoResp> upinfo = new List<UserPatrolInfoResp>();
|
||||||
|
|
@ -91,6 +94,12 @@ namespace OpenAuth.App.ServiceApp.FireManagement
|
||||||
}
|
}
|
||||||
upinfo = upinfo.OrderByDescending(r => r.StartTime).ToList();
|
upinfo = upinfo.OrderByDescending(r => r.StartTime).ToList();
|
||||||
return new Response<List<UserPatrolInfoResp>> { Result = upinfo, Message = "操作成功" };
|
return new Response<List<UserPatrolInfoResp>> { Result = upinfo, Message = "操作成功" };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("用户不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -579,6 +579,26 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取视频流---海康平台2
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="deviceCode"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public string GetPreviewURLs2(string deviceCode, string protocol)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return _app.GetPreviewURLs2(deviceCode, protocol);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return ex.Message.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region 人员类型统计查询
|
#region 人员类型统计查询
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
|
|
|
||||||
|
|
@ -309,6 +309,7 @@ namespace OpenAuth.WebApi
|
||||||
#endregion
|
#endregion
|
||||||
#region 配置文件
|
#region 配置文件
|
||||||
services.Configure<KikvisionConfig>(Configuration.GetSection("Hik"));
|
services.Configure<KikvisionConfig>(Configuration.GetSection("Hik"));
|
||||||
|
services.Configure<KikvisionConfig2>(Configuration.GetSection("Hik2"));
|
||||||
services.Configure<JPushClientConfig>(Configuration.GetSection("JPushClient"));
|
services.Configure<JPushClientConfig>(Configuration.GetSection("JPushClient"));
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,12 @@
|
||||||
"AppKey": "23604396",
|
"AppKey": "23604396",
|
||||||
"SecretKey": "NZJ8L3bxCOOV6rtTFjsx"
|
"SecretKey": "NZJ8L3bxCOOV6rtTFjsx"
|
||||||
},
|
},
|
||||||
|
"Hik2": {
|
||||||
|
"Url": "223.99.16.253",
|
||||||
|
"Port": 1443,
|
||||||
|
"AppKey": "28135251",
|
||||||
|
"SecretKey": "V5nOdrZ7llDeNVP3KHX4"
|
||||||
|
},
|
||||||
"JPushClient": {
|
"JPushClient": {
|
||||||
"AppKey": "bfee2a863eccbb852baa9140",
|
"AppKey": "bfee2a863eccbb852baa9140",
|
||||||
"MasterSecret": "019f8665e581318dfcbac060"
|
"MasterSecret": "019f8665e581318dfcbac060"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue