Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
liwen 6 months ago
parent
commit
3a45d92129
  1. 6
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java
  2. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java
  3. 20
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml
  4. 16
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java
  5. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java
  6. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java

6
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java

@ -72,20 +72,22 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
return;
}
// 告警已处理
if(handlers.contains(alarm.getAlarmContext())){
if(CollectionUtil.isNotEmpty(handlers) && handlers.contains(alarm.getAlarmContext())){
return;
}
// 告警已延后处理
if(delays.contains(alarm.getAlarmContext())){
if(CollectionUtil.isNotEmpty(delays) && delays.contains(alarm.getAlarmContext())){
return;
}
// 近5分钟内告警重复
if(CollectionUtil.isNotEmpty(keys)){
for (String key : keys) {
String value = stringRedisTemplate.opsForValue().get(key);
if (value.equals(optional.get().getName()+alarm.getAlarmContext())){
return;
}
}
}
// fpd告警拼接站点名称
if(AlarmConstants.EARLY_WARNING.equals(alarm.getAlarmSource())){
alarm.setAlarmContext(optional.get().getName() + "." + alarm.getAlarmContext());

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java

@ -21,4 +21,8 @@ public interface AlarmHandleMapper extends UserDataScopeBaseMapper<AlarmHandleEn
IPage<AlarmHandleVo> selectHandlePage(IPage<Object> page, @Param("param") HandleQueryVo param);
List<String> handles(@Param("start") String start,@Param("end") String end);
List<String> sameDayContent(@Param("start") String start,@Param("end") String end);
List<String> incompleteContent(@Param("end") String end);
}

20
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml

@ -40,4 +40,24 @@
AND (HANDLER.DELAY_TIME &gt; #{end} OR HANDLER.DELAY_TIME IS NULL)
</where>
</select>
<select id="sameDayContent" resultType="java.lang.String">
SELECT HANDLER.ALARM_CONTENT
FROM HZIMS_ALARM_HANDLE HANDLER
<where>
HANDLER.IS_DELETED = 0
AND HANDLER.HANDLE_WAY in (5,6)
<if test="start != null and end != null">
AND HANDLER.CREATE_TIME BETWEEN #{start} AND #{end}
</if>
</where>
</select>
<select id="incompleteContent" resultType="java.lang.String">
SELECT HANDLER.ALARM_CONTENT
FROM HZIMS_ALARM_HANDLE HANDLER
<where>
HANDLER.IS_DELETED = 0
AND HANDLER.HANDLE_WAY = 1
AND (HANDLER.DELAY_TIME &gt; #{end})
</where>
</select>
</mapper>

16
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java

@ -31,10 +31,7 @@ import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -172,12 +169,16 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
}
/**
* 查询当天处理告警的内容
* 查询近一小时处理告警的内容
* @return
*/
@Override
public List<String> sameDayContent() {
return null;
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR_OF_DAY,-1);
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
return this.baseMapper.sameDayContent(start,end);
}
/**
@ -186,6 +187,7 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
*/
@Override
public List<String> incompleteContent() {
return null;
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
return this.baseMapper.incompleteContent(end);
}
}

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java

@ -42,5 +42,5 @@ public interface IInteractiveService {
*/
R knowledgeAsk(String question, String sessionId, String userId, String knowledge);
Object sendRemoteControl(ControlDTO operate);
R<Object> sendRemoteControl(ControlDTO operate);
}

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java

@ -274,7 +274,7 @@ public class InteractiveServiceImpl implements IInteractiveService {
* @return
*/
@Override
public Object sendRemoteControl(ControlDTO operate) {
public R<Object> sendRemoteControl(ControlDTO operate) {
return remoteClient.sendCtrl(operate);
}
}

Loading…
Cancel
Save