Browse Source

fix:视频巡检,空指针异常

zhongwei
luyie 2 months ago
parent
commit
142cf9dd70
  1. 10
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java
  2. 3
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java
  3. 6
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java
  4. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java

10
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java

@ -4,6 +4,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.gglm.bigmodel.business.service.VectorDataService;
import com.hnac.gglm.bigmodel.business.vo.DeviceModelData;
import com.hnac.hzinfo.api.annotation.ApiInterface;
import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO;
@ -63,4 +64,13 @@ public class VectorDataController {
public R<List<DeviceModelData>> getModelData() {
return R.data(vectorDataService.getModelData());
}
@GetMapping("/getDeviceAttr")
@ApiOperation(value = "获取模型数据")
@ApiOperationSupport(order = 4)
@ApiInterface
public R<List<DeviceAttrInfoDTO>> getDeviceAttr( ) {
return R.data(vectorDataService.getDeviceAttr());
}
}

3
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java

@ -1,6 +1,7 @@
package com.hnac.gglm.bigmodel.business.service;
import com.hnac.gglm.bigmodel.business.vo.DeviceModelData;
import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO;
@ -20,4 +21,6 @@ public interface VectorDataService {
List<ModelEventVO> getModelEventData();
List<DeviceModelData> getModelData();
List<DeviceAttrInfoDTO> getDeviceAttr();
}

6
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java

@ -2,6 +2,7 @@ package com.hnac.gglm.bigmodel.business.service.impl;
import com.hnac.gglm.bigmodel.business.service.VectorDataService;
import com.hnac.gglm.bigmodel.business.vo.DeviceModelData;
import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO;
import com.hnac.hzinfo.sdk.v5.model.ModelClient;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO;
@ -61,4 +62,9 @@ public class VectorDataServiceImpl implements VectorDataService {
}
return modelDataList;
}
@Override
public List<DeviceAttrInfoDTO> getDeviceAttr() {
return null;
}
}

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java

@ -172,7 +172,7 @@ public class VideoTaskSchedule {
record.setUpdateUser(task.getUpdateUser());
record.setCurrentStatus("1");
CameraInfoEntity camera = this.getCameraByProIdAndConId(project.getProjectId(), content.getContentId());
log.info("【taskId:" + task.getId() + "】视频巡检任务执行,获取视频巡检结果,camera:" + Optional.of(camera).map(JsonUtil::toJson).orElse("null"));
log.info("【taskId:" + task.getId() + "】视频巡检任务执行,获取视频巡检结果,camera:" + Optional.ofNullable(camera).map(JsonUtil::toJson).orElse("null"));
if (Func.isNotEmpty(camera)) {
// 获取计划时间段内视频的告警信息设置是否异常
if (Func.isNotEmpty(camera.getEmCode())) {

Loading…
Cancel
Save