From 095850700a9f4f06d1b18d04c89ca47f4cd2eee7 Mon Sep 17 00:00:00 2001 From: xxm1995 Date: Mon, 18 Mar 2024 00:10:15 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E9=A9=BE=E9=A9=B6=E8=88=B1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/CockpitReportController.java | 16 ++++++++-------- .../core/report/dao/CockpitReportMapper.java | 9 +++++---- .../report/service/CockpitReportService.java | 16 ++++++++-------- .../service/param/report/CockpitReportQuery.java | 4 ++-- .../mapper/report/CockpitReportMapper.xml | 4 ++-- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/report/CockpitReportController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/report/CockpitReportController.java index 526dd9f15..0a06f8051 100644 --- a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/report/CockpitReportController.java +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/report/CockpitReportController.java @@ -58,18 +58,18 @@ public class CockpitReportController { return Res.ok(cockpitReportService.getRefundOrderCount(query)); } - @Operation(summary = "支付通道折线图") - @GetMapping("/getPayChannelLine") - public ResResult> getPayChannelLine(@ParameterObject CockpitReportQuery query){ + @Operation(summary = "显示通道支付订单金额和订单数") + @GetMapping("/getPayChannelInfo") + public ResResult> getPayChannelInfo(@ParameterObject CockpitReportQuery query){ ValidationUtil.validateParam(query); - return Res.ok(cockpitReportService.getPayChannelLine(query)); + return Res.ok(cockpitReportService.getPayChannelInfo(query)); } - @Operation(summary = "退款通道折线图") - @GetMapping("/getRefundChannelLine") - public ResResult> getRefundChannelLine(@ParameterObject CockpitReportQuery query){ + @Operation(summary = "显示通道退款订单金额和订单数") + @GetMapping("/getRefundChannelInfo") + public ResResult> getRefundChannelInfo(@ParameterObject CockpitReportQuery query){ ValidationUtil.validateParam(query); - return Res.ok(cockpitReportService.getRefundChannelLine(query)); + return Res.ok(cockpitReportService.getRefundChannelInfo(query)); } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/report/dao/CockpitReportMapper.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/report/dao/CockpitReportMapper.java index 0654abcd3..4a09e3a9b 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/report/dao/CockpitReportMapper.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/report/dao/CockpitReportMapper.java @@ -5,6 +5,7 @@ import cn.bootx.platform.daxpay.service.param.report.CockpitReportQuery; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Optional; /** * 查询报表 @@ -17,12 +18,12 @@ public interface CockpitReportMapper { /** * 获取支付金额 */ - Integer getPayAmount(CockpitReportQuery query); + Optional getPayAmount(CockpitReportQuery query); /** * 获取退款金额 */ - Integer getRefundAmount(CockpitReportQuery query); + Optional getRefundAmount(CockpitReportQuery query); /** * 获取支付订单数量 @@ -37,12 +38,12 @@ public interface CockpitReportMapper { /** * 支付通道订单折线图 */ - List getPayChannelLine(CockpitReportQuery query); + List getPayChannelInfo(CockpitReportQuery query); /** * 退款通道订单折线图 */ - List getRefundChannelLine(CockpitReportQuery query); + List getRefundChannelInfo(CockpitReportQuery query); } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/report/service/CockpitReportService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/report/service/CockpitReportService.java index 3432a7308..96615c2b5 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/report/service/CockpitReportService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/report/service/CockpitReportService.java @@ -34,14 +34,14 @@ public class CockpitReportService { */ public Integer getPayAmount(CockpitReportQuery query){ // 获取支付成功的订单 - return cockpitReportMapper.getPayAmount(query); + return cockpitReportMapper.getPayAmount(query).orElse(0); } /** * 退款金额(分) */ public Integer getRefundAmount(CockpitReportQuery query){ - return cockpitReportMapper.getRefundAmount(query); + return cockpitReportMapper.getRefundAmount(query).orElse(0); } /** @@ -59,10 +59,10 @@ public class CockpitReportService { } /** - * (折线图)显示各通道支付分为支付金额和订单数, + * (折线图/占比图)显示各通道支付分为支付金额和订单数 */ - public List getPayChannelLine(CockpitReportQuery query){ - Map lineMap = cockpitReportMapper.getPayChannelLine(query) + public List getPayChannelInfo(CockpitReportQuery query){ + Map lineMap = cockpitReportMapper.getPayChannelInfo(query) .stream() .collect(Collectors.toMap(ChannelOrderLine::getChannel, Function.identity(), CollectorsFunction::retainLatest)); // 根据系统中有的通道编码,获取对应的通道名称 @@ -83,10 +83,10 @@ public class CockpitReportService { } /** - * (折线图)显示各通道退款金额和订单数, + * (折线图/占比图)显示各通道退款金额和订单数, */ - public List getRefundChannelLine(CockpitReportQuery query){ - Map lineMap = cockpitReportMapper.getRefundChannelLine(query) + public List getRefundChannelInfo(CockpitReportQuery query){ + Map lineMap = cockpitReportMapper.getRefundChannelInfo(query) .stream() .collect(Collectors.toMap(ChannelOrderLine::getChannel, Function.identity(), CollectorsFunction::retainLatest)); // 根据系统中有的通道编码,获取对应的通道名称 diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/report/CockpitReportQuery.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/report/CockpitReportQuery.java index 0c59ce381..e7a073a81 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/report/CockpitReportQuery.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/report/CockpitReportQuery.java @@ -26,8 +26,8 @@ public class CockpitReportQuery { @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) private LocalDateTime startTime; - @NotNull(message = "开始时间不得为空") - @Schema(description = "开始时间") + @NotNull(message = "结束时间不得为空") + @Schema(description = "结束时间") @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) private LocalDateTime endTime; diff --git a/daxpay-single/daxpay-single-service/src/main/resources/mapper/report/CockpitReportMapper.xml b/daxpay-single/daxpay-single-service/src/main/resources/mapper/report/CockpitReportMapper.xml index ffba7400b..26a0e40ec 100644 --- a/daxpay-single/daxpay-single-service/src/main/resources/mapper/report/CockpitReportMapper.xml +++ b/daxpay-single/daxpay-single-service/src/main/resources/mapper/report/CockpitReportMapper.xml @@ -47,7 +47,7 @@ - SELECT channel, count(*) as count, @@ -62,7 +62,7 @@ - SELECT channel, count(*) as count,