1、增加对象存储初始模块
2、优化出省流量统计展示。
This commit is contained in:
+8
-3
@@ -1,7 +1,8 @@
|
||||
package com.tongran.rocketmq.controller;
|
||||
|
||||
import com.tongran.common.core.web.controller.BaseController;
|
||||
import com.tongran.common.core.web.domain.AjaxResult;
|
||||
import com.tongran.common.core.web.page.PageDomain;
|
||||
import com.tongran.common.core.web.page.TableDataInfo;
|
||||
import com.tongran.common.security.annotation.RequiresPermissions;
|
||||
import com.tongran.rocketmq.domain.RmOutboundTrafficStatistics;
|
||||
import com.tongran.rocketmq.service.IRmOutboundTrafficStatisticsService;
|
||||
@@ -31,10 +32,14 @@ public class RmOutboundTrafficStatisticsController extends BaseController
|
||||
* 查询出省流量统计列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public AjaxResult list(@RequestBody RmOutboundTrafficStatistics rmOutboundTrafficStatistics)
|
||||
public TableDataInfo list(@RequestBody RmOutboundTrafficStatistics rmOutboundTrafficStatistics)
|
||||
{
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(rmOutboundTrafficStatistics.getPageNum());
|
||||
pageDomain.setPageSize(rmOutboundTrafficStatistics.getPageSize());
|
||||
startPage(pageDomain);
|
||||
List<RmOutboundTrafficStatistics> list = rmOutboundTrafficStatisticsService.selectRmOutboundTrafficStatisticsList(rmOutboundTrafficStatistics);
|
||||
return success(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -4,6 +4,8 @@ import com.tongran.common.core.annotation.Excel;
|
||||
import com.tongran.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 出省流量统计对象 rm_outbound_traffic_statistics
|
||||
*
|
||||
@@ -25,5 +27,11 @@ public class RmOutboundTrafficStatistics extends BaseEntity
|
||||
/** 出省流量统计详情 */
|
||||
@Excel(name = "出省流量统计详情")
|
||||
private String description;
|
||||
/** 总占比 */
|
||||
private BigDecimal totalRate;
|
||||
/** ipv4占比 */
|
||||
private BigDecimal ipv4Rate;
|
||||
/** ipv6占比 */
|
||||
private BigDecimal ipv6Rate;
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ import org.springframework.stereotype.Component;
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.Consumer;
|
||||
@@ -251,11 +250,6 @@ public class MessageHandler {
|
||||
BigDecimal v4TotalRate = BigDecimal.ZERO;
|
||||
BigDecimal v6TotalRate = BigDecimal.ZERO;
|
||||
BigDecimal totalRate = BigDecimal.ZERO;
|
||||
// 添加时间戳
|
||||
content.append("时间:").append(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())).append("\n");
|
||||
int insertPosition = content.length();
|
||||
int insertPositionV6 = content.length();
|
||||
|
||||
// 处理IPv4统计
|
||||
if (!ipTypeMap.get("IPv4").isEmpty()) {
|
||||
content.append("##### V4 统计 ##### ##\n");
|
||||
@@ -296,8 +290,6 @@ public class MessageHandler {
|
||||
v4TotalRate = v4TotalRate.add(percentage);
|
||||
}
|
||||
// 在记录的位置插入总计信息
|
||||
content.insert(insertPosition, "IPv4总计占比: " + v4TotalRate + "%\n");
|
||||
insertPositionV6 += ("IPv4总计占比: " + v4TotalRate + "%\n").length(); // 更新插入位置
|
||||
totalRate = totalRate.add(v4TotalRate);
|
||||
}
|
||||
|
||||
@@ -340,12 +332,8 @@ public class MessageHandler {
|
||||
content.append(entry.getKey()).append(": ").append(percentage).append("%\n");
|
||||
v6TotalRate = v6TotalRate.add(percentage);
|
||||
}
|
||||
// 在更新后的位置插入IPv6总计
|
||||
content.insert(insertPositionV6, "IPv6总计占比: " + v6TotalRate + "%\n");
|
||||
totalRate = totalRate.add(v6TotalRate);
|
||||
}
|
||||
// 在更新后的位置插入IPv6总计
|
||||
content.insert(insertPosition, "总占比: " + totalRate + "%\n");
|
||||
// 添加总占比
|
||||
RmResourceRegistrationRemote updateData = new RmResourceRegistrationRemote();
|
||||
updateData.setClientId(message.getClientId());
|
||||
@@ -353,6 +341,9 @@ public class MessageHandler {
|
||||
remoteRevenueConfigService.innerUpdateRegist(updateData, SecurityConstants.INNER);
|
||||
RmOutboundTrafficStatistics insertData = new RmOutboundTrafficStatistics();
|
||||
insertData.setClientId(message.getClientId());
|
||||
insertData.setTotalRate(totalRate);
|
||||
insertData.setIpv4Rate(v4TotalRate);
|
||||
insertData.setIpv6Rate(v6TotalRate);
|
||||
insertData.setDescription(content.toString());
|
||||
rmOutboundTrafficStatisticsService.insertRmOutboundTrafficStatistics(insertData);
|
||||
// 查询告警阈值
|
||||
|
||||
Reference in New Issue
Block a user