解决代码里面的报警

pull/36/head
刘鑫 2 weeks ago
parent 76c03cafb7
commit 5071e8c310
  1. 8
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.API/Controllers/ShenZhouShengAn/SunPalaceBoardSafetyController.cs
  2. 2
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.Application/ShenZhouShengAn/ResponseDto/ThirdPartyProviderResDto.cs
  3. 20
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.DomainService/PuTianSuYuan/SunPalaceBoardFacilityService.cs
  4. 16
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.DomainService/ShenZhouShengAn/SunPalaceBoardSafetyService.cs
  5. 2
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.DomainService/ShenZhouShengAn/ThirdPartyProviderService.cs
  6. 24
      WeiCloud.Fusion/VideoService/Video.Application/IdentityClientConfig.cs
  7. 3
      WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/DahuaGeneralCtlService.cs
  8. 31
      WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/RootVideoPlaybackService.cs

@ -20,6 +20,11 @@ namespace ThirdPartyServices.API.Controllers.ShenZhouShengAn
private readonly ISunPalaceBoardSafetyService _secSituationService; private readonly ISunPalaceBoardSafetyService _secSituationService;
/// <summary>
///
/// </summary>
/// <param name="logger"></param>
/// <param name="secSituationService"></param>
public SunPalaceBoardSafetyController(ILogger<SunPalaceBoardSafetyController> logger, ISunPalaceBoardSafetyService secSituationService) public SunPalaceBoardSafetyController(ILogger<SunPalaceBoardSafetyController> logger, ISunPalaceBoardSafetyService secSituationService)
{ {
_logger = logger; _logger = logger;
@ -82,7 +87,7 @@ namespace ThirdPartyServices.API.Controllers.ShenZhouShengAn
/// <summary> /// <summary>
/// 14、获得隐患详情数据 /// 14、获得隐患详情数据
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="dto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("GetDangerDetail")] [HttpPost("GetDangerDetail")]
public async Task<ApiResult<HazardDataDto>> GetDangerDetail(DangerDetailReqDto dto) public async Task<ApiResult<HazardDataDto>> GetDangerDetail(DangerDetailReqDto dto)
@ -126,7 +131,6 @@ namespace ThirdPartyServices.API.Controllers.ShenZhouShengAn
/// <summary> /// <summary>
/// 获得本月隐患数据 /// 获得本月隐患数据
/// </summary> /// </summary>
/// <param name="dto"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public async Task<ApiResult<List<DangerHomeResDto>>> GetDangerHome() public async Task<ApiResult<List<DangerHomeResDto>>> GetDangerHome()

@ -99,7 +99,7 @@ namespace ThirdPartyServices.Application.ShenZhouShengAn.ResponseDto
break; break;
case "message": case "message":
case "msg": // 👈 支持两个字段名 case "msg":
result.Message = reader.GetString(); result.Message = reader.GetString();
break; break;

@ -29,9 +29,15 @@ namespace ThirdPartyServices.DomainService.PuTianSuYuan
switch (dto.QueryTimeType) switch (dto.QueryTimeType)
{ {
case (int)QueryTimeEnum.Custom: case (int)QueryTimeEnum.Custom:
if (dto.StartTime != null)
{
start = dto.StartTime.Value;
}
if (dto.EndTime != null)
{
end = dto.EndTime.Value;
}
start = dto.StartTime.Value;
end = dto.EndTime.Value;
break; break;
case (int)QueryTimeEnum.Monthly: case (int)QueryTimeEnum.Monthly:
@ -156,8 +162,14 @@ namespace ThirdPartyServices.DomainService.PuTianSuYuan
{ {
case (int)QueryTimeEnum.Custom: case (int)QueryTimeEnum.Custom:
start = dto.StartTime.Value; if (dto.StartTime != null)
end = dto.EndTime.Value; {
start = dto.StartTime.Value;
}
if (dto.EndTime != null)
{
end = dto.EndTime.Value;
}
break; break;
case (int)QueryTimeEnum.Monthly: case (int)QueryTimeEnum.Monthly:

@ -30,7 +30,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<ApiResult<FloorResDto>> GetListFloor() public async Task<ApiResult<FloorResDto>> GetListFloor()
{ {
ApiResult<FloorResDto> result = new ApiResult<FloorResDto>() { Code = 200, Msg = "接口调用成功", Data = null }; ApiResult<FloorResDto> result = new ApiResult<FloorResDto>() { Code = 200, Msg = "接口调用成功", Data = new() };
try try
{ {
@ -244,7 +244,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
/// <returns></returns> /// <returns></returns>
public async Task<ApiResult<RootReqDto>> GetRiskMapInfo(int floorId) public async Task<ApiResult<RootReqDto>> GetRiskMapInfo(int floorId)
{ {
ApiResult<RootReqDto> result = new ApiResult<RootReqDto>() { Code = 200, Msg = "接口调用成功", Data = null }; ApiResult<RootReqDto> result = new ApiResult<RootReqDto>() { Code = 200, Msg = "接口调用成功", Data = new() };
try try
{ {
@ -300,7 +300,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<ApiResult<LedgerDto>> GetLedger(WorkTaskQueryParamsDto dto) public async Task<ApiResult<LedgerDto>> GetLedger(WorkTaskQueryParamsDto dto)
{ {
ApiResult<LedgerDto> result = new ApiResult<LedgerDto>() { Code = 200, Msg = "接口调用成功", Data = null }; ApiResult<LedgerDto> result = new ApiResult<LedgerDto>() { Code = 200, Msg = "接口调用成功", Data = new() };
try try
{ {
@ -361,7 +361,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<ApiResult<HazardDataDto>> GetDangerDetail(DangerDetailReqDto dto) public async Task<ApiResult<HazardDataDto>> GetDangerDetail(DangerDetailReqDto dto)
{ {
ApiResult<HazardDataDto> result = new ApiResult<HazardDataDto>() { Code = 200, Msg = "接口调用成功", Data = null }; ApiResult<HazardDataDto> result = new ApiResult<HazardDataDto>() { Code = 200, Msg = "接口调用成功", Data = new() };
try try
{ {
@ -403,7 +403,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<ApiResult<List<InjureResDto>>> GetInjureInfo() public async Task<ApiResult<List<InjureResDto>>> GetInjureInfo()
{ {
ApiResult<List<InjureResDto>> result = new ApiResult<List<InjureResDto>>() { Code = 200, Msg = "接口调用成功", Data = null }; ApiResult<List<InjureResDto>> result = new ApiResult<List<InjureResDto>>() { Code = 200, Msg = "接口调用成功", Data = [] };
try try
{ {
@ -458,7 +458,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<ApiResult<RegionStructureRootDto>> GetRegionRootInfo(RegionRootInfoReqDto dto) public async Task<ApiResult<RegionStructureRootDto>> GetRegionRootInfo(RegionRootInfoReqDto dto)
{ {
ApiResult<RegionStructureRootDto> result = new ApiResult<RegionStructureRootDto>() { Code = 200, Msg = "接口调用成功", Data = null }; ApiResult<RegionStructureRootDto> result = new ApiResult<RegionStructureRootDto>() { Code = 200, Msg = "接口调用成功", Data = new() };
try try
{ {
@ -510,7 +510,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<ApiResult<List<StatisticsInfoDto>>> GetStatistics(WorkTaskQueryParamsDto dto) public async Task<ApiResult<List<StatisticsInfoDto>>> GetStatistics(WorkTaskQueryParamsDto dto)
{ {
ApiResult<List<StatisticsInfoDto>> result = new ApiResult<List<StatisticsInfoDto>>() { Code = 200, Msg = "接口调用成功", Data = null }; ApiResult<List<StatisticsInfoDto>> result = new ApiResult<List<StatisticsInfoDto>>() { Code = 200, Msg = "接口调用成功", Data = new() };
try try
{ {
@ -653,7 +653,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
public async Task<ApiResult<List<DangerHomeResDto>>> GetDangerHome() public async Task<ApiResult<List<DangerHomeResDto>>> GetDangerHome()
{ {
ApiResult<List<DangerHomeResDto>> result = new ApiResult<List<DangerHomeResDto>>() { Code = 200, Msg = "接口调用成功", Data = null }; ApiResult<List<DangerHomeResDto>> result = new ApiResult<List<DangerHomeResDto>>() { Code = 200, Msg = "接口调用成功", Data = [] };
try try
{ {

@ -74,7 +74,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
result = await SendAndParseAsync<HttpClientResult<LoginUsersConfiguration>>( result = await SendAndParseAsync<HttpClientResult<LoginUsersConfiguration>>(
"https://zrh.szdunan.cn/v1/api/users", "https://zrh.szdunan.cn/v1/api/users",
token, token,
HttpMethod.Post); HttpMethod.Post) ?? new();
return result; return result;
} }

@ -6,27 +6,27 @@ namespace Video.Application
{ {
public class IdentityClientConfig public class IdentityClientConfig
{ {
public string Scheme { get; set; } public string Scheme { get; set; } = string.Empty;
public string Authority { get; set; } public string Authority { get; set; } = string.Empty;
public bool RequireHttpsMetadata { get; set; } public bool RequireHttpsMetadata { get; set; }
public string ApiName { get; set; } public string ApiName { get; set; } = string.Empty;
public string[] CorsWithOrigins { get; set; } public string[] CorsWithOrigins { get; set; } = [];
public string ClientSecret { get; set; } public string ClientSecret { get; set; } = string.Empty;
public string ClientId { get; set; } public string ClientId { get; set; } = string.Empty;
public string Scope { get; set; } public string Scope { get; set; } = string.Empty;
public string GrantType { get; set; } public string GrantType { get; set; } = string.Empty;
} }
public class IdentityClientConfigV4 public class IdentityClientConfigV4
{ {
public string PolicyScheme { get; set; } public string PolicyScheme { get; set; } = string.Empty;
public List<IdentityClientConfigItemV4> Items { get; set; } public List<IdentityClientConfigItemV4> Items { get; set; } = [];
} }
public class IdentityClientConfigItemV4 public class IdentityClientConfigItemV4
{ {
public string Scheme { get; set; } public string Scheme { get; set; } = string.Empty;
public string Authority { get; set; } public string Authority { get; set; } = string.Empty;
public bool RequireHttpsMetadata { get; set; } public bool RequireHttpsMetadata { get; set; }
} }
} }

@ -316,7 +316,7 @@ namespace Video.DomainService
var result = await resp.Content.ReadFromJsonAsync<DaHApiResult<object>>(); var result = await resp.Content.ReadFromJsonAsync<DaHApiResult<object>>();
if (!result.Success || result.Code != "0") if (result != null && (result.Success || result.Code != "0"))
{ {
result.Success = false; result.Success = false;
result.Code = "1011"; result.Code = "1011";
@ -339,7 +339,6 @@ namespace Video.DomainService
/// <summary> /// <summary>
/// rtsp录像回放 /// rtsp录像回放
/// TODO:后续增加一个调用视频信息接口,去得到里面recordType=多少
/// (播放命令:ffplay -rtsp_transport tcp -i "rtsp://demo.weienergy.cn:15210/dss/monitor/param/cameraid=1000021%24104%26substream=1?token=430")强制走tcp /// (播放命令:ffplay -rtsp_transport tcp -i "rtsp://demo.weienergy.cn:15210/dss/monitor/param/cameraid=1000021%24104%26substream=1?token=430")强制走tcp
/// </summary> /// </summary>
/// <param name="dto"></param> /// <param name="dto"></param>

@ -2,6 +2,7 @@
using Common.Shared.Application.DaHua; using Common.Shared.Application.DaHua;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using WeiCloud.Utils.FileTools;
namespace Video.DomainService namespace Video.DomainService
{ {
@ -43,11 +44,11 @@ namespace Video.DomainService
if (!urlReult.Success) if (!urlReult.Success)
{ {
result.Code = 500; result.Code = 500;
result.Msg = urlReult.Msg; result.Msg = urlReult.Msg ?? "" ?? "";
_logger.LogWarning("大华录像回放接口调用失败:{Msg}", urlReult.Msg); _logger.LogWarning("大华录像回放接口调用失败:{Msg}", urlReult.Msg ?? "");
} }
result.Data = urlReult.Data; result.Data = urlReult.Data ?? new();
return result; return result;
} }
@ -65,10 +66,10 @@ namespace Video.DomainService
if (!urlReult.Success) if (!urlReult.Success)
{ {
result.Code = 500; result.Code = 500;
result.Msg = urlReult.Msg; result.Msg = urlReult.Msg ?? "";
_logger.LogWarning("大华实时视频接口调用失败:{Msg}", urlReult.Msg); _logger.LogWarning("大华实时视频接口调用失败:{Msg}", urlReult.Msg ?? "");
} }
result.Data = urlReult.Data; result.Data = urlReult.Data ?? new();
return result; return result;
} }
@ -84,10 +85,10 @@ namespace Video.DomainService
if (!pageResult.Success) if (!pageResult.Success)
{ {
result.Code = 500; result.Code = 500;
result.Msg = pageResult.Msg; result.Msg = pageResult.Msg ?? "";
_logger.LogWarning("大华设备通道分页查询接口调用失败:{Msg}", pageResult.Msg); _logger.LogWarning("大华设备通道分页查询接口调用失败:{Msg}", pageResult.Msg);
} }
result.Data = pageResult.Data; result.Data = pageResult.Data ?? new();
return result; return result;
} }
@ -106,7 +107,7 @@ namespace Video.DomainService
if (!logoutResult.Success) if (!logoutResult.Success)
{ {
result.Code = 500; result.Code = 500;
result.Msg = logoutResult.Msg; result.Msg = logoutResult.Msg ?? "";
_logger.LogWarning("大华登出接口调用失败:{Msg}", logoutResult.Msg); _logger.LogWarning("大华登出接口调用失败:{Msg}", logoutResult.Msg);
} }
else else
@ -130,10 +131,10 @@ namespace Video.DomainService
if (!urlReult.Success) if (!urlReult.Success)
{ {
result.Code = 500; result.Code = 500;
result.Msg = urlReult.Msg; result.Msg = urlReult.Msg ?? "";
_logger.LogWarning("大华实时视频接口调用失败:{Msg}", urlReult.Msg); _logger.LogWarning("大华实时视频接口调用失败:{Msg}", urlReult.Msg ?? "");
} }
result.Data = urlReult.Data; result.Data = urlReult.Data ?? new();
return result; return result;
} }
@ -150,11 +151,11 @@ namespace Video.DomainService
if (!urlReult.Success) if (!urlReult.Success)
{ {
result.Code = 500; result.Code = 500;
result.Msg = urlReult.Msg; result.Msg = urlReult.Msg ?? "";
_logger.LogWarning("大华录像回放接口调用失败:{Msg}", urlReult.Msg); _logger.LogWarning("大华录像回放接口调用失败:{Msg}", urlReult.Msg ?? "");
} }
result.Data = urlReult.Data; result.Data = urlReult.Data ?? new();
return result; return result;
} }

Loading…
Cancel
Save