feat: 2.5.0:
1、https://gitee.com/aizuda/easy-retry/issues/I8GRJP 2、Dashboard 添加任务调度数据展示 3、新增重试、定时饼图、任务列表 4、根据后台mode配置动态重试、定时权限
This commit is contained in:
parent
2b35161dbc
commit
b253df6d7f
@ -0,0 +1,73 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wodeyangzipingpingwuqi
|
||||
* @date : 2023-11-29
|
||||
*/
|
||||
@Data
|
||||
public class DashboardCardResponseDO {
|
||||
|
||||
/**
|
||||
* 定时任务
|
||||
*/
|
||||
private JobTask jobTask;
|
||||
|
||||
/**
|
||||
* 重试任务
|
||||
*/
|
||||
private RetryTask retryTask;
|
||||
|
||||
/**
|
||||
* 重试任务折线图
|
||||
*/
|
||||
private List<RetryTaskBar> retryTaskBarList;
|
||||
|
||||
@Data
|
||||
public static class RetryTask {
|
||||
|
||||
// 总数
|
||||
private Long totalNum;
|
||||
|
||||
// 运行中
|
||||
private Long runningNum;
|
||||
|
||||
// 完成
|
||||
private Long finishNum;
|
||||
|
||||
// 最大重试次数
|
||||
private Long maxCountNum;
|
||||
|
||||
// 暂停重试
|
||||
private Long suspendNum;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class JobTask {
|
||||
//成功
|
||||
private Integer successNum;
|
||||
//失败
|
||||
private Integer failNum;
|
||||
// 总数
|
||||
private Integer totalNum;
|
||||
// 成功率
|
||||
private BigDecimal successRate;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RetryTaskBar {
|
||||
/**
|
||||
* 时间x
|
||||
*/
|
||||
private String x;
|
||||
|
||||
/**
|
||||
* 总数y
|
||||
*/
|
||||
private Long y;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
||||
* @date : 2022-04-22 20:27
|
||||
*/
|
||||
@Data
|
||||
public class DashboardRetryLineResponseDO {
|
||||
|
||||
/**
|
||||
* 任务列表
|
||||
*/
|
||||
private List<Task> taskList;
|
||||
|
||||
/**
|
||||
* 排名列表
|
||||
*/
|
||||
private List<Rank> rankList;
|
||||
|
||||
/**
|
||||
* 折线图列表
|
||||
*/
|
||||
private List<DispatchQuantityResponseDO> dispatchQuantityResponseVOList;
|
||||
|
||||
@Data
|
||||
public static class Task {
|
||||
private String groupName;
|
||||
|
||||
private Integer run;
|
||||
|
||||
private Integer total;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Rank {
|
||||
private String name;
|
||||
|
||||
private String total;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author: wodeyangzipingpingwuqi
|
||||
* @date : 2023-11-30
|
||||
*/
|
||||
@Data
|
||||
public class DashboardRetryLinkeResponseDO {
|
||||
|
||||
private String createDt;
|
||||
|
||||
private Long total;
|
||||
|
||||
private Long successNum;
|
||||
|
||||
private Long runningNum;
|
||||
|
||||
private Long maxCountNum;
|
||||
|
||||
private Long suspendNum;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
* @version 1.0.0
|
||||
* @date 2023/11/28
|
||||
*/
|
||||
@Data
|
||||
public class DashboardRetryResponseDO {
|
||||
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
private String namespaceId;
|
||||
|
||||
/**
|
||||
* 组名
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 场景名称
|
||||
*/
|
||||
private String sceneName;
|
||||
|
||||
/**
|
||||
* 运行数量
|
||||
*/
|
||||
private Integer runningNum;
|
||||
|
||||
/**
|
||||
* 完成数量
|
||||
*/
|
||||
private Integer finishNum;
|
||||
|
||||
/**
|
||||
* 最大重试数量
|
||||
*/
|
||||
private Integer maxCountNum;
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
private Integer suspendNum;
|
||||
}
|
@ -2,8 +2,6 @@ package com.aizuda.easy.retry.template.datasource.persistence.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
||||
* @date : 2022-04-22 20:27
|
||||
@ -11,14 +9,19 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
public class DispatchQuantityResponseDO {
|
||||
|
||||
private String createDt;
|
||||
|
||||
private Long total;
|
||||
|
||||
private BigDecimal successPercent = BigDecimal.ZERO;
|
||||
|
||||
private Long success;
|
||||
private Long successNum;
|
||||
|
||||
private Long fail;
|
||||
|
||||
private String createDt;
|
||||
private Long totalNum;
|
||||
|
||||
private Long failNum;
|
||||
|
||||
private Long stopNum;
|
||||
|
||||
private Long cancelNum;
|
||||
}
|
||||
|
@ -0,0 +1,66 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* stop => 已经向客户端下发了执行任务指令
|
||||
* cancel => 未向客户端下发指令
|
||||
* fail => 客户端上报执行失败,或者服务端执行失败
|
||||
*
|
||||
* @author wodeyangzipingpingwuqi
|
||||
* @date 2023-11-22 11:39
|
||||
* @since 2.5.0
|
||||
*/
|
||||
@Data
|
||||
public class JobBatchSummaryResponseDO {
|
||||
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
private String namespaceId;
|
||||
|
||||
/**
|
||||
* 组名
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Long jobId;
|
||||
|
||||
/**
|
||||
* 任务批次状态
|
||||
*/
|
||||
private int taskBatchStatus;
|
||||
|
||||
/**
|
||||
* 操作原因
|
||||
*/
|
||||
private Long operationReason;
|
||||
|
||||
/**
|
||||
* 操作原因总数
|
||||
*/
|
||||
private Integer operationReasonTotal;
|
||||
|
||||
/**
|
||||
* 执行成功-日志数量
|
||||
*/
|
||||
private Integer successNum;
|
||||
|
||||
/**
|
||||
* cancel执行失败-日志数量
|
||||
*/
|
||||
private Integer cancelNum;
|
||||
|
||||
/**
|
||||
* stop执行失败-日志数量
|
||||
*/
|
||||
private Integer stopNum;
|
||||
|
||||
/**
|
||||
* fail执行失败-日志数量
|
||||
*/
|
||||
private Integer failNum;
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DispatchQuantityResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobSummary;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
* @version 1.0.0
|
||||
* @date 2023/11/22
|
||||
*/
|
||||
@Mapper
|
||||
public interface JobSummaryMapper extends BaseMapper<JobSummary> {
|
||||
|
||||
int insertBatchJobSummary(@Param("list") List<JobSummary> list);
|
||||
|
||||
int updateBatchTriggerAtById(@Param("list") List<JobSummary> list);
|
||||
|
||||
IPage<DashboardRetryLineResponseDO.Task> jobTaskList(@Param("namespaceId") String namespaceId, Page<Object> page);
|
||||
|
||||
List<DispatchQuantityResponseDO> jobLineList(@Param("namespaceId") String namespaceId,
|
||||
@Param("type") String type,
|
||||
@Param("from") LocalDateTime from,
|
||||
@Param("to") LocalDateTime to);
|
||||
|
||||
DashboardCardResponseDO.JobTask toJobTask(@Param("namespaceId") String namespaceId);
|
||||
|
||||
List<DashboardRetryLineResponseDO.Rank> dashboardRank(@Param("namespaceId") String namespaceId,
|
||||
@Param("groupName") String groupName,
|
||||
@Param("startTime") LocalDateTime startTime,
|
||||
@Param("endTime") LocalDateTime endTime
|
||||
);
|
||||
}
|
@ -2,12 +2,14 @@ package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchQueryDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -22,4 +24,6 @@ import java.util.List;
|
||||
public interface JobTaskBatchMapper extends BaseMapper<JobTaskBatch> {
|
||||
|
||||
List<JobBatchResponseDO> selectJobBatchList(IPage<JobTaskBatch> iPage, @Param("queryDO") JobBatchQueryDO queryDO);
|
||||
|
||||
List<JobBatchSummaryResponseDO> summaryJobBatchList(@Param("from") LocalDateTime todayFrom, @Param("to") LocalDateTime to);
|
||||
}
|
||||
|
@ -0,0 +1,45 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLinkeResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetrySummary;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
* @version 1.0.0
|
||||
* @date 2023/11/22
|
||||
*/
|
||||
@Mapper
|
||||
public interface RetrySummaryMapper extends BaseMapper<RetrySummary> {
|
||||
|
||||
int insertBatchRetrySummary(@Param("list") List<RetrySummary> list);
|
||||
|
||||
int updateBatchSceneNameById(@Param("list") List<RetrySummary> list);
|
||||
|
||||
DashboardCardResponseDO.RetryTask retryTask(@Param("namespaceId") String namespaceId);
|
||||
|
||||
List<DashboardCardResponseDO.RetryTaskBar> retryTaskBarList(@Param("namespaceId") String namespaceId);
|
||||
|
||||
IPage<DashboardRetryLineResponseDO.Task> retryTaskList(@Param("namespaceId") String namespaceId, Page<Object> page);
|
||||
|
||||
List<DashboardRetryLinkeResponseDO> retryLineList(@Param("namespaceId") String namespaceId,
|
||||
@Param("type") String type,
|
||||
@Param("from") LocalDateTime from,
|
||||
@Param("to") LocalDateTime to);
|
||||
|
||||
|
||||
List<DashboardRetryLineResponseDO.Rank> dashboardRank(@Param("namespaceId") String namespaceId,
|
||||
@Param("groupName") String groupName,
|
||||
@Param("startTime") LocalDateTime startTime,
|
||||
@Param("endTime") LocalDateTime endTime
|
||||
);
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.mapper;
|
||||
|
||||
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DispatchQuantityResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.SceneQuantityRankResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetryTaskLog;
|
||||
@ -24,13 +25,15 @@ public interface RetryTaskLogMapper extends BaseMapper<RetryTaskLog> {
|
||||
@Param("endTime")LocalDateTime endTime
|
||||
);
|
||||
|
||||
@Deprecated
|
||||
List<DispatchQuantityResponseDO> lineDispatchQuantity(@Param("groupName") String groupName,
|
||||
@Param("retryStatus") Integer retryStatus,
|
||||
@Param("type") String type,
|
||||
@Param("startTime")LocalDateTime startTime,
|
||||
@Param("endTime")LocalDateTime endTime
|
||||
);
|
||||
//
|
||||
|
||||
int batchInsert(List<RetryTaskLog> list);
|
||||
|
||||
List<DashboardRetryResponseDO> retrySummaryRetryTaskLogList(@Param("from") LocalDateTime from, @Param("to") LocalDateTime to);
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
* @version 1.0.0
|
||||
* @date 2023/11/22
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("job_summary")
|
||||
public class JobSummary implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
private String namespaceId;
|
||||
|
||||
/**
|
||||
* 组名
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* '任务信息id'
|
||||
*/
|
||||
private Long jobId;
|
||||
|
||||
/**
|
||||
* '统计时间'
|
||||
*/
|
||||
private LocalDateTime triggerAt;
|
||||
|
||||
/**
|
||||
* 执行成功-日志数量
|
||||
*/
|
||||
private Integer successNum;
|
||||
|
||||
/**
|
||||
* 执行失败-日志数量
|
||||
*/
|
||||
private Integer failNum;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String failReason;
|
||||
|
||||
/**
|
||||
* 执行失败-日志数量
|
||||
*/
|
||||
private Integer stopNum;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String stopReason;
|
||||
|
||||
/**
|
||||
* 执行失败-日志数量
|
||||
*/
|
||||
private Integer cancelNum;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String cancelReason;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createDt;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updateDt;
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.aizuda.easy.retry.template.datasource.persistence.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
* @version 1.0.0
|
||||
* @date 2023/11/28
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("retry_summary")
|
||||
public class RetrySummary implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 命名空间
|
||||
*/
|
||||
private String namespaceId;
|
||||
|
||||
/**
|
||||
* 组名
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
/**
|
||||
* 调度时间
|
||||
*/
|
||||
private LocalDateTime triggerAt;
|
||||
|
||||
/**
|
||||
* 场景名称
|
||||
*/
|
||||
private String sceneName;
|
||||
|
||||
/**
|
||||
* 运行数量
|
||||
*/
|
||||
private Integer runningNum;
|
||||
|
||||
/**
|
||||
* 完成数量
|
||||
*/
|
||||
private Integer finishNum;
|
||||
|
||||
/**
|
||||
* 最大重试数量
|
||||
*/
|
||||
private Integer maxCountNum;
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
private Integer suspendNum;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createDt;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private LocalDateTime updateDt;
|
||||
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.aizuda.easy.retry.template.datasource.persistence.mapper.JobSummaryMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.JobSummary">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="namespace_id" jdbcType="TINYINT" property="namespaceId"/>
|
||||
<result column="group_name" jdbcType="TINYINT" property="groupName"/>
|
||||
<result column="job_id" jdbcType="TINYINT" property="jobId"/>
|
||||
<result column="trigger_at" jdbcType="TIMESTAMP" property="triggerAt"/>
|
||||
<result column="success_num" jdbcType="TINYINT" property="successNum"/>
|
||||
<result column="fail_num" jdbcType="TINYINT" property="failNum"/>
|
||||
<result column="fail_reason" jdbcType="VARCHAR" property="failReason"/>
|
||||
<result column="stop_num" jdbcType="TINYINT" property="stopNum"/>
|
||||
<result column="stop_reason" jdbcType="VARCHAR" property="stopReason"/>
|
||||
<result column="cancel_num" jdbcType="TINYINT" property="cancelNum"/>
|
||||
<result column="cancel_reason" jdbcType="VARCHAR" property="cancelReason"/>
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt"/>
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBatchJobSummary">
|
||||
INSERT INTO
|
||||
job_summary (namespace_id, group_name, job_id, trigger_at,
|
||||
success_num,fail_num,fail_reason,stop_num,stop_reason, cancel_num,cancel_reason)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.namespaceId},
|
||||
#{item.groupName},
|
||||
#{item.jobId},
|
||||
#{item.triggerAt},
|
||||
#{item.successNum},
|
||||
#{item.failNum},
|
||||
#{item.failReason},
|
||||
#{item.stopNum},
|
||||
#{item.stopReason},
|
||||
#{item.cancelNum},
|
||||
#{item.cancelReason}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateBatchTriggerAtById" parameterType="java.util.List">
|
||||
UPDATE job_summary js,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator=" union all ">
|
||||
SELECT
|
||||
#{item.namespaceId} AS namespace_id,
|
||||
#{item.groupName} AS group_name,
|
||||
#{item.jobId} AS job_id,
|
||||
#{item.triggerAt} AS trigger_at,
|
||||
#{item.successNum} AS success_num,
|
||||
#{item.failNum} AS fail_num,
|
||||
#{item.failReason} AS fail_reason,
|
||||
#{item.stopNum} AS stop_num,
|
||||
#{item.stopReason} AS stop_reason,
|
||||
#{item.cancelNum} AS cancel_num,
|
||||
#{item.cancelReason} AS cancel_reason
|
||||
</foreach>
|
||||
) tt
|
||||
SET
|
||||
js.namespace_id = tt.namespace_id,
|
||||
js.group_name = tt.group_name,
|
||||
js.job_id = tt.job_id,
|
||||
js.success_num = tt.success_num,
|
||||
js.fail_num = tt.fail_num,
|
||||
js.fail_reason = tt.fail_reason,
|
||||
js.stop_num = tt.stop_num,
|
||||
js.stop_reason = tt.stop_reason,
|
||||
js.cancel_num = tt.cancel_num,
|
||||
js.cancel_reason = tt.cancel_reason
|
||||
WHERE js.job_id = tt.job_id AND js.trigger_at = tt.trigger_at
|
||||
</update>
|
||||
|
||||
<select id="jobLineList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DispatchQuantityResponseDO">
|
||||
SELECT
|
||||
<choose>
|
||||
<when test="type == 'YEAR'">
|
||||
DATE_FORMAT(trigger_at,'%Y-%m')
|
||||
</when>
|
||||
<otherwise>
|
||||
DATE_FORMAT(trigger_at,'%Y-%m-%d')
|
||||
</otherwise>
|
||||
</choose>
|
||||
AS createDt,
|
||||
ifnull(SUM(success_num), 0) AS successNum,
|
||||
ifnull(SUM(fail_num), 0) AS failNum,
|
||||
ifnull(SUM(stop_num), 0) AS stopNum,
|
||||
ifnull(SUM(cancel_num), 0) AS cancelNum,
|
||||
ifnull(SUM(fail_num + stop_num + cancel_num), 0) AS fail,
|
||||
ifnull(SUM(success_num + fail_num + stop_num + cancel_num), 0) AS total
|
||||
FROM job_summary
|
||||
WHERE namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
GROUP BY createDt
|
||||
</select>
|
||||
|
||||
<select id="toJobTask"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO$JobTask">
|
||||
SELECT ifnull(sum(success_num), 0) AS successNum,
|
||||
ifnull(sum(fail_num + stop_num + cancel_num), 0) AS failNum,
|
||||
ifnull(sum(success_num + fail_num + stop_num + cancel_num), 0) AS totalNum
|
||||
FROM job_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
</select>
|
||||
|
||||
<select id="dashboardRank"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Rank">
|
||||
SELECT
|
||||
CONCAT(group_name, '/', (SELECT job_name FROM job WHERE id=job_id)) `name`,
|
||||
SUM(success_num + fail_num + stop_num + cancel_num) AS total FROM job_summary
|
||||
<where>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND trigger_at >= #{startTime} AND trigger_at <= #{endTime}
|
||||
</where>
|
||||
AND namespace_id = #{namespaceId}
|
||||
GROUP BY namespace_id, group_name, job_id
|
||||
ORDER BY total DESC LIMIT 10
|
||||
</select>
|
||||
|
||||
<select id="jobTaskList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Task">
|
||||
SELECT group_name AS groupName,
|
||||
SUM(CASE WHEN (job_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
count(*) AS total
|
||||
FROM job
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
@ -37,4 +37,22 @@
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="summaryJobBatchList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO">
|
||||
SELECT namespace_id AS namespaceId,
|
||||
job_id AS jobId,
|
||||
group_name AS groupName,
|
||||
task_batch_status AS taskBatchStatus,
|
||||
operation_reason AS operationReason,
|
||||
COUNT(operation_reason) AS operationReasonTotal,
|
||||
SUM(CASE WHEN (task_batch_status = 3) THEN 1 ELSE 0 END) AS successNum,
|
||||
SUM(CASE WHEN (operation_reason IN (2, 3)) THEN 1 ELSE 0 END) AS cancelNum,
|
||||
SUM(CASE WHEN (operation_reason IN (1, 5, 8)) THEN 1 ELSE 0 END) AS stopNum,
|
||||
SUM(CASE WHEN (operation_reason IN (4, 6, 7)) THEN 1 ELSE 0 END) AS failNum
|
||||
FROM job_task_batch
|
||||
WHERE create_dt BETWEEN #{from} AND #{to}
|
||||
GROUP BY namespace_id, group_name, job_id, task_batch_status, operation_reason
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.aizuda.easy.retry.template.datasource.persistence.mapper.RetrySummaryMapper">
|
||||
<resultMap id="BaseResultMap" type="com.aizuda.easy.retry.template.datasource.persistence.po.RetrySummary">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="namespace_id" jdbcType="TINYINT" property="namespaceId"/>
|
||||
<result column="group_name" jdbcType="TINYINT" property="groupName"/>
|
||||
<result column="scene_name" jdbcType="TINYINT" property="sceneName"/>
|
||||
<result column="trigger_at" jdbcType="TIMESTAMP" property="triggerAt"/>
|
||||
<result column="running_num" jdbcType="TINYINT" property="runningNum"/>
|
||||
<result column="finish_num" jdbcType="TINYINT" property="finishNum"/>
|
||||
<result column="max_count_num" jdbcType="VARCHAR" property="maxCountNum"/>
|
||||
<result column="suspend_num" jdbcType="TINYINT" property="suspendNum"/>
|
||||
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt"/>
|
||||
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBatchRetrySummary">
|
||||
INSERT INTO
|
||||
retry_summary (namespace_id, group_name, scene_name, trigger_at, running_num, finish_num, max_count_num,
|
||||
suspend_num)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.namespaceId},
|
||||
#{item.groupName},
|
||||
#{item.sceneName},
|
||||
#{item.triggerAt},
|
||||
#{item.runningNum},
|
||||
#{item.finishNum},
|
||||
#{item.maxCountNum},
|
||||
#{item.suspendNum}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateBatchSceneNameById" parameterType="java.util.List">
|
||||
UPDATE retry_summary rs,
|
||||
(
|
||||
<foreach collection="list" item="item" index="index" separator=" union all ">
|
||||
SELECT
|
||||
#{item.namespaceId} AS namespace_id,
|
||||
#{item.groupName} AS group_name,
|
||||
#{item.sceneName} AS scene_name,
|
||||
#{item.triggerAt} AS trigger_at,
|
||||
#{item.runningNum} AS running_num,
|
||||
#{item.finishNum} AS finish_num,
|
||||
#{item.maxCountNum} AS max_count_num,
|
||||
#{item.suspendNum} AS suspend_num
|
||||
</foreach>
|
||||
) tt
|
||||
SET
|
||||
rs.namespace_id = tt.namespace_id,
|
||||
rs.group_name = tt.group_name,
|
||||
rs.scene_name = tt.scene_name,
|
||||
rs.running_num = tt.running_num,
|
||||
rs.finish_num = tt.finish_num,
|
||||
rs.max_count_num = tt.max_count_num,
|
||||
rs.suspend_num = tt.suspend_num
|
||||
WHERE rs.scene_name = tt.scene_name AND rs.trigger_at = tt.trigger_at
|
||||
</update>
|
||||
|
||||
<select id="retryTask"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO$RetryTask">
|
||||
SELECT ifnull(sum(running_num), 0) AS runningNum,
|
||||
ifnull(sum(finish_num), 0) AS finishNum,
|
||||
ifnull(sum(max_count_num), 0) AS maxCountNum,
|
||||
ifnull(sum(suspend_num), 0) AS suspendNum,
|
||||
ifnull(sum(running_num + finish_num + max_count_num + suspend_num), 0) AS totalNum
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
</select>
|
||||
|
||||
<select id="retryTaskBarList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO$RetryTaskBar">
|
||||
SELECT DATE_FORMAT(trigger_at, '%Y-%m-%d') AS x,
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS y
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
GROUP BY trigger_at LIMIT 7
|
||||
</select>
|
||||
|
||||
<select id="retryLineList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLinkeResponseDO">
|
||||
SELECT
|
||||
<choose>
|
||||
<when test="type == 'YEAR'">
|
||||
DATE_FORMAT(trigger_at,'%Y-%m')
|
||||
</when>
|
||||
<otherwise>
|
||||
DATE_FORMAT(trigger_at,'%Y-%m-%d')
|
||||
</otherwise>
|
||||
</choose>
|
||||
AS createDt,
|
||||
ifnull(SUM(finish_num), 0) AS successNum,
|
||||
ifnull(SUM(running_num), 0) AS runningNum,
|
||||
ifnull(SUM(max_count_num), 0) AS maxCountNum,
|
||||
ifnull(SUM(suspend_num), 0) AS suspendNum,
|
||||
ifnull(SUM(finish_num + running_num + max_count_num + suspend_num), 0) AS total
|
||||
FROM retry_summary
|
||||
WHERE namespace_id = #{namespaceId} AND trigger_at BETWEEN #{from} AND #{to}
|
||||
GROUP BY createDt
|
||||
</select>
|
||||
|
||||
<select id="dashboardRank"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Rank">
|
||||
SELECT
|
||||
CONCAT(group_name, '/', scene_name) `name`,
|
||||
SUM(running_num + finish_num + max_count_num + suspend_num) AS total FROM retry_summary
|
||||
<where>
|
||||
<if test="groupName != '' and groupName != null">
|
||||
AND group_name = #{groupName}
|
||||
</if>
|
||||
AND namespace_id = #{namespaceId}
|
||||
AND trigger_at >= #{startTime} AND trigger_at <= #{endTime}
|
||||
</where>
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
ORDER BY total DESC LIMIT 10
|
||||
</select>
|
||||
|
||||
<select id="retryTaskList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO$Task">
|
||||
SELECT group_name AS groupName,
|
||||
sum(CASE WHEN (group_status = 1) THEN 1 ELSE 0 END) AS run,
|
||||
count(*) AS total
|
||||
FROM group_config
|
||||
WHERE namespace_id = #{namespaceId}
|
||||
GROUP BY namespace_id, group_name
|
||||
</select>
|
||||
</mapper>
|
@ -95,4 +95,19 @@
|
||||
(#{item.uniqueId}, #{item.groupName}, #{item.sceneName}, #{item.idempotentId}, #{item.bizNo}, #{item.executorName}, #{item.argsStr}, #{item.extAttrs}, #{item.taskType}, #{item.createDt})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 重试统计 -->
|
||||
<select id="retrySummaryRetryTaskLogList"
|
||||
resultType="com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryResponseDO">
|
||||
SELECT namespace_id AS namespaceId,
|
||||
group_name AS groupName,
|
||||
scene_name AS sceneName,
|
||||
SUM(CASE WHEN (retry_status = 0) THEN 1 ELSE 0 END) AS runningNum,
|
||||
SUM(CASE WHEN (retry_status = 1) THEN 1 ELSE 0 END) AS finishNum,
|
||||
SUM(CASE WHEN (retry_status = 2) THEN 1 ELSE 0 END) AS maxCountNum,
|
||||
SUM(CASE WHEN (retry_status = 3) THEN 1 ELSE 0 END) AS suspendNum
|
||||
FROM retry_task_log
|
||||
WHERE create_dt between #{from} and #{to}
|
||||
GROUP BY namespace_id, group_name, scene_name
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -0,0 +1,23 @@
|
||||
package com.aizuda.easy.retry.server.common.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
* @version 1.0.0
|
||||
* @date 2023/11/22
|
||||
*/
|
||||
@Data
|
||||
public class JobTaskBatchReason {
|
||||
|
||||
/**
|
||||
* 操作原因
|
||||
*/
|
||||
private Long reason;
|
||||
|
||||
/**
|
||||
* 操作原因总数
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package com.aizuda.easy.retry.server.job.task.support.schedule;
|
||||
|
||||
import com.aizuda.easy.retry.common.core.enums.JobTaskBatchStatusEnum;
|
||||
import com.aizuda.easy.retry.common.core.log.LogUtils;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.server.common.Lifecycle;
|
||||
import com.aizuda.easy.retry.server.common.dto.JobTaskBatchReason;
|
||||
import com.aizuda.easy.retry.server.common.schedule.AbstractSchedule;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.JobBatchSummaryResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobSummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobTaskBatchMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.JobSummary;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Job Dashboard
|
||||
*
|
||||
* @author: wodeyangzipingpingwuqi
|
||||
* @date : 2023-11-21 11:15
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class JobSummarySchedule extends AbstractSchedule implements Lifecycle {
|
||||
|
||||
@Autowired
|
||||
private JobTaskBatchMapper jobTaskBatchMapper;
|
||||
@Autowired
|
||||
private JobSummaryMapper jobSummaryMapper;
|
||||
|
||||
@Override
|
||||
public String lockName() {
|
||||
return "jobSummaryDashboard";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String lockAtMost() {
|
||||
return "PT1M";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String lockAtLeast() {
|
||||
return "PT20S";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doExecute() {
|
||||
try {
|
||||
// 定时按日实时查询统计数据(00:00:00 - 23:59:59)
|
||||
LocalDateTime todayFrom = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
|
||||
LocalDateTime todayTo = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
|
||||
List<JobBatchSummaryResponseDO> summaryResponseDOList = jobTaskBatchMapper.summaryJobBatchList(todayFrom, todayTo);
|
||||
if (summaryResponseDOList == null || summaryResponseDOList.size() < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// insertOrUpdate
|
||||
List<JobSummary> jobSummaryList = jobSummaryList(todayFrom, summaryResponseDOList);
|
||||
int total = jobSummaryMapper.updateBatchTriggerAtById(jobSummaryList);
|
||||
if (total < 1) {
|
||||
jobSummaryMapper.insertBatchJobSummary(jobSummaryList);
|
||||
}
|
||||
LogUtils.debug(log, "job summary dashboard success todayFrom:[{}] todayTo:[{}] total:[{}]", todayFrom, todayTo, total);
|
||||
} catch (Exception e) {
|
||||
LogUtils.error(log, "job summary dashboard log error", e);
|
||||
}
|
||||
}
|
||||
|
||||
private List<JobSummary> jobSummaryList(LocalDateTime triggerAt, List<JobBatchSummaryResponseDO> summaryResponseDOList) {
|
||||
List<JobSummary> jobSummaryList = new ArrayList<>();
|
||||
Map<Long, List<JobBatchSummaryResponseDO>> jobIdListMap = summaryResponseDOList.parallelStream().collect(Collectors.groupingBy(JobBatchSummaryResponseDO::getJobId));
|
||||
for (Map.Entry<Long, List<JobBatchSummaryResponseDO>> job : jobIdListMap.entrySet()) {
|
||||
JobSummary jobSummary = new JobSummary();
|
||||
jobSummary.setJobId(job.getKey());
|
||||
jobSummary.setTriggerAt(triggerAt);
|
||||
jobSummary.setNamespaceId(job.getValue().get(0).getNamespaceId());
|
||||
jobSummary.setGroupName(job.getValue().get(0).getGroupName());
|
||||
jobSummary.setSuccessNum(job.getValue().stream().mapToInt(JobBatchSummaryResponseDO::getSuccessNum).sum());
|
||||
jobSummary.setFailNum(job.getValue().stream().mapToInt(JobBatchSummaryResponseDO::getFailNum).sum());
|
||||
jobSummary.setStopNum(job.getValue().stream().mapToInt(JobBatchSummaryResponseDO::getStopNum).sum());
|
||||
jobSummary.setCancelNum(job.getValue().stream().mapToInt(JobBatchSummaryResponseDO::getCancelNum).sum());
|
||||
|
||||
jobSummary.setFailReason(JsonUtil.toJsonString(jobTaskBatchReasonList(JobTaskBatchStatusEnum.FAIL.getStatus(), job.getValue())));
|
||||
jobSummary.setStopReason(JsonUtil.toJsonString(jobTaskBatchReasonList(JobTaskBatchStatusEnum.STOP.getStatus(), job.getValue())));
|
||||
jobSummary.setCancelReason(JsonUtil.toJsonString(jobTaskBatchReasonList(JobTaskBatchStatusEnum.CANCEL.getStatus(), job.getValue())));
|
||||
jobSummaryList.add(jobSummary);
|
||||
}
|
||||
return jobSummaryList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批次状态查询 (操作原因 && 总数)
|
||||
*
|
||||
* @param jobTaskBatchStatus
|
||||
* @param jobBatchSummaryResponseDOList
|
||||
* @return
|
||||
*/
|
||||
private List<JobTaskBatchReason> jobTaskBatchReasonList(int jobTaskBatchStatus, List<JobBatchSummaryResponseDO> jobBatchSummaryResponseDOList) {
|
||||
List<JobTaskBatchReason> jobTaskBatchReasonArrayList = new ArrayList<>();
|
||||
List<JobBatchSummaryResponseDO> summaryResponseDOList = jobBatchSummaryResponseDOList.stream().filter(i -> jobTaskBatchStatus == i.getTaskBatchStatus()).collect(Collectors.toList());
|
||||
for (JobBatchSummaryResponseDO jobBatchSummaryResponseDO : summaryResponseDOList) {
|
||||
JobTaskBatchReason jobTaskBatchReason = new JobTaskBatchReason();
|
||||
jobTaskBatchReason.setReason(jobBatchSummaryResponseDO.getOperationReason());
|
||||
jobTaskBatchReason.setTotal(jobBatchSummaryResponseDO.getOperationReasonTotal());
|
||||
jobTaskBatchReasonArrayList.add(jobTaskBatchReason);
|
||||
}
|
||||
return jobTaskBatchReasonArrayList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
taskScheduler.scheduleAtFixedRate(this::execute, Duration.parse("PT1M"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.aizuda.easy.retry.server.retry.task.support.schedule;
|
||||
|
||||
import com.aizuda.easy.retry.common.core.log.LogUtils;
|
||||
import com.aizuda.easy.retry.server.common.Lifecycle;
|
||||
import com.aizuda.easy.retry.server.common.schedule.AbstractSchedule;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetrySummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetryTaskLogMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetrySummary;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Retry Dashboard
|
||||
*
|
||||
* @author: wodeyangzipingpingwuqi
|
||||
* @date : 2023-11-28 13:46
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class RetrySummarySchedule extends AbstractSchedule implements Lifecycle {
|
||||
|
||||
@Autowired
|
||||
private RetryTaskLogMapper retryTaskLogMapper;
|
||||
@Autowired
|
||||
private RetrySummaryMapper retrySummaryMapper;
|
||||
|
||||
@Override
|
||||
public String lockName() {
|
||||
return "retrySummaryDashboard";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String lockAtMost() {
|
||||
return "PT1M";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String lockAtLeast() {
|
||||
return "PT20S";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doExecute() {
|
||||
try {
|
||||
// 重试按日实时查询统计数据(00:00:00 - 23:59:59)
|
||||
LocalDateTime todayFrom = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
|
||||
LocalDateTime todayTo = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
|
||||
List<DashboardRetryResponseDO> dashboardRetryResponseDOList = retryTaskLogMapper.retrySummaryRetryTaskLogList(todayFrom, todayTo);
|
||||
if (dashboardRetryResponseDOList == null || dashboardRetryResponseDOList.size() < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// insertOrUpdate
|
||||
List<RetrySummary> retrySummaryList = retrySummaryList(todayFrom, dashboardRetryResponseDOList);
|
||||
int total = retrySummaryMapper.updateBatchSceneNameById(retrySummaryList);
|
||||
if (total < 1) {
|
||||
retrySummaryMapper.insertBatchRetrySummary(retrySummaryList);
|
||||
}
|
||||
LogUtils.debug(log, "retry summary dashboard success todayFrom:[{}] todayTo:[{}] total:[{}]", todayFrom, todayTo, total);
|
||||
} catch (Exception e) {
|
||||
LogUtils.error(log, "retry summary dashboard log error", e);
|
||||
}
|
||||
}
|
||||
|
||||
private List<RetrySummary> retrySummaryList(LocalDateTime triggerAt, List<DashboardRetryResponseDO> dashboardRetryResponseDOList) {
|
||||
List<RetrySummary> retrySummaryList = new ArrayList<>();
|
||||
for (DashboardRetryResponseDO dashboardRetryResponseDO : dashboardRetryResponseDOList) {
|
||||
RetrySummary retrySummary = new RetrySummary();
|
||||
retrySummary.setTriggerAt(triggerAt);
|
||||
retrySummary.setNamespaceId(dashboardRetryResponseDO.getNamespaceId());
|
||||
retrySummary.setGroupName(dashboardRetryResponseDO.getGroupName());
|
||||
retrySummary.setSceneName(dashboardRetryResponseDO.getSceneName());
|
||||
retrySummary.setRunningNum(dashboardRetryResponseDO.getRunningNum());
|
||||
retrySummary.setFinishNum(dashboardRetryResponseDO.getFinishNum());
|
||||
retrySummary.setMaxCountNum(dashboardRetryResponseDO.getMaxCountNum());
|
||||
retrySummary.setSuspendNum(dashboardRetryResponseDO.getSuspendNum());
|
||||
retrySummaryList.add(retrySummary);
|
||||
}
|
||||
return retrySummaryList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
taskScheduler.scheduleAtFixedRate(this::execute, Duration.parse("PT1M"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
.extra-wrapper[data-v-5a5cdc3c]{line-height:55px;padding-right:24px}.extra-wrapper .extra-item[data-v-5a5cdc3c]{display:inline-block;margin-right:24px}.extra-wrapper .extra-item a[data-v-5a5cdc3c]{margin-left:24px}.antd-pro-pages-dashboard-analysis-twoColLayout[data-v-5a5cdc3c]{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;display:block;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.antd-pro-pages-dashboard-analysis-salesCard[data-v-5a5cdc3c]{height:calc(100% - 24px)}.antd-pro-pages-dashboard-analysis-salesCard[data-v-5a5cdc3c] .ant-card-head{position:relative}.dashboard-analysis-iconGroup i[data-v-5a5cdc3c]{margin-left:16px;color:rgba(0,0,0,.45);cursor:pointer;-webkit-transition:color .32s;transition:color .32s;color:#000}.analysis-salesTypeRadio[data-v-5a5cdc3c]{position:absolute;right:54px;bottom:12px}
|
@ -0,0 +1 @@
|
||||
.extra-wrapper[data-v-1cb0bb97]{line-height:55px;padding-right:24px}.extra-wrapper .extra-item[data-v-1cb0bb97]{display:inline-block;margin-right:24px}.extra-wrapper .extra-item a[data-v-1cb0bb97]{color:#0e0101;margin-left:24px}.extra-wrapper .extra-item span[data-v-1cb0bb97]{border:none;cursor:pointer}.in[data-v-1cb0bb97]{color:#1b7ee5}.extra-wrapper[data-v-9f5509c6]{line-height:55px;padding-right:24px}.extra-wrapper .extra-item[data-v-9f5509c6]{display:inline-block;margin-right:24px}.extra-wrapper .extra-item a[data-v-9f5509c6]{color:#0e0101;margin-left:24px}.extra-wrapper .extra-item span[data-v-9f5509c6]{border:none;cursor:pointer}.in[data-v-9f5509c6]{color:#1b7ee5}.antv-chart-mini[data-v-5b067982]{position:relative;width:100%}.antv-chart-mini .chart-wrapper[data-v-5b067982]{position:absolute;bottom:-28px;width:100%}.extra-wrapper[data-v-5b067982]{line-height:55px;padding-right:24px}.extra-wrapper .extra-item[data-v-5b067982]{display:inline-block;margin-right:24px}.extra-wrapper .extra-item a[data-v-5b067982]{margin-left:24px}.antd-pro-pages-dashboard-analysis-twoColLayout[data-v-5b067982]{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;display:block;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.antd-pro-pages-dashboard-analysis-salesCard[data-v-5b067982]{height:calc(100% - 24px)}.antd-pro-pages-dashboard-analysis-salesCard[data-v-5b067982] .ant-card-head{position:relative}.dashboard-analysis-iconGroup i[data-v-5b067982]{margin-left:16px;color:rgba(0,0,0,.45);cursor:pointer;-webkit-transition:color .32s;transition:color .32s;color:#000}.analysis-salesTypeRadio[data-v-5b067982]{position:absolute;right:54px;bottom:12px}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-251479d0"],{"339f":function(t,e,r){"use strict";var a=function(){var t=this,e=this,r=e._self._c;return r("div",[r("div",{staticStyle:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[r("span",{staticStyle:{"padding-left":"18px"}},[e._v("调用日志详情 (总调度次数: "+e._s(e.total)+")")]),r("span",{staticStyle:{"padding-left":"18px"}},[r("a-icon",{attrs:{type:"sync"},on:{click:function(){return t.$refs.table.refresh(!0)}}})],1)]),r("a-card",[r("s-table",{ref:"table",attrs:{size:"default",rowKey:"key",columns:e.columns,data:e.loadData},scopedSlots:e._u([{key:"serial",fn:function(t,a){return r("span",{},[e._v(" "+e._s(a.id)+" ")])}},{key:"clientInfo",fn:function(t){return r("span",{},[e._v(" "+e._s(t?t.split("@")[1]:"无")+" ")])}}])})],1)],1)},s=[],n=r("c1df"),o=r.n(n),i=r("0fea"),l=r("2af9"),c={name:"RetryTaskLogMessageList",components:{STable:l["k"]},data:function(){var t=this;return{columns:[{title:"#",scopedSlots:{customRender:"serial"},width:"10%"},{title:"信息",dataIndex:"message",width:"50%"},{title:"地址",dataIndex:"clientInfo",scopedSlots:{customRender:"clientInfo"},width:"10%"},{title:"触发时间",dataIndex:"createDt",sorter:!0,customRender:function(t){return o()(t).format("YYYY-MM-DD HH:mm:ss")},width:"10%"}],queryParam:{},loadData:function(e){if(t.queryParam["groupName"])return Object(i["x"])(Object.assign(e,t.queryParam)).then((function(e){return t.total=e.total,e}))},total:0}},methods:{refreshTable:function(t){this.queryParam=t,this.$refs.table.refresh(!0)}}},d=c,u=r("2877"),f=Object(u["a"])(d,a,s,!1,null,"7ee48017",null);e["a"]=f.exports},"5fe2":function(t,e,r){"use strict";r.r(e);r("ac1f"),r("5319"),r("b0c0");var a=function(){var t=this,e=t._self._c;return e("div",[t.showHeader?e("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return t.$router.replace("/retry/log/list")}}},[e("div")]):t._e(),e("a-card",{attrs:{bordered:!1}},[null!==t.retryInfo?e("a-descriptions",{attrs:{title:"",column:t.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[t._v(" "+t._s(t.retryInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"场景名称"}},[t._v(" "+t._s(t.retryInfo.sceneName)+" ")]),e("a-descriptions-item",{attrs:{label:"唯一id"}},[t._v(" "+t._s(t.retryInfo.uniqueId)+" ")]),e("a-descriptions-item",{attrs:{label:"幂等id",span:2}},[t._v(" "+t._s(t.retryInfo.idempotentId)+" ")]),e("a-descriptions-item",{attrs:{label:"业务编号"}},[t._v(" "+t._s(t.retryInfo.bizNo)+" ")]),e("a-descriptions-item",{attrs:{label:"当前重试状态 | 数据类型"}},[e("a-tag",{attrs:{color:"red"}},[t._v(" "+t._s(t.retryStatus[t.retryInfo.retryStatus])+" ")]),e("a-divider",{attrs:{type:"vertical"}}),e("a-tag",{attrs:{color:t.taskType[t.retryInfo.taskType].color}},[t._v(" "+t._s(t.taskType[t.retryInfo.taskType].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"创建时间"}},[t._v(" "+t._s(t.retryInfo.createDt)+" ")]),e("a-descriptions-item",{attrs:{label:"执行器名称",span:3}},[t._v(" "+t._s(t.retryInfo.executorName)+" ")]),e("a-descriptions-item",{attrs:{label:"参数",span:3}},[t._v(" "+t._s(t.retryInfo.argsStr)+" ")]),e("a-descriptions-item",{attrs:{label:"扩展参数",span:3}},[t._v(" "+t._s(t.retryInfo.extAttrs)+" ")])],1):t._e()],1),e("RetryTaskLogMessageList",{ref:"retryTaskLogMessageListRef"})],1)},s=[],n=(r("a9e3"),r("0fea")),o=r("2af9"),i=r("339f"),l={name:"RetryLogInfo",components:{RetryTaskLogMessageList:i["a"],STable:o["k"]},props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{retryInfo:null,retryStatus:{0:"处理中",1:"处理成功",2:"最大次数"},taskType:{1:{name:"重试数据",color:"#d06892"},2:{name:"回调数据",color:"#f5a22d"}}}},created:function(){var t=this.$route.query.id;t&&this.getRetryTaskLogById(t)},methods:{getRetryTaskLogById:function(t){var e=this;Object(n["w"])(t).then((function(t){e.retryInfo=t.data,e.queryParam={groupName:e.retryInfo.groupName,uniqueId:e.retryInfo.uniqueId},e.$refs.retryTaskLogMessageListRef.refreshTable(e.queryParam)}))}}},c=l,d=r("2877"),u=Object(d["a"])(c,a,s,!1,null,"3750b48e",null);e["default"]=u.exports}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-251479d0"],{"339f":function(t,e,r){"use strict";var a=function(){var t=this,e=this,r=e._self._c;return r("div",[r("div",{staticStyle:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[r("span",{staticStyle:{"padding-left":"18px"}},[e._v("调用日志详情 (总调度次数: "+e._s(e.total)+")")]),r("span",{staticStyle:{"padding-left":"18px"}},[r("a-icon",{attrs:{type:"sync"},on:{click:function(){return t.$refs.table.refresh(!0)}}})],1)]),r("a-card",[r("s-table",{ref:"table",attrs:{size:"default",rowKey:"key",columns:e.columns,data:e.loadData},scopedSlots:e._u([{key:"serial",fn:function(t,a){return r("span",{},[e._v(" "+e._s(a.id)+" ")])}},{key:"clientInfo",fn:function(t){return r("span",{},[e._v(" "+e._s(t?t.split("@")[1]:"无")+" ")])}}])})],1)],1)},s=[],n=r("c1df"),o=r.n(n),i=r("0fea"),l=r("2af9"),c={name:"RetryTaskLogMessageList",components:{STable:l["i"]},data:function(){var t=this;return{columns:[{title:"#",scopedSlots:{customRender:"serial"},width:"10%"},{title:"信息",dataIndex:"message",width:"50%"},{title:"地址",dataIndex:"clientInfo",scopedSlots:{customRender:"clientInfo"},width:"10%"},{title:"触发时间",dataIndex:"createDt",sorter:!0,customRender:function(t){return o()(t).format("YYYY-MM-DD HH:mm:ss")},width:"10%"}],queryParam:{},loadData:function(e){if(t.queryParam["groupName"])return Object(i["w"])(Object.assign(e,t.queryParam)).then((function(e){return t.total=e.total,e}))},total:0}},methods:{refreshTable:function(t){this.queryParam=t,this.$refs.table.refresh(!0)}}},d=c,u=r("2877"),f=Object(u["a"])(d,a,s,!1,null,"7ee48017",null);e["a"]=f.exports},"5fe2":function(t,e,r){"use strict";r.r(e);r("ac1f"),r("5319"),r("b0c0");var a=function(){var t=this,e=t._self._c;return e("div",[t.showHeader?e("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return t.$router.replace("/retry/log/list")}}},[e("div")]):t._e(),e("a-card",{attrs:{bordered:!1}},[null!==t.retryInfo?e("a-descriptions",{attrs:{title:"",column:t.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[t._v(" "+t._s(t.retryInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"场景名称"}},[t._v(" "+t._s(t.retryInfo.sceneName)+" ")]),e("a-descriptions-item",{attrs:{label:"唯一id"}},[t._v(" "+t._s(t.retryInfo.uniqueId)+" ")]),e("a-descriptions-item",{attrs:{label:"幂等id",span:2}},[t._v(" "+t._s(t.retryInfo.idempotentId)+" ")]),e("a-descriptions-item",{attrs:{label:"业务编号"}},[t._v(" "+t._s(t.retryInfo.bizNo)+" ")]),e("a-descriptions-item",{attrs:{label:"当前重试状态 | 数据类型"}},[e("a-tag",{attrs:{color:"red"}},[t._v(" "+t._s(t.retryStatus[t.retryInfo.retryStatus])+" ")]),e("a-divider",{attrs:{type:"vertical"}}),e("a-tag",{attrs:{color:t.taskType[t.retryInfo.taskType].color}},[t._v(" "+t._s(t.taskType[t.retryInfo.taskType].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"创建时间"}},[t._v(" "+t._s(t.retryInfo.createDt)+" ")]),e("a-descriptions-item",{attrs:{label:"执行器名称",span:3}},[t._v(" "+t._s(t.retryInfo.executorName)+" ")]),e("a-descriptions-item",{attrs:{label:"参数",span:3}},[t._v(" "+t._s(t.retryInfo.argsStr)+" ")]),e("a-descriptions-item",{attrs:{label:"扩展参数",span:3}},[t._v(" "+t._s(t.retryInfo.extAttrs)+" ")])],1):t._e()],1),e("RetryTaskLogMessageList",{ref:"retryTaskLogMessageListRef"})],1)},s=[],n=(r("a9e3"),r("0fea")),o=r("2af9"),i=r("339f"),l={name:"RetryLogInfo",components:{RetryTaskLogMessageList:i["a"],STable:o["i"]},props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{retryInfo:null,retryStatus:{0:"处理中",1:"处理成功",2:"最大次数"},taskType:{1:{name:"重试数据",color:"#d06892"},2:{name:"回调数据",color:"#f5a22d"}}}},created:function(){var t=this.$route.query.id;t&&this.getRetryTaskLogById(t)},methods:{getRetryTaskLogById:function(t){var e=this;Object(n["v"])(t).then((function(t){e.retryInfo=t.data,e.queryParam={groupName:e.retryInfo.groupName,uniqueId:e.retryInfo.uniqueId},e.$refs.retryTaskLogMessageListRef.refreshTable(e.queryParam)}))}}},c=l,d=r("2877"),u=Object(d["a"])(c,a,s,!1,null,"3750b48e",null);e["default"]=u.exports}}]);
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0aa660"],{"119c":function(t,a,e){"use strict";e.r(a);e("ac1f"),e("5319"),e("b0c0");var o=function(){var t=this,a=this,e=a._self._c;return e("div",[a.showHeader?e("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return a.$router.replace("/job/batch/list")}}},[e("div")]):a._e(),null!==a.jobBatchInfo?e("a-card",{attrs:{bordered:!1}},[e("a-descriptions",{attrs:{title:"",column:a.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[a._v(" "+a._s(a.jobBatchInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"任务名称"}},[a._v(" "+a._s(a.jobBatchInfo.jobName)+" ")]),e("a-descriptions-item",{attrs:{label:"状态"}},[e("a-tag",{attrs:{color:a.taskBatchStatus[a.jobBatchInfo.taskBatchStatus].color}},[a._v(" "+a._s(a.taskBatchStatus[a.jobBatchInfo.taskBatchStatus].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"执行器类型"}},[e("a-tag",{attrs:{color:a.executorType[a.jobBatchInfo.executorType].color}},[a._v(" "+a._s(a.executorType[a.jobBatchInfo.executorType].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"操作原因"}},[e("a-tag",{attrs:{color:a.operationReason[a.jobBatchInfo.operationReason].color}},[a._v(" "+a._s(a.operationReason[a.jobBatchInfo.operationReason].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"开始执行时间"}},[a._v(" "+a._s(a.jobBatchInfo.executionAt)+" ")]),e("a-descriptions-item",{attrs:{label:"执行器名称",span:"4"}},[a._v(" "+a._s(a.jobBatchInfo.executorInfo)+" ")]),e("a-descriptions-item",{attrs:{label:"创建时间"}},[a._v(" "+a._s(a.jobBatchInfo.createDt)+" ")])],1)],1):a._e(),e("div",{staticStyle:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[e("span",{staticStyle:{"padding-left":"18px"}},[a._v("任务项列表")]),e("span",{staticStyle:{"padding-left":"18px"}},[e("a-icon",{attrs:{type:"sync"},on:{click:function(){return t.$refs.JobTaskListRef.refreshTable(t.queryParam)}}})],1)]),e("JobTaskList",{ref:"JobTaskListRef"})],1)},r=[],s=(e("a9e3"),e("3b7a")),n=e("c1df"),c=e.n(n),i=e("38b7"),p=e.n(i),u=e("36e8"),l={name:"JobInfo",components:{JobTaskList:u["default"]},props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{jobBatchInfo:null,taskBatchStatus:p.a.taskBatchStatus,operationReason:p.a.operationReason,taskType:p.a.taskType,triggerType:p.a.triggerType,blockStrategy:p.a.blockStrategy,executorType:p.a.executorType,queryParam:{}}},created:function(){var t=this.$route.query.id,a=this.$route.query.groupName;t&&a?this.jobBatchDetail(t):this.showHeader&&this.$router.push({path:"/404"})},methods:{parseDate:function(t){return c()(t).format("YYYY-MM-DD HH:mm:ss")},jobBatchDetail:function(t){var a=this;Object(s["d"])(t).then((function(e){a.jobBatchInfo=e.data,a.queryParam={groupName:a.jobBatchInfo.groupName,taskBatchId:t},a.$refs.JobTaskListRef.refreshTable(a.queryParam)}))}}},b=l,f=e("2877"),d=Object(f["a"])(b,o,r,!1,null,"aa07bd40",null);a["default"]=d.exports}}]);
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c8f97"],{"56bb":function(e,t,r){"use strict";r.r(t);r("ac1f"),r("5319"),r("b0c0");var a=function(){var e=this,t=e._self._c;return t("div",[e.showHeader?t("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return e.$router.replace("/retry/dead-letter/list")}}},[t("div")]):e._e(),t("a-card",{attrs:{bordered:!1}},[null!==e.retryDealLetterInfo?t("a-descriptions",{attrs:{title:"",column:e.column,bordered:""}},[t("a-descriptions-item",{attrs:{label:"组名称"}},[e._v(" "+e._s(e.retryDealLetterInfo.groupName)+" ")]),t("a-descriptions-item",{attrs:{label:"场景名称"}},[e._v(" "+e._s(e.retryDealLetterInfo.sceneName)+" ")]),t("a-descriptions-item",{attrs:{label:"业务id",span:"2"}},[e._v(" "+e._s(e.retryDealLetterInfo.idempotentId)+" ")]),t("a-descriptions-item",{attrs:{label:"业务编号"}},[e._v(" "+e._s(e.retryDealLetterInfo.bizNo)+" ")]),t("a-descriptions-item",{attrs:{label:"数据类型"}},[t("a-tag",{attrs:{color:e.taskType[e.retryDealLetterInfo.taskType].color}},[e._v(" "+e._s(e.taskType[e.retryDealLetterInfo.taskType].name)+" ")])],1),t("a-descriptions-item",{attrs:{label:"创建时间"}},[e._v(" "+e._s(e.retryDealLetterInfo.createDt)+" ")]),t("a-descriptions-item",{attrs:{label:"执行器名称",span:"2"}},[e._v(" "+e._s(e.retryDealLetterInfo.executorName)+" ")]),t("a-descriptions-item",{attrs:{label:"扩展参数",span:"3"}},[e._v(" "+e._s(e.retryDealLetterInfo.bizNo)+" ")]),t("a-descriptions-item",{attrs:{label:"参数",span:"3"}},[e._v(" "+e._s(e.retryDealLetterInfo.argsStr)+" ")])],1):e._e()],1)],1)},s=[],n=(r("a9e3"),r("0fea")),o={name:"RetryDeadLetterInfo",props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{retryDealLetterInfo:null,taskType:{1:{name:"重试数据",color:"#d06892"},2:{name:"回调数据",color:"#f5a22d"}}}},created:function(){var e=this.$route.query.id,t=this.$route.query.groupName;e&&t&&this.retryDeadLetterById(e,t)},methods:{retryDeadLetterById:function(e,t){var r=this;Object(n["t"])(e,{groupName:t}).then((function(e){r.retryDealLetterInfo=e.data}))}}},l=o,i=r("2877"),c=Object(i["a"])(l,a,s,!1,null,"7c315ea2",null);t["default"]=c.exports}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c8f97"],{"56bb":function(e,t,r){"use strict";r.r(t);r("ac1f"),r("5319"),r("b0c0");var a=function(){var e=this,t=e._self._c;return t("div",[e.showHeader?t("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return e.$router.replace("/retry/dead-letter/list")}}},[t("div")]):e._e(),t("a-card",{attrs:{bordered:!1}},[null!==e.retryDealLetterInfo?t("a-descriptions",{attrs:{title:"",column:e.column,bordered:""}},[t("a-descriptions-item",{attrs:{label:"组名称"}},[e._v(" "+e._s(e.retryDealLetterInfo.groupName)+" ")]),t("a-descriptions-item",{attrs:{label:"场景名称"}},[e._v(" "+e._s(e.retryDealLetterInfo.sceneName)+" ")]),t("a-descriptions-item",{attrs:{label:"业务id",span:"2"}},[e._v(" "+e._s(e.retryDealLetterInfo.idempotentId)+" ")]),t("a-descriptions-item",{attrs:{label:"业务编号"}},[e._v(" "+e._s(e.retryDealLetterInfo.bizNo)+" ")]),t("a-descriptions-item",{attrs:{label:"数据类型"}},[t("a-tag",{attrs:{color:e.taskType[e.retryDealLetterInfo.taskType].color}},[e._v(" "+e._s(e.taskType[e.retryDealLetterInfo.taskType].name)+" ")])],1),t("a-descriptions-item",{attrs:{label:"创建时间"}},[e._v(" "+e._s(e.retryDealLetterInfo.createDt)+" ")]),t("a-descriptions-item",{attrs:{label:"执行器名称",span:"2"}},[e._v(" "+e._s(e.retryDealLetterInfo.executorName)+" ")]),t("a-descriptions-item",{attrs:{label:"扩展参数",span:"3"}},[e._v(" "+e._s(e.retryDealLetterInfo.bizNo)+" ")]),t("a-descriptions-item",{attrs:{label:"参数",span:"3"}},[e._v(" "+e._s(e.retryDealLetterInfo.argsStr)+" ")])],1):e._e()],1)],1)},s=[],n=(r("a9e3"),r("0fea")),o={name:"RetryDeadLetterInfo",props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{retryDealLetterInfo:null,taskType:{1:{name:"重试数据",color:"#d06892"},2:{name:"回调数据",color:"#f5a22d"}}}},created:function(){var e=this.$route.query.id,t=this.$route.query.groupName;e&&t&&this.retryDeadLetterById(e,t)},methods:{retryDeadLetterById:function(e,t){var r=this;Object(n["s"])(e,{groupName:t}).then((function(e){r.retryDealLetterInfo=e.data}))}}},l=o,i=r("2877"),c=Object(i["a"])(l,a,s,!1,null,"7c315ea2",null);t["default"]=c.exports}}]);
|
@ -1 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-35f76107"],{"339f":function(t,e,a){"use strict";var r=function(){var t=this,e=this,a=e._self._c;return a("div",[a("div",{staticStyle:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[a("span",{staticStyle:{"padding-left":"18px"}},[e._v("调用日志详情 (总调度次数: "+e._s(e.total)+")")]),a("span",{staticStyle:{"padding-left":"18px"}},[a("a-icon",{attrs:{type:"sync"},on:{click:function(){return t.$refs.table.refresh(!0)}}})],1)]),a("a-card",[a("s-table",{ref:"table",attrs:{size:"default",rowKey:"key",columns:e.columns,data:e.loadData},scopedSlots:e._u([{key:"serial",fn:function(t,r){return a("span",{},[e._v(" "+e._s(r.id)+" ")])}},{key:"clientInfo",fn:function(t){return a("span",{},[e._v(" "+e._s(t?t.split("@")[1]:"无")+" ")])}}])})],1)],1)},s=[],n=a("c1df"),o=a.n(n),i=a("0fea"),l=a("2af9"),d={name:"RetryTaskLogMessageList",components:{STable:l["k"]},data:function(){var t=this;return{columns:[{title:"#",scopedSlots:{customRender:"serial"},width:"10%"},{title:"信息",dataIndex:"message",width:"50%"},{title:"地址",dataIndex:"clientInfo",scopedSlots:{customRender:"clientInfo"},width:"10%"},{title:"触发时间",dataIndex:"createDt",sorter:!0,customRender:function(t){return o()(t).format("YYYY-MM-DD HH:mm:ss")},width:"10%"}],queryParam:{},loadData:function(e){if(t.queryParam["groupName"])return Object(i["x"])(Object.assign(e,t.queryParam)).then((function(e){return t.total=e.total,e}))},total:0}},methods:{refreshTable:function(t){this.queryParam=t,this.$refs.table.refresh(!0)}}},u=d,c=a("2877"),f=Object(c["a"])(u,r,s,!1,null,"7ee48017",null);e["a"]=f.exports},"99f5":function(t,e,a){"use strict";a.r(e);a("ac1f"),a("5319"),a("b0c0");var r=function(){var t=this,e=t._self._c;return e("div",[t.showHeader?e("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return t.$router.replace("/retry/list")}}},[e("div")]):t._e(),null!==t.retryTaskInfo?e("a-card",{attrs:{bordered:!1}},[e("a-descriptions",{attrs:{title:"",column:t.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[t._v(" "+t._s(t.retryTaskInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"场景名称"}},[t._v(" "+t._s(t.retryTaskInfo.sceneName)+" ")]),e("a-descriptions-item",{attrs:{label:"幂等id"}},[t._v(" "+t._s(t.retryTaskInfo.idempotentId)+" ")]),e("a-descriptions-item",{attrs:{label:"唯一id"}},[t._v(" "+t._s(t.retryTaskInfo.uniqueId)+" ")]),e("a-descriptions-item",{attrs:{label:"业务编号"}},[t._v(" "+t._s(t.retryTaskInfo.bizNo)+" ")]),e("a-descriptions-item",{attrs:{label:"重试次数"}},[t._v(" "+t._s(t.retryTaskInfo.retryCount)+" ")]),e("a-descriptions-item",{attrs:{label:"重试状态 | 数据类型"}},[e("a-tag",{attrs:{color:"red"}},[t._v(" "+t._s(t.retryStatus[t.retryTaskInfo.retryStatus])+" ")]),e("a-divider",{attrs:{type:"vertical"}}),e("a-tag",{attrs:{color:t.taskType[t.retryTaskInfo.taskType].color}},[t._v(" "+t._s(t.taskType[t.retryTaskInfo.taskType].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"下次触发时间"}},[t._v(" "+t._s(t.retryTaskInfo.nextTriggerAt)+" ")]),e("a-descriptions-item",{attrs:{label:"更新时间"}},[t._v(" "+t._s(t.retryTaskInfo.updateDt)+" ")]),e("a-descriptions-item",{attrs:{label:"执行器名称",span:"3"}},[t._v(" "+t._s(t.retryTaskInfo.executorName)+" ")]),e("a-descriptions-item",{attrs:{label:"参数",span:"3"}},[t._v(" "+t._s(t.retryTaskInfo.argsStr)+" ")]),e("a-descriptions-item",{attrs:{label:"扩展参数",span:"3"}},[t._v(" "+t._s(t.retryTaskInfo.extAttrs)+" ")])],1)],1):t._e(),e("RetryTaskLogMessageList",{ref:"retryTaskLogMessageListRef"})],1)},s=[],n=(a("a9e3"),a("0fea")),o=a("339f"),i={name:"RetryTaskInfo",components:{RetryTaskLogMessageList:o["a"]},props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{retryTaskInfo:null,retryStatus:{0:"处理中",1:"处理成功",2:"最大次数",3:"暂停"},taskType:{1:{name:"重试数据",color:"#d06892"},2:{name:"回调数据",color:"#f5a22d"}}}},created:function(){var t=this.$route.query.id,e=this.$route.query.groupName;t&&e?this.getRetryTaskById(t,e):this.showHeader&&this.$router.push({path:"/404"})},methods:{getRetryTaskById:function(t,e){var a=this;Object(n["v"])(t,{groupName:e}).then((function(t){a.retryTaskInfo=t.data,a.queryParam={groupName:a.retryTaskInfo.groupName,uniqueId:a.retryTaskInfo.uniqueId},a.$refs.retryTaskLogMessageListRef.refreshTable(a.queryParam)}))}}},l=i,d=a("2877"),u=Object(d["a"])(l,r,s,!1,null,"0b3ba3ef",null);e["default"]=u.exports}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-35f76107"],{"339f":function(t,e,a){"use strict";var r=function(){var t=this,e=this,a=e._self._c;return a("div",[a("div",{staticStyle:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[a("span",{staticStyle:{"padding-left":"18px"}},[e._v("调用日志详情 (总调度次数: "+e._s(e.total)+")")]),a("span",{staticStyle:{"padding-left":"18px"}},[a("a-icon",{attrs:{type:"sync"},on:{click:function(){return t.$refs.table.refresh(!0)}}})],1)]),a("a-card",[a("s-table",{ref:"table",attrs:{size:"default",rowKey:"key",columns:e.columns,data:e.loadData},scopedSlots:e._u([{key:"serial",fn:function(t,r){return a("span",{},[e._v(" "+e._s(r.id)+" ")])}},{key:"clientInfo",fn:function(t){return a("span",{},[e._v(" "+e._s(t?t.split("@")[1]:"无")+" ")])}}])})],1)],1)},s=[],n=a("c1df"),o=a.n(n),i=a("0fea"),l=a("2af9"),u={name:"RetryTaskLogMessageList",components:{STable:l["i"]},data:function(){var t=this;return{columns:[{title:"#",scopedSlots:{customRender:"serial"},width:"10%"},{title:"信息",dataIndex:"message",width:"50%"},{title:"地址",dataIndex:"clientInfo",scopedSlots:{customRender:"clientInfo"},width:"10%"},{title:"触发时间",dataIndex:"createDt",sorter:!0,customRender:function(t){return o()(t).format("YYYY-MM-DD HH:mm:ss")},width:"10%"}],queryParam:{},loadData:function(e){if(t.queryParam["groupName"])return Object(i["w"])(Object.assign(e,t.queryParam)).then((function(e){return t.total=e.total,e}))},total:0}},methods:{refreshTable:function(t){this.queryParam=t,this.$refs.table.refresh(!0)}}},d=u,c=a("2877"),f=Object(c["a"])(d,r,s,!1,null,"7ee48017",null);e["a"]=f.exports},"99f5":function(t,e,a){"use strict";a.r(e);a("ac1f"),a("5319"),a("b0c0");var r=function(){var t=this,e=t._self._c;return e("div",[t.showHeader?e("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return t.$router.replace("/retry/list")}}},[e("div")]):t._e(),null!==t.retryTaskInfo?e("a-card",{attrs:{bordered:!1}},[e("a-descriptions",{attrs:{title:"",column:t.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[t._v(" "+t._s(t.retryTaskInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"场景名称"}},[t._v(" "+t._s(t.retryTaskInfo.sceneName)+" ")]),e("a-descriptions-item",{attrs:{label:"幂等id"}},[t._v(" "+t._s(t.retryTaskInfo.idempotentId)+" ")]),e("a-descriptions-item",{attrs:{label:"唯一id"}},[t._v(" "+t._s(t.retryTaskInfo.uniqueId)+" ")]),e("a-descriptions-item",{attrs:{label:"业务编号"}},[t._v(" "+t._s(t.retryTaskInfo.bizNo)+" ")]),e("a-descriptions-item",{attrs:{label:"重试次数"}},[t._v(" "+t._s(t.retryTaskInfo.retryCount)+" ")]),e("a-descriptions-item",{attrs:{label:"重试状态 | 数据类型"}},[e("a-tag",{attrs:{color:"red"}},[t._v(" "+t._s(t.retryStatus[t.retryTaskInfo.retryStatus])+" ")]),e("a-divider",{attrs:{type:"vertical"}}),e("a-tag",{attrs:{color:t.taskType[t.retryTaskInfo.taskType].color}},[t._v(" "+t._s(t.taskType[t.retryTaskInfo.taskType].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"下次触发时间"}},[t._v(" "+t._s(t.retryTaskInfo.nextTriggerAt)+" ")]),e("a-descriptions-item",{attrs:{label:"更新时间"}},[t._v(" "+t._s(t.retryTaskInfo.updateDt)+" ")]),e("a-descriptions-item",{attrs:{label:"执行器名称",span:"3"}},[t._v(" "+t._s(t.retryTaskInfo.executorName)+" ")]),e("a-descriptions-item",{attrs:{label:"参数",span:"3"}},[t._v(" "+t._s(t.retryTaskInfo.argsStr)+" ")]),e("a-descriptions-item",{attrs:{label:"扩展参数",span:"3"}},[t._v(" "+t._s(t.retryTaskInfo.extAttrs)+" ")])],1)],1):t._e(),e("RetryTaskLogMessageList",{ref:"retryTaskLogMessageListRef"})],1)},s=[],n=(a("a9e3"),a("0fea")),o=a("339f"),i={name:"RetryTaskInfo",components:{RetryTaskLogMessageList:o["a"]},props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{retryTaskInfo:null,retryStatus:{0:"处理中",1:"处理成功",2:"最大次数",3:"暂停"},taskType:{1:{name:"重试数据",color:"#d06892"},2:{name:"回调数据",color:"#f5a22d"}}}},created:function(){var t=this.$route.query.id,e=this.$route.query.groupName;t&&e?this.getRetryTaskById(t,e):this.showHeader&&this.$router.push({path:"/404"})},methods:{getRetryTaskById:function(t,e){var a=this;Object(n["u"])(t,{groupName:e}).then((function(t){a.retryTaskInfo=t.data,a.queryParam={groupName:a.retryTaskInfo.groupName,uniqueId:a.retryTaskInfo.uniqueId},a.$refs.retryTaskLogMessageListRef.refreshTable(a.queryParam)}))}}},l=i,u=a("2877"),d=Object(u["a"])(l,r,s,!1,null,"0b3ba3ef",null);e["default"]=d.exports}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5e4dab78"],{"12b3":function(o,e){var a={sceneStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},backOffLabels:{1:{name:"延迟等级",color:"#d06892"},2:{name:"固定时间",color:"#f5a22d"},3:{name:"CRON表达式",color:"#e1f52d"},4:{name:"随机等待",color:"#a127f3"}},triggerInterval:{1:{name:"CRON表达式",color:"#d06892"},2:{name:"固定时间",color:"#f5a22d"}},notifyScene:{1:{name:"场景重试数量超过阈值",color:"#d06892"},2:{name:"场景重试失败数量超过阈值",color:"#f5a22d"},3:{name:"客户端上报失败",color:"#e1f52d"},4:{name:"客户端组件异常",color:"#a127f3"},5:{name:"任务重试数量超过阈值",color:"#f5a22d"},6:{name:"任务失败进入死信队列",color:"#f5a22d"}},routeKey:{4:{name:"轮询",color:"#8f68d2"},1:{name:"一致性Hash",color:"#d06892"},2:{name:"随机",color:"#f5a22d"},3:{name:"LRU",color:"#e1f52d"}},notifyType:{1:{name:"钉钉通知",color:"#64a6ea"},2:{name:"邮箱通知",color:"#1b7ee5"},4:{name:"飞书",color:"#087da1"}},rateLimiterStatus:{0:{name:"未启用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},notifyStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},idGenMode:{1:{name:"号段模式",color:"#1b7ee5"},2:{name:"雪花算法",color:"#087da1"}},groupStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},initScene:{0:{name:"否",color:"#9c1f1f"},1:{name:"是",color:"#f5a22d"}}};o.exports=a},"9b4b":function(o,e,a){"use strict";a.r(e);a("ac1f"),a("5319"),a("b0c0"),a("a4d3"),a("e01a");var r=function(){var o=this,e=o._self._c;return e("div",[o.showHeader?e("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return o.$router.replace("/group/list")}}},[e("div")]):o._e(),null!==o.groupInfo?e("a-card",{attrs:{bordered:!1}},[e("a-descriptions",{attrs:{title:"通用配置",column:o.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[o._v(" "+o._s(o.groupInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"状态"}},[e("a-tag",{attrs:{color:o.groupStatus[o.groupInfo.groupStatus].color}},[o._v(" "+o._s(o.groupStatus[o.groupInfo.groupStatus].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"版本"}},[o._v(" "+o._s(o.groupInfo.version)+" ")]),e("a-descriptions-item",{attrs:{label:"描述",span:"3"}},[o._v(" "+o._s(o.groupInfo.description)+" ")]),e("a-descriptions-item",{attrs:{label:"OnLine机器",span:"3"}},o._l(o.podInfo,(function(a){return e("a-tag",{key:a,attrs:{color:"blue"}},[o._v(" "+o._s(a)+" ")])})),1)],1),e("br"),e("a-descriptions",{attrs:{title:"重试配置",column:o.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"ID生成模式"}},[e("a-tag",{attrs:{color:o.idGeneratorMode[o.groupInfo.idGeneratorMode].color}},[o._v(" "+o._s(o.idGeneratorMode[o.groupInfo.idGeneratorMode].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"分区"}},[o._v(" "+o._s(o.groupInfo.groupPartition)+" ")]),e("a-descriptions-item",{attrs:{label:"初始化场景"}},[e("a-tag",{attrs:{color:o.initScene[o.groupInfo.initScene].color}},[o._v(" "+o._s(o.initScene[o.groupInfo.initScene].name)+" ")])],1)],1)],1):o._e()],1)},t=[],n=(a("a9e3"),a("0fea")),c=a("12b3"),i=a.n(c),l={name:"GroupInfo",components:{},props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{groupInfo:null,podInfo:[],initScene:i.a.initScene,groupStatus:i.a.groupStatus,idGeneratorMode:i.a.idGenMode}},created:function(){var o=this.$route.query.groupName;o?this.groupConfigDetail(o):this.showHeader&&this.$router.push({path:"/404"})},methods:{groupConfigDetail:function(o){var e=this;Object(n["o"])(o).then((function(o){e.groupInfo=o.data})),Object(n["J"])(o).then((function(o){e.podInfo=o.data}))}}},s=l,d=a("2877"),u=Object(d["a"])(s,r,t,!1,null,"4f09eb18",null);e["default"]=u.exports}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5e4dab78"],{"12b3":function(o,e){var a={sceneStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},backOffLabels:{1:{name:"延迟等级",color:"#d06892"},2:{name:"固定时间",color:"#f5a22d"},3:{name:"CRON表达式",color:"#e1f52d"},4:{name:"随机等待",color:"#a127f3"}},triggerInterval:{1:{name:"CRON表达式",color:"#d06892"},2:{name:"固定时间",color:"#f5a22d"}},notifyScene:{1:{name:"场景重试数量超过阈值",color:"#d06892"},2:{name:"场景重试失败数量超过阈值",color:"#f5a22d"},3:{name:"客户端上报失败",color:"#e1f52d"},4:{name:"客户端组件异常",color:"#a127f3"},5:{name:"任务重试数量超过阈值",color:"#f5a22d"},6:{name:"任务失败进入死信队列",color:"#f5a22d"}},routeKey:{4:{name:"轮询",color:"#8f68d2"},1:{name:"一致性Hash",color:"#d06892"},2:{name:"随机",color:"#f5a22d"},3:{name:"LRU",color:"#e1f52d"}},notifyType:{1:{name:"钉钉通知",color:"#64a6ea"},2:{name:"邮箱通知",color:"#1b7ee5"},4:{name:"飞书",color:"#087da1"}},rateLimiterStatus:{0:{name:"未启用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},notifyStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},idGenMode:{1:{name:"号段模式",color:"#1b7ee5"},2:{name:"雪花算法",color:"#087da1"}},groupStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},initScene:{0:{name:"否",color:"#9c1f1f"},1:{name:"是",color:"#f5a22d"}}};o.exports=a},"9b4b":function(o,e,a){"use strict";a.r(e);a("ac1f"),a("5319"),a("b0c0"),a("a4d3"),a("e01a");var r=function(){var o=this,e=o._self._c;return e("div",[o.showHeader?e("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return o.$router.replace("/group/list")}}},[e("div")]):o._e(),null!==o.groupInfo?e("a-card",{attrs:{bordered:!1}},[e("a-descriptions",{attrs:{title:"通用配置",column:o.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[o._v(" "+o._s(o.groupInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"状态"}},[e("a-tag",{attrs:{color:o.groupStatus[o.groupInfo.groupStatus].color}},[o._v(" "+o._s(o.groupStatus[o.groupInfo.groupStatus].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"版本"}},[o._v(" "+o._s(o.groupInfo.version)+" ")]),e("a-descriptions-item",{attrs:{label:"描述",span:"3"}},[o._v(" "+o._s(o.groupInfo.description)+" ")]),e("a-descriptions-item",{attrs:{label:"OnLine机器",span:"3"}},o._l(o.podInfo,(function(a){return e("a-tag",{key:a,attrs:{color:"blue"}},[o._v(" "+o._s(a)+" ")])})),1)],1),e("br"),e("a-descriptions",{attrs:{title:"重试配置",column:o.column,bordered:""}},[e("a-descriptions-item",{attrs:{label:"ID生成模式"}},[e("a-tag",{attrs:{color:o.idGeneratorMode[o.groupInfo.idGeneratorMode].color}},[o._v(" "+o._s(o.idGeneratorMode[o.groupInfo.idGeneratorMode].name)+" ")])],1),e("a-descriptions-item",{attrs:{label:"分区"}},[o._v(" "+o._s(o.groupInfo.groupPartition)+" ")]),e("a-descriptions-item",{attrs:{label:"初始化场景"}},[e("a-tag",{attrs:{color:o.initScene[o.groupInfo.initScene].color}},[o._v(" "+o._s(o.initScene[o.groupInfo.initScene].name)+" ")])],1)],1)],1):o._e()],1)},t=[],n=(a("a9e3"),a("0fea")),c=a("12b3"),i=a.n(c),l={name:"GroupInfo",components:{},props:{showHeader:{type:Boolean,default:!0},column:{type:Number,default:3}},data:function(){return{groupInfo:null,podInfo:[],initScene:i.a.initScene,groupStatus:i.a.groupStatus,idGeneratorMode:i.a.idGenMode}},created:function(){var o=this.$route.query.groupName;o?this.groupConfigDetail(o):this.showHeader&&this.$router.push({path:"/404"})},methods:{groupConfigDetail:function(o){var e=this;Object(n["o"])(o).then((function(o){e.groupInfo=o.data})),Object(n["I"])(o).then((function(o){e.podInfo=o.data}))}}},s=l,d=a("2877"),u=Object(d["a"])(s,r,t,!1,null,"4f09eb18",null);e["default"]=u.exports}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-74bac939"],{"9141d":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t._self._c;return e("a-card",{attrs:{bordered:!1}},[e("div",{staticClass:"table-page-search-wrapper"},[e("a-form",{attrs:{layout:"inline"}},[e("a-row",{attrs:{gutter:48}},[[e("a-col",{attrs:{md:8,sm:24}},[e("a-form-item",{attrs:{label:"组名称"}},[e("a-input",{attrs:{placeholder:"请输入组名称",allowClear:""},model:{value:t.queryParam.groupName,callback:function(e){t.$set(t.queryParam,"groupName",e)},expression:"queryParam.groupName"}})],1)],1)],e("a-col",{attrs:{md:t.advanced?24:8,sm:24}},[e("span",{staticClass:"table-page-search-submitButtons",style:t.advanced&&{float:"right",overflow:"hidden"}||{}},[e("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.$refs.table.refresh(!0)}}},[t._v("查询")]),e("a-button",{staticStyle:{"margin-left":"8px"},on:{click:function(){return t.queryParam={}}}},[t._v("重置")])],1)])],2)],1)],1),e("s-table",{ref:"table",attrs:{size:"default",rowKey:"key",columns:t.columns,data:t.loadData,alert:t.options.alert,rowSelection:t.options.rowSelection,scroll:{x:1600}},scopedSlots:t._u([{key:"serial",fn:function(a,o,n){return e("span",{},[t._v(" "+t._s(n+1)+" ")])}},{key:"contextPath",fn:function(a,o){return e("span",{},[1===o.nodeType?e("div",[t._v(" Path: "),e("a-tag",{attrs:{color:"#108ee9"}},[t._v(" "+t._s(a)+" ")])],1):e("div",[t._v(" Bucket: "),e("a-popover",{attrs:{placement:"topLeft"}},[e("template",{slot:"content"},t._l(o.consumerBuckets,(function(a){return e("a-tag",{key:a,staticStyle:{"margin-bottom":"16px"},attrs:{color:"pink"}},[t._v(" "+t._s(a)+" ")])})),1),e("template",{slot:"title"},[e("span",[t._v("Bucket列表")])]),t._l(5,(function(a){return e("a-tag",{key:a,staticStyle:{"margin-bottom":"16px"},attrs:{color:"pink"}},[t._v(" "+t._s(o.consumerBuckets[a-1])+" ")])})),o.consumerBuckets.length>5?e("a-tag",{staticStyle:{"margin-bottom":"16px"},attrs:{color:"pink"}},[t._v(" ... ")]):t._e()],2)],1)])}}])})],1)},n=[],r=a("c1df"),s=a.n(r),l=a("0fea"),c=a("2af9"),i={name:"PodList",components:{STable:c["k"]},data:function(){var t=this;return{advanced:!1,queryParam:{},columns:[{title:"#",scopedSlots:{customRender:"serial"},width:"6%"},{title:"类型",dataIndex:"nodeType",customRender:function(e){return t.nodeType[e]},width:"8%"},{title:"组名称",dataIndex:"groupName",width:"10%"},{title:"PodId",dataIndex:"hostId",width:"18%"},{title:"IP",dataIndex:"hostIp",width:"12%"},{title:"Port",dataIndex:"hostPort",width:"8%"},{title:"路径/组",dataIndex:"contextPath",scopedSlots:{customRender:"contextPath"},ellipsis:!0,width:"22%"},{title:"更新时间",dataIndex:"updateDt",sorter:!0,customRender:function(t){return s()(t).format("YYYY-MM-DD HH:mm:ss")}}],loadData:function(e){return Object(l["K"])(Object.assign(e,t.queryParam)).then((function(t){return t}))},selectedRowKeys:[],selectedRows:[],options:{alert:{show:!0,clear:function(){t.selectedRowKeys=[]}},rowSelection:{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}},nodeType:{1:"客户端",2:"服务端"}}},methods:{}},d=i,u=a("2877"),p=Object(u["a"])(d,o,n,!1,null,"38a41799",null);e["default"]=p.exports}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-74bac939"],{"9141d":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t._self._c;return e("a-card",{attrs:{bordered:!1}},[e("div",{staticClass:"table-page-search-wrapper"},[e("a-form",{attrs:{layout:"inline"}},[e("a-row",{attrs:{gutter:48}},[[e("a-col",{attrs:{md:8,sm:24}},[e("a-form-item",{attrs:{label:"组名称"}},[e("a-input",{attrs:{placeholder:"请输入组名称",allowClear:""},model:{value:t.queryParam.groupName,callback:function(e){t.$set(t.queryParam,"groupName",e)},expression:"queryParam.groupName"}})],1)],1)],e("a-col",{attrs:{md:t.advanced?24:8,sm:24}},[e("span",{staticClass:"table-page-search-submitButtons",style:t.advanced&&{float:"right",overflow:"hidden"}||{}},[e("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.$refs.table.refresh(!0)}}},[t._v("查询")]),e("a-button",{staticStyle:{"margin-left":"8px"},on:{click:function(){return t.queryParam={}}}},[t._v("重置")])],1)])],2)],1)],1),e("s-table",{ref:"table",attrs:{size:"default",rowKey:"key",columns:t.columns,data:t.loadData,alert:t.options.alert,rowSelection:t.options.rowSelection,scroll:{x:1600}},scopedSlots:t._u([{key:"serial",fn:function(a,o,n){return e("span",{},[t._v(" "+t._s(n+1)+" ")])}},{key:"contextPath",fn:function(a,o){return e("span",{},[1===o.nodeType?e("div",[t._v(" Path: "),e("a-tag",{attrs:{color:"#108ee9"}},[t._v(" "+t._s(a)+" ")])],1):e("div",[t._v(" Bucket: "),e("a-popover",{attrs:{placement:"topLeft"}},[e("template",{slot:"content"},t._l(o.consumerBuckets,(function(a){return e("a-tag",{key:a,staticStyle:{"margin-bottom":"16px"},attrs:{color:"pink"}},[t._v(" "+t._s(a)+" ")])})),1),e("template",{slot:"title"},[e("span",[t._v("Bucket列表")])]),t._l(5,(function(a){return e("a-tag",{key:a,staticStyle:{"margin-bottom":"16px"},attrs:{color:"pink"}},[t._v(" "+t._s(o.consumerBuckets[a-1])+" ")])})),o.consumerBuckets.length>5?e("a-tag",{staticStyle:{"margin-bottom":"16px"},attrs:{color:"pink"}},[t._v(" ... ")]):t._e()],2)],1)])}}])})],1)},n=[],r=a("c1df"),s=a.n(r),l=a("0fea"),c=a("2af9"),i={name:"PodList",components:{STable:c["i"]},data:function(){var t=this;return{advanced:!1,queryParam:{},columns:[{title:"#",scopedSlots:{customRender:"serial"},width:"6%"},{title:"类型",dataIndex:"nodeType",customRender:function(e){return t.nodeType[e]},width:"8%"},{title:"组名称",dataIndex:"groupName",width:"10%"},{title:"PodId",dataIndex:"hostId",width:"18%"},{title:"IP",dataIndex:"hostIp",width:"12%"},{title:"Port",dataIndex:"hostPort",width:"8%"},{title:"路径/组",dataIndex:"contextPath",scopedSlots:{customRender:"contextPath"},ellipsis:!0,width:"22%"},{title:"更新时间",dataIndex:"updateDt",sorter:!0,customRender:function(t){return s()(t).format("YYYY-MM-DD HH:mm:ss")}}],loadData:function(e){return Object(l["J"])(Object.assign(e,t.queryParam)).then((function(t){return t}))},selectedRowKeys:[],selectedRows:[],options:{alert:{show:!0,clear:function(){t.selectedRowKeys=[]}},rowSelection:{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}},nodeType:{1:"客户端",2:"服务端"}}},methods:{}},d=i,u=a("2877"),p=Object(u["a"])(d,o,n,!1,null,"38a41799",null);e["default"]=p.exports}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-zh-CN-dashboard-analysis"],{"5dd5":function(a,s,d){"use strict";d.r(s),s["default"]={"dashboard.analysis.test":"工专路 {no} 号店","dashboard.analysis.introduce":"指标说明","dashboard.analysis.total-sales":"重试任务","dashboard.analysis.day-sales":"日均任务","dashboard.analysis.job_success":"成功","dashboard.analysis.job_fail":"失败","dashboard.analysis.visits":"定时任务","dashboard.analysis.visits-trend":"访问量趋势","dashboard.analysis.visits-ranking":"门店访问量排名","dashboard.analysis.day-visits":"日访问量","dashboard.analysis.week":"周同比","dashboard.analysis.day":"日同比","dashboard.analysis.payments":"支付笔数","dashboard.analysis.conversion-rate":"转化率","dashboard.analysis.operational-effect":"运营活动效果","dashboard.analysis.sales-trend":"销售趋势","dashboard.analysis.sales-ranking":"任务量排名","dashboard.analysis.all-day":"今日","dashboard.analysis.all-week":"最近一周","dashboard.analysis.all-month":"最近一月","dashboard.analysis.all-year":"全年","dashboard.analysis.search-users":"搜索用户数","dashboard.analysis.per-capita-search":"人均搜索次数","dashboard.analysis.online-top-search":"任务列表","dashboard.analysis.the-proportion-of-sales":"成功比例图","dashboard.analysis.dropdown-option-one":"重试","dashboard.analysis.dropdown-option-two":"定时","dashboard.analysis.channel.all":"全部任务","dashboard.analysis.channel.online":"重试","dashboard.analysis.channel.stores":"定时","dashboard.analysis.sales":"重试任务","dashboard.analysis.job.sales":"定时任务","dashboard.analysis.traffic":"客流量","dashboard.analysis.table.rank":"命名空间","dashboard.analysis.table.search-keyword":"组名称","dashboard.analysis.table.users":"运行中任务数","dashboard.analysis.table.weekly-range":"总任务数"}}}]);
|
@ -1 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-zh-CN-dashboard-analysis"],{"5dd5":function(a,s,d){"use strict";d.r(s),s["default"]={"dashboard.analysis.test":"工专路 {no} 号店","dashboard.analysis.introduce":"指标说明","dashboard.analysis.total-sales":"总任务量","dashboard.analysis.day-sales":"日均任务","dashboard.analysis.visits":"访问量","dashboard.analysis.visits-trend":"访问量趋势","dashboard.analysis.visits-ranking":"门店访问量排名","dashboard.analysis.day-visits":"日访问量","dashboard.analysis.week":"周同比","dashboard.analysis.day":"日同比","dashboard.analysis.payments":"支付笔数","dashboard.analysis.conversion-rate":"转化率","dashboard.analysis.operational-effect":"运营活动效果","dashboard.analysis.sales-trend":"销售趋势","dashboard.analysis.sales-ranking":"任务量排名","dashboard.analysis.all-year":"全年","dashboard.analysis.all-month":"本月","dashboard.analysis.all-week":"本周","dashboard.analysis.all-day":"今日","dashboard.analysis.search-users":"搜索用户数","dashboard.analysis.per-capita-search":"人均搜索次数","dashboard.analysis.online-top-search":"线上热门搜索","dashboard.analysis.the-proportion-of-sales":"销售额类别占比","dashboard.analysis.dropdown-option-one":"操作一","dashboard.analysis.dropdown-option-two":"操作二","dashboard.analysis.channel.all":"全部渠道","dashboard.analysis.channel.online":"线上","dashboard.analysis.channel.stores":"门店","dashboard.analysis.sales":"调度","dashboard.analysis.traffic":"客流量","dashboard.analysis.table.rank":"排名","dashboard.analysis.table.search-keyword":"搜索关键词","dashboard.analysis.table.users":"用户数","dashboard.analysis.table.weekly-range":"周涨幅"}}}]);
|
@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-zh-CN-dashboard","lang-zh-CN-dashboard-analysis"],{"5dd5":function(a,s,d){"use strict";d.r(s),s["default"]={"dashboard.analysis.test":"工专路 {no} 号店","dashboard.analysis.introduce":"指标说明","dashboard.analysis.total-sales":"重试任务","dashboard.analysis.day-sales":"日均任务","dashboard.analysis.job_success":"成功","dashboard.analysis.job_fail":"失败","dashboard.analysis.visits":"定时任务","dashboard.analysis.visits-trend":"访问量趋势","dashboard.analysis.visits-ranking":"门店访问量排名","dashboard.analysis.day-visits":"日访问量","dashboard.analysis.week":"周同比","dashboard.analysis.day":"日同比","dashboard.analysis.payments":"支付笔数","dashboard.analysis.conversion-rate":"转化率","dashboard.analysis.operational-effect":"运营活动效果","dashboard.analysis.sales-trend":"销售趋势","dashboard.analysis.sales-ranking":"任务量排名","dashboard.analysis.all-day":"今日","dashboard.analysis.all-week":"最近一周","dashboard.analysis.all-month":"最近一月","dashboard.analysis.all-year":"全年","dashboard.analysis.search-users":"搜索用户数","dashboard.analysis.per-capita-search":"人均搜索次数","dashboard.analysis.online-top-search":"任务列表","dashboard.analysis.the-proportion-of-sales":"成功比例图","dashboard.analysis.dropdown-option-one":"重试","dashboard.analysis.dropdown-option-two":"定时","dashboard.analysis.channel.all":"全部任务","dashboard.analysis.channel.online":"重试","dashboard.analysis.channel.stores":"定时","dashboard.analysis.sales":"重试任务","dashboard.analysis.job.sales":"定时任务","dashboard.analysis.traffic":"客流量","dashboard.analysis.table.rank":"命名空间","dashboard.analysis.table.search-keyword":"组名称","dashboard.analysis.table.users":"运行中任务数","dashboard.analysis.table.weekly-range":"总任务数"}},dec6:function(a,s,d){"use strict";d.r(s);var n=d("5530"),o=d("5dd5");s["default"]=Object(n["a"])({},o["default"])}}]);
|
@ -1 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["lang-zh-CN-dashboard","lang-zh-CN-dashboard-analysis"],{"5dd5":function(a,s,d){"use strict";d.r(s),s["default"]={"dashboard.analysis.test":"工专路 {no} 号店","dashboard.analysis.introduce":"指标说明","dashboard.analysis.total-sales":"总任务量","dashboard.analysis.day-sales":"日均任务","dashboard.analysis.visits":"访问量","dashboard.analysis.visits-trend":"访问量趋势","dashboard.analysis.visits-ranking":"门店访问量排名","dashboard.analysis.day-visits":"日访问量","dashboard.analysis.week":"周同比","dashboard.analysis.day":"日同比","dashboard.analysis.payments":"支付笔数","dashboard.analysis.conversion-rate":"转化率","dashboard.analysis.operational-effect":"运营活动效果","dashboard.analysis.sales-trend":"销售趋势","dashboard.analysis.sales-ranking":"任务量排名","dashboard.analysis.all-year":"全年","dashboard.analysis.all-month":"本月","dashboard.analysis.all-week":"本周","dashboard.analysis.all-day":"今日","dashboard.analysis.search-users":"搜索用户数","dashboard.analysis.per-capita-search":"人均搜索次数","dashboard.analysis.online-top-search":"线上热门搜索","dashboard.analysis.the-proportion-of-sales":"销售额类别占比","dashboard.analysis.dropdown-option-one":"操作一","dashboard.analysis.dropdown-option-two":"操作二","dashboard.analysis.channel.all":"全部渠道","dashboard.analysis.channel.online":"线上","dashboard.analysis.channel.stores":"门店","dashboard.analysis.sales":"调度","dashboard.analysis.traffic":"客流量","dashboard.analysis.table.rank":"排名","dashboard.analysis.table.search-keyword":"搜索关键词","dashboard.analysis.table.users":"用户数","dashboard.analysis.table.weekly-range":"周涨幅"}},dec6:function(a,s,d){"use strict";d.r(s);var n=d("5530"),o=d("5dd5");s["default"]=Object(n["a"])({},o["default"])}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,15 +1,13 @@
|
||||
package com.aizuda.easy.retry.server.web.controller;
|
||||
|
||||
import com.aizuda.easy.retry.server.common.cache.CacheConsumerGroup;
|
||||
import com.aizuda.easy.retry.server.common.dto.DistributeInstance;
|
||||
import com.aizuda.easy.retry.server.web.annotation.LoginRequired;
|
||||
import com.aizuda.easy.retry.server.web.model.base.BaseQueryVO;
|
||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||
import com.aizuda.easy.retry.server.web.model.request.ServerNodeQueryVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.ActivePodQuantityResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DispatchQuantityResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.SceneQuantityRankResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.annotation.LoginRequired;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardCardResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardRetryLineResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.ServerNodeResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.TaskQuantityResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.service.DashBoardService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -21,7 +19,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 看板接口
|
||||
* 仪表盘接口
|
||||
*
|
||||
* @author: www.byteblogs.com
|
||||
* @date : 2022-04-22 20:17
|
||||
@ -34,42 +32,31 @@ public class DashBoardController {
|
||||
private DashBoardService dashBoardService;
|
||||
|
||||
@LoginRequired
|
||||
@GetMapping("/task/count")
|
||||
public TaskQuantityResponseVO countTask() {
|
||||
return dashBoardService.countTask();
|
||||
@GetMapping("/task-retry-job")
|
||||
public DashboardCardResponseVO taskRetryJob() {
|
||||
return dashBoardService.taskRetryJob();
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@GetMapping("/dispatch/count")
|
||||
public DispatchQuantityResponseVO countDispatch() {
|
||||
return dashBoardService.countDispatch();
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@GetMapping("/active-pod/count")
|
||||
public ActivePodQuantityResponseVO countActivePod() {
|
||||
return dashBoardService.countActivePod();
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@GetMapping("/scene/rank")
|
||||
public List<SceneQuantityRankResponseVO> rankSceneQuantity(@RequestParam(value = "groupName", required = false)
|
||||
String groupName,
|
||||
@RequestParam(value = "type") String type,
|
||||
@RequestParam(value = "startTime", required = false) String startTime,
|
||||
@RequestParam(value = "endTime", required = false) String endTime) {
|
||||
return dashBoardService.rankSceneQuantity(groupName, type, startTime, endTime);
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@GetMapping("/dispatch/line")
|
||||
public List<DispatchQuantityResponseVO> lineDispatchQuantity(@RequestParam(value = "groupName", required = false)
|
||||
String groupName,
|
||||
@RequestParam(value = "type") String type,
|
||||
@RequestParam(value = "startTime", required = false) String startTime,
|
||||
@RequestParam(value = "endTime", required = false) String endTime
|
||||
@GetMapping("/retry/line")
|
||||
public DashboardRetryLineResponseVO retryLineList(BaseQueryVO baseQueryVO,
|
||||
@RequestParam(value = "groupName", required = false) String groupName,
|
||||
@RequestParam(value = "type", required = false, defaultValue = "WEEK") String type,
|
||||
@RequestParam(value = "startTime", required = false) String startTime,
|
||||
@RequestParam(value = "endTime", required = false) String endTime
|
||||
) {
|
||||
return dashBoardService.lineDispatchQuantity(groupName, type, startTime, endTime);
|
||||
return dashBoardService.retryLineList(baseQueryVO, groupName, type, startTime, endTime);
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@GetMapping("/job/line")
|
||||
public DashboardRetryLineResponseVO jobLineList(BaseQueryVO baseQueryVO,
|
||||
@RequestParam(value = "groupName", required = false) String groupName,
|
||||
@RequestParam(value = "type", required = false, defaultValue = "WEEK") String type,
|
||||
@RequestParam(value = "startTime", required = false) String startTime,
|
||||
@RequestParam(value = "endTime", required = false) String endTime
|
||||
) {
|
||||
return dashBoardService.jobLineList(baseQueryVO, groupName, type, startTime, endTime);
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
|
@ -92,7 +92,8 @@ public class GroupConfigController {
|
||||
public List<Integer> getTablePartitionList() {
|
||||
// https://gitee.com/aizuda/easy-retry/issues/I8DAMH
|
||||
List<String> tableList = jdbcTemplate.queryForList("SHOW TABLES LIKE 'retry_task_%'", String.class);
|
||||
return tableList.stream().map(ReUtil::getFirstNumber).filter(i -> !Objects.isNull(i) && i <= systemProperties.getTotalPartition()).distinct().collect(Collectors.toList());
|
||||
return tableList.stream().map(ReUtil::getFirstNumber).filter(i ->
|
||||
!Objects.isNull(i) && i <= systemProperties.getTotalPartition()).distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,18 +2,14 @@ package com.aizuda.easy.retry.server.web.model.enums;
|
||||
|
||||
import com.aizuda.easy.retry.server.web.model.response.DispatchQuantityResponseVO;
|
||||
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author: byteblogs
|
||||
@ -24,126 +20,61 @@ public enum DateTypeEnum {
|
||||
* 天
|
||||
*/
|
||||
DAY(dispatchQuantityResponseVOList -> {
|
||||
Map<String, DispatchQuantityResponseVO> dispatchQuantityResponseVOMap = dispatchQuantityResponseVOList.stream().collect(Collectors.toMap(DispatchQuantityResponseVO::getCreateDt, i -> i));
|
||||
for (int i = 0; i < 24; i++) {
|
||||
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("HH");
|
||||
String format = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusHours(i).format(dateTimeFormatter);
|
||||
DispatchQuantityResponseVO dispatchQuantityResponseVO = dispatchQuantityResponseVOMap.get(format);
|
||||
if (Objects.isNull(dispatchQuantityResponseVO)) {
|
||||
dispatchQuantityResponseVO = new DispatchQuantityResponseVO();
|
||||
dispatchQuantityResponseVO.setFail(0L);
|
||||
dispatchQuantityResponseVO.setSuccess(0L);
|
||||
dispatchQuantityResponseVO.setCreateDt(format);
|
||||
dispatchQuantityResponseVOList.add(dispatchQuantityResponseVO);
|
||||
}
|
||||
}
|
||||
}, (startTime) -> {
|
||||
return LocalDateTime.of(startTime.toLocalDate(), LocalTime.MIN);
|
||||
return Objects.isNull(startTime) ?
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MIN.withNano(0)) :
|
||||
LocalDateTime.of(startTime.toLocalDate(), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX);
|
||||
return Objects.isNull(endTime) ?
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MAX.withNano(0)) :
|
||||
LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX.withNano(0));
|
||||
}),
|
||||
/**
|
||||
* 星期
|
||||
* 周
|
||||
*/
|
||||
WEEK(dispatchQuantityResponseVOList -> {
|
||||
Map<String, DispatchQuantityResponseVO> dispatchQuantityResponseVOMap = dispatchQuantityResponseVOList.stream().collect(Collectors.toMap(DispatchQuantityResponseVO::getCreateDt, i -> i));
|
||||
for (int i = 0; i < 7; i++) {
|
||||
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String format = LocalDateTime.of(LocalDate.now().with(DayOfWeek.of(1)), LocalTime.MIN).plusDays(i).format(dateTimeFormatter);
|
||||
DispatchQuantityResponseVO dispatchQuantityResponseVO = dispatchQuantityResponseVOMap.get(format);
|
||||
if (Objects.isNull(dispatchQuantityResponseVO)) {
|
||||
dispatchQuantityResponseVO = new DispatchQuantityResponseVO();
|
||||
dispatchQuantityResponseVO.setFail(0L);
|
||||
dispatchQuantityResponseVO.setSuccess(0L);
|
||||
dispatchQuantityResponseVO.setCreateDt(format);
|
||||
dispatchQuantityResponseVOList.add(dispatchQuantityResponseVO);
|
||||
}
|
||||
}
|
||||
}, (startTime) -> {
|
||||
return LocalDateTime.of(startTime.toLocalDate().with(DayOfWeek.of(1)), LocalTime.MIN);
|
||||
return Objects.isNull(startTime) ?
|
||||
LocalDateTime.of(LocalDate.now().minusDays(7), LocalTime.MIN.withNano(0)) :
|
||||
LocalDateTime.of(startTime.toLocalDate().minusDays(7), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return LocalDateTime.of(endTime.toLocalDate().with(DayOfWeek.of(7)), LocalTime.MAX);
|
||||
return Objects.isNull(endTime) ?
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MAX.withNano(0)) :
|
||||
LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX.withNano(0));
|
||||
}),
|
||||
|
||||
/**
|
||||
* 月
|
||||
*/
|
||||
MONTH(dispatchQuantityResponseVOList -> {
|
||||
Map<String, DispatchQuantityResponseVO> dispatchQuantityResponseVOMap = dispatchQuantityResponseVOList.stream().collect(Collectors.toMap(DispatchQuantityResponseVO::getCreateDt, i -> i));
|
||||
int curMonth = LocalDateTime.now().with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth();
|
||||
for (int i = 0; i < curMonth; i++) {
|
||||
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String format = LocalDateTime.of(LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()), LocalTime.MIN).plusDays(i).format(dateTimeFormatter);
|
||||
DispatchQuantityResponseVO dispatchQuantityResponseVO = dispatchQuantityResponseVOMap.get(format);
|
||||
if (Objects.isNull(dispatchQuantityResponseVO)) {
|
||||
dispatchQuantityResponseVO = new DispatchQuantityResponseVO();
|
||||
dispatchQuantityResponseVO.setFail(0L);
|
||||
dispatchQuantityResponseVO.setSuccess(0L);
|
||||
dispatchQuantityResponseVO.setCreateDt(format);
|
||||
dispatchQuantityResponseVOList.add(dispatchQuantityResponseVO);
|
||||
}
|
||||
}
|
||||
}, (startTime) -> {
|
||||
return LocalDateTime.of(startTime.toLocalDate().with(TemporalAdjusters.firstDayOfMonth()), LocalTime.MIN);
|
||||
return Objects.isNull(startTime) ?
|
||||
LocalDateTime.of(LocalDate.now().minusMonths(1), LocalTime.MIN.withNano(0)) :
|
||||
LocalDateTime.of(startTime.toLocalDate().minusMonths(1), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return LocalDateTime.of(endTime.toLocalDate().with(TemporalAdjusters.lastDayOfMonth()), LocalTime.MAX);
|
||||
return Objects.isNull(endTime) ?
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MAX.withNano(0)) :
|
||||
LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX.withNano(0));
|
||||
}),
|
||||
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
YEAR(dispatchQuantityResponseVOList -> {
|
||||
Map<String, DispatchQuantityResponseVO> dispatchQuantityResponseVOMap = dispatchQuantityResponseVOList.stream().collect(Collectors.toMap(DispatchQuantityResponseVO::getCreateDt, i -> i));
|
||||
for (int i = 0; i < 12; i++) {
|
||||
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
|
||||
String format = LocalDateTime.of(LocalDate.now().with(TemporalAdjusters.firstDayOfYear()), LocalTime.MIN).plusMonths(i).format(dateTimeFormatter);
|
||||
DispatchQuantityResponseVO dispatchQuantityResponseVO = dispatchQuantityResponseVOMap.get(format);
|
||||
if (Objects.isNull(dispatchQuantityResponseVO)) {
|
||||
dispatchQuantityResponseVO = new DispatchQuantityResponseVO();
|
||||
dispatchQuantityResponseVO.setFail(0L);
|
||||
dispatchQuantityResponseVO.setSuccess(0L);
|
||||
dispatchQuantityResponseVO.setCreateDt(format);
|
||||
dispatchQuantityResponseVOList.add(dispatchQuantityResponseVO);
|
||||
}
|
||||
}
|
||||
}, (startTime) -> {
|
||||
return LocalDateTime.of(startTime.toLocalDate().with(TemporalAdjusters.firstDayOfYear()), LocalTime.MIN);
|
||||
return LocalDateTime.of(LocalDate.now().with(TemporalAdjusters.firstDayOfYear()), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return LocalDateTime.of(endTime.toLocalDate().with(TemporalAdjusters.lastDayOfYear()), LocalTime.MAX);
|
||||
return LocalDateTime.of(LocalDate.now().with(TemporalAdjusters.lastDayOfYear()), LocalTime.MAX.withNano(0));
|
||||
}),
|
||||
|
||||
/**
|
||||
* 其他类型
|
||||
*/
|
||||
OTHERS(dispatchQuantityResponseVOList -> {
|
||||
Map<String, DispatchQuantityResponseVO> dispatchQuantityResponseVOMap = dispatchQuantityResponseVOList.stream().collect(Collectors.toMap(DispatchQuantityResponseVO::getCreateDt, i -> i));
|
||||
for (int i = 0; i < 24; i++) {
|
||||
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd 00:00:00");
|
||||
String format = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusHours(i).format(dateTimeFormatter);
|
||||
DispatchQuantityResponseVO dispatchQuantityResponseVO = dispatchQuantityResponseVOMap.get(format);
|
||||
if (Objects.isNull(dispatchQuantityResponseVO)) {
|
||||
dispatchQuantityResponseVO = new DispatchQuantityResponseVO();
|
||||
dispatchQuantityResponseVO.setFail(0L);
|
||||
dispatchQuantityResponseVO.setSuccess(0L);
|
||||
dispatchQuantityResponseVO.setCreateDt(format);
|
||||
dispatchQuantityResponseVOList.add(dispatchQuantityResponseVO);
|
||||
}
|
||||
}
|
||||
}, (startTime) -> {
|
||||
if (Objects.isNull(startTime)) {
|
||||
return LocalDateTime.now();
|
||||
}
|
||||
return startTime;
|
||||
return LocalDateTime.of(startTime.toLocalDate(), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
if (Objects.isNull(endTime)) {
|
||||
return LocalDateTime.now();
|
||||
}
|
||||
return endTime;
|
||||
return LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX.withNano(0));
|
||||
});
|
||||
|
||||
private Consumer<List<DispatchQuantityResponseVO>> consumer;
|
||||
@ -154,7 +85,6 @@ public enum DateTypeEnum {
|
||||
this.consumer = listConsumer;
|
||||
this.startTime = startTime;
|
||||
this.endTime = endTime;
|
||||
|
||||
}
|
||||
|
||||
public Function<LocalDateTime, LocalDateTime> getStartTime() {
|
||||
|
@ -0,0 +1,101 @@
|
||||
package com.aizuda.easy.retry.server.web.model.enums;
|
||||
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardRetryLinkeResponseVO;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @author: byteblogs
|
||||
* @date: 2020/1/19 20:36
|
||||
*/
|
||||
public enum RetryDateTypeEnum {
|
||||
/**
|
||||
* 天
|
||||
*/
|
||||
DAY(dashboardRetryLinkeResponseVOList -> {
|
||||
}, (startTime) -> {
|
||||
return Objects.isNull(startTime) ?
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MIN.withNano(0)) :
|
||||
LocalDateTime.of(startTime.toLocalDate(), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return Objects.isNull(endTime) ?
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MAX.withNano(0)) :
|
||||
LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX.withNano(0));
|
||||
}),
|
||||
/**
|
||||
* 周
|
||||
*/
|
||||
WEEK(dashboardRetryLinkeResponseVOList -> {
|
||||
}, (startTime) -> {
|
||||
return Objects.isNull(startTime) ?
|
||||
LocalDateTime.of(LocalDate.now().minusDays(7), LocalTime.MIN.withNano(0)) :
|
||||
LocalDateTime.of(startTime.toLocalDate().minusDays(7), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return Objects.isNull(endTime) ?
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MAX.withNano(0)) :
|
||||
LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX.withNano(0));
|
||||
}),
|
||||
|
||||
/**
|
||||
* 月
|
||||
*/
|
||||
MONTH(dashboardRetryLinkeResponseVOList -> {
|
||||
}, (startTime) -> {
|
||||
return Objects.isNull(startTime) ?
|
||||
LocalDateTime.of(LocalDate.now().minusMonths(1), LocalTime.MIN.withNano(0)) :
|
||||
LocalDateTime.of(startTime.toLocalDate().minusMonths(1), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return Objects.isNull(endTime) ?
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MAX.withNano(0)) :
|
||||
LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX.withNano(0));
|
||||
}),
|
||||
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
YEAR(dashboardRetryLinkeResponseVOList -> {
|
||||
}, (startTime) -> {
|
||||
return LocalDateTime.of(LocalDate.now().with(TemporalAdjusters.firstDayOfYear()), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return LocalDateTime.of(LocalDate.now().with(TemporalAdjusters.lastDayOfYear()), LocalTime.MAX.withNano(0));
|
||||
}),
|
||||
|
||||
/**
|
||||
* 其他类型
|
||||
*/
|
||||
OTHERS(dashboardRetryLinkeResponseVOList -> {
|
||||
}, (startTime) -> {
|
||||
return LocalDateTime.of(startTime.toLocalDate(), LocalTime.MIN.withNano(0));
|
||||
}, (endTime) -> {
|
||||
return LocalDateTime.of(endTime.toLocalDate(), LocalTime.MAX.withNano(0));
|
||||
});
|
||||
|
||||
private Consumer<List<DashboardRetryLinkeResponseVO>> consumer;
|
||||
private Function<LocalDateTime, LocalDateTime> startTime;
|
||||
private Function<LocalDateTime, LocalDateTime> endTime;
|
||||
|
||||
RetryDateTypeEnum(Consumer<List<DashboardRetryLinkeResponseVO>> listConsumer, Function<LocalDateTime, LocalDateTime> startTime, Function<LocalDateTime, LocalDateTime> endTime) {
|
||||
this.consumer = listConsumer;
|
||||
this.startTime = startTime;
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public Function<LocalDateTime, LocalDateTime> getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public Function<LocalDateTime, LocalDateTime> getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public Consumer<List<DashboardRetryLinkeResponseVO>> getConsumer() {
|
||||
return consumer;
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.aizuda.easy.retry.server.web.model.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wodeyangzipingpingwuqi
|
||||
* @date : 2023-11-29
|
||||
*/
|
||||
@Data
|
||||
public class DashboardCardResponseVO {
|
||||
|
||||
/**
|
||||
* 定时任务
|
||||
*/
|
||||
private JobTask jobTask;
|
||||
|
||||
/**
|
||||
* 重试任务
|
||||
*/
|
||||
private RetryTask retryTask;
|
||||
|
||||
/**
|
||||
* 重试任务折线图
|
||||
*/
|
||||
private List<RetryTaskBar> retryTaskBarList;
|
||||
|
||||
/**
|
||||
* 在线服务
|
||||
*/
|
||||
private OnLineService onLineService = new OnLineService();
|
||||
|
||||
@Data
|
||||
public static class OnLineService {
|
||||
private Long total;
|
||||
|
||||
private Long clientTotal;
|
||||
|
||||
private Long serverTotal;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RetryTask {
|
||||
|
||||
// 总数
|
||||
private Long totalNum;
|
||||
|
||||
// 运行中
|
||||
private Long runningNum;
|
||||
|
||||
// 完成
|
||||
private Long finishNum;
|
||||
|
||||
// 最大重试次数
|
||||
private Long maxCountNum;
|
||||
|
||||
// 暂停重试
|
||||
private Long suspendNum;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class JobTask {
|
||||
//成功
|
||||
private Integer successNum;
|
||||
//失败
|
||||
private Integer failNum;
|
||||
// 总数
|
||||
private Integer totalNum;
|
||||
// 成功率
|
||||
private BigDecimal successRate;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RetryTaskBar {
|
||||
/**
|
||||
* 时间x
|
||||
*/
|
||||
private String x;
|
||||
|
||||
/**
|
||||
* 总数y
|
||||
*/
|
||||
private Long y;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.aizuda.easy.retry.server.web.model.response;
|
||||
|
||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
||||
* @date : 2022-04-22 20:27
|
||||
*/
|
||||
@Data
|
||||
public class DashboardRetryLineResponseVO {
|
||||
|
||||
/**
|
||||
* 任务列表
|
||||
*/
|
||||
private PageResult<List<Task>> taskList;
|
||||
|
||||
/**
|
||||
* 排名列表
|
||||
*/
|
||||
private List<Rank> rankList;
|
||||
|
||||
/**
|
||||
* 折线图列表
|
||||
*/
|
||||
private List<DispatchQuantityResponseVO> dispatchQuantityResponseVOList;
|
||||
|
||||
private List<DashboardRetryLinkeResponseVO> retryLinkeResponseVOList;
|
||||
|
||||
@Data
|
||||
public static class Task {
|
||||
private String groupName;
|
||||
|
||||
private Integer run;
|
||||
|
||||
private Integer total;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Rank {
|
||||
private String name;
|
||||
|
||||
private String total;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.aizuda.easy.retry.server.web.model.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author: wodeyangzipingpingwuqi
|
||||
* @date : 2023-11-30
|
||||
*/
|
||||
@Data
|
||||
public class DashboardRetryLinkeResponseVO {
|
||||
|
||||
private String createDt;
|
||||
|
||||
private Long total;
|
||||
|
||||
private Long successNum;
|
||||
|
||||
private Long runningNum;
|
||||
|
||||
private Long maxCountNum;
|
||||
|
||||
private Long suspendNum;
|
||||
}
|
@ -2,7 +2,6 @@ package com.aizuda.easy.retry.server.web.model.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
||||
@ -11,14 +10,19 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
public class DispatchQuantityResponseVO {
|
||||
|
||||
private String createDt;
|
||||
|
||||
private Long total;
|
||||
|
||||
private BigDecimal successPercent = BigDecimal.ZERO;
|
||||
|
||||
private Long success;
|
||||
private Long successNum;
|
||||
|
||||
private Long fail;
|
||||
|
||||
private String createDt;
|
||||
private Long totalNum;
|
||||
|
||||
private Long failNum;
|
||||
|
||||
private Long stopNum;
|
||||
|
||||
private Long cancelNum;
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
package com.aizuda.easy.retry.server.web.service;
|
||||
|
||||
import com.aizuda.easy.retry.server.web.model.base.BaseQueryVO;
|
||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||
import com.aizuda.easy.retry.server.web.model.request.ServerNodeQueryVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.ActivePodQuantityResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DispatchQuantityResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.SceneQuantityRankResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardCardResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardRetryLineResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.ServerNodeResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.TaskQuantityResponseVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -16,15 +15,11 @@ import java.util.List;
|
||||
*/
|
||||
public interface DashBoardService {
|
||||
|
||||
TaskQuantityResponseVO countTask();
|
||||
DashboardCardResponseVO taskRetryJob();
|
||||
|
||||
DispatchQuantityResponseVO countDispatch();
|
||||
DashboardRetryLineResponseVO retryLineList(BaseQueryVO baseQueryVO, String groupName, String type, String startTime, String endTime);
|
||||
|
||||
ActivePodQuantityResponseVO countActivePod();
|
||||
|
||||
List<SceneQuantityRankResponseVO> rankSceneQuantity(String groupName, String type, String startTime, String endTime);
|
||||
|
||||
List<DispatchQuantityResponseVO> lineDispatchQuantity(String groupName, String type, String startTime, String endTime);
|
||||
DashboardRetryLineResponseVO jobLineList(BaseQueryVO baseQueryVO, String groupName, String type, String startTime, String endTime);
|
||||
|
||||
PageResult<List<ServerNodeResponseVO>> pods(ServerNodeQueryVO serverNodeQueryVO);
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.aizuda.easy.retry.server.web.service.convert;
|
||||
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardRetryLinkeResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DispatchQuantityResponseVO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLinkeResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DispatchQuantityResponseDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@ -17,6 +19,7 @@ public interface DispatchQuantityResponseVOConverter {
|
||||
|
||||
DispatchQuantityResponseVOConverter INSTANCE = Mappers.getMapper(DispatchQuantityResponseVOConverter.class);
|
||||
|
||||
List<DispatchQuantityResponseVO> toDispatchQuantityResponse(List<DispatchQuantityResponseDO> dispatchQuantityResponseDOS);
|
||||
List<DashboardRetryLinkeResponseVO> toDashboardRetryLinkeResponseVO(List<DashboardRetryLinkeResponseDO> dashboardRetryLinkeResponseDOList);
|
||||
|
||||
List<DispatchQuantityResponseVO> toDispatchQuantityResponseVO(List<DispatchQuantityResponseDO> dispatchQuantityResponseDOList);
|
||||
}
|
||||
|
@ -0,0 +1,40 @@
|
||||
package com.aizuda.easy.retry.server.web.service.convert;
|
||||
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardRetryLineResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardCardResponseVO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
* @version 1.0.0
|
||||
* @date 2023/11/24
|
||||
*/
|
||||
@Mapper
|
||||
public interface JobSummaryResponseVOConverter {
|
||||
|
||||
JobSummaryResponseVOConverter INSTANCE = Mappers.getMapper(JobSummaryResponseVOConverter.class);
|
||||
|
||||
@Mappings({
|
||||
@Mapping(target = "successRate", expression = "java(JobSummaryResponseVOConverter.toSuccessRate(jobTask.getSuccessNum(), jobTask.getTotalNum()))")
|
||||
})
|
||||
DashboardCardResponseVO.JobTask toTaskJob(DashboardCardResponseDO.JobTask jobTask);
|
||||
|
||||
List<DashboardRetryLineResponseVO.Task> toDashboardRetryLineResponseVO(List<DashboardRetryLineResponseDO.Task> taskList);
|
||||
|
||||
static BigDecimal toSuccessRate(Integer successNum, Integer totalNum) {
|
||||
if (Objects.isNull(totalNum) || totalNum == 0) {
|
||||
return null;
|
||||
}
|
||||
return new BigDecimal(successNum + "").divide(new BigDecimal(totalNum + ""), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.aizuda.easy.retry.server.web.service.convert;
|
||||
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardCardResponseVO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardCardResponseDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
* @version 1.0.0
|
||||
* @date 2023/11/24
|
||||
*/
|
||||
@Mapper
|
||||
public interface RetrySummaryResponseVOConverter {
|
||||
|
||||
RetrySummaryResponseVOConverter INSTANCE = Mappers.getMapper(RetrySummaryResponseVOConverter.class);
|
||||
|
||||
DashboardCardResponseVO.RetryTask toRetryTask(DashboardCardResponseDO.RetryTask retryTask);
|
||||
|
||||
List<DashboardCardResponseVO.RetryTaskBar> toRetryTaskBar(List<DashboardCardResponseDO.RetryTaskBar> retryTaskBarList);
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package com.aizuda.easy.retry.server.web.service.convert;
|
||||
|
||||
import com.aizuda.easy.retry.server.web.model.response.SceneQuantityRankResponseVO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.SceneQuantityRankResponseDO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DashboardRetryLineResponseVO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@ -17,5 +17,5 @@ public interface SceneQuantityRankResponseVOConverter {
|
||||
|
||||
SceneQuantityRankResponseVOConverter INSTANCE = Mappers.getMapper(SceneQuantityRankResponseVOConverter.class);
|
||||
|
||||
List<SceneQuantityRankResponseVO> toSceneQuantityRankResponseVO(List<SceneQuantityRankResponseDO> dispatchQuantityResponseDOS);
|
||||
List<DashboardRetryLineResponseVO.Rank> toDashboardRetryLineResponseVORank(List<DashboardRetryLineResponseDO.Rank> rankList);
|
||||
}
|
||||
|
@ -1,55 +1,48 @@
|
||||
package com.aizuda.easy.retry.server.web.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.aizuda.easy.retry.common.core.enums.NodeTypeEnum;
|
||||
import com.aizuda.easy.retry.common.core.log.LogUtils;
|
||||
import com.aizuda.easy.retry.common.core.model.Result;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.server.common.cache.CacheConsumerGroup;
|
||||
import com.aizuda.easy.retry.server.common.dto.DistributeInstance;
|
||||
import com.aizuda.easy.retry.server.common.dto.ServerNodeExtAttrs;
|
||||
import com.aizuda.easy.retry.server.common.register.ServerRegister;
|
||||
import com.aizuda.easy.retry.server.web.service.convert.DispatchQuantityResponseVOConverter;
|
||||
import com.aizuda.easy.retry.server.web.service.convert.SceneQuantityRankResponseVOConverter;
|
||||
import com.aizuda.easy.retry.server.web.model.base.BaseQueryVO;
|
||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||
import com.aizuda.easy.retry.server.web.model.enums.DateTypeEnum;
|
||||
import com.aizuda.easy.retry.server.web.model.enums.RetryDateTypeEnum;
|
||||
import com.aizuda.easy.retry.server.web.model.request.ServerNodeQueryVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.*;
|
||||
import com.aizuda.easy.retry.server.web.service.DashBoardService;
|
||||
import com.aizuda.easy.retry.server.web.service.convert.*;
|
||||
import com.aizuda.easy.retry.server.web.util.UserSessionUtils;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLineResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DashboardRetryLinkeResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.DispatchQuantityResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.dataobject.SceneQuantityRankResponseDO;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetryTaskLogMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetryTaskLogMessageMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobSummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.RetrySummaryMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.mapper.ServerNodeMapper;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.RetryTaskLog;
|
||||
import com.aizuda.easy.retry.template.datasource.persistence.po.ServerNode;
|
||||
import com.aizuda.easy.retry.server.web.service.convert.ServerNodeResponseVOConverter;
|
||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||
import com.aizuda.easy.retry.server.web.model.request.ServerNodeQueryVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.ServerNodeResponseVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.aizuda.easy.retry.common.core.enums.NodeTypeEnum;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.aizuda.easy.retry.server.web.service.DashBoardService;
|
||||
import com.aizuda.easy.retry.server.web.model.enums.DateTypeEnum;
|
||||
import com.aizuda.easy.retry.server.web.model.response.ActivePodQuantityResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.DispatchQuantityResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.SceneQuantityRankResponseVO;
|
||||
import com.aizuda.easy.retry.server.web.model.response.TaskQuantityResponseVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.MessageFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -60,13 +53,8 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DashBoardServiceImpl implements DashBoardService {
|
||||
public static final String URL = "http://{0}:{1}/{2}/dashboard/consumer/bucket";
|
||||
|
||||
@Autowired
|
||||
private RetryTaskLogMapper retryTaskLogMapper;
|
||||
|
||||
@Autowired
|
||||
private RetryTaskLogMessageMapper retryTaskLogMessageMapper;
|
||||
public static final String URL = "http://{0}:{1}/dashboard/consumer/bucket";
|
||||
|
||||
@Autowired
|
||||
private ServerNodeMapper serverNodeMapper;
|
||||
@ -74,115 +62,87 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Override
|
||||
public TaskQuantityResponseVO countTask() {
|
||||
@Autowired
|
||||
private JobSummaryMapper jobSummaryMapper;
|
||||
|
||||
TaskQuantityResponseVO taskQuantityResponseVO = new TaskQuantityResponseVO();
|
||||
taskQuantityResponseVO.setTotal(retryTaskLogMapper.countTaskTotal());
|
||||
|
||||
taskQuantityResponseVO.setFinish(retryTaskLogMapper.countTaskByRetryStatus(RetryStatusEnum.FINISH.getStatus()));
|
||||
taskQuantityResponseVO.setMaxRetryCount(retryTaskLogMapper.countTaskByRetryStatus(RetryStatusEnum.MAX_COUNT.getStatus()));
|
||||
taskQuantityResponseVO.setRunning(taskQuantityResponseVO.getTotal() - taskQuantityResponseVO.getFinish() - taskQuantityResponseVO.getMaxRetryCount());
|
||||
|
||||
return taskQuantityResponseVO;
|
||||
}
|
||||
@Autowired
|
||||
private RetrySummaryMapper retrySummaryMapper;
|
||||
|
||||
@Override
|
||||
public DispatchQuantityResponseVO countDispatch() {
|
||||
DispatchQuantityResponseVO dispatchQuantityResponseVO = new DispatchQuantityResponseVO();
|
||||
public DashboardCardResponseVO taskRetryJob() {
|
||||
|
||||
// 任务的总调度量
|
||||
Long total = retryTaskLogMessageMapper.selectCount(null);
|
||||
dispatchQuantityResponseVO.setTotal(total);
|
||||
|
||||
if (total == 0) {
|
||||
return dispatchQuantityResponseVO;
|
||||
}
|
||||
|
||||
Long success = retryTaskLogMapper.selectCount(new LambdaQueryWrapper<RetryTaskLog>()
|
||||
.eq(RetryTaskLog::getRetryStatus, RetryStatusEnum.FINISH.getStatus()));
|
||||
dispatchQuantityResponseVO.setSuccessPercent(BigDecimal.valueOf(success).divide(BigDecimal.valueOf(total), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)));
|
||||
|
||||
return dispatchQuantityResponseVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivePodQuantityResponseVO countActivePod() {
|
||||
|
||||
ActivePodQuantityResponseVO activePodQuantityResponseVO = new ActivePodQuantityResponseVO();
|
||||
|
||||
List<ActivePodQuantityResponseDO> activePodQuantityDO = serverNodeMapper.countActivePod(UserSessionUtils.currentUserSession().getNamespaceId());
|
||||
String namespaceId = UserSessionUtils.currentUserSession().getNamespaceId();
|
||||
DashboardCardResponseVO dashboardCardResponseVO = new DashboardCardResponseVO();
|
||||
// 重试任务
|
||||
dashboardCardResponseVO.setRetryTask(RetrySummaryResponseVOConverter.INSTANCE.toRetryTask(retrySummaryMapper.retryTask(namespaceId)));
|
||||
// 定时任务
|
||||
dashboardCardResponseVO.setJobTask(JobSummaryResponseVOConverter.INSTANCE.toTaskJob(jobSummaryMapper.toJobTask(namespaceId)));
|
||||
// 重试任务柱状图
|
||||
dashboardCardResponseVO.setRetryTaskBarList(RetrySummaryResponseVOConverter.INSTANCE.toRetryTaskBar(retrySummaryMapper.retryTaskBarList(namespaceId)));
|
||||
// 在线Pods
|
||||
List<ActivePodQuantityResponseDO> activePodQuantityDO = serverNodeMapper.countActivePod(namespaceId);
|
||||
Map<Integer, Long> map = activePodQuantityDO.stream().collect(Collectors.toMap(ActivePodQuantityResponseDO::getNodeType, ActivePodQuantityResponseDO::getTotal));
|
||||
Long clientTotal = map.getOrDefault(NodeTypeEnum.CLIENT.getType(), 0L);
|
||||
Long serverTotal = map.getOrDefault(NodeTypeEnum.SERVER.getType(), 0L);
|
||||
activePodQuantityResponseVO.setServerTotal(serverTotal);
|
||||
activePodQuantityResponseVO.setClientTotal(clientTotal);
|
||||
dashboardCardResponseVO.getOnLineService().setServerTotal(serverTotal);
|
||||
dashboardCardResponseVO.getOnLineService().setClientTotal(clientTotal);
|
||||
dashboardCardResponseVO.getOnLineService().setTotal(clientTotal + serverTotal);
|
||||
|
||||
activePodQuantityResponseVO.setTotal(clientTotal + serverTotal);
|
||||
|
||||
return activePodQuantityResponseVO;
|
||||
return dashboardCardResponseVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SceneQuantityRankResponseVO> rankSceneQuantity(String groupName, String type, String startTime, String endTime) {
|
||||
LocalDateTime startDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isNotBlank(startTime)) {
|
||||
startDateTime = LocalDateTime.of(LocalDate.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalTime.MIN);
|
||||
}
|
||||
public DashboardRetryLineResponseVO retryLineList(BaseQueryVO baseQueryVO, String groupName, String type, String startTime, String endTime) {
|
||||
|
||||
LocalDateTime endDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isNotBlank(endTime)) {
|
||||
endDateTime = LocalDateTime.of(LocalDate.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalTime.MAX);
|
||||
}
|
||||
String namespaceId = UserSessionUtils.currentUserSession().getNamespaceId();
|
||||
DashboardRetryLineResponseVO dashboardRetryLineResponseVO = new DashboardRetryLineResponseVO();
|
||||
// 重试任务列表
|
||||
IPage<DashboardRetryLineResponseDO.Task> IPage = retrySummaryMapper.retryTaskList(namespaceId, new Page<>(baseQueryVO.getPage(), baseQueryVO.getSize()));
|
||||
List<DashboardRetryLineResponseVO.Task> taskList = JobSummaryResponseVOConverter.INSTANCE.toDashboardRetryLineResponseVO(IPage.getRecords());
|
||||
PageResult<List<DashboardRetryLineResponseVO.Task>> pageResult = new PageResult<>(new PageDTO(IPage.getCurrent(), IPage.getSize(), IPage.getTotal()), taskList);
|
||||
dashboardRetryLineResponseVO.setTaskList(pageResult);
|
||||
|
||||
DateTypeEnum dateTypeEnum = DateTypeEnum.valueOf(type.toUpperCase());
|
||||
startDateTime = dateTypeEnum.getStartTime().apply(startDateTime);
|
||||
endDateTime = dateTypeEnum.getEndTime().apply(endDateTime);
|
||||
// 折线图
|
||||
RetryDateTypeEnum dateTypeEnum = RetryDateTypeEnum.valueOf(type);
|
||||
LocalDateTime startDateTime = dateTypeEnum.getStartTime().apply(StrUtil.isNotBlank(startTime) ? LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : null);
|
||||
LocalDateTime endDateTime = dateTypeEnum.getEndTime().apply(StrUtil.isNotBlank(endTime) ? LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : null);
|
||||
List<DashboardRetryLinkeResponseDO> dashboardRetryLinkeResponseDOList = retrySummaryMapper.retryLineList(namespaceId, type, startDateTime, endDateTime);
|
||||
List<DashboardRetryLinkeResponseVO> retryLinkeResponseVOList = DispatchQuantityResponseVOConverter.INSTANCE.toDashboardRetryLinkeResponseVO(dashboardRetryLinkeResponseDOList);
|
||||
dateTypeEnum.getConsumer().accept(retryLinkeResponseVOList);
|
||||
dashboardRetryLineResponseVO.setRetryLinkeResponseVOList(retryLinkeResponseVOList);
|
||||
|
||||
List<SceneQuantityRankResponseDO> dispatchQuantityResponseDOS = retryTaskLogMapper.rankSceneQuantity(groupName, startDateTime, endDateTime);
|
||||
return SceneQuantityRankResponseVOConverter.INSTANCE.toSceneQuantityRankResponseVO(dispatchQuantityResponseDOS);
|
||||
// 排行榜
|
||||
List<DashboardRetryLineResponseDO.Rank> rankList = retrySummaryMapper.dashboardRank(namespaceId, groupName, startDateTime, endDateTime);
|
||||
List<DashboardRetryLineResponseVO.Rank> ranks = SceneQuantityRankResponseVOConverter.INSTANCE.toDashboardRetryLineResponseVORank(rankList);
|
||||
dashboardRetryLineResponseVO.setRankList(ranks);
|
||||
return dashboardRetryLineResponseVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DispatchQuantityResponseVO> lineDispatchQuantity(String groupName, String type, String startTime, String endTime) {
|
||||
public DashboardRetryLineResponseVO jobLineList(BaseQueryVO baseQueryVO, String groupName, String type, String startTime, String endTime) {
|
||||
|
||||
DateTypeEnum dateTypeEnum = DateTypeEnum.valueOf(type.toUpperCase());
|
||||
String namespaceId = UserSessionUtils.currentUserSession().getNamespaceId();
|
||||
DashboardRetryLineResponseVO dashboardRetryLineResponseVO = new DashboardRetryLineResponseVO();
|
||||
// 重试任务列表
|
||||
IPage<DashboardRetryLineResponseDO.Task> IPage = jobSummaryMapper.jobTaskList(namespaceId, new Page<>(baseQueryVO.getPage(), baseQueryVO.getSize()));
|
||||
List<DashboardRetryLineResponseVO.Task> taskList = JobSummaryResponseVOConverter.INSTANCE.toDashboardRetryLineResponseVO(IPage.getRecords());
|
||||
PageResult<List<DashboardRetryLineResponseVO.Task>> pageResult = new PageResult<>(new PageDTO(IPage.getCurrent(), IPage.getSize(), IPage.getTotal()), taskList);
|
||||
dashboardRetryLineResponseVO.setTaskList(pageResult);
|
||||
|
||||
LocalDateTime startDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isNotBlank(startTime)) {
|
||||
startDateTime = LocalDateTime.of(LocalDate.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalTime.MIN);
|
||||
}
|
||||
// 折线图
|
||||
DateTypeEnum dateTypeEnum = DateTypeEnum.valueOf(type);
|
||||
LocalDateTime startDateTime = dateTypeEnum.getStartTime().apply(StrUtil.isNotBlank(startTime) ? LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : null);
|
||||
LocalDateTime endDateTime = dateTypeEnum.getEndTime().apply(StrUtil.isNotBlank(endTime) ? LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : null);
|
||||
List<DispatchQuantityResponseDO> dispatchQuantityResponseDOList = jobSummaryMapper.jobLineList(namespaceId, type, startDateTime, endDateTime);
|
||||
List<DispatchQuantityResponseVO> dispatchQuantityResponseVOList = DispatchQuantityResponseVOConverter.INSTANCE.toDispatchQuantityResponseVO(dispatchQuantityResponseDOList);
|
||||
dateTypeEnum.getConsumer().accept(dispatchQuantityResponseVOList);
|
||||
dashboardRetryLineResponseVO.setDispatchQuantityResponseVOList(dispatchQuantityResponseVOList);
|
||||
|
||||
LocalDateTime endDateTime = LocalDateTime.now();
|
||||
if (StrUtil.isNotBlank(endTime)) {
|
||||
endDateTime = LocalDateTime.of(LocalDate.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalTime.MAX);
|
||||
}
|
||||
|
||||
startDateTime = dateTypeEnum.getStartTime().apply(startDateTime);
|
||||
endDateTime = dateTypeEnum.getEndTime().apply(endDateTime);
|
||||
|
||||
List<DispatchQuantityResponseDO> totalDispatchQuantityResponseList = retryTaskLogMapper.lineDispatchQuantity(groupName, null, type, startDateTime, endDateTime);
|
||||
|
||||
List<DispatchQuantityResponseDO> successDispatchQuantityResponseList = retryTaskLogMapper.lineDispatchQuantity(groupName, RetryStatusEnum.FINISH.getStatus(), type, startDateTime, endDateTime);
|
||||
Map<String, DispatchQuantityResponseDO> successDispatchQuantityResponseVOMap = successDispatchQuantityResponseList.stream().collect(Collectors.toMap(DispatchQuantityResponseDO::getCreateDt, i -> i));
|
||||
for (DispatchQuantityResponseDO dispatchQuantityResponseDO : totalDispatchQuantityResponseList) {
|
||||
|
||||
DispatchQuantityResponseDO quantityResponseVO = successDispatchQuantityResponseVOMap.get(dispatchQuantityResponseDO.getCreateDt());
|
||||
if (Objects.isNull(quantityResponseVO)) {
|
||||
dispatchQuantityResponseDO.setSuccess(0L);
|
||||
} else {
|
||||
dispatchQuantityResponseDO.setSuccess(quantityResponseVO.getTotal());
|
||||
}
|
||||
|
||||
dispatchQuantityResponseDO.setFail(dispatchQuantityResponseDO.getTotal() - dispatchQuantityResponseDO.getSuccess());
|
||||
|
||||
}
|
||||
|
||||
List<DispatchQuantityResponseVO> dispatchQuantityResponse = DispatchQuantityResponseVOConverter.INSTANCE.toDispatchQuantityResponse(totalDispatchQuantityResponseList);
|
||||
|
||||
dateTypeEnum.getConsumer().accept(dispatchQuantityResponse);
|
||||
|
||||
return dispatchQuantityResponse.stream().sorted(Comparator.comparing(DispatchQuantityResponseVO::getCreateDt)).collect(Collectors.toList());
|
||||
// 排行榜
|
||||
List<DashboardRetryLineResponseDO.Rank> rankList = jobSummaryMapper.dashboardRank(namespaceId, groupName, startDateTime, endDateTime);
|
||||
List<DashboardRetryLineResponseVO.Rank> ranks = SceneQuantityRankResponseVOConverter.INSTANCE.toDashboardRetryLineResponseVORank(rankList);
|
||||
dashboardRetryLineResponseVO.setRankList(ranks);
|
||||
return dashboardRetryLineResponseVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -212,19 +172,13 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
serverNodeResponseVO.setConsumerBuckets(DistributeInstance.INSTANCE.getConsumerBucket());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(serverNodeResponseVO.getExtAttrs())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ServerNodeExtAttrs serverNodeExtAttrs = JsonUtil
|
||||
.parseObject(serverNodeResponseVO.getExtAttrs(), ServerNodeExtAttrs.class);
|
||||
|
||||
ServerNodeExtAttrs serverNodeExtAttrs = JsonUtil.parseObject(serverNodeResponseVO.getExtAttrs(), ServerNodeExtAttrs.class);
|
||||
try {
|
||||
|
||||
// 从远程节点取
|
||||
String format = MessageFormat
|
||||
.format(URL, serverNodeResponseVO.getHostIp(), serverNodeExtAttrs.getWebPort().toString(), serverNodeResponseVO.getContextPath());
|
||||
String format = MessageFormat.format(URL, serverNodeResponseVO.getHostIp(), serverNodeExtAttrs.getWebPort().toString());
|
||||
Result<List<Integer>> result = restTemplate.getForObject(format, Result.class);
|
||||
List<Integer> data = result.getData();
|
||||
if (!CollectionUtils.isEmpty(data)) {
|
||||
@ -232,14 +186,10 @@ public class DashBoardServiceImpl implements DashBoardService {
|
||||
.sorted(Integer::compareTo)
|
||||
.collect(Collectors.toCollection(LinkedHashSet::new)));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
LogUtils.error(log, "Failed to retrieve consumer group for node [{}:{}].", serverNodeResponseVO.getHostIp(), serverNodeExtAttrs.getWebPort());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return new PageResult<>(serverNodePageDTO, serverNodeResponseVOS);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,11 @@ const api = {
|
||||
role: '/role',
|
||||
service: '/service',
|
||||
permission: '/permission',
|
||||
dashboardTaskRetryJob: `/dashboard/task-retry-job`,
|
||||
dashboardRetryLine: '/dashboard/retry/line',
|
||||
dashboardJobLine: '/dashboard/job/line',
|
||||
pods: '/dashboard/pods',
|
||||
consumerGroup: '/dashboard/consumer/group',
|
||||
permissionNoPager: '/permission/no-pager',
|
||||
orgTree: '/org/tree',
|
||||
groupConfigForPage: '/group/list',
|
||||
@ -38,16 +43,9 @@ const api = {
|
||||
saveUser: '/user',
|
||||
systemUserByUserName: '/user/username/user-info',
|
||||
systemUserPermissionByUserId: '/user-permissions/',
|
||||
countTask: '/dashboard/task/count',
|
||||
countDispatch: '/dashboard/dispatch/count',
|
||||
countActivePod: '/dashboard/active-pod/count',
|
||||
rankSceneQuantity: '/dashboard/scene/rank',
|
||||
lineDispatchQuantity: '/dashboard/dispatch/line',
|
||||
partitionTableList: '/group/partition-table/list',
|
||||
totalPartition: '/group/partition',
|
||||
systemVersion: '/system/version',
|
||||
pods: '/dashboard/pods',
|
||||
consumerGroup: '/dashboard/consumer/group',
|
||||
updateGroupStatus: '/group/status',
|
||||
|
||||
addNamespace: '/namespace',
|
||||
@ -197,43 +195,6 @@ export function getPartitionTableList () {
|
||||
})
|
||||
}
|
||||
|
||||
export function getLineDispatchQuantity (parameter) {
|
||||
return request({
|
||||
url: api.lineDispatchQuantity,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function rankSceneQuantity (parameter) {
|
||||
return request({
|
||||
url: api.rankSceneQuantity,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function countActivePod () {
|
||||
return request({
|
||||
url: api.countActivePod,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function countTask () {
|
||||
return request({
|
||||
url: api.countTask,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function countDispatch () {
|
||||
return request({
|
||||
url: api.countDispatch,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getGroupConfigForPage (parameter) {
|
||||
return request({
|
||||
url: api.groupConfigForPage,
|
||||
@ -249,6 +210,30 @@ export function getAllGroupNameList () {
|
||||
})
|
||||
}
|
||||
|
||||
export function getDashboardRetryLine (parameter) {
|
||||
return request({
|
||||
url: api.dashboardRetryLine,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function getDashboardJobLine (parameter) {
|
||||
return request({
|
||||
url: api.dashboardJobLine,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function getDashboardTaskRetryJob (parameter) {
|
||||
return request({
|
||||
url: api.dashboardTaskRetryJob,
|
||||
method: 'get',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function getRetryTaskPage (parameter) {
|
||||
return request({
|
||||
url: api.retryTaskPage,
|
||||
|
86
frontend/src/components/Charts/JobLine.vue
Normal file
86
frontend/src/components/Charts/JobLine.vue
Normal file
@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<div>
|
||||
<div id="jobViewData"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as G2 from '@antv/g2'
|
||||
import { getDashboardJobLine } from '@/api/manage'
|
||||
|
||||
const DataSet = require('@antv/data-set')
|
||||
|
||||
export default {
|
||||
name: 'JobLine',
|
||||
data () {
|
||||
return {
|
||||
viewRecords: [],
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getDashboardJobLine()
|
||||
this.createView()
|
||||
},
|
||||
methods: {
|
||||
getDashboardJobLine (groupName, type = 'WEEK', startTime, endTime) {
|
||||
getDashboardJobLine({
|
||||
'groupName': groupName,
|
||||
'type': type,
|
||||
'startTime': startTime,
|
||||
'endTime': endTime
|
||||
}).then(res => {
|
||||
this.$bus.$emit('job', res)
|
||||
this.viewCharts(res.data.dispatchQuantityResponseVOList)
|
||||
})
|
||||
},
|
||||
viewCharts (viewRecords, type = 'WEEK') {
|
||||
var ds = new DataSet()
|
||||
if (viewRecords === undefined || viewRecords === null) {
|
||||
return
|
||||
}
|
||||
var dv = ds.createView().source(viewRecords)
|
||||
dv.transform({
|
||||
type: 'fold',
|
||||
fields: ['success', 'fail'],
|
||||
key: 'name',
|
||||
value: 'viewTotal',
|
||||
retains: ['total', 'createDt']
|
||||
})
|
||||
|
||||
this.chart.source(dv, {
|
||||
date: {
|
||||
type: 'cat'
|
||||
}
|
||||
})
|
||||
this.chart.axis('viewTotal', {
|
||||
label: {
|
||||
textStyle: {
|
||||
fill: '#aaaaaa'
|
||||
}
|
||||
}
|
||||
})
|
||||
this.chart.tooltip({
|
||||
crosshairs: {
|
||||
type: 'line'
|
||||
}
|
||||
})
|
||||
this.chart.line().position('createDt*viewTotal').color('name', ['#1890ff', '#c28c62']).shape('smooth')
|
||||
this.chart.point().position('createDt*viewTotal').color('name', ['#1890ff', '#c28c62']).size(4).shape('circle').style({
|
||||
stroke: '#fff',
|
||||
lineWidth: 1
|
||||
})
|
||||
|
||||
this.chart.render()
|
||||
},
|
||||
createView () {
|
||||
this.chart = new G2.Chart({
|
||||
container: 'jobViewData',
|
||||
forceFit: true,
|
||||
height: 410,
|
||||
padding: [20, 90, 60, 50]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -14,7 +14,6 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'RankList',
|
||||
// ['title', 'list']
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
|
@ -6,34 +6,36 @@
|
||||
|
||||
<script>
|
||||
import * as G2 from '@antv/g2'
|
||||
import { getLineDispatchQuantity } from '@/api/manage'
|
||||
import { getDashboardRetryLine } from '@/api/manage'
|
||||
|
||||
const DataSet = require('@antv/data-set')
|
||||
|
||||
export default {
|
||||
name: 'G2Line',
|
||||
name: 'RetryLine',
|
||||
data () {
|
||||
return {
|
||||
viewRecords: [],
|
||||
retryLinkeResponseVOList: [],
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getLineDispatchQuantity()
|
||||
this.getDashboardRetryLine()
|
||||
this.createView()
|
||||
},
|
||||
methods: {
|
||||
getLineDispatchQuantity (groupName, type = 'day', startTime, endTime) {
|
||||
getLineDispatchQuantity({
|
||||
getDashboardRetryLine (groupName, type = 'WEEK', startTime, endTime) {
|
||||
getDashboardRetryLine({
|
||||
'groupName': groupName,
|
||||
'type': type,
|
||||
'startTime': startTime,
|
||||
'endTime': endTime
|
||||
}).then(res => {
|
||||
this.viewCharts(res.data)
|
||||
this.$bus.$emit('retry', res)
|
||||
this.viewCharts(res.data.retryLinkeResponseVOList)
|
||||
})
|
||||
},
|
||||
viewCharts (viewRecords, type = 'day') {
|
||||
viewCharts (viewRecords, type = 'WEEK') {
|
||||
var ds = new DataSet()
|
||||
if (viewRecords === undefined || viewRecords === null) {
|
||||
return
|
||||
@ -41,7 +43,7 @@ export default {
|
||||
var dv = ds.createView().source(viewRecords)
|
||||
dv.transform({
|
||||
type: 'fold',
|
||||
fields: ['success', 'fail'], // 展开字段集
|
||||
fields: ['successNum', 'runningNum', 'maxCountNum', 'suspendNum'],
|
||||
key: 'name',
|
||||
value: 'viewTotal',
|
||||
retains: ['total', 'createDt']
|
@ -10,7 +10,8 @@ import Radar from '@/components/Charts/Radar'
|
||||
import RankList from '@/components/Charts/RankList'
|
||||
import TransferBar from '@/components/Charts/TransferBar'
|
||||
import TagCloud from '@/components/Charts/TagCloud'
|
||||
import G2Line from '@/components/Charts/Line'
|
||||
import RetryLine from '@/components/Charts/RetryLine'
|
||||
import JobLine from '@/components/Charts/JobLine'
|
||||
|
||||
// pro components
|
||||
import AvatarList from '@/components/AvatarList'
|
||||
@ -53,7 +54,8 @@ export {
|
||||
TagSelect,
|
||||
StandardFormRow,
|
||||
ArticleListContent,
|
||||
G2Line,
|
||||
RetryLine,
|
||||
JobLine,
|
||||
Drawer,
|
||||
Dialog
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ export const asyncRouterMap = [
|
||||
{
|
||||
path: '/dashboard/analysis',
|
||||
name: 'Analysis',
|
||||
component: () => import('@/views/dashboard/Analysis'),
|
||||
component: () => import('@/views/dashboard/Analysis.vue'),
|
||||
meta: { title: 'menu.dashboard.analysis', keepAlive: true, permission: ['dashboard'] }
|
||||
},
|
||||
{
|
||||
|
@ -27,11 +27,17 @@ function plugin (Vue) {
|
||||
const [permission, action] = permissions.split('.')
|
||||
const permissionList = _this.$store.getters.roles.permissions
|
||||
|
||||
return permissionList.find((val) => {
|
||||
if (permissionList.find((val) => {
|
||||
return val.permissionId === permission
|
||||
}).actionList.findIndex((val) => {
|
||||
}) !== undefined) {
|
||||
return permissionList.find((val) => {
|
||||
return val.permissionId === permission
|
||||
}).actionList.findIndex((val) => {
|
||||
console.log(val)
|
||||
console.log(action)
|
||||
return val === action
|
||||
}) > -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
export default {
|
||||
'dashboard.analysis.test': '工专路 {no} 号店',
|
||||
'dashboard.analysis.introduce': '指标说明',
|
||||
'dashboard.analysis.total-sales': '总任务量',
|
||||
'dashboard.analysis.total-sales': '重试任务',
|
||||
'dashboard.analysis.day-sales': '日均任务',
|
||||
'dashboard.analysis.visits': '访问量',
|
||||
'dashboard.analysis.job_success': '成功',
|
||||
'dashboard.analysis.job_fail': '失败',
|
||||
'dashboard.analysis.visits': '定时任务',
|
||||
'dashboard.analysis.visits-trend': '访问量趋势',
|
||||
'dashboard.analysis.visits-ranking': '门店访问量排名',
|
||||
'dashboard.analysis.day-visits': '日访问量',
|
||||
@ -14,23 +16,24 @@ export default {
|
||||
'dashboard.analysis.operational-effect': '运营活动效果',
|
||||
'dashboard.analysis.sales-trend': '销售趋势',
|
||||
'dashboard.analysis.sales-ranking': '任务量排名',
|
||||
'dashboard.analysis.all-year': '全年',
|
||||
'dashboard.analysis.all-month': '本月',
|
||||
'dashboard.analysis.all-week': '本周',
|
||||
'dashboard.analysis.all-day': '今日',
|
||||
'dashboard.analysis.all-week': '最近一周',
|
||||
'dashboard.analysis.all-month': '最近一月',
|
||||
'dashboard.analysis.all-year': '全年',
|
||||
'dashboard.analysis.search-users': '搜索用户数',
|
||||
'dashboard.analysis.per-capita-search': '人均搜索次数',
|
||||
'dashboard.analysis.online-top-search': '线上热门搜索',
|
||||
'dashboard.analysis.the-proportion-of-sales': '销售额类别占比',
|
||||
'dashboard.analysis.dropdown-option-one': '操作一',
|
||||
'dashboard.analysis.dropdown-option-two': '操作二',
|
||||
'dashboard.analysis.channel.all': '全部渠道',
|
||||
'dashboard.analysis.channel.online': '线上',
|
||||
'dashboard.analysis.channel.stores': '门店',
|
||||
'dashboard.analysis.sales': '调度',
|
||||
'dashboard.analysis.online-top-search': '任务列表',
|
||||
'dashboard.analysis.the-proportion-of-sales': '成功比例图',
|
||||
'dashboard.analysis.dropdown-option-one': '重试',
|
||||
'dashboard.analysis.dropdown-option-two': '定时',
|
||||
'dashboard.analysis.channel.all': '全部任务',
|
||||
'dashboard.analysis.channel.online': '重试',
|
||||
'dashboard.analysis.channel.stores': '定时',
|
||||
'dashboard.analysis.sales': '重试任务',
|
||||
'dashboard.analysis.job.sales': '定时任务',
|
||||
'dashboard.analysis.traffic': '客流量',
|
||||
'dashboard.analysis.table.rank': '排名',
|
||||
'dashboard.analysis.table.search-keyword': '搜索关键词',
|
||||
'dashboard.analysis.table.users': '用户数',
|
||||
'dashboard.analysis.table.weekly-range': '周涨幅'
|
||||
'dashboard.analysis.table.rank': '命名空间',
|
||||
'dashboard.analysis.table.search-keyword': '组名称',
|
||||
'dashboard.analysis.table.users': '运行中任务数',
|
||||
'dashboard.analysis.table.weekly-range': '总任务数'
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ Vue.use(CronInput)
|
||||
|
||||
window.umi_plugin_ant_themeVar = themePluginConfig.theme
|
||||
|
||||
Vue.prototype.$bus = new Vue()
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
|
@ -16,7 +16,7 @@ const constantRouterComponents = {
|
||||
|
||||
// 你需要动态引入的页面组件
|
||||
Workplace: () => import('@/views/dashboard/Workplace'),
|
||||
Analysis: () => import('@/views/dashboard/Analysis'),
|
||||
Analysis: () => import('@/views/dashboard/Analysis.vue'),
|
||||
|
||||
// form
|
||||
BasicForm: () => import('@/views/form/basicForm'),
|
||||
|
@ -44,6 +44,18 @@ const commonAdmin = [
|
||||
}
|
||||
]
|
||||
const retryAdmin = [
|
||||
{
|
||||
roleId: 2,
|
||||
permissionId: 'RetryAnalysis',
|
||||
permissionName: '重试任务',
|
||||
actionEntitySet: [
|
||||
{
|
||||
action: 'retry',
|
||||
describe: '重试',
|
||||
defaultCheck: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
roleId: 2,
|
||||
permissionId: 'dashboard',
|
||||
@ -66,6 +78,18 @@ const retryAdmin = [
|
||||
}
|
||||
]
|
||||
const jobAdmin = [
|
||||
{
|
||||
roleId: 2,
|
||||
permissionId: 'JobAnalysis',
|
||||
permissionName: '定时任务',
|
||||
actionEntitySet: [
|
||||
{
|
||||
action: 'job',
|
||||
describe: '定时',
|
||||
defaultCheck: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
roleId: 2,
|
||||
permissionId: 'dashboard',
|
||||
@ -99,6 +123,18 @@ const commonUser = [
|
||||
}
|
||||
]
|
||||
const retryUser = [
|
||||
{
|
||||
roleId: 1,
|
||||
permissionId: 'RetryAnalysis',
|
||||
permissionName: '重试任务',
|
||||
actionEntitySet: [
|
||||
{
|
||||
action: 'retry',
|
||||
describe: '重试',
|
||||
defaultCheck: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
roleId: 1,
|
||||
permissionId: 'dashboard',
|
||||
|
26
frontend/src/views/dashboard/Analysis.less
Normal file
26
frontend/src/views/dashboard/Analysis.less
Normal file
@ -0,0 +1,26 @@
|
||||
.extra-wrapper {
|
||||
line-height: 55px;
|
||||
padding-right: 24px;
|
||||
|
||||
.extra-item {
|
||||
display: inline-block;
|
||||
margin-right: 24px;
|
||||
|
||||
a {
|
||||
color: #0e0101;
|
||||
margin-left: 24px;
|
||||
}
|
||||
|
||||
span {
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.in {
|
||||
color: #1b7ee5;
|
||||
}
|
||||
|
||||
.on {
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user