From 171ef66695dd41bafa2658bde2f553ca8e05c18d Mon Sep 17 00:00:00 2001 From: zhengweilin Date: Mon, 4 Dec 2023 16:58:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=202.5.0:=201=E3=80=81=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98MiniBar=E6=9F=A5=E8=AF=A2=E8=BF=917=E5=A4=A9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=EF=BC=8C=E4=B8=8D=E8=B6=B3=E8=A1=A50=202=E3=80=81?= =?UTF-8?q?=E9=87=8D=E8=AF=95=E3=80=81=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=8A=98=E7=BA=BF=E5=9B=BE=EF=BC=88=E6=8C=89=E5=A4=A9=EF=BC=8C?= =?UTF-8?q?=E5=91=A8=EF=BC=8C=E6=9C=88=EF=BC=8C=E5=B9=B4=E8=A1=A50?= =?UTF-8?q?=EF=BC=89=203=E3=80=81=E4=BC=98=E5=8C=96=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E6=8E=A5=E5=8F=A3=EF=BC=8C=E9=87=8D=E8=AF=95=EF=BC=8C?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=85=B1=E7=94=A8DateTypeEnum=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataobject/DashboardCardResponseDO.java | 6 +- .../dataobject/DashboardLineResponseDO.java | 67 ++++++++++++ .../DashboardRetryLineResponseDO.java | 2 +- .../DashboardRetryLinkeResponseDO.java | 23 ---- .../DispatchQuantityResponseDO.java | 27 ----- .../persistence/mapper/JobSummaryMapper.java | 10 +- .../mapper/RetrySummaryMapper.java | 10 +- .../mapper/RetryTaskLogMapper.java | 2 - .../mysql/mapper/JobSummaryMapper.xml | 15 ++- .../mysql/mapper/RetrySummaryMapper.xml | 42 ++++++-- .../server/web/model/enums/DateTypeEnum.java | 86 +++++++++++++-- .../web/model/enums/RetryDateTypeEnum.java | 101 ------------------ .../response/DashboardCardResponseVO.java | 6 +- .../response/DashboardLineResponseVO.java | 69 ++++++++++++ .../DashboardRetryLineResponseVO.java | 7 +- .../DashboardRetryLinkeResponseVO.java | 23 ---- .../response/DispatchQuantityResponseVO.java | 28 ----- .../DispatchQuantityResponseVOConverter.java | 10 +- .../service/impl/DashBoardServiceImpl.java | 25 ++--- frontend/src/components/Charts/JobLine.vue | 3 +- frontend/src/components/Charts/RetryLine.vue | 2 +- frontend/src/store/getters.js | 3 +- frontend/src/store/modules/user.js | 6 +- frontend/src/store/mutation-types.js | 1 + frontend/src/views/dashboard/Analysis.vue | 58 ++++++++-- frontend/src/views/dashboard/JobAnalysis.vue | 27 +---- .../src/views/dashboard/RetryAnalysis.vue | 25 +---- 27 files changed, 353 insertions(+), 331 deletions(-) create mode 100644 easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardLineResponseDO.java delete mode 100644 easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardRetryLinkeResponseDO.java delete mode 100644 easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DispatchQuantityResponseDO.java delete mode 100644 easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/enums/RetryDateTypeEnum.java create mode 100644 easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/response/DashboardLineResponseVO.java delete mode 100644 easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/response/DashboardRetryLinkeResponseVO.java delete mode 100644 easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/response/DispatchQuantityResponseVO.java diff --git a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardCardResponseDO.java b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardCardResponseDO.java index 99f2913f..58c7e0b2 100644 --- a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardCardResponseDO.java +++ b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardCardResponseDO.java @@ -61,13 +61,13 @@ public class DashboardCardResponseDO { @Data public static class RetryTaskBar { /** - * 时间x + * 时间x轴 */ private String x; /** - * 总数y + * 任务总数y轴 */ - private Long y; + private Long taskTotal; } } diff --git a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardLineResponseDO.java b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardLineResponseDO.java new file mode 100644 index 00000000..e1ee25b1 --- /dev/null +++ b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardLineResponseDO.java @@ -0,0 +1,67 @@ +package com.aizuda.easy.retry.template.datasource.persistence.dataobject; + +import lombok.Data; + +/** + * @author: wodeyangzipingpingwuqi + * @date : 2023-11-30 + */ +@Data +public class DashboardLineResponseDO { + + /** + * 时间x轴 + */ + private String createDt; + + /** + * 总量,计算百分比 + */ + private Long total; + + /** + * 重试-成功数 + */ + private Long successNum; + + /** + * 重试-运行数 + */ + private Long runningNum; + + /** + * 重试-最大次数 + */ + private Long maxCountNum; + + /** + * 重试-暂停数 + */ + private Long suspendNum; + + /** + * 定时-失败任务 + */ + private Long fail; + + /** + * 定时-总任务数 + */ + private Long totalNum; + + /** + * 定时-无效任务数 + */ + private Long failNum; + + /** + * 定时-停止数 + */ + private Long stopNum; + + /** + * 定时-取消数 + */ + private Long cancelNum; + +} diff --git a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardRetryLineResponseDO.java b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardRetryLineResponseDO.java index aba78075..b8b373e4 100644 --- a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardRetryLineResponseDO.java +++ b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardRetryLineResponseDO.java @@ -24,7 +24,7 @@ public class DashboardRetryLineResponseDO { /** * 折线图列表 */ - private List dispatchQuantityResponseVOList; + private List dashboardLineResponseDOList; @Data public static class Task { diff --git a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardRetryLinkeResponseDO.java b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardRetryLinkeResponseDO.java deleted file mode 100644 index 076c42cd..00000000 --- a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DashboardRetryLinkeResponseDO.java +++ /dev/null @@ -1,23 +0,0 @@ -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; -} diff --git a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DispatchQuantityResponseDO.java b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DispatchQuantityResponseDO.java deleted file mode 100644 index 1783ce45..00000000 --- a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/dataobject/DispatchQuantityResponseDO.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.aizuda.easy.retry.template.datasource.persistence.dataobject; - -import lombok.Data; - -/** - * @author: www.byteblogs.com - * @date : 2022-04-22 20:27 - */ -@Data -public class DispatchQuantityResponseDO { - - private String createDt; - - private Long total; - - private Long successNum; - - private Long fail; - - private Long totalNum; - - private Long failNum; - - private Long stopNum; - - private Long cancelNum; -} diff --git a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/JobSummaryMapper.java b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/JobSummaryMapper.java index a49b7c9c..757edbe7 100644 --- a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/JobSummaryMapper.java +++ b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/JobSummaryMapper.java @@ -1,8 +1,8 @@ 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.DashboardLineResponseDO; 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; @@ -27,10 +27,10 @@ public interface JobSummaryMapper extends BaseMapper { IPage jobTaskList(@Param("namespaceId") String namespaceId, Page page); - List jobLineList(@Param("namespaceId") String namespaceId, - @Param("type") String type, - @Param("from") LocalDateTime from, - @Param("to") LocalDateTime to); + List jobLineList(@Param("namespaceId") String namespaceId, + @Param("type") String type, + @Param("from") LocalDateTime from, + @Param("to") LocalDateTime to); DashboardCardResponseDO.JobTask toJobTask(@Param("namespaceId") String namespaceId); diff --git a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/RetrySummaryMapper.java b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/RetrySummaryMapper.java index 2871acf6..c93e1661 100644 --- a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/RetrySummaryMapper.java +++ b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/RetrySummaryMapper.java @@ -2,7 +2,7 @@ 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.dataobject.DashboardLineResponseDO; import com.aizuda.easy.retry.template.datasource.persistence.po.RetrySummary; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -31,10 +31,10 @@ public interface RetrySummaryMapper extends BaseMapper { IPage retryTaskList(@Param("namespaceId") String namespaceId, Page page); - List retryLineList(@Param("namespaceId") String namespaceId, - @Param("type") String type, - @Param("from") LocalDateTime from, - @Param("to") LocalDateTime to); + List retryLineList(@Param("namespaceId") String namespaceId, + @Param("type") String type, + @Param("from") LocalDateTime from, + @Param("to") LocalDateTime to); List dashboardRank(@Param("namespaceId") String namespaceId, diff --git a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/RetryTaskLogMapper.java b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/RetryTaskLogMapper.java index 8f3aaf12..3c2580b2 100644 --- a/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/RetryTaskLogMapper.java +++ b/easy-retry-datasource/easy-retry-datasource-template/src/main/java/com/aizuda/easy/retry/template/datasource/persistence/mapper/RetryTaskLogMapper.java @@ -2,8 +2,6 @@ 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; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; diff --git a/easy-retry-datasource/easy-retry-mysql-datasource/src/main/resources/mysql/mapper/JobSummaryMapper.xml b/easy-retry-datasource/easy-retry-mysql-datasource/src/main/resources/mysql/mapper/JobSummaryMapper.xml index a912552a..655c712e 100644 --- a/easy-retry-datasource/easy-retry-mysql-datasource/src/main/resources/mysql/mapper/JobSummaryMapper.xml +++ b/easy-retry-datasource/easy-retry-mysql-datasource/src/main/resources/mysql/mapper/JobSummaryMapper.xml @@ -73,14 +73,23 @@ - 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 tmp.date AS x, ifnull(b.taskTotal, 0) AS taskTotal + FROM ( + SELECT curdate() AS date + UNION ALL + SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS date + UNION ALL + SELECT DATE_SUB(CURDATE(), interval 2 day) AS date + UNION ALL + SELECT DATE_SUB(CURDATE(), interval 3 day) AS date + UNION ALL + SELECT DATE_SUB(CURDATE(), interval 4 day) AS date + UNION ALL + SELECT DATE_SUB(CURDATE(), interval 5 day) AS date + UNION ALL + SELECT DATE_SUB(CURDATE(), interval 6 day) AS date + ) tmp + LEFT JOIN ( + SELECT DATE (trigger_at) AS triggerAt, + SUM(running_num + finish_num + max_count_num + suspend_num) AS taskTotal FROM retry_summary + GROUP BY triggerAt + ) b + ON tmp.date = b.triggerAt