增加日志控制、优化金山95值自动计算方法
This commit is contained in:
+8
-1
@@ -1,8 +1,9 @@
|
|||||||
package com.ruoyi.system.mapper;
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ruoyi.system.domain.RmRegistrationMachine;
|
import com.ruoyi.system.domain.RmRegistrationMachine;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定金山machinecodeMapper接口
|
* 绑定金山machinecodeMapper接口
|
||||||
*
|
*
|
||||||
@@ -58,4 +59,10 @@ public interface RmRegistrationMachineMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteRmRegistrationMachineByIds(Long[] ids);
|
public int deleteRmRegistrationMachineByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取绑定的clientId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RmRegistrationMachine> getAllMachineClientId();
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-4
@@ -49,6 +49,8 @@ public class EpsInitialTrafficDataServiceImpl implements EpsInitialTrafficDataSe
|
|||||||
private EpsBusinessDeployMapper epsBusinessDeployMapper;
|
private EpsBusinessDeployMapper epsBusinessDeployMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RmEpsTopologyManagementMapper rmEpsTopologyManagementMapper;
|
private RmEpsTopologyManagementMapper rmEpsTopologyManagementMapper;
|
||||||
|
@Autowired
|
||||||
|
private RmRegistrationMachineMapper rmRegistrationMachineMapper;
|
||||||
@Override
|
@Override
|
||||||
public void createNextMonthTables() {
|
public void createNextMonthTables() {
|
||||||
LocalDate nextMonth = LocalDate.now().plusMonths(1);
|
LocalDate nextMonth = LocalDate.now().plusMonths(1);
|
||||||
@@ -271,11 +273,12 @@ public class EpsInitialTrafficDataServiceImpl implements EpsInitialTrafficDataSe
|
|||||||
@Override
|
@Override
|
||||||
public void calculate95ByJinShan(EpsInitialTrafficData queryParam,
|
public void calculate95ByJinShan(EpsInitialTrafficData queryParam,
|
||||||
String dailyStartTime, String dailyEndTime, String calculationMode) {
|
String dailyStartTime, String dailyEndTime, String calculationMode) {
|
||||||
// 获取所有设备SN列表
|
// 获取已绑定金山Code的clientId列表
|
||||||
List<AllInterfaceName> snList = allInterfaceNameMapper.getAllDeviceSn(new AllInterfaceName());
|
List<RmRegistrationMachine> rmRegistrationMachineList = rmRegistrationMachineMapper.getAllMachineClientId();
|
||||||
|
if(rmRegistrationMachineList != null && !rmRegistrationMachineList.isEmpty()){
|
||||||
// 遍历处理每个设备
|
// 遍历处理每个设备
|
||||||
snList.forEach(interfaceName -> {
|
rmRegistrationMachineList.forEach(interfaceName -> {
|
||||||
queryParam.setServiceSn(interfaceName.getDeviceSn());
|
queryParam.setClientId(interfaceName.getClientId());
|
||||||
queryParam.setStartTime(dailyStartTime);
|
queryParam.setStartTime(dailyStartTime);
|
||||||
queryParam.setEndTime(dailyEndTime);
|
queryParam.setEndTime(dailyEndTime);
|
||||||
List<EpsInitialTrafficData> dataList = query(queryParam);
|
List<EpsInitialTrafficData> dataList = query(queryParam);
|
||||||
@@ -298,6 +301,7 @@ public class EpsInitialTrafficDataServiceImpl implements EpsInitialTrafficDataSe
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重新计算服务器95带宽值
|
* 重新计算服务器95带宽值
|
||||||
|
|||||||
+8
@@ -74,4 +74,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="getAllMachineClientId" resultType="RmRegistrationMachine">
|
||||||
|
select client_id clientId from rm_registration_machine
|
||||||
|
<where>
|
||||||
|
and client_id != ''
|
||||||
|
</where>
|
||||||
|
group by client_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/ruoyi-rocketmq" />
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- RocketMQ业务日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- RocketMQ错误日志输出 -->
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- RocketMQ消息追踪日志 -->
|
||||||
|
<appender name="file_trace" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/trace.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/trace.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>DEBUG</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- RocketMQ模块日志级别控制 -->
|
||||||
|
<logger name="com.ruoyi.rocketmq" level="info" additivity="false">
|
||||||
|
<appender-ref ref="file_trace" />
|
||||||
|
<appender-ref ref="file_info" />
|
||||||
|
<appender-ref ref="file_error" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- Apache RocketMQ客户端日志控制 -->
|
||||||
|
<logger name="org.apache.rocketmq" level="warn" />
|
||||||
|
|
||||||
|
<!-- Spring RocketMQ相关日志 -->
|
||||||
|
<logger name="org.springframework.messaging" level="warn" />
|
||||||
|
|
||||||
|
<!-- 根日志配置 -->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
<appender-ref ref="file_info" />
|
||||||
|
<appender-ref ref="file_error" />
|
||||||
|
</root>
|
||||||
|
</configuration>
|
||||||
Reference in New Issue
Block a user