Browse Source

#历史告警查询

zhongwei
yang_shj 1 year ago
parent
commit
b891a849e3
  1. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java
  2. 2
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java
  3. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java
  4. 18
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java

2
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java

@ -60,4 +60,6 @@ public interface AlarmConstants {
Integer STOP = 61;
List<Integer> START_STOP_ALARAM = Arrays.asList(START,STOP);
String VIDEO_SCHEDULED_TASK= "VideoScheduledTask";
List<String> HZ3000_TYPES = Arrays.asList("0","1","2","3","4","5","6","7","8","9","10","11","12");
}

2
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java

@ -30,5 +30,5 @@ public class TabulateLevelVo {
private Integer soeType;
@ApiModelProperty(value = "告警类型")
private List<String> types;
private String types;
}

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java

@ -45,14 +45,14 @@ public class AlarmTabulateController extends BladeController {
}
@GetMapping("/video")
@ApiOperationSupport(order = 2)
@ApiOperationSupport(order = 3)
@ApiOperation(value = "视频告警(海康)", notes = "视频告警(海康)")
public R<IPage<Object>> video(TabulateLevelVo param, Query query) {
return R.data(tabulateService.video(Condition.getPage(query), param));
}
@GetMapping("/hz3000")
@ApiOperationSupport(order = 2)
@ApiOperationSupport(order = 4)
@ApiOperation(value = "hz3000告警", notes = "hz3000告警")
public R<IPage<SoeData>> hz3000(TabulateLevelVo param, Query query) {
return R.data(tabulateService.hz3000(Condition.getPage(query), param));

18
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java

@ -1,6 +1,7 @@
package com.hnac.hzims.alarm.tabulate.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.alarm.config.constants.AlarmConstants;
import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService;
import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo;
import com.hnac.hzims.alarm.tabulate.vo.TabulateLevelVo;
@ -16,17 +17,12 @@ import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.core.tool.utils.*;
import org.springframework.stereotype.Service;
import java.lang.reflect.Array;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @author ysj
@ -122,8 +118,10 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService {
query.setPage((int) page.getCurrent());
query.setLimit((int) page.getSize());
query.setStationIds(Collections.singletonList(param.getProjectId()));
if(CollectionUtil.isNotEmpty(param.getTypes())){
query.setTypes(param.getTypes());
if(StringUtil.isNotBlank(param.getTypes())){
query.setTypes(Func.toStrList(",",param.getTypes()));
}else {
query.setTypes(AlarmConstants.HZ3000_TYPES);
}
if(StringUtil.isNotBlank(param.getStartTime())){
query.setBeginTime(LocalDateTime.parse(param.getStartTime(),DateUtil.DATETIME_FORMATTER));

Loading…
Cancel
Save