From b6e63e885dc7e02756603a84e3ad2161040014e1 Mon Sep 17 00:00:00 2001 From: "zhijiantianya@gmail.com" Date: Mon, 16 Oct 2023 20:01:25 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/statistics/enums/TimeRangeTypeEnum.java | 3 +-- .../admin/member/MemberStatisticsController.java | 5 +++++ .../controller/admin/member/vo/MemberCountRespVO.java | 1 + .../controller/admin/pay/PayStatisticsController.java | 1 + .../admin/trade/TradeStatisticsController.java | 9 +++++++++ .../convert/trade/TradeStatisticsConvert.java | 1 + .../dal/dataobject/trade/TradeStatisticsDO.java | 1 + .../dal/mysql/infra/ApiAccessLogStatisticsMapper.java | 2 ++ .../dal/mysql/member/MemberStatisticsMapper.java | 11 +++++++++++ .../dal/mysql/pay/PayWalletStatisticsMapper.java | 1 + .../dal/mysql/trade/AfterSaleStatisticsMapper.java | 1 + .../dal/mysql/trade/BrokerageStatisticsMapper.java | 2 ++ .../dal/mysql/trade/TradeOrderStatisticsMapper.java | 5 +++++ .../dal/mysql/trade/TradeStatisticsMapper.java | 3 +++ .../statistics/job/trade/TradeStatisticsJob.java | 1 + .../service/infra/ApiAccessLogStatisticsService.java | 2 ++ .../service/member/MemberStatisticsService.java | 6 ++++++ .../service/pay/PayWalletStatisticsService.java | 1 + .../service/pay/bo/RechargeSummaryRespBO.java | 1 - .../service/trade/AfterSaleStatisticsService.java | 1 + .../service/trade/BrokerageStatisticsService.java | 1 + .../service/trade/TradeOrderStatisticsService.java | 3 +++ .../trade/TradeOrderStatisticsServiceImpl.java | 8 ++++---- .../service/trade/TradeStatisticsService.java | 2 ++ .../service/trade/TradeStatisticsServiceImpl.java | 2 ++ .../mapper/trade/TradeOrderStatisticsMapper.xml | 5 ++++- .../service/order/TradeOrderUpdateServiceImpl.java | 1 + .../member/dal/dataobject/user/MemberUserDO.java | 2 +- .../member/service/user/MemberUserServiceImpl.java | 1 + 29 files changed, 74 insertions(+), 9 deletions(-) diff --git a/yudao-module-mall/yudao-module-statistics-api/src/main/java/cn/iocoder/yudao/module/statistics/enums/TimeRangeTypeEnum.java b/yudao-module-mall/yudao-module-statistics-api/src/main/java/cn/iocoder/yudao/module/statistics/enums/TimeRangeTypeEnum.java index 1b2361e43..5f3c8fe22 100644 --- a/yudao-module-mall/yudao-module-statistics-api/src/main/java/cn/iocoder/yudao/module/statistics/enums/TimeRangeTypeEnum.java +++ b/yudao-module-mall/yudao-module-statistics-api/src/main/java/cn/iocoder/yudao/module/statistics/enums/TimeRangeTypeEnum.java @@ -35,9 +35,8 @@ public enum TimeRangeTypeEnum implements IntArrayValuable { public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TimeRangeTypeEnum::getType).toArray(); - /** - * 状态 + * 类型 */ private final Integer type; diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/MemberStatisticsController.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/MemberStatisticsController.java index 3ee8eb919..59d2dd2b4 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/MemberStatisticsController.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/MemberStatisticsController.java @@ -77,6 +77,7 @@ public class MemberStatisticsController { } // TODO 芋艿:已经 review + // TODO @疯狂:要不 get 前缀去掉,和下面的 list 接口保持一致 @GetMapping("/get-area-statistics-list") @Operation(summary = "按照省份,获得会员统计列表") @PreAuthorize("@ss.hasPermission('statistics:member:query')") @@ -85,6 +86,7 @@ public class MemberStatisticsController { } // TODO 芋艿:已经 review + // TODO @疯狂:要不 get 前缀去掉,和下面的 list 接口保持一致 @GetMapping("/get-sex-statistics-list") @Operation(summary = "按照性别,获得会员统计列表") @PreAuthorize("@ss.hasPermission('statistics:member:query')") @@ -92,6 +94,8 @@ public class MemberStatisticsController { return success(memberStatisticsService.getMemberSexStatisticsList()); } + // TODO 芋艿:已经 review + // TODO @疯狂:要不 get 前缀去掉,和下面的 list 接口保持一致 @GetMapping("/get-terminal-statistics-list") @Operation(summary = "按照终端,获得会员统计列表") @PreAuthorize("@ss.hasPermission('statistics:member:query')") @@ -106,6 +110,7 @@ public class MemberStatisticsController { return success(memberStatisticsService.getUserCountComparison()); } + // TODO 芋艿:已经 review @GetMapping("/register-count-list") @Operation(summary = "获得会员注册数量列表") @PreAuthorize("@ss.hasPermission('statistics:member:query')") diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/vo/MemberCountRespVO.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/vo/MemberCountRespVO.java index 28e807e79..d44f2ac5e 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/vo/MemberCountRespVO.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/member/vo/MemberCountRespVO.java @@ -10,6 +10,7 @@ public class MemberCountRespVO { @Schema(description = "用户访问量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Integer visitUserCount; + // TODO @疯狂:要不改成 registerUserCount,注册 @Schema(description = "新增用户数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Integer createUserCount; diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/pay/PayStatisticsController.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/pay/PayStatisticsController.java index 7a6fc7ab7..0af4dc697 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/pay/PayStatisticsController.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/pay/PayStatisticsController.java @@ -24,6 +24,7 @@ public class PayStatisticsController { @Resource private PayWalletStatisticsService payWalletStatisticsService; + // TODO @疯狂:要不搞成 PaySummary?只是目前只有 rechargePrice 充值金额? @GetMapping("/wallet-recharge-price") @Operation(summary = "获取充值金额") public CommonResult getWalletRechargePrice() { diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/TradeStatisticsController.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/TradeStatisticsController.java index 087b955d5..457988986 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/TradeStatisticsController.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/TradeStatisticsController.java @@ -47,6 +47,7 @@ public class TradeStatisticsController { @Resource private BrokerageStatisticsService brokerageStatisticsService; + // TODO 芋艿:已经 review @GetMapping("/summary") @Operation(summary = "获得交易统计") @PreAuthorize("@ss.hasPermission('statistics:trade:query')") @@ -55,6 +56,7 @@ public class TradeStatisticsController { TradeSummaryRespBO yesterdayData = tradeStatisticsService.getTradeSummaryByDays(-1); // 1.2 前天的数据(用于对照昨天的数据) TradeSummaryRespBO beforeYesterdayData = tradeStatisticsService.getTradeSummaryByDays(-2); + // 2.1 本月数据 TradeSummaryRespBO monthData = tradeStatisticsService.getTradeSummaryByMonths(0); // 2.2 上月数据(用于对照本月的数据) @@ -73,6 +75,7 @@ public class TradeStatisticsController { ArrayUtil.get(reqVO.getTimes(), 1))); } + // TODO 芋艿:已经 review @GetMapping("/list") @Operation(summary = "获得交易状况明细") @PreAuthorize("@ss.hasPermission('statistics:trade:query')") @@ -82,6 +85,7 @@ public class TradeStatisticsController { return success(TradeStatisticsConvert.INSTANCE.convertList(list)); } + // TODO 芋艿:已经 review @GetMapping("/export-excel") @Operation(summary = "导出获得交易状况明细 Excel") @PreAuthorize("@ss.hasPermission('statistics:trade:export')") @@ -94,16 +98,20 @@ public class TradeStatisticsController { ExcelUtils.write(response, "交易状况.xls", "数据", TradeTrendSummaryExcelVO.class, data); } + // TODO 芋艿:已经 review @GetMapping("/order-count") @Operation(summary = "获得交易订单数量") @PreAuthorize("@ss.hasPermission('statistics:trade:query')") public CommonResult getOrderCount() { + // 订单统计 TradeOrderCountRespVO vo = tradeOrderStatisticsService.getOrderCount(); + // 售后统计 vo.setAfterSaleApply(afterSaleStatisticsService.getCountByStatus(AfterSaleStatusEnum.APPLY)) .setAuditingWithdraw(brokerageStatisticsService.getWithdrawCountByStatus(BrokerageWithdrawStatusEnum.AUDITING)); return success(vo); } + // TODO 芋艿:已经 review @GetMapping("/order-comparison") @Operation(summary = "获得交易订单数量") @PreAuthorize("@ss.hasPermission('statistics:trade:query')") @@ -111,6 +119,7 @@ public class TradeStatisticsController { return success(tradeOrderStatisticsService.getOrderComparison()); } + // TODO 芋艿:已经 review @GetMapping("/order-count-trend") @Operation(summary = "获得订单量趋势统计") @PreAuthorize("@ss.hasPermission('statistics:trade:query')") diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/convert/trade/TradeStatisticsConvert.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/convert/trade/TradeStatisticsConvert.java index 9fe68f96c..bc519847f 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/convert/trade/TradeStatisticsConvert.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/convert/trade/TradeStatisticsConvert.java @@ -52,6 +52,7 @@ public interface TradeStatisticsConvert { List convertList(List list); + // TODO @疯狂:要不要搞个默认的 convertA 方法,然后这个 convert 去调用 convertA,特殊字段再去 set? default TradeTrendSummaryRespVO convert(TradeStatisticsDO tradeStatistics) { return new TradeTrendSummaryRespVO() .setDate(tradeStatistics.getTime().toLocalDate()) diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java index 0cc3ba3f2..b8e26ff35 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java @@ -63,6 +63,7 @@ public class TradeStatisticsDO extends TenantBaseDO { */ private Integer brokerageSettlementPrice; + // TODO @疯狂:walletPayPrice,钱包支付金额 /** * 总支付金额(余额),单位:分 */ diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/infra/ApiAccessLogStatisticsMapper.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/infra/ApiAccessLogStatisticsMapper.java index 5f76b58fd..cf7f98a0e 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/infra/ApiAccessLogStatisticsMapper.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/infra/ApiAccessLogStatisticsMapper.java @@ -16,10 +16,12 @@ import java.time.LocalDateTime; @SuppressWarnings("rawtypes") public interface ApiAccessLogStatisticsMapper extends BaseMapperX { + // TODO 芋艿:已经 review Integer selectIpCountByUserTypeAndCreateTimeBetween(@Param("userType") Integer userType, @Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); + // TODO 芋艿:已经 review Integer selectUserCountByUserTypeAndCreateTimeBetween(@Param("userType") Integer userType, @Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/member/MemberStatisticsMapper.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/member/MemberStatisticsMapper.java index 4b1bc8783..1d215b818 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/member/MemberStatisticsMapper.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/member/MemberStatisticsMapper.java @@ -20,16 +20,27 @@ import java.util.List; @SuppressWarnings("rawtypes") public interface MemberStatisticsMapper extends BaseMapperX { + // TODO @芋艿:已经 review List selectSummaryListByAreaId(); + // TODO @芋艿:已经 review List selectSummaryListBySex(); + // TODO @芋艿:已经 review List selectSummaryListByRegisterTerminal(); // TODO @芋艿:已经 review Integer selectUserCount(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); + // TODO @芋艿:已经 review + /** + * 获得用户的每天注册数量列表 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return 每天注册数量列表 + */ List selectListByCreateTimeBetween(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/pay/PayWalletStatisticsMapper.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/pay/PayWalletStatisticsMapper.java index 4a2c47180..90ab0e0c6 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/pay/PayWalletStatisticsMapper.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/pay/PayWalletStatisticsMapper.java @@ -37,6 +37,7 @@ public interface PayWalletStatisticsMapper extends BaseMapperX { @Param("endTime") LocalDateTime endTime, @Param("payStatus") Boolean payStatus); + // TODO 芋艿:已经 review; Integer selectRechargePriceSummary(@Param("payStatus") Integer payStatus); } diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/AfterSaleStatisticsMapper.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/AfterSaleStatisticsMapper.java index bbc3ac1c7..1d2bb8814 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/AfterSaleStatisticsMapper.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/AfterSaleStatisticsMapper.java @@ -20,6 +20,7 @@ public interface AfterSaleStatisticsMapper extends BaseMapperX { + // TODO 芋艿:已经 review Integer selectSummaryPriceByStatusAndUnfreezeTimeBetween(@Param("bizType") Integer bizType, @Param("status") Integer status, @Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); + // TODO 芋艿:已经 review Long selectWithdrawCountByStatus(@Param("status") Integer status); } diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeOrderStatisticsMapper.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeOrderStatisticsMapper.java index 2b7ff88a4..5f8645f5d 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeOrderStatisticsMapper.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeOrderStatisticsMapper.java @@ -42,6 +42,7 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX selectListByPayTimeBetweenAndGroupByDay(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); + // TODO 芋艿:已经 review /** * 按照支付时间统计订单(按月分组) * @@ -62,10 +64,13 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX selectListByPayTimeBetweenAndGroupByMonth(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); + // TODO @芋艿:已经 review Long selectCountByStatus(@Param("status") Integer status); + // TODO 芋艿:已经 review Long selectCountByStatusAndPickUpStoreIdIsNotNull(@Param("status") Integer status); + // TODO 芋艿:已经 review TradeOrderSummaryRespVO selectPaySummaryByStatusAndPayTimeBetween(@Param("status") Integer status, @Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeStatisticsMapper.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeStatisticsMapper.java index 67d2d5007..d5ed54cec 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeStatisticsMapper.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeStatisticsMapper.java @@ -25,14 +25,17 @@ public interface TradeStatisticsMapper extends BaseMapperX { TradeTrendSummaryRespVO selectVoByTimeBetween(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); + // TODO @芋艿:已经 review default List selectListByTimeBetween(LocalDateTime beginTime, LocalDateTime endTime) { return selectList(new LambdaQueryWrapperX() .between(TradeStatisticsDO::getTime, beginTime, endTime)); } + // TODO @芋艿:已经 review Integer selectExpensePriceByTimeBetween(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime); + // TODO @芋艿:已经 review default TradeStatisticsDO selectByTimeBetween(LocalDateTime beginTime, LocalDateTime endTime) { return selectOne(new LambdaQueryWrapperX() .between(TradeStatisticsDO::getTime, beginTime, endTime)); diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/job/trade/TradeStatisticsJob.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/job/trade/TradeStatisticsJob.java index 2cefe22b5..708e555ea 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/job/trade/TradeStatisticsJob.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/job/trade/TradeStatisticsJob.java @@ -30,6 +30,7 @@ public class TradeStatisticsJob implements JobHandler { @Override @TenantJob public String execute(String param) { + // TODO @疯狂:要搞个默认的 1 哈; if (NumberUtil.isInteger(param)) { throw new RuntimeException("交易统计任务的参数只能为是正整数"); } diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/infra/ApiAccessLogStatisticsService.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/infra/ApiAccessLogStatisticsService.java index 6c200fdef..f4042730b 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/infra/ApiAccessLogStatisticsService.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/infra/ApiAccessLogStatisticsService.java @@ -9,6 +9,7 @@ import java.time.LocalDateTime; */ public interface ApiAccessLogStatisticsService { + // TODO 芋艿:已经 review /** * 获取活跃用户数量 * @@ -19,6 +20,7 @@ public interface ApiAccessLogStatisticsService { */ Integer getUserCount(Integer userType, LocalDateTime beginTime, LocalDateTime endTime); + // TODO 芋艿:已经 review /** * 获取访问用户数量 * 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 2ace6f86a..96d3ad1f3 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 @@ -21,6 +21,7 @@ public interface MemberStatisticsService { */ MemberSummaryRespVO getMemberSummary(); + // TODO 芋艿:已经 review /** * 获取会员分析对照数据 * @@ -31,6 +32,7 @@ public interface MemberStatisticsService { DataComparisonRespVO getMemberAnalyseComparisonData(LocalDateTime beginTime, LocalDateTime endTime); + // TODO 芋艿:已经 review /** * 按照省份,获得会员统计列表 * @@ -38,6 +40,7 @@ public interface MemberStatisticsService { */ List getMemberAreaStatisticsList(); + // TODO 芋艿:已经 review /** * 按照性别,获得会员统计列表 * @@ -45,6 +48,7 @@ public interface MemberStatisticsService { */ List getMemberSexStatisticsList(); + // TODO @疯狂:这个要不要使用 getMemberTerminalStatisticsList;保持统一? /** * 按照终端,获得会员统计列表 * @@ -52,6 +56,7 @@ public interface MemberStatisticsService { */ List getRegisterTerminalStatisticsList(); + // TODO 芋艿:已经 review /** * 获取用户注册数量列表 * @@ -61,6 +66,7 @@ public interface MemberStatisticsService { */ List getMemberRegisterCountList(LocalDateTime beginTime, LocalDateTime endTime); + // TODO 芋艿:已经 review /** * 获得用户数量量统计对照 * diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsService.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsService.java index be41584e9..4801ad186 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsService.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsService.java @@ -32,6 +32,7 @@ public interface PayWalletStatisticsService { */ RechargeSummaryRespBO getUserRechargeSummary(LocalDateTime beginTime, LocalDateTime endTime); + // TODO 芋艿:已经 review /** * 获取充值金额合计 * diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/bo/RechargeSummaryRespBO.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/bo/RechargeSummaryRespBO.java index b99c05d44..05cfa1155 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/bo/RechargeSummaryRespBO.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/bo/RechargeSummaryRespBO.java @@ -6,7 +6,6 @@ import lombok.Data; /** * 充值统计 Response BO */ -@Schema(description = "管理后台 - ") @Data public class RechargeSummaryRespBO { diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/AfterSaleStatisticsService.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/AfterSaleStatisticsService.java index fa09da770..3904387d6 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/AfterSaleStatisticsService.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/AfterSaleStatisticsService.java @@ -22,6 +22,7 @@ public interface AfterSaleStatisticsService { */ AfterSaleSummaryRespBO getAfterSaleSummary(LocalDateTime beginTime, LocalDateTime endTime); + // TODO 芋艿:已经 review /** * 获取指定状态的售后订单数量 * diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/BrokerageStatisticsService.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/BrokerageStatisticsService.java index 2bcf393d5..5f856778d 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/BrokerageStatisticsService.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/BrokerageStatisticsService.java @@ -21,6 +21,7 @@ public interface BrokerageStatisticsService { */ Integer getBrokerageSettlementPriceSummary(LocalDateTime beginTime, LocalDateTime endTime); + // TODO 芋艿:已经 review /** * 获取指定状态的提现记录数量 * diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsService.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsService.java index dc92b2660..b8bd25e75 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsService.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsService.java @@ -62,6 +62,7 @@ public interface TradeOrderStatisticsService { */ Integer getOrderPayPrice(LocalDateTime beginTime, LocalDateTime endTime); + // TODO 芋艿:已经 review /** * 获得交易订单数量 * @@ -69,6 +70,7 @@ public interface TradeOrderStatisticsService { */ TradeOrderCountRespVO getOrderCount(); + // TODO 芋艿:已经 review /** * 交易订单销售额对照 * @@ -76,6 +78,7 @@ public interface TradeOrderStatisticsService { */ DataComparisonRespVO getOrderComparison(); + // TODO 芋艿:已经 review /** * 获得订单量趋势统计 * diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsServiceImpl.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsServiceImpl.java index 2758979f5..63655ceec 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsServiceImpl.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsServiceImpl.java @@ -63,9 +63,9 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ @Override public TradeOrderCountRespVO getOrderCount() { + // TODO 疯狂:这个可以根据 status + delivertyType 来过滤呀;ps:是不是搞个 service 方法,交给上层去聚合,这样 TradeOrderCountRespVO 可以更明确返回,不用搞 bo; Long undeliveredCount = tradeOrderStatisticsMapper.selectCountByStatus(TradeOrderStatusEnum.UNDELIVERED.getStatus()); Long pickUpCount = tradeOrderStatisticsMapper.selectCountByStatusAndPickUpStoreIdIsNotNull(TradeOrderStatusEnum.DELIVERED.getStatus()); - return new TradeOrderCountRespVO() .setPickUp(ObjUtil.defaultIfNull(pickUpCount, 0L)) .setUndelivered(ObjUtil.defaultIfNull(undeliveredCount, 0L)); @@ -81,8 +81,8 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ private TradeOrderSummaryRespVO getPayPriceSummary(LocalDateTime date) { LocalDateTime beginTime = LocalDateTimeUtil.beginOfDay(date); LocalDateTime endTime = LocalDateTimeUtil.beginOfDay(date); - - return tradeOrderStatisticsMapper.selectPaySummaryByStatusAndPayTimeBetween(PayOrderStatusEnum.SUCCESS.getStatus(), beginTime, endTime); + return tradeOrderStatisticsMapper.selectPaySummaryByStatusAndPayTimeBetween( + PayOrderStatusEnum.SUCCESS.getStatus(), beginTime, endTime); } @Override @@ -93,7 +93,7 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ LocalDateTime referenceEndTime = reqVO.getBeginTime().minusDays(1); LocalDateTime referenceBeginTime = referenceEndTime.minus(Duration.between(reqVO.getBeginTime(), reqVO.getEndTime())); List reference = getOrderCountTrend(reqVO.getType(), referenceBeginTime, referenceEndTime); - + // 顺序对比返回 return IntStream.range(0, value.size()) .mapToObj(index -> new DataComparisonRespVO() .setValue(CollUtil.get(value, index)) diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsService.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsService.java index 949f95ba9..ec2e5bd5a 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsService.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsService.java @@ -49,6 +49,7 @@ public interface TradeStatisticsService { */ String statisticsTrade(Integer days); + // TODO 芋艿:已经 review /** * 统计指定日期的交易数据 * @@ -57,6 +58,7 @@ public interface TradeStatisticsService { */ TradeSummaryRespBO getTradeSummaryByDays(int days); + // TODO 芋艿:已经 review /** * 统计指定月份的交易数据 * diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsServiceImpl.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsServiceImpl.java index 43b3fa475..b3f625d98 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsServiceImpl.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsServiceImpl.java @@ -83,6 +83,7 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { @Override public String statisticsTrade(Integer days) { LocalDateTime today = LocalDateTime.now(); + // TODO @疯狂:不用并发哈,因为租户可能会丢;然后,一般串行就好,对性能没绝对的要求哈,天数也不会多; return IntStream.rangeClosed(1, days) .parallel() .mapToObj(day -> statisticsTrade(today.minusDays(day))) @@ -130,6 +131,7 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { entity = TradeStatisticsConvert.INSTANCE.convert(date, orderSummary, afterSaleSummary, brokerageSettlementPrice, walletSummary); tradeStatisticsMapper.insert(entity); + // TODO @疯狂:这里是不是也要把日期带上?类似 108 那边 return stopWatch.prettyPrint(); } 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 22e468e3a..e054b32b0 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 @@ -1,6 +1,8 @@ + + SELECT COUNT(1) FROM trade_order - WHERE status = #{status} AND deleted = FALSE + WHERE status = #{status} + AND deleted = FALSE