修改抓拍问题

pull/34/head
刘鑫 1 month ago
parent 90d3c830a1
commit 34f3067de7
  1. 2
      WeiCloud.Fusion/Common.SharedService/Common.Shared.Application/Common.Shared.Application.csproj
  2. 12
      WeiCloud.Fusion/Common.SharedService/Common.Shared.Application/SafetyFirePro/ResponseDto/SunPlaceBoardWorkOrderResDto.cs
  3. 6
      WeiCloud.Fusion/VideoService/Video.API/Controllers/DaHua/VideoManageController.cs
  4. 11
      WeiCloud.Fusion/VideoService/Video.Application/RequestDto/DeviceOperationReqDto.cs
  5. 9
      WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/DahuaGeneralCtlService.cs
  6. 2
      WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/IDahuaGeneralCtlService.cs

@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PackageId>Common.Shared.Application</PackageId> <PackageId>Common.Shared.Application</PackageId>
<Version>3.5.0</Version> <Version>3.6.0</Version>
<Authors>zrh-lx</Authors> <Authors>zrh-lx</Authors>
<Company>zrh-lx</Company> <!-- 可选 --> <Company>zrh-lx</Company> <!-- 可选 -->
<Description>包含所有公共使用的 DTO、契约、接口模型等,供微服务之间共享使用</Description> <Description>包含所有公共使用的 DTO、契约、接口模型等,供微服务之间共享使用</Description>

@ -765,6 +765,15 @@ namespace Common.Shared.Application.SafetyFirePro.ResponseDto
[JsonPropertyName("infos")] [JsonPropertyName("infos")]
public string Infos { get; set; } = string.Empty; public string Infos { get; set; } = string.Empty;
[JsonPropertyName("user")]
public UserDto? User { get; set; }
[JsonPropertyName("report_time")]
public string Report_time { get; set; } = string.Empty;
[JsonPropertyName("suggestions")]
public string? Suggestions { get; set; }
} }
public class RectificationCheckItem public class RectificationCheckItem
@ -786,9 +795,6 @@ namespace Common.Shared.Application.SafetyFirePro.ResponseDto
[JsonPropertyName("user")] [JsonPropertyName("user")]
public UserDto? User { get; set; } public UserDto? User { get; set; }
[JsonPropertyName("suggestions")]
public string? Suggestions { get; set; }
} }
public class UserDto public class UserDto

@ -181,11 +181,13 @@ namespace Video.API.Controllers.DaHua
/// 操作抓拍 /// 操作抓拍
/// </summary> /// </summary>
/// <param name="deviceCode"></param> /// <param name="deviceCode"></param>
/// <param name="id"></param>
/// <param name="channelId"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public async Task<DaHApiResult<SnapshotResDto>> InvokeSnapshot(string deviceCode, long id) public async Task<DaHApiResult<SnapshotResDto>> InvokeSnapshot(string deviceCode, long id, int channelId)
{ {
return await _dahGeneralCtlService.InvokeSnapshot(deviceCode, id); return await _dahGeneralCtlService.InvokeSnapshot(deviceCode, id, channelId);
} }
#endregion 大华视频处理 #endregion 大华视频处理

@ -9,12 +9,12 @@
/// </summary> /// </summary>
public class DeviceOperationReqDto public class DeviceOperationReqDto
{ {
public DeviceOperationReqDto(string deviceCode, long id) public DeviceOperationReqDto(string deviceCode, long id, int channelId)
{ {
DeviceCode = deviceCode; DeviceCode = deviceCode;
Operation = "generalJsonTransport"; Operation = "generalJsonTransport";
Params = JsonSerializer.Serialize(new OperationVO(deviceCode, id)); Params = JsonSerializer.Serialize(new OperationVO(deviceCode, id, channelId));
} }
[JsonPropertyName("deviceCode")] [JsonPropertyName("deviceCode")]
@ -32,11 +32,11 @@
/// </summary> /// </summary>
public class OperationVO public class OperationVO
{ {
public OperationVO(string devID, long id) public OperationVO(string devID, long id, int channelId)
{ {
Method = "dev.snap"; Method = "dev.snap";
Id = id; Id = id;
Params = new DeviceVO(devID); Params = new DeviceVO(devID, channelId);
} }
[JsonPropertyName("method")] [JsonPropertyName("method")]
@ -54,9 +54,10 @@
/// </summary> /// </summary>
public class DeviceVO public class DeviceVO
{ {
public DeviceVO(string devID) public DeviceVO(string devID, int channelId)
{ {
DevID = devID; DevID = devID;
DevChannel = channelId;
} }
[JsonPropertyName("DevID")] [JsonPropertyName("DevID")]

@ -544,7 +544,7 @@ namespace Video.DomainService
/// <param name="deviceCode"></param> /// <param name="deviceCode"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<DaHApiResult<SnapshotResDto>> InvokeSnapshot(string deviceCode, long id) public async Task<DaHApiResult<SnapshotResDto>> InvokeSnapshot(string deviceCode, long id, int channelId)
{ {
DaHApiResult<SnapshotResDto> apiResult = new DaHApiResult<SnapshotResDto>() { Code = "200", Msg = "接口调用成功", Data = new SnapshotResDto() }; DaHApiResult<SnapshotResDto> apiResult = new DaHApiResult<SnapshotResDto>() { Code = "200", Msg = "接口调用成功", Data = new SnapshotResDto() };
var clientId = _configuration["DahuaAuth:ClientId"]; var clientId = _configuration["DahuaAuth:ClientId"];
@ -557,7 +557,7 @@ namespace Video.DomainService
} }
var url = $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/admin/API/EVO/invoke/DMS"; var url = $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/admin/API/EVO/invoke/DMS";
DeviceOperationReqDto dto = new DeviceOperationReqDto(deviceCode, id); DeviceOperationReqDto dto = new DeviceOperationReqDto(deviceCode, id, channelId);
using var req = new HttpRequestMessage(HttpMethod.Post, url) using var req = new HttpRequestMessage(HttpMethod.Post, url)
{ {
@ -577,6 +577,11 @@ namespace Video.DomainService
return new DaHApiResult<SnapshotResDto> { Success = false, Code = "1014", Msg = $"抓拍错误 {(int)resp.StatusCode}" }; return new DaHApiResult<SnapshotResDto> { Success = false, Code = "1014", Msg = $"抓拍错误 {(int)resp.StatusCode}" };
} }
var outer = JsonSerializer.Deserialize<DaHApiResult<string>>(body); var outer = JsonSerializer.Deserialize<DaHApiResult<string>>(body);
if (outer == null || !outer.Success)
{
_logger.LogWarning("抓拍请求业务失败: {Body}", body);
return new DaHApiResult<SnapshotResDto> { Success = false, Code = "1013", Msg = "抓拍请求失败" };
}
var result = JsonSerializer.Deserialize<SnapResponseVO>(outer.Data); var result = JsonSerializer.Deserialize<SnapResponseVO>(outer.Data);
if (result == null) if (result == null)
{ {

@ -63,6 +63,6 @@ namespace Video.DomainService
/// <returns></returns> /// <returns></returns>
Task<string> Download(DownloadReqDto dto); Task<string> Download(DownloadReqDto dto);
Task<DaHApiResult<SnapshotResDto>> InvokeSnapshot(string deviceCode, long id); Task<DaHApiResult<SnapshotResDto>> InvokeSnapshot(string deviceCode, long id, int channelId);
} }
} }
Loading…
Cancel
Save