修改抓拍问题

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

@ -765,6 +765,15 @@ namespace Common.Shared.Application.SafetyFirePro.ResponseDto
[JsonPropertyName("infos")]
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
@ -786,9 +795,6 @@ namespace Common.Shared.Application.SafetyFirePro.ResponseDto
[JsonPropertyName("user")]
public UserDto? User { get; set; }
[JsonPropertyName("suggestions")]
public string? Suggestions { get; set; }
}
public class UserDto

@ -181,11 +181,13 @@ namespace Video.API.Controllers.DaHua
/// 操作抓拍
/// </summary>
/// <param name="deviceCode"></param>
/// <param name="id"></param>
/// <param name="channelId"></param>
/// <returns></returns>
[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 大华视频处理

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

@ -544,7 +544,7 @@ namespace Video.DomainService
/// <param name="deviceCode"></param>
/// <returns></returns>
/// <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() };
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";
DeviceOperationReqDto dto = new DeviceOperationReqDto(deviceCode, id);
DeviceOperationReqDto dto = new DeviceOperationReqDto(deviceCode, id, channelId);
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}" };
}
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);
if (result == null)
{

@ -63,6 +63,6 @@ namespace Video.DomainService
/// <returns></returns>
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