告警管理,告警日志接口。更改计算95值定时任务时间
This commit is contained in:
@@ -48,7 +48,7 @@ public class TableScheduleConfig {
|
||||
}
|
||||
|
||||
// 每天12点执行 计算95带宽值/日
|
||||
@Scheduled(cron = "0 0 0 * * ?", zone = "Asia/Shanghai")
|
||||
@Scheduled(cron = "0 4 0 * * ?", zone = "Asia/Shanghai")
|
||||
public void calculate95BandwidthDaily() {
|
||||
// 获取昨天的日期范围(北京时间)
|
||||
LocalDate yesterday = LocalDate.now(ZoneId.of("Asia/Shanghai")).minusDays(1);
|
||||
@@ -66,7 +66,7 @@ public class TableScheduleConfig {
|
||||
}
|
||||
|
||||
// 每月1号0点执行 计算95带宽值/月
|
||||
@Scheduled(cron = "0 0 0 1 * ?", zone = "Asia/Shanghai")
|
||||
@Scheduled(cron = "0 3 0 1 * ?", zone = "Asia/Shanghai")
|
||||
public void calculateMonthlyBandwidthTasks() {
|
||||
// 获取上个月的日期范围
|
||||
LocalDate lastMonth = LocalDate.now(ZoneId.of("Asia/Shanghai")).minusMonths(1);
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.system.api.RemoteRocketMqService;
|
||||
import com.ruoyi.system.domain.RmResourceRegistration;
|
||||
import com.ruoyi.system.service.EpsInitialTrafficDataService;
|
||||
import com.ruoyi.system.service.IEpsServerRevenueConfigService;
|
||||
@@ -36,6 +38,8 @@ public class ScreenController extends BaseController
|
||||
private EpsInitialTrafficDataService epsInitialTrafficDataService;
|
||||
@Autowired
|
||||
private IInitialSwitchInfoDetailsService initialSwitchInfoDetailsService;
|
||||
@Autowired
|
||||
private RemoteRocketMqService remoteRocketMqService;
|
||||
|
||||
/**
|
||||
* 统计当前在线服务器的流量相关的业务数
|
||||
@@ -111,4 +115,14 @@ public class ScreenController extends BaseController
|
||||
{
|
||||
return success(initialSwitchInfoDetailsService.sumTrafficBySwitch());
|
||||
}
|
||||
/**
|
||||
* 资源告警处理情况
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("system:config:list")
|
||||
@GetMapping("/alarmProcess")
|
||||
public AjaxResult alarmProcess() {
|
||||
Map alarmList = remoteRocketMqService.alarmHandlingStatus(SecurityConstants.INNER).getData();
|
||||
return success(alarmList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ public class EpsNodeBandwidthServiceImpl implements IEpsNodeBandwidthService
|
||||
nodeData.put("resultData", EchartsDataConverter.convertToLineChart(
|
||||
nodeBandwidthList,
|
||||
bandwidthType,
|
||||
node.getBusinessName(),
|
||||
node.getNodeName(),
|
||||
epsNodeBandwidth.getStartTime(),
|
||||
epsNodeBandwidth.getEndTime(),
|
||||
timeUnit
|
||||
|
||||
@@ -189,7 +189,7 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
|
||||
}
|
||||
|
||||
// 发送消息通知
|
||||
sendRegistrationMessage(rmResourceRegistration);
|
||||
// sendRegistrationMessage(rmResourceRegistration);
|
||||
|
||||
// 更新注册状态
|
||||
return updateRegistrationStatus(rmResourceRegistration);
|
||||
|
||||
@@ -18,7 +18,7 @@ public class EchartsDataConverter {
|
||||
*/
|
||||
public static Map<String, Object> convertToLineChart(
|
||||
List<EpsNodeBandwidth> dataList,
|
||||
String bandwidthType, String businessName, String startTime, String endTime, ChronoUnit timeUnit
|
||||
String bandwidthType, String nodeName, String startTime, String endTime, ChronoUnit timeUnit
|
||||
) {
|
||||
// 定义时间格式化器
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(
|
||||
@@ -32,7 +32,7 @@ public class EchartsDataConverter {
|
||||
item.getCreateTime() != null &&
|
||||
item.getBandwidthResult() != null &&
|
||||
(bandwidthType == null || bandwidthType.equals(item.getBandwidthType())) &&
|
||||
(businessName == null || businessName.equals(item.getBusinessName()))
|
||||
(nodeName == null || nodeName.equals(item.getNodeName()))
|
||||
)
|
||||
.sorted(Comparator.comparing(EpsNodeBandwidth::getCreateTime))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -72,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updaterId != null "> and updater_id = #{updaterId}</if>
|
||||
<if test="updaterName != null and updaterName != ''"> and updater_name like concat('%', #{updaterName}, '%')</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRmResourceRegistrationById" parameterType="Long" resultMap="RmResourceRegistrationResult">
|
||||
|
||||
Reference in New Issue
Block a user