优化执行结果根据失败关键字筛选
优化告警日志 监控看板概览功能
This commit is contained in:
@@ -84,6 +84,8 @@ public class RmDeploymentPolicy extends BaseEntity
|
||||
private Boolean resourceGroupIdNull;
|
||||
/** 部署设备 */
|
||||
private String deployDevice;
|
||||
/** 业务脚本id */
|
||||
private Long scriptId;
|
||||
/** 业务脚本名称 */
|
||||
private String scriptName;
|
||||
/** 业务脚本文件地址 */
|
||||
|
||||
@@ -4,7 +4,8 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum AlarmTypeEnum {
|
||||
服务器下线("1", "服务器下线");
|
||||
服务器下线("1", "服务器下线"),
|
||||
交换机下线("2", "交换机下线");
|
||||
private final String code;
|
||||
private final String msg;
|
||||
AlarmTypeEnum(String code, String msg){
|
||||
|
||||
+20
-4
@@ -103,10 +103,14 @@ public class RmDeploymentPolicyServiceImpl implements IRmDeploymentPolicyService
|
||||
}
|
||||
});
|
||||
}
|
||||
policy.setSucessNum(successList.size());
|
||||
policy.setSucessClientIds(successList);
|
||||
policy.setFailNum(failList.size());
|
||||
policy.setFailClientIds(failList);
|
||||
// 对三个list分别去重
|
||||
List<String> successListDict = successList.stream().distinct().collect(Collectors.toList());
|
||||
List<String> failListDict = failList.stream().distinct().collect(Collectors.toList());
|
||||
offOnlineList = offOnlineList.stream().distinct().collect(Collectors.toList());
|
||||
policy.setSucessNum(successListDict.size());
|
||||
policy.setSucessClientIds(successListDict);
|
||||
policy.setFailNum(failListDict.size());
|
||||
policy.setFailClientIds(failListDict);
|
||||
policy.setOfflineNum(offOnlineList.size());
|
||||
policy.setOfflineClientIds(offOnlineList);
|
||||
}
|
||||
@@ -161,6 +165,18 @@ public class RmDeploymentPolicyServiceImpl implements IRmDeploymentPolicyService
|
||||
{
|
||||
rmDeploymentPolicy.setCreateTime(DateUtils.getNowDate());
|
||||
rmDeploymentPolicy.setCreateBy(SecurityUtils.getUsername());
|
||||
// 部署设备去重
|
||||
String clientIds = rmDeploymentPolicy.getDeployDevice();
|
||||
String[] clientIdArr = clientIds.split("\n");
|
||||
// 去重并保持顺序
|
||||
String distinctClientIds = Arrays.stream(clientIdArr)
|
||||
.map(String::trim) // 去除前后空格
|
||||
.filter(s -> !s.isEmpty()) // 过滤空行
|
||||
.distinct() // 去重
|
||||
.collect(Collectors.joining("\n")); // 用换行符重新拼接
|
||||
// 设置回原对象
|
||||
rmDeploymentPolicy.setDeployDevice(distinctClientIds);
|
||||
|
||||
return rmDeploymentPolicyMapper.insertRmDeploymentPolicy(rmDeploymentPolicy);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,24 +58,10 @@
|
||||
</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="console" /> <!-- 显式添加控制台 -->
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</logger>
|
||||
@@ -89,7 +75,5 @@
|
||||
<!-- 根日志配置 -->
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -24,6 +24,7 @@
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="deployDevice" column="deploy_device" />
|
||||
<result property="scriptId" column="script_id" />
|
||||
<result property="scriptName" column="script_name" />
|
||||
<result property="scriptPath" column="script_path" />
|
||||
<result property="defaultParams" column="default_params" />
|
||||
@@ -31,7 +32,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRmDeploymentPolicyVo">
|
||||
select id, policy_name, description, resource_group_id, included_devices_id, source_file_path_type, source_file_path, target_directory, command_content, execution_method, scheduled_time, policy_status, deploy_time, script_type, create_time, update_time, create_by, update_by, deploy_device, script_name, script_path, default_params, task_name from rm_deployment_policy
|
||||
select id, policy_name, description, resource_group_id, included_devices_id, source_file_path_type, source_file_path, target_directory, command_content, execution_method, scheduled_time, policy_status, deploy_time, script_type, create_time, update_time, create_by, update_by, deploy_device, script_id, script_name, script_path, default_params, task_name from rm_deployment_policy
|
||||
</sql>
|
||||
|
||||
<select id="selectRmDeploymentPolicyList" parameterType="RmDeploymentPolicy" resultMap="RmDeploymentPolicyResult">
|
||||
@@ -51,6 +52,7 @@
|
||||
<if test="deployTime != null "> and deploy_time = #{deployTime}</if>
|
||||
<if test="scriptType != null and scriptType != ''"> and script_type = #{scriptType}</if>
|
||||
<if test="deployDevice != null and deployDevice != ''"> and deploy_device = #{deployDevice}</if>
|
||||
<if test="scriptId != null "> and script_id = #{scriptId}</if>
|
||||
<if test="scriptName != null and scriptName != ''"> and script_name like concat('%', #{scriptName}, '%')</if>
|
||||
<if test="scriptPath != null and scriptPath != ''"> and script_path = #{scriptPath}</if>
|
||||
<if test="defaultParams != null and defaultParams != ''"> and default_params = #{defaultParams}</if>
|
||||
@@ -85,6 +87,7 @@
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="deployDevice != null">deploy_device,</if>
|
||||
<if test="scriptId != null">script_id,</if>
|
||||
<if test="scriptName != null">script_name,</if>
|
||||
<if test="scriptPath != null">script_path,</if>
|
||||
<if test="defaultParams != null">default_params,</if>
|
||||
@@ -109,6 +112,7 @@
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="deployDevice != null">#{deployDevice},</if>
|
||||
<if test="scriptId != null">#{scriptId},</if>
|
||||
<if test="scriptName != null">#{scriptName},</if>
|
||||
<if test="scriptPath != null">#{scriptPath},</if>
|
||||
<if test="defaultParams != null">#{defaultParams},</if>
|
||||
@@ -137,6 +141,7 @@
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="deployDevice != null">deploy_device = #{deployDevice},</if>
|
||||
<if test="scriptId != null">script_id = #{scriptId},</if>
|
||||
<if test="scriptName != null">script_name = #{scriptName},</if>
|
||||
<if test="scriptPath != null">script_path = #{scriptPath},</if>
|
||||
<if test="defaultParams != null">default_params = #{defaultParams},</if>
|
||||
|
||||
@@ -44,7 +44,14 @@
|
||||
<if test="resultFlag != null "> and result_flag = #{resultFlag}</if>
|
||||
<if test="scriptId != null "> and script_id = #{scriptId}</if>
|
||||
</where>
|
||||
order by result_flag asc,create_time desc
|
||||
<choose>
|
||||
<when test="clientId != null and clientId != ''">
|
||||
order by create_time desc
|
||||
</when>
|
||||
<otherwise>
|
||||
order by result_flag asc,create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectRmResourceRemoteById" parameterType="Long" resultMap="RmResourceRemoteResult">
|
||||
|
||||
Reference in New Issue
Block a user