From a72869b97edb263793cfc514736a42f6e85ad8d9 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 12 Oct 2023 21:54:06 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=BB=9F=E8=AE=A1=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/member/package-info.java | 9 ------- .../member/MemberStatisticsService.java | 14 +++++------ .../member/MemberStatisticsServiceImpl.java | 25 +++++++++---------- .../trade/TradeOrderStatisticsMapper.xml | 6 ++--- 4 files changed, 21 insertions(+), 33 deletions(-) delete mode 100644 yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/package-info.java diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/package-info.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/package-info.java deleted file mode 100644 index f3a5e3fff..000000000 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * TODO - * 1. 会员总数据 - * 2. 性别统计 - * 3. 渠道统计 - * 4. 地域统计 - * 5. 会员概览 - */ -package cn.iocoder.yudao.module.statistics.controller.admin.member; diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsService.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsService.java index 7c60affeb..1f30eeb8d 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsService.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsService.java @@ -15,6 +15,13 @@ import java.util.List; */ public interface MemberStatisticsService { + /** + * 获取会员统计 + * + * @return 会员统计 + */ + MemberSummaryRespVO getMemberSummary(); + /** * 按照省份,获得会员统计列表 * @@ -38,11 +45,4 @@ public interface MemberStatisticsService { */ MemberAnalyseRespVO getMemberAnalyse(LocalDateTime beginTime, LocalDateTime endTime); - /** - * 获取会员统计 - * - * @return 会员统计 - */ - MemberSummaryRespVO getMemberSummary(); - } diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java index 02623e7de..a93938b06 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java @@ -44,6 +44,18 @@ public class MemberStatisticsServiceImpl implements MemberStatisticsService { @Resource private ApiAccessLogStatisticsService apiAccessLogStatisticsService; + @Override + public MemberSummaryRespVO getMemberSummary() { + MemberSummaryRespVO vo = payWalletStatisticsService.getUserRechargeSummary(null, null); + Integer expensePrice = tradeStatisticsService.getExpensePrice(null, null); + Integer userCount = memberStatisticsMapper.selectUserCount(null, null); + // 拼接数据 + if (vo == null) { + vo = new MemberSummaryRespVO().setRechargeUserCount(0).setRechargePrice(0); + } + return vo.setUserCount(userCount).setExpensePrice(expensePrice); + } + @Override public List getMemberAreaStatisticsList() { // 统计用户 @@ -89,19 +101,6 @@ public class MemberStatisticsServiceImpl implements MemberStatisticsService { .setComparison(new TradeStatisticsComparisonRespVO<>(vo, reference)); } - @Override - public MemberSummaryRespVO getMemberSummary() { - MemberSummaryRespVO vo = payWalletStatisticsService.getUserRechargeSummary(null, null); - Integer expensePrice = tradeStatisticsService.getExpensePrice(null, null); - Integer userCount = memberStatisticsMapper.selectUserCount(null, null); - - if (vo == null) { - vo = new MemberSummaryRespVO().setRechargeUserCount(0).setRechargePrice(0); - } - - return vo.setUserCount(userCount).setExpensePrice(expensePrice); - } - private MemberAnalyseComparisonRespVO getMemberAnalyseComparisonData(LocalDateTime beginTime, LocalDateTime endTime) { Integer rechargeUserCount = Optional.ofNullable(payWalletStatisticsService.getUserRechargeSummary(beginTime, endTime)) .map(MemberSummaryRespVO::getRechargeUserCount).orElse(0); diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeOrderStatisticsMapper.xml b/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeOrderStatisticsMapper.xml index dbc3a11c7..2cecd468e 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeOrderStatisticsMapper.xml +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeOrderStatisticsMapper.xml @@ -24,20 +24,18 @@