Browse Source

#告警修改

zhongwei
yang_shj 1 year ago
parent
commit
383009870c
  1. 25
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java
  2. 5
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java
  3. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.java
  4. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.xml
  5. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/AlarmHistoryService.java
  6. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/ConditionAlarmService.java
  7. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/FdpAlarmService.java
  8. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/LevelAlarmService.java
  9. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/MessageService.java
  10. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/SystemAlarmService.java
  11. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/VideoAlarmService.java
  12. 8
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/AlarmHistoryServiceImpl.java
  13. 9
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/ConditionAlarmServiceImpl.java
  14. 6
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/FdpAlarmServiceImpl.java
  15. 6
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/LevelAlarmServiceImpl.java
  16. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/MessageServiceImpl.java
  17. 6
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/SystemAlarmServiceImpl.java
  18. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/VideoAlarmServiceImpl.java
  19. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConfig.java
  20. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConsumer.java
  21. 67
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java
  22. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java
  23. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml
  24. 7
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java
  25. 88
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java
  26. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/task/VideoScheduledTask.java
  27. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmRegular.java
  28. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmWebSocket.java
  29. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmRegular.java
  30. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmWebSocket.java
  31. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmRegular.java
  32. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmWebSocket.java
  33. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java
  34. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java

25
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java

@ -65,4 +65,29 @@ public class AlarmEntity extends TenantEntity {
@ApiModelProperty(value = "监测点")
private String realId;
@ApiModelProperty(value = "是否集中监控右侧列表展示 : 0-展示 1-不展示")
private Integer isRightTabulation;
@ApiModelProperty(value = "是否集中监控弹窗展示 : 0-展示 1-不展示")
private Integer isShowAlert;
@ApiModelProperty(value = "是否集中监控铃铛展示 : 0-展示 1-不展示")
private Integer isSmallBell;
@ApiModelProperty(value = "是否集中监控遮罩展示 : 0-展示 1-不展示")
private Integer isMask;
@ApiModelProperty(value = "是否语音播报 : 0-播报 1-不播报")
private Integer isBroadcast;
@ApiModelProperty(value = "是否进行平台消息推送 : 0-推送 1-不推送")
private Integer isPlatformMessage;
@ApiModelProperty(value = "是否短信推送 :0-推送 1-不推送")
private Integer isShortMessage;
@ApiModelProperty(value = "是否微信公众号消息推送 :0-推送 1-不推送")
private Integer isWxMessage;
}

5
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java

@ -99,4 +99,9 @@ public class IEmInfoClientBack implements IEmInfoClient {
public R<List<String>> getChildrenByEmCode(String emCode) {
return R.fail("远程调用失败");
}
@Override
public List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo) {
return new ArrayList<>();
}
}

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.config.mapper;
package com.hnac.hzims.alarm.handle.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.alarm.entity.AlarmHistoryEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.xml → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.alarm.config.mapper.AlarmHistoryMapper">
<mapper namespace="com.hnac.hzims.alarm.handle.mapper.AlarmHistoryMapper">
</mapper>

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHistoryService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/AlarmHistoryService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.show.service;
package com.hnac.hzims.alarm.handle.service;
import com.hnac.hzims.alarm.entity.AlarmHistoryEntity;
import org.springblade.core.mp.base.BaseService;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/ConditionAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/ConditionAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.show.service;
package com.hnac.hzims.alarm.handle.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/FdpAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/FdpAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.show.service;
package com.hnac.hzims.alarm.handle.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/LevelAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/LevelAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.show.service;
package com.hnac.hzims.alarm.handle.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/MessageService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/MessageService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.show.service;
package com.hnac.hzims.alarm.handle.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/SystemAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/SystemAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.show.service;
package com.hnac.hzims.alarm.handle.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/VideoAlarmService.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/VideoAlarmService.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.show.service;
package com.hnac.hzims.alarm.handle.service;
import com.hnac.hzims.alarm.entity.AlarmEntity;

8
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHistoryServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/AlarmHistoryServiceImpl.java

@ -1,10 +1,10 @@
package com.hnac.hzims.alarm.show.service.impl;
package com.hnac.hzims.alarm.handle.service.impl;
import com.hnac.hzims.alarm.entity.AlarmHistoryEntity;
import com.hnac.hzims.alarm.config.mapper.AlarmHistoryMapper;
import com.hnac.hzims.alarm.show.service.AlarmHistoryService;
import com.hnac.hzims.alarm.handle.mapper.AlarmHistoryMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@ -14,6 +14,6 @@ import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
@Slf4j
public class AlarmHistoryServiceImpl extends BaseServiceImpl<AlarmHistoryMapper, AlarmHistoryEntity> implements AlarmHistoryService {
public class AlarmHistoryServiceImpl extends BaseServiceImpl<AlarmHistoryMapper, AlarmHistoryEntity> implements BaseService<AlarmHistoryEntity> {
}

9
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/ConditionAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/ConditionAlarmServiceImpl.java

@ -1,11 +1,11 @@
package com.hnac.hzims.alarm.show.service.impl;
package com.hnac.hzims.alarm.handle.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.ConditionAlarmService;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.ConditionAlarmService;
import com.hnac.hzims.alarm.show.service.MessageService;
import com.hnac.hzims.alarm.vo.ConditionAlarmVo;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.operational.station.entity.StationEntity;
@ -21,7 +21,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static com.hnac.hzims.alarm.constants.AlarmConstants.*;
import static com.hnac.hzims.alarm.constants.AlarmConstants.CONDITION;
import static com.hnac.hzims.alarm.constants.AlarmConstants.CONDITION_ALARM;
/**
* 等级告警实现类

6
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/FdpAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/FdpAlarmServiceImpl.java

@ -1,11 +1,11 @@
package com.hnac.hzims.alarm.show.service.impl;
package com.hnac.hzims.alarm.handle.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.FdpAlarmService;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.FdpAlarmService;
import com.hnac.hzims.alarm.show.service.MessageService;
import com.hnac.hzims.alarm.vo.FdpAlarmVo;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.station.entity.StationEntity;

6
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/LevelAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/LevelAlarmServiceImpl.java

@ -1,12 +1,12 @@
package com.hnac.hzims.alarm.show.service.impl;
package com.hnac.hzims.alarm.handle.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.LevelAlarmService;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.LevelAlarmService;
import com.hnac.hzims.alarm.show.service.MessageService;
import com.hnac.hzims.alarm.vo.LevelMessageVo;
import com.hnac.hzims.alarm.vo.LevelVo;
import com.hnac.hzims.equipment.feign.IEmInfoClient;

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/MessageServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/MessageServiceImpl.java

@ -1,10 +1,10 @@
package com.hnac.hzims.alarm.show.service.impl;
package com.hnac.hzims.alarm.handle.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.config.service.AlarmConfigService;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.show.service.MessageService;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient;

6
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/SystemAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/SystemAlarmServiceImpl.java

@ -1,12 +1,12 @@
package com.hnac.hzims.alarm.show.service.impl;
package com.hnac.hzims.alarm.handle.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.handle.service.SystemAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.MessageService;
import com.hnac.hzims.alarm.show.service.SystemAlarmService;
import com.hnac.hzims.alarm.vo.SystemAlarmVo;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/VideoAlarmServiceImpl.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/VideoAlarmServiceImpl.java

@ -1,11 +1,11 @@
package com.hnac.hzims.alarm.show.service.impl;
package com.hnac.hzims.alarm.handle.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.VideoAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.VideoAlarmService;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.message.fegin.IMessageClient;

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConfig.java

@ -19,7 +19,7 @@ public class fdpMqttConfig {
@Autowired
fdpMqttConsumer fdpMqttConsumer;
@Value("${hzims.mqtt.fdp-url}")
/*@Value("${hzims.mqtt.fdp-url}")
private String mqtt_fdp_url;
@Value("${hzims.mqtt.fdp-group}")
private String mqtt_fdp_group;
@ -28,7 +28,7 @@ public class fdpMqttConfig {
@Value("${hzims.mqtt.fdp-username}")
private String mqtt_fdp_username;
@Value("${hzims.mqtt.fdp-topname}")
private String mqtt_fdp_topname;
private String mqtt_fdp_topname;*/
@PostConstruct
public void registerMqtt(){
try {

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConsumer.java

@ -2,8 +2,8 @@ package com.hnac.hzims.alarm.mqtt;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.FdpAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.FdpAlarmService;
import com.hnac.hzinfo.subscribe.SubscribeCallBack;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;

67
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java

@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.SystemAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.SystemAlarmService;
import com.hnac.hzims.alarm.vo.AlarmCountVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -29,75 +29,34 @@ import java.util.Map;
*/
@RestController
@AllArgsConstructor
@RequestMapping("/alarm/show")
@RequestMapping("/alarm")
@Api(value = "告警配置", tags = "告警配置")
public class ShowAlarmController extends BladeController {
@Autowired
private AlarmService alarmService;
private SystemAlarmService systemAlarmService;
@PostMapping("/alarms")
@GetMapping("/broadcast")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "播报告警", notes = "传入:时间区间")
public R<List<AlarmEntity>> broadcast(@ApiParam(value = "开始时间", required = false) String startTime,
@ApiParam(value = "结束时间", required = true) String endTime) {
return R.data(alarmService.broadcast(startTime,endTime));
}
@PostMapping("/show")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "告警列表分页", notes = "传入: AlarmConfigEntity对象,分页参数")
public R<IPage<AlarmEntity>> alarms(@ApiIgnore @RequestParam AlarmEntity alarm, Query query) {
return R.data(alarmService.alarms(alarm,Condition.getPage(query)));
}
@PostMapping("/count")
@ApiOperationSupport(order = 1)
@ApiOperationSupport(order = 3)
@ApiOperation(value = "告警分类数量", notes = "不需要传入参数")
public R<List<AlarmCountVo>> counts() {
return R.data(alarmService.counts());
}
@PostMapping("/save")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入AlarmEntity对象")
public R save(@Valid @RequestBody AlarmEntity entity) {
return R.status(alarmService.save(entity));
}
@PostMapping("/update")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "修改", notes = "传入AlarmEntity对象")
public R update(@Valid @RequestBody AlarmEntity entity) {
return R.status(alarmService.updateById(entity));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(alarmService.deleteLogic(Func.toLongList(ids)));
}
@GetMapping("/list")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "传入em_model_param")
public R<IPage<AlarmEntity>> list(@ApiIgnore @RequestParam Map<String,Object> params, Query query) {
QueryWrapper<AlarmEntity> queryWrapper = Condition.getQueryWrapper( params, AlarmEntity.class);
IPage<AlarmEntity> pages = alarmService.page(Condition.getPage(query), queryWrapper);
return R.data(pages);
}
@GetMapping("/detail")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "详情", notes = "传入em_model_param")
public R<AlarmEntity> detail(AlarmEntity entity) {
AlarmEntity detail = alarmService.getOne(Condition.getQueryWrapper(entity));
return R.data(detail);
}
@PostMapping("/test")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "详情", notes = "传入em_model_param")
public R<AlarmEntity> test(@RequestBody String param) {
systemAlarmService.receiveMessage(param);
return R.success("结束");
}
}

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.java → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java

@ -1,4 +1,4 @@
package com.hnac.hzims.alarm.config.mapper;
package com.hnac.hzims.alarm.show.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.alarm.entity.AlarmEntity;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.xml → hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.alarm.config.mapper.AlarmMapper">
<mapper namespace="com.hnac.hzims.alarm.show.mapper.AlarmMapper">
</mapper>

7
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java

@ -16,10 +16,7 @@ public interface AlarmService extends BaseService<AlarmEntity> {
List<AlarmCountVo> counts();
/**
* websocket 消息推送保存
* @param param
*/
void dealAlarmEntities(List<AlarmEntity> param);
List<AlarmEntity> broadcast(String startTime, String endTime);
void dealAlarmEntities(List<AlarmEntity> param);
}

88
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java

@ -3,16 +3,18 @@ package com.hnac.hzims.alarm.show.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.alarm.config.mapper.AlarmMapper;
import com.hnac.hzims.alarm.config.service.AlarmConfigService;
import com.hnac.hzims.alarm.constants.AlarmConstants;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.MessageService;
import com.hnac.hzims.alarm.show.mapper.AlarmMapper;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.MessageService;
import com.hnac.hzims.alarm.vo.AlarmCountVo;
import com.hnac.hzims.alarm.vo.ChildAlarmCountVo;
import com.hnac.hzims.message.dto.MailMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -39,11 +41,16 @@ import java.util.stream.Collectors;
@Slf4j
public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity> implements AlarmService {
private final AlarmConfigService configService;
private final MessageService messageService;
private final IMessageClient messageClient;
private final AlarmConfigService configService;
private final IUserClient userClient;
private final IStationClient stationClient;
private final IMessageClient messageClient;
/**
* 查询告警列表
* @param alarm
@ -52,11 +59,15 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
*/
@Override
public IPage<AlarmEntity> alarms(AlarmEntity alarm, IPage<AlarmEntity> page) {
// 排除站点
List<String> codes = configService.exclude(AlarmConstants.IS_RIGHT_TABULATION);
List<StationEntity> stations = this.stations();
if(CollectionUtil.isEmpty(stations)){
return page;
}
// 参数过滤 :站点、告警来源、告警子类
QueryWrapper wrapper = new QueryWrapper<>();
wrapper.eq("IS_RIGHT_TABULATION",0);
wrapper.in("STATION_ID",stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
if(!StringUtil.isEmpty(alarm.getStationId())){
wrapper.eq("STATION_ID",alarm.getStationId());
}
@ -66,29 +77,49 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
if(!StringUtil.isEmpty(alarm.getAlarmType())){
wrapper.eq("ALARM_TYPE",alarm.getAlarmType());
}
if(!CollectionUtil.isEmpty(codes)){
wrapper.notIn("STATION_ID",codes);
}
// 查询数据
return this.page(page,wrapper);
}
/**
* 获取权限站点
* @return
*/
private List<StationEntity> stations() {
StationEntity station = new StationEntity();
station.setServeType("2");
station.setType(0);
R<List<StationEntity>> result = stationClient.list(station);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return new ArrayList<>();
}
return result.getData();
}
/**
* 查询告警数量
* @return
*/
@Override
public List<AlarmCountVo> counts() {
// 排除站点
List<String> codes = configService.exclude(AlarmConstants.IS_RIGHT_TABULATION);
// 站点查询
List<StationEntity> stations = this.stations();
if(CollectionUtil.isEmpty(stations)){
return AlarmConstants.ALARAM_SOURCE.stream().map(source->{
AlarmCountVo count = new AlarmCountVo();
count.setType(source);
count.setCount(0L);
return count;
}).collect(Collectors.toList());
}
// 查询告警数据
// 参数过滤 :站点、告警来源、告警子类
QueryWrapper wrapper = new QueryWrapper<>();
if(CollectionUtil.isNotEmpty(codes)){
wrapper.notIn("STATION_ID",codes);
}
wrapper.eq("IS_RIGHT_TABULATION",0);
wrapper.in("STATION_ID",stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 查询告警数据
List<AlarmEntity> alarms = this.list(wrapper);
// 查询数量
return AlarmConstants.ALARAM_SOURCE.stream().map(source->{
AlarmCountVo count = new AlarmCountVo();
@ -104,6 +135,31 @@ public class AlarmServiceImpl extends BaseServiceImpl<AlarmMapper, AlarmEntity>
}
/**
* 播报告警
* @param startTime
* @param endTime
* @return
*/
@Override
public List<AlarmEntity> broadcast(String startTime, String endTime) {
// 站点查询
List<StationEntity> stations = this.stations();
if(CollectionUtil.isEmpty(stations)){
return new ArrayList<>();
}
// 参数过滤 :站点、告警来源、告警子类
QueryWrapper wrapper = new QueryWrapper<>();
wrapper.eq("IS_BROADCAST",0);
wrapper.in("STATION_ID",stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
wrapper.le("CREATE_TIME",endTime);
if(!StringUtil.isEmpty(startTime)){
wrapper.ge("CREATE_TIME",startTime);
}
// 查询播报告警
return this.list(wrapper);
}
/**
* websocket 消息推送保存
* @param param
*/

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/task/VideoScheduledTask.java

@ -1,8 +1,8 @@
package com.hnac.hzims.alarm.task;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.VideoAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.VideoAlarmService;
import com.xxl.job.core.biz.model.ReturnT;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmRegular.java

@ -1,6 +1,6 @@
package com.hnac.hzims.alarm.ws.condition;
import com.hnac.hzims.alarm.show.service.ConditionAlarmService;
import com.hnac.hzims.alarm.handle.service.ConditionAlarmService;
import com.hnac.hzims.alarm.ws.level.LevelAlarmWebSocket;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmWebSocket.java

@ -1,8 +1,8 @@
package com.hnac.hzims.alarm.ws.condition;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.ConditionAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.ConditionAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmRegular.java

@ -1,6 +1,6 @@
package com.hnac.hzims.alarm.ws.fdp;
import com.hnac.hzims.alarm.show.service.FdpAlarmService;
import com.hnac.hzims.alarm.handle.service.FdpAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.beans.factory.annotation.Autowired;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmWebSocket.java

@ -1,8 +1,8 @@
package com.hnac.hzims.alarm.ws.fdp;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.FdpAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.FdpAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmRegular.java

@ -1,6 +1,6 @@
package com.hnac.hzims.alarm.ws.hz3000;
import com.hnac.hzims.alarm.show.service.SystemAlarmService;
import com.hnac.hzims.alarm.handle.service.SystemAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.beans.factory.annotation.Autowired;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmWebSocket.java

@ -1,8 +1,8 @@
package com.hnac.hzims.alarm.ws.hz3000;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.SystemAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.SystemAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java

@ -1,6 +1,6 @@
package com.hnac.hzims.alarm.ws.level;
import com.hnac.hzims.alarm.show.service.LevelAlarmService;
import com.hnac.hzims.alarm.handle.service.LevelAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java

@ -1,8 +1,8 @@
package com.hnac.hzims.alarm.ws.level;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.handle.service.LevelAlarmService;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.show.service.LevelAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;

Loading…
Cancel
Save