Commit b6e63e885dc7e02756603a84e3ad2161040014e1
1 parent
15021596
code review:商城统计
Showing
29 changed files
with
74 additions
and
9 deletions
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 { | @@ -35,9 +35,8 @@ public enum TimeRangeTypeEnum implements IntArrayValuable { | ||
| 35 | 35 | ||
| 36 | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TimeRangeTypeEnum::getType).toArray(); | 36 | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TimeRangeTypeEnum::getType).toArray(); |
| 37 | 37 | ||
| 38 | - | ||
| 39 | /** | 38 | /** |
| 40 | - * 状态 | 39 | + * 类型 |
| 41 | */ | 40 | */ |
| 42 | private final Integer type; | 41 | private final Integer type; |
| 43 | 42 |
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 { | @@ -77,6 +77,7 @@ public class MemberStatisticsController { | ||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | // TODO 芋艿:已经 review | 79 | // TODO 芋艿:已经 review |
| 80 | + // TODO @疯狂:要不 get 前缀去掉,和下面的 list 接口保持一致 | ||
| 80 | @GetMapping("/get-area-statistics-list") | 81 | @GetMapping("/get-area-statistics-list") |
| 81 | @Operation(summary = "按照省份,获得会员统计列表") | 82 | @Operation(summary = "按照省份,获得会员统计列表") |
| 82 | @PreAuthorize("@ss.hasPermission('statistics:member:query')") | 83 | @PreAuthorize("@ss.hasPermission('statistics:member:query')") |
| @@ -85,6 +86,7 @@ public class MemberStatisticsController { | @@ -85,6 +86,7 @@ public class MemberStatisticsController { | ||
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | // TODO 芋艿:已经 review | 88 | // TODO 芋艿:已经 review |
| 89 | + // TODO @疯狂:要不 get 前缀去掉,和下面的 list 接口保持一致 | ||
| 88 | @GetMapping("/get-sex-statistics-list") | 90 | @GetMapping("/get-sex-statistics-list") |
| 89 | @Operation(summary = "按照性别,获得会员统计列表") | 91 | @Operation(summary = "按照性别,获得会员统计列表") |
| 90 | @PreAuthorize("@ss.hasPermission('statistics:member:query')") | 92 | @PreAuthorize("@ss.hasPermission('statistics:member:query')") |
| @@ -92,6 +94,8 @@ public class MemberStatisticsController { | @@ -92,6 +94,8 @@ public class MemberStatisticsController { | ||
| 92 | return success(memberStatisticsService.getMemberSexStatisticsList()); | 94 | return success(memberStatisticsService.getMemberSexStatisticsList()); |
| 93 | } | 95 | } |
| 94 | 96 | ||
| 97 | + // TODO 芋艿:已经 review | ||
| 98 | + // TODO @疯狂:要不 get 前缀去掉,和下面的 list 接口保持一致 | ||
| 95 | @GetMapping("/get-terminal-statistics-list") | 99 | @GetMapping("/get-terminal-statistics-list") |
| 96 | @Operation(summary = "按照终端,获得会员统计列表") | 100 | @Operation(summary = "按照终端,获得会员统计列表") |
| 97 | @PreAuthorize("@ss.hasPermission('statistics:member:query')") | 101 | @PreAuthorize("@ss.hasPermission('statistics:member:query')") |
| @@ -106,6 +110,7 @@ public class MemberStatisticsController { | @@ -106,6 +110,7 @@ public class MemberStatisticsController { | ||
| 106 | return success(memberStatisticsService.getUserCountComparison()); | 110 | return success(memberStatisticsService.getUserCountComparison()); |
| 107 | } | 111 | } |
| 108 | 112 | ||
| 113 | + // TODO 芋艿:已经 review | ||
| 109 | @GetMapping("/register-count-list") | 114 | @GetMapping("/register-count-list") |
| 110 | @Operation(summary = "获得会员注册数量列表") | 115 | @Operation(summary = "获得会员注册数量列表") |
| 111 | @PreAuthorize("@ss.hasPermission('statistics:member:query')") | 116 | @PreAuthorize("@ss.hasPermission('statistics:member:query')") |
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 { | @@ -10,6 +10,7 @@ public class MemberCountRespVO { | ||
| 10 | @Schema(description = "用户访问量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 10 | @Schema(description = "用户访问量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 11 | private Integer visitUserCount; | 11 | private Integer visitUserCount; |
| 12 | 12 | ||
| 13 | + // TODO @疯狂:要不改成 registerUserCount,注册 | ||
| 13 | @Schema(description = "新增用户数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 14 | @Schema(description = "新增用户数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 14 | private Integer createUserCount; | 15 | private Integer createUserCount; |
| 15 | 16 |
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 { | @@ -24,6 +24,7 @@ public class PayStatisticsController { | ||
| 24 | @Resource | 24 | @Resource |
| 25 | private PayWalletStatisticsService payWalletStatisticsService; | 25 | private PayWalletStatisticsService payWalletStatisticsService; |
| 26 | 26 | ||
| 27 | + // TODO @疯狂:要不搞成 PaySummary?只是目前只有 rechargePrice 充值金额? | ||
| 27 | @GetMapping("/wallet-recharge-price") | 28 | @GetMapping("/wallet-recharge-price") |
| 28 | @Operation(summary = "获取充值金额") | 29 | @Operation(summary = "获取充值金额") |
| 29 | public CommonResult<Integer> getWalletRechargePrice() { | 30 | public CommonResult<Integer> getWalletRechargePrice() { |
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 { | @@ -47,6 +47,7 @@ public class TradeStatisticsController { | ||
| 47 | @Resource | 47 | @Resource |
| 48 | private BrokerageStatisticsService brokerageStatisticsService; | 48 | private BrokerageStatisticsService brokerageStatisticsService; |
| 49 | 49 | ||
| 50 | + // TODO 芋艿:已经 review | ||
| 50 | @GetMapping("/summary") | 51 | @GetMapping("/summary") |
| 51 | @Operation(summary = "获得交易统计") | 52 | @Operation(summary = "获得交易统计") |
| 52 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") | 53 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") |
| @@ -55,6 +56,7 @@ public class TradeStatisticsController { | @@ -55,6 +56,7 @@ public class TradeStatisticsController { | ||
| 55 | TradeSummaryRespBO yesterdayData = tradeStatisticsService.getTradeSummaryByDays(-1); | 56 | TradeSummaryRespBO yesterdayData = tradeStatisticsService.getTradeSummaryByDays(-1); |
| 56 | // 1.2 前天的数据(用于对照昨天的数据) | 57 | // 1.2 前天的数据(用于对照昨天的数据) |
| 57 | TradeSummaryRespBO beforeYesterdayData = tradeStatisticsService.getTradeSummaryByDays(-2); | 58 | TradeSummaryRespBO beforeYesterdayData = tradeStatisticsService.getTradeSummaryByDays(-2); |
| 59 | + | ||
| 58 | // 2.1 本月数据 | 60 | // 2.1 本月数据 |
| 59 | TradeSummaryRespBO monthData = tradeStatisticsService.getTradeSummaryByMonths(0); | 61 | TradeSummaryRespBO monthData = tradeStatisticsService.getTradeSummaryByMonths(0); |
| 60 | // 2.2 上月数据(用于对照本月的数据) | 62 | // 2.2 上月数据(用于对照本月的数据) |
| @@ -73,6 +75,7 @@ public class TradeStatisticsController { | @@ -73,6 +75,7 @@ public class TradeStatisticsController { | ||
| 73 | ArrayUtil.get(reqVO.getTimes(), 1))); | 75 | ArrayUtil.get(reqVO.getTimes(), 1))); |
| 74 | } | 76 | } |
| 75 | 77 | ||
| 78 | + // TODO 芋艿:已经 review | ||
| 76 | @GetMapping("/list") | 79 | @GetMapping("/list") |
| 77 | @Operation(summary = "获得交易状况明细") | 80 | @Operation(summary = "获得交易状况明细") |
| 78 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") | 81 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") |
| @@ -82,6 +85,7 @@ public class TradeStatisticsController { | @@ -82,6 +85,7 @@ public class TradeStatisticsController { | ||
| 82 | return success(TradeStatisticsConvert.INSTANCE.convertList(list)); | 85 | return success(TradeStatisticsConvert.INSTANCE.convertList(list)); |
| 83 | } | 86 | } |
| 84 | 87 | ||
| 88 | + // TODO 芋艿:已经 review | ||
| 85 | @GetMapping("/export-excel") | 89 | @GetMapping("/export-excel") |
| 86 | @Operation(summary = "导出获得交易状况明细 Excel") | 90 | @Operation(summary = "导出获得交易状况明细 Excel") |
| 87 | @PreAuthorize("@ss.hasPermission('statistics:trade:export')") | 91 | @PreAuthorize("@ss.hasPermission('statistics:trade:export')") |
| @@ -94,16 +98,20 @@ public class TradeStatisticsController { | @@ -94,16 +98,20 @@ public class TradeStatisticsController { | ||
| 94 | ExcelUtils.write(response, "交易状况.xls", "数据", TradeTrendSummaryExcelVO.class, data); | 98 | ExcelUtils.write(response, "交易状况.xls", "数据", TradeTrendSummaryExcelVO.class, data); |
| 95 | } | 99 | } |
| 96 | 100 | ||
| 101 | + // TODO 芋艿:已经 review | ||
| 97 | @GetMapping("/order-count") | 102 | @GetMapping("/order-count") |
| 98 | @Operation(summary = "获得交易订单数量") | 103 | @Operation(summary = "获得交易订单数量") |
| 99 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") | 104 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") |
| 100 | public CommonResult<TradeOrderCountRespVO> getOrderCount() { | 105 | public CommonResult<TradeOrderCountRespVO> getOrderCount() { |
| 106 | + // 订单统计 | ||
| 101 | TradeOrderCountRespVO vo = tradeOrderStatisticsService.getOrderCount(); | 107 | TradeOrderCountRespVO vo = tradeOrderStatisticsService.getOrderCount(); |
| 108 | + // 售后统计 | ||
| 102 | vo.setAfterSaleApply(afterSaleStatisticsService.getCountByStatus(AfterSaleStatusEnum.APPLY)) | 109 | vo.setAfterSaleApply(afterSaleStatisticsService.getCountByStatus(AfterSaleStatusEnum.APPLY)) |
| 103 | .setAuditingWithdraw(brokerageStatisticsService.getWithdrawCountByStatus(BrokerageWithdrawStatusEnum.AUDITING)); | 110 | .setAuditingWithdraw(brokerageStatisticsService.getWithdrawCountByStatus(BrokerageWithdrawStatusEnum.AUDITING)); |
| 104 | return success(vo); | 111 | return success(vo); |
| 105 | } | 112 | } |
| 106 | 113 | ||
| 114 | + // TODO 芋艿:已经 review | ||
| 107 | @GetMapping("/order-comparison") | 115 | @GetMapping("/order-comparison") |
| 108 | @Operation(summary = "获得交易订单数量") | 116 | @Operation(summary = "获得交易订单数量") |
| 109 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") | 117 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") |
| @@ -111,6 +119,7 @@ public class TradeStatisticsController { | @@ -111,6 +119,7 @@ public class TradeStatisticsController { | ||
| 111 | return success(tradeOrderStatisticsService.getOrderComparison()); | 119 | return success(tradeOrderStatisticsService.getOrderComparison()); |
| 112 | } | 120 | } |
| 113 | 121 | ||
| 122 | + // TODO 芋艿:已经 review | ||
| 114 | @GetMapping("/order-count-trend") | 123 | @GetMapping("/order-count-trend") |
| 115 | @Operation(summary = "获得订单量趋势统计") | 124 | @Operation(summary = "获得订单量趋势统计") |
| 116 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") | 125 | @PreAuthorize("@ss.hasPermission('statistics:trade:query')") |
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 { | @@ -52,6 +52,7 @@ public interface TradeStatisticsConvert { | ||
| 52 | 52 | ||
| 53 | List<TradeTrendSummaryRespVO> convertList(List<TradeStatisticsDO> list); | 53 | List<TradeTrendSummaryRespVO> convertList(List<TradeStatisticsDO> list); |
| 54 | 54 | ||
| 55 | + // TODO @疯狂:要不要搞个默认的 convertA 方法,然后这个 convert 去调用 convertA,特殊字段再去 set? | ||
| 55 | default TradeTrendSummaryRespVO convert(TradeStatisticsDO tradeStatistics) { | 56 | default TradeTrendSummaryRespVO convert(TradeStatisticsDO tradeStatistics) { |
| 56 | return new TradeTrendSummaryRespVO() | 57 | return new TradeTrendSummaryRespVO() |
| 57 | .setDate(tradeStatistics.getTime().toLocalDate()) | 58 | .setDate(tradeStatistics.getTime().toLocalDate()) |
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 { | @@ -63,6 +63,7 @@ public class TradeStatisticsDO extends TenantBaseDO { | ||
| 63 | */ | 63 | */ |
| 64 | private Integer brokerageSettlementPrice; | 64 | private Integer brokerageSettlementPrice; |
| 65 | 65 | ||
| 66 | + // TODO @疯狂:walletPayPrice,钱包支付金额 | ||
| 66 | /** | 67 | /** |
| 67 | * 总支付金额(余额),单位:分 | 68 | * 总支付金额(余额),单位:分 |
| 68 | */ | 69 | */ |
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; | @@ -16,10 +16,12 @@ import java.time.LocalDateTime; | ||
| 16 | @SuppressWarnings("rawtypes") | 16 | @SuppressWarnings("rawtypes") |
| 17 | public interface ApiAccessLogStatisticsMapper extends BaseMapperX { | 17 | public interface ApiAccessLogStatisticsMapper extends BaseMapperX { |
| 18 | 18 | ||
| 19 | + // TODO 芋艿:已经 review | ||
| 19 | Integer selectIpCountByUserTypeAndCreateTimeBetween(@Param("userType") Integer userType, | 20 | Integer selectIpCountByUserTypeAndCreateTimeBetween(@Param("userType") Integer userType, |
| 20 | @Param("beginTime") LocalDateTime beginTime, | 21 | @Param("beginTime") LocalDateTime beginTime, |
| 21 | @Param("endTime") LocalDateTime endTime); | 22 | @Param("endTime") LocalDateTime endTime); |
| 22 | 23 | ||
| 24 | + // TODO 芋艿:已经 review | ||
| 23 | Integer selectUserCountByUserTypeAndCreateTimeBetween(@Param("userType") Integer userType, | 25 | Integer selectUserCountByUserTypeAndCreateTimeBetween(@Param("userType") Integer userType, |
| 24 | @Param("beginTime") LocalDateTime beginTime, | 26 | @Param("beginTime") LocalDateTime beginTime, |
| 25 | @Param("endTime") LocalDateTime endTime); | 27 | @Param("endTime") LocalDateTime endTime); |
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; | @@ -20,16 +20,27 @@ import java.util.List; | ||
| 20 | @SuppressWarnings("rawtypes") | 20 | @SuppressWarnings("rawtypes") |
| 21 | public interface MemberStatisticsMapper extends BaseMapperX { | 21 | public interface MemberStatisticsMapper extends BaseMapperX { |
| 22 | 22 | ||
| 23 | + // TODO @芋艿:已经 review | ||
| 23 | List<MemberAreaStatisticsRespBO> selectSummaryListByAreaId(); | 24 | List<MemberAreaStatisticsRespBO> selectSummaryListByAreaId(); |
| 24 | 25 | ||
| 26 | + // TODO @芋艿:已经 review | ||
| 25 | List<MemberSexStatisticsRespVO> selectSummaryListBySex(); | 27 | List<MemberSexStatisticsRespVO> selectSummaryListBySex(); |
| 26 | 28 | ||
| 29 | + // TODO @芋艿:已经 review | ||
| 27 | List<MemberTerminalStatisticsRespVO> selectSummaryListByRegisterTerminal(); | 30 | List<MemberTerminalStatisticsRespVO> selectSummaryListByRegisterTerminal(); |
| 28 | 31 | ||
| 29 | // TODO @芋艿:已经 review | 32 | // TODO @芋艿:已经 review |
| 30 | Integer selectUserCount(@Param("beginTime") LocalDateTime beginTime, | 33 | Integer selectUserCount(@Param("beginTime") LocalDateTime beginTime, |
| 31 | @Param("endTime") LocalDateTime endTime); | 34 | @Param("endTime") LocalDateTime endTime); |
| 32 | 35 | ||
| 36 | + // TODO @芋艿:已经 review | ||
| 37 | + /** | ||
| 38 | + * 获得用户的每天注册数量列表 | ||
| 39 | + * | ||
| 40 | + * @param beginTime 开始时间 | ||
| 41 | + * @param endTime 结束时间 | ||
| 42 | + * @return 每天注册数量列表 | ||
| 43 | + */ | ||
| 33 | List<MemberRegisterCountRespVO> selectListByCreateTimeBetween(@Param("beginTime") LocalDateTime beginTime, | 44 | List<MemberRegisterCountRespVO> selectListByCreateTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 34 | @Param("endTime") LocalDateTime endTime); | 45 | @Param("endTime") LocalDateTime endTime); |
| 35 | 46 |
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 { | @@ -37,6 +37,7 @@ public interface PayWalletStatisticsMapper extends BaseMapperX { | ||
| 37 | @Param("endTime") LocalDateTime endTime, | 37 | @Param("endTime") LocalDateTime endTime, |
| 38 | @Param("payStatus") Boolean payStatus); | 38 | @Param("payStatus") Boolean payStatus); |
| 39 | 39 | ||
| 40 | + // TODO 芋艿:已经 review; | ||
| 40 | Integer selectRechargePriceSummary(@Param("payStatus") Integer payStatus); | 41 | Integer selectRechargePriceSummary(@Param("payStatus") Integer payStatus); |
| 41 | 42 | ||
| 42 | } | 43 | } |
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<TradeStatisticsDO | @@ -20,6 +20,7 @@ public interface AfterSaleStatisticsMapper extends BaseMapperX<TradeStatisticsDO | ||
| 20 | AfterSaleSummaryRespBO selectSummaryByRefundTimeBetween(@Param("beginTime") LocalDateTime beginTime, | 20 | AfterSaleSummaryRespBO selectSummaryByRefundTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 21 | @Param("endTime") LocalDateTime endTime); | 21 | @Param("endTime") LocalDateTime endTime); |
| 22 | 22 | ||
| 23 | + // TODO 芋艿:已经 review | ||
| 23 | Long selectCountByStatus(@Param("status") Integer status); | 24 | Long selectCountByStatus(@Param("status") Integer status); |
| 24 | 25 | ||
| 25 | } | 26 | } |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/BrokerageStatisticsMapper.java
| @@ -15,11 +15,13 @@ import java.time.LocalDateTime; | @@ -15,11 +15,13 @@ import java.time.LocalDateTime; | ||
| 15 | @Mapper | 15 | @Mapper |
| 16 | public interface BrokerageStatisticsMapper extends BaseMapperX<TradeStatisticsDO> { | 16 | public interface BrokerageStatisticsMapper extends BaseMapperX<TradeStatisticsDO> { |
| 17 | 17 | ||
| 18 | + // TODO 芋艿:已经 review | ||
| 18 | Integer selectSummaryPriceByStatusAndUnfreezeTimeBetween(@Param("bizType") Integer bizType, | 19 | Integer selectSummaryPriceByStatusAndUnfreezeTimeBetween(@Param("bizType") Integer bizType, |
| 19 | @Param("status") Integer status, | 20 | @Param("status") Integer status, |
| 20 | @Param("beginTime") LocalDateTime beginTime, | 21 | @Param("beginTime") LocalDateTime beginTime, |
| 21 | @Param("endTime") LocalDateTime endTime); | 22 | @Param("endTime") LocalDateTime endTime); |
| 22 | 23 | ||
| 24 | + // TODO 芋艿:已经 review | ||
| 23 | Long selectWithdrawCountByStatus(@Param("status") Integer status); | 25 | Long selectWithdrawCountByStatus(@Param("status") Integer status); |
| 24 | 26 | ||
| 25 | } | 27 | } |
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<TradeStatisticsD | @@ -42,6 +42,7 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX<TradeStatisticsD | ||
| 42 | Integer selectUserCountByPayTimeBetween(@Param("beginTime") LocalDateTime beginTime, | 42 | Integer selectUserCountByPayTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 43 | @Param("endTime") LocalDateTime endTime); | 43 | @Param("endTime") LocalDateTime endTime); |
| 44 | 44 | ||
| 45 | + // TODO 芋艿:已经 review | ||
| 45 | /** | 46 | /** |
| 46 | * 按照支付时间统计订单(按天分组) | 47 | * 按照支付时间统计订单(按天分组) |
| 47 | * | 48 | * |
| @@ -52,6 +53,7 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX<TradeStatisticsD | @@ -52,6 +53,7 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX<TradeStatisticsD | ||
| 52 | List<TradeOrderTrendRespVO> selectListByPayTimeBetweenAndGroupByDay(@Param("beginTime") LocalDateTime beginTime, | 53 | List<TradeOrderTrendRespVO> selectListByPayTimeBetweenAndGroupByDay(@Param("beginTime") LocalDateTime beginTime, |
| 53 | @Param("endTime") LocalDateTime endTime); | 54 | @Param("endTime") LocalDateTime endTime); |
| 54 | 55 | ||
| 56 | + // TODO 芋艿:已经 review | ||
| 55 | /** | 57 | /** |
| 56 | * 按照支付时间统计订单(按月分组) | 58 | * 按照支付时间统计订单(按月分组) |
| 57 | * | 59 | * |
| @@ -62,10 +64,13 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX<TradeStatisticsD | @@ -62,10 +64,13 @@ public interface TradeOrderStatisticsMapper extends BaseMapperX<TradeStatisticsD | ||
| 62 | List<TradeOrderTrendRespVO> selectListByPayTimeBetweenAndGroupByMonth(@Param("beginTime") LocalDateTime beginTime, | 64 | List<TradeOrderTrendRespVO> selectListByPayTimeBetweenAndGroupByMonth(@Param("beginTime") LocalDateTime beginTime, |
| 63 | @Param("endTime") LocalDateTime endTime); | 65 | @Param("endTime") LocalDateTime endTime); |
| 64 | 66 | ||
| 67 | + // TODO @芋艿:已经 review | ||
| 65 | Long selectCountByStatus(@Param("status") Integer status); | 68 | Long selectCountByStatus(@Param("status") Integer status); |
| 66 | 69 | ||
| 70 | + // TODO 芋艿:已经 review | ||
| 67 | Long selectCountByStatusAndPickUpStoreIdIsNotNull(@Param("status") Integer status); | 71 | Long selectCountByStatusAndPickUpStoreIdIsNotNull(@Param("status") Integer status); |
| 68 | 72 | ||
| 73 | + // TODO 芋艿:已经 review | ||
| 69 | TradeOrderSummaryRespVO selectPaySummaryByStatusAndPayTimeBetween(@Param("status") Integer status, | 74 | TradeOrderSummaryRespVO selectPaySummaryByStatusAndPayTimeBetween(@Param("status") Integer status, |
| 70 | @Param("beginTime") LocalDateTime beginTime, | 75 | @Param("beginTime") LocalDateTime beginTime, |
| 71 | @Param("endTime") LocalDateTime endTime); | 76 | @Param("endTime") LocalDateTime endTime); |
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<TradeStatisticsDO> { | @@ -25,14 +25,17 @@ public interface TradeStatisticsMapper extends BaseMapperX<TradeStatisticsDO> { | ||
| 25 | TradeTrendSummaryRespVO selectVoByTimeBetween(@Param("beginTime") LocalDateTime beginTime, | 25 | TradeTrendSummaryRespVO selectVoByTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 26 | @Param("endTime") LocalDateTime endTime); | 26 | @Param("endTime") LocalDateTime endTime); |
| 27 | 27 | ||
| 28 | + // TODO @芋艿:已经 review | ||
| 28 | default List<TradeStatisticsDO> selectListByTimeBetween(LocalDateTime beginTime, LocalDateTime endTime) { | 29 | default List<TradeStatisticsDO> selectListByTimeBetween(LocalDateTime beginTime, LocalDateTime endTime) { |
| 29 | return selectList(new LambdaQueryWrapperX<TradeStatisticsDO>() | 30 | return selectList(new LambdaQueryWrapperX<TradeStatisticsDO>() |
| 30 | .between(TradeStatisticsDO::getTime, beginTime, endTime)); | 31 | .between(TradeStatisticsDO::getTime, beginTime, endTime)); |
| 31 | } | 32 | } |
| 32 | 33 | ||
| 34 | + // TODO @芋艿:已经 review | ||
| 33 | Integer selectExpensePriceByTimeBetween(@Param("beginTime") LocalDateTime beginTime, | 35 | Integer selectExpensePriceByTimeBetween(@Param("beginTime") LocalDateTime beginTime, |
| 34 | @Param("endTime") LocalDateTime endTime); | 36 | @Param("endTime") LocalDateTime endTime); |
| 35 | 37 | ||
| 38 | + // TODO @芋艿:已经 review | ||
| 36 | default TradeStatisticsDO selectByTimeBetween(LocalDateTime beginTime, LocalDateTime endTime) { | 39 | default TradeStatisticsDO selectByTimeBetween(LocalDateTime beginTime, LocalDateTime endTime) { |
| 37 | return selectOne(new LambdaQueryWrapperX<TradeStatisticsDO>() | 40 | return selectOne(new LambdaQueryWrapperX<TradeStatisticsDO>() |
| 38 | .between(TradeStatisticsDO::getTime, beginTime, endTime)); | 41 | .between(TradeStatisticsDO::getTime, beginTime, endTime)); |
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 { | @@ -30,6 +30,7 @@ public class TradeStatisticsJob implements JobHandler { | ||
| 30 | @Override | 30 | @Override |
| 31 | @TenantJob | 31 | @TenantJob |
| 32 | public String execute(String param) { | 32 | public String execute(String param) { |
| 33 | + // TODO @疯狂:要搞个默认的 1 哈; | ||
| 33 | if (NumberUtil.isInteger(param)) { | 34 | if (NumberUtil.isInteger(param)) { |
| 34 | throw new RuntimeException("交易统计任务的参数只能为是正整数"); | 35 | throw new RuntimeException("交易统计任务的参数只能为是正整数"); |
| 35 | } | 36 | } |
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; | @@ -9,6 +9,7 @@ import java.time.LocalDateTime; | ||
| 9 | */ | 9 | */ |
| 10 | public interface ApiAccessLogStatisticsService { | 10 | public interface ApiAccessLogStatisticsService { |
| 11 | 11 | ||
| 12 | + // TODO 芋艿:已经 review | ||
| 12 | /** | 13 | /** |
| 13 | * 获取活跃用户数量 | 14 | * 获取活跃用户数量 |
| 14 | * | 15 | * |
| @@ -19,6 +20,7 @@ public interface ApiAccessLogStatisticsService { | @@ -19,6 +20,7 @@ public interface ApiAccessLogStatisticsService { | ||
| 19 | */ | 20 | */ |
| 20 | Integer getUserCount(Integer userType, LocalDateTime beginTime, LocalDateTime endTime); | 21 | Integer getUserCount(Integer userType, LocalDateTime beginTime, LocalDateTime endTime); |
| 21 | 22 | ||
| 23 | + // TODO 芋艿:已经 review | ||
| 22 | /** | 24 | /** |
| 23 | * 获取访问用户数量 | 25 | * 获取访问用户数量 |
| 24 | * | 26 | * |
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 { | @@ -21,6 +21,7 @@ public interface MemberStatisticsService { | ||
| 21 | */ | 21 | */ |
| 22 | MemberSummaryRespVO getMemberSummary(); | 22 | MemberSummaryRespVO getMemberSummary(); |
| 23 | 23 | ||
| 24 | + // TODO 芋艿:已经 review | ||
| 24 | /** | 25 | /** |
| 25 | * 获取会员分析对照数据 | 26 | * 获取会员分析对照数据 |
| 26 | * | 27 | * |
| @@ -31,6 +32,7 @@ public interface MemberStatisticsService { | @@ -31,6 +32,7 @@ public interface MemberStatisticsService { | ||
| 31 | DataComparisonRespVO<MemberAnalyseDataRespVO> getMemberAnalyseComparisonData(LocalDateTime beginTime, | 32 | DataComparisonRespVO<MemberAnalyseDataRespVO> getMemberAnalyseComparisonData(LocalDateTime beginTime, |
| 32 | LocalDateTime endTime); | 33 | LocalDateTime endTime); |
| 33 | 34 | ||
| 35 | + // TODO 芋艿:已经 review | ||
| 34 | /** | 36 | /** |
| 35 | * 按照省份,获得会员统计列表 | 37 | * 按照省份,获得会员统计列表 |
| 36 | * | 38 | * |
| @@ -38,6 +40,7 @@ public interface MemberStatisticsService { | @@ -38,6 +40,7 @@ public interface MemberStatisticsService { | ||
| 38 | */ | 40 | */ |
| 39 | List<MemberAreaStatisticsRespVO> getMemberAreaStatisticsList(); | 41 | List<MemberAreaStatisticsRespVO> getMemberAreaStatisticsList(); |
| 40 | 42 | ||
| 43 | + // TODO 芋艿:已经 review | ||
| 41 | /** | 44 | /** |
| 42 | * 按照性别,获得会员统计列表 | 45 | * 按照性别,获得会员统计列表 |
| 43 | * | 46 | * |
| @@ -45,6 +48,7 @@ public interface MemberStatisticsService { | @@ -45,6 +48,7 @@ public interface MemberStatisticsService { | ||
| 45 | */ | 48 | */ |
| 46 | List<MemberSexStatisticsRespVO> getMemberSexStatisticsList(); | 49 | List<MemberSexStatisticsRespVO> getMemberSexStatisticsList(); |
| 47 | 50 | ||
| 51 | + // TODO @疯狂:这个要不要使用 getMemberTerminalStatisticsList;保持统一? | ||
| 48 | /** | 52 | /** |
| 49 | * 按照终端,获得会员统计列表 | 53 | * 按照终端,获得会员统计列表 |
| 50 | * | 54 | * |
| @@ -52,6 +56,7 @@ public interface MemberStatisticsService { | @@ -52,6 +56,7 @@ public interface MemberStatisticsService { | ||
| 52 | */ | 56 | */ |
| 53 | List<MemberTerminalStatisticsRespVO> getRegisterTerminalStatisticsList(); | 57 | List<MemberTerminalStatisticsRespVO> getRegisterTerminalStatisticsList(); |
| 54 | 58 | ||
| 59 | + // TODO 芋艿:已经 review | ||
| 55 | /** | 60 | /** |
| 56 | * 获取用户注册数量列表 | 61 | * 获取用户注册数量列表 |
| 57 | * | 62 | * |
| @@ -61,6 +66,7 @@ public interface MemberStatisticsService { | @@ -61,6 +66,7 @@ public interface MemberStatisticsService { | ||
| 61 | */ | 66 | */ |
| 62 | List<MemberRegisterCountRespVO> getMemberRegisterCountList(LocalDateTime beginTime, LocalDateTime endTime); | 67 | List<MemberRegisterCountRespVO> getMemberRegisterCountList(LocalDateTime beginTime, LocalDateTime endTime); |
| 63 | 68 | ||
| 69 | + // TODO 芋艿:已经 review | ||
| 64 | /** | 70 | /** |
| 65 | * 获得用户数量量统计对照 | 71 | * 获得用户数量量统计对照 |
| 66 | * | 72 | * |
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 { | @@ -32,6 +32,7 @@ public interface PayWalletStatisticsService { | ||
| 32 | */ | 32 | */ |
| 33 | RechargeSummaryRespBO getUserRechargeSummary(LocalDateTime beginTime, LocalDateTime endTime); | 33 | RechargeSummaryRespBO getUserRechargeSummary(LocalDateTime beginTime, LocalDateTime endTime); |
| 34 | 34 | ||
| 35 | + // TODO 芋艿:已经 review | ||
| 35 | /** | 36 | /** |
| 36 | * 获取充值金额合计 | 37 | * 获取充值金额合计 |
| 37 | * | 38 | * |
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/bo/RechargeSummaryRespBO.java
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 { | @@ -22,6 +22,7 @@ public interface AfterSaleStatisticsService { | ||
| 22 | */ | 22 | */ |
| 23 | AfterSaleSummaryRespBO getAfterSaleSummary(LocalDateTime beginTime, LocalDateTime endTime); | 23 | AfterSaleSummaryRespBO getAfterSaleSummary(LocalDateTime beginTime, LocalDateTime endTime); |
| 24 | 24 | ||
| 25 | + // TODO 芋艿:已经 review | ||
| 25 | /** | 26 | /** |
| 26 | * 获取指定状态的售后订单数量 | 27 | * 获取指定状态的售后订单数量 |
| 27 | * | 28 | * |
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 { | @@ -21,6 +21,7 @@ public interface BrokerageStatisticsService { | ||
| 21 | */ | 21 | */ |
| 22 | Integer getBrokerageSettlementPriceSummary(LocalDateTime beginTime, LocalDateTime endTime); | 22 | Integer getBrokerageSettlementPriceSummary(LocalDateTime beginTime, LocalDateTime endTime); |
| 23 | 23 | ||
| 24 | + // TODO 芋艿:已经 review | ||
| 24 | /** | 25 | /** |
| 25 | * 获取指定状态的提现记录数量 | 26 | * 获取指定状态的提现记录数量 |
| 26 | * | 27 | * |
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 { | @@ -62,6 +62,7 @@ public interface TradeOrderStatisticsService { | ||
| 62 | */ | 62 | */ |
| 63 | Integer getOrderPayPrice(LocalDateTime beginTime, LocalDateTime endTime); | 63 | Integer getOrderPayPrice(LocalDateTime beginTime, LocalDateTime endTime); |
| 64 | 64 | ||
| 65 | + // TODO 芋艿:已经 review | ||
| 65 | /** | 66 | /** |
| 66 | * 获得交易订单数量 | 67 | * 获得交易订单数量 |
| 67 | * | 68 | * |
| @@ -69,6 +70,7 @@ public interface TradeOrderStatisticsService { | @@ -69,6 +70,7 @@ public interface TradeOrderStatisticsService { | ||
| 69 | */ | 70 | */ |
| 70 | TradeOrderCountRespVO getOrderCount(); | 71 | TradeOrderCountRespVO getOrderCount(); |
| 71 | 72 | ||
| 73 | + // TODO 芋艿:已经 review | ||
| 72 | /** | 74 | /** |
| 73 | * 交易订单销售额对照 | 75 | * 交易订单销售额对照 |
| 74 | * | 76 | * |
| @@ -76,6 +78,7 @@ public interface TradeOrderStatisticsService { | @@ -76,6 +78,7 @@ public interface TradeOrderStatisticsService { | ||
| 76 | */ | 78 | */ |
| 77 | DataComparisonRespVO<TradeOrderSummaryRespVO> getOrderComparison(); | 79 | DataComparisonRespVO<TradeOrderSummaryRespVO> getOrderComparison(); |
| 78 | 80 | ||
| 81 | + // TODO 芋艿:已经 review | ||
| 79 | /** | 82 | /** |
| 80 | * 获得订单量趋势统计 | 83 | * 获得订单量趋势统计 |
| 81 | * | 84 | * |
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 | @@ -63,9 +63,9 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ | ||
| 63 | 63 | ||
| 64 | @Override | 64 | @Override |
| 65 | public TradeOrderCountRespVO getOrderCount() { | 65 | public TradeOrderCountRespVO getOrderCount() { |
| 66 | + // TODO 疯狂:这个可以根据 status + delivertyType 来过滤呀;ps:是不是搞个 service 方法,交给上层去聚合,这样 TradeOrderCountRespVO 可以更明确返回,不用搞 bo; | ||
| 66 | Long undeliveredCount = tradeOrderStatisticsMapper.selectCountByStatus(TradeOrderStatusEnum.UNDELIVERED.getStatus()); | 67 | Long undeliveredCount = tradeOrderStatisticsMapper.selectCountByStatus(TradeOrderStatusEnum.UNDELIVERED.getStatus()); |
| 67 | Long pickUpCount = tradeOrderStatisticsMapper.selectCountByStatusAndPickUpStoreIdIsNotNull(TradeOrderStatusEnum.DELIVERED.getStatus()); | 68 | Long pickUpCount = tradeOrderStatisticsMapper.selectCountByStatusAndPickUpStoreIdIsNotNull(TradeOrderStatusEnum.DELIVERED.getStatus()); |
| 68 | - | ||
| 69 | return new TradeOrderCountRespVO() | 69 | return new TradeOrderCountRespVO() |
| 70 | .setPickUp(ObjUtil.defaultIfNull(pickUpCount, 0L)) | 70 | .setPickUp(ObjUtil.defaultIfNull(pickUpCount, 0L)) |
| 71 | .setUndelivered(ObjUtil.defaultIfNull(undeliveredCount, 0L)); | 71 | .setUndelivered(ObjUtil.defaultIfNull(undeliveredCount, 0L)); |
| @@ -81,8 +81,8 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ | @@ -81,8 +81,8 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ | ||
| 81 | private TradeOrderSummaryRespVO getPayPriceSummary(LocalDateTime date) { | 81 | private TradeOrderSummaryRespVO getPayPriceSummary(LocalDateTime date) { |
| 82 | LocalDateTime beginTime = LocalDateTimeUtil.beginOfDay(date); | 82 | LocalDateTime beginTime = LocalDateTimeUtil.beginOfDay(date); |
| 83 | LocalDateTime endTime = LocalDateTimeUtil.beginOfDay(date); | 83 | LocalDateTime endTime = LocalDateTimeUtil.beginOfDay(date); |
| 84 | - | ||
| 85 | - return tradeOrderStatisticsMapper.selectPaySummaryByStatusAndPayTimeBetween(PayOrderStatusEnum.SUCCESS.getStatus(), beginTime, endTime); | 84 | + return tradeOrderStatisticsMapper.selectPaySummaryByStatusAndPayTimeBetween( |
| 85 | + PayOrderStatusEnum.SUCCESS.getStatus(), beginTime, endTime); | ||
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | @Override | 88 | @Override |
| @@ -93,7 +93,7 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ | @@ -93,7 +93,7 @@ public class TradeOrderStatisticsServiceImpl implements TradeOrderStatisticsServ | ||
| 93 | LocalDateTime referenceEndTime = reqVO.getBeginTime().minusDays(1); | 93 | LocalDateTime referenceEndTime = reqVO.getBeginTime().minusDays(1); |
| 94 | LocalDateTime referenceBeginTime = referenceEndTime.minus(Duration.between(reqVO.getBeginTime(), reqVO.getEndTime())); | 94 | LocalDateTime referenceBeginTime = referenceEndTime.minus(Duration.between(reqVO.getBeginTime(), reqVO.getEndTime())); |
| 95 | List<TradeOrderTrendRespVO> reference = getOrderCountTrend(reqVO.getType(), referenceBeginTime, referenceEndTime); | 95 | List<TradeOrderTrendRespVO> reference = getOrderCountTrend(reqVO.getType(), referenceBeginTime, referenceEndTime); |
| 96 | - | 96 | + // 顺序对比返回 |
| 97 | return IntStream.range(0, value.size()) | 97 | return IntStream.range(0, value.size()) |
| 98 | .mapToObj(index -> new DataComparisonRespVO<TradeOrderTrendRespVO>() | 98 | .mapToObj(index -> new DataComparisonRespVO<TradeOrderTrendRespVO>() |
| 99 | .setValue(CollUtil.get(value, index)) | 99 | .setValue(CollUtil.get(value, index)) |
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 { | @@ -49,6 +49,7 @@ public interface TradeStatisticsService { | ||
| 49 | */ | 49 | */ |
| 50 | String statisticsTrade(Integer days); | 50 | String statisticsTrade(Integer days); |
| 51 | 51 | ||
| 52 | + // TODO 芋艿:已经 review | ||
| 52 | /** | 53 | /** |
| 53 | * 统计指定日期的交易数据 | 54 | * 统计指定日期的交易数据 |
| 54 | * | 55 | * |
| @@ -57,6 +58,7 @@ public interface TradeStatisticsService { | @@ -57,6 +58,7 @@ public interface TradeStatisticsService { | ||
| 57 | */ | 58 | */ |
| 58 | TradeSummaryRespBO getTradeSummaryByDays(int days); | 59 | TradeSummaryRespBO getTradeSummaryByDays(int days); |
| 59 | 60 | ||
| 61 | + // TODO 芋艿:已经 review | ||
| 60 | /** | 62 | /** |
| 61 | * 统计指定月份的交易数据 | 63 | * 统计指定月份的交易数据 |
| 62 | * | 64 | * |
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 { | @@ -83,6 +83,7 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { | ||
| 83 | @Override | 83 | @Override |
| 84 | public String statisticsTrade(Integer days) { | 84 | public String statisticsTrade(Integer days) { |
| 85 | LocalDateTime today = LocalDateTime.now(); | 85 | LocalDateTime today = LocalDateTime.now(); |
| 86 | + // TODO @疯狂:不用并发哈,因为租户可能会丢;然后,一般串行就好,对性能没绝对的要求哈,天数也不会多; | ||
| 86 | return IntStream.rangeClosed(1, days) | 87 | return IntStream.rangeClosed(1, days) |
| 87 | .parallel() | 88 | .parallel() |
| 88 | .mapToObj(day -> statisticsTrade(today.minusDays(day))) | 89 | .mapToObj(day -> statisticsTrade(today.minusDays(day))) |
| @@ -130,6 +131,7 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { | @@ -130,6 +131,7 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { | ||
| 130 | entity = TradeStatisticsConvert.INSTANCE.convert(date, orderSummary, afterSaleSummary, brokerageSettlementPrice, | 131 | entity = TradeStatisticsConvert.INSTANCE.convert(date, orderSummary, afterSaleSummary, brokerageSettlementPrice, |
| 131 | walletSummary); | 132 | walletSummary); |
| 132 | tradeStatisticsMapper.insert(entity); | 133 | tradeStatisticsMapper.insert(entity); |
| 134 | + // TODO @疯狂:这里是不是也要把日期带上?类似 108 那边 | ||
| 133 | return stopWatch.prettyPrint(); | 135 | return stopWatch.prettyPrint(); |
| 134 | } | 136 | } |
| 135 | 137 |
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeOrderStatisticsMapper.xml
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 3 | <mapper namespace="cn.iocoder.yudao.module.statistics.dal.mysql.trade.TradeOrderStatisticsMapper"> | 3 | <mapper namespace="cn.iocoder.yudao.module.statistics.dal.mysql.trade.TradeOrderStatisticsMapper"> |
| 4 | + | ||
| 5 | + <!-- TODO @疯狂:是返回不是的 MemberAreaStatisticsRespBO 哈 --> | ||
| 4 | <select id="selectSummaryListByAreaId" | 6 | <select id="selectSummaryListByAreaId" |
| 5 | resultType="cn.iocoder.yudao.module.statistics.controller.admin.member.vo.MemberAreaStatisticsRespVO"> | 7 | resultType="cn.iocoder.yudao.module.statistics.controller.admin.member.vo.MemberAreaStatisticsRespVO"> |
| 6 | SELECT receiver_area_id AS areaId, | 8 | SELECT receiver_area_id AS areaId, |
| @@ -87,7 +89,8 @@ | @@ -87,7 +89,8 @@ | ||
| 87 | <select id="selectCountByStatus" resultType="java.lang.Long"> | 89 | <select id="selectCountByStatus" resultType="java.lang.Long"> |
| 88 | SELECT COUNT(1) | 90 | SELECT COUNT(1) |
| 89 | FROM trade_order | 91 | FROM trade_order |
| 90 | - WHERE status = #{status} AND deleted = FALSE | 92 | + WHERE status = #{status} |
| 93 | + AND deleted = FALSE | ||
| 91 | </select> | 94 | </select> |
| 92 | 95 | ||
| 93 | <select id="selectCountByStatusAndPickUpStoreIdIsNotNull" resultType="java.lang.Long"> | 96 | <select id="selectCountByStatusAndPickUpStoreIdIsNotNull" resultType="java.lang.Long"> |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java
| @@ -187,6 +187,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | @@ -187,6 +187,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | ||
| 187 | order.setStatus(TradeOrderStatusEnum.UNPAID.getStatus()); | 187 | order.setStatus(TradeOrderStatusEnum.UNPAID.getStatus()); |
| 188 | order.setRefundStatus(TradeOrderRefundStatusEnum.NONE.getStatus()); | 188 | order.setRefundStatus(TradeOrderRefundStatusEnum.NONE.getStatus()); |
| 189 | order.setProductCount(getSumValue(calculateRespBO.getItems(), TradePriceCalculateRespBO.OrderItem::getCount, Integer::sum)); | 189 | order.setProductCount(getSumValue(calculateRespBO.getItems(), TradePriceCalculateRespBO.OrderItem::getCount, Integer::sum)); |
| 190 | + // TODO @疯狂:无状态,terminal 不从 servletuTILS 拿,而是通过 controller 传递给 service; | ||
| 190 | order.setTerminal(ServletUtils.getTerminal()); | 191 | order.setTerminal(ServletUtils.getTerminal()); |
| 191 | // 支付 + 退款信息 | 192 | // 支付 + 退款信息 |
| 192 | order.setAdjustPrice(0).setPayStatus(false); | 193 | order.setAdjustPrice(0).setPayStatus(false); |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/user/MemberUserDO.java
| @@ -117,7 +117,7 @@ public class MemberUserDO extends TenantBaseDO { | @@ -117,7 +117,7 @@ public class MemberUserDO extends TenantBaseDO { | ||
| 117 | * 积分 | 117 | * 积分 |
| 118 | */ | 118 | */ |
| 119 | private Integer point; | 119 | private Integer point; |
| 120 | - // TODO 芋艿:增加一个 totalPoint;个人信息接口要返回 | 120 | + // TODO 疯狂:增加一个 totalPoint;个人信息接口要返回 |
| 121 | 121 | ||
| 122 | /** | 122 | /** |
| 123 | * 会员标签列表,以逗号分隔 | 123 | * 会员标签列表,以逗号分隔 |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java
| @@ -100,6 +100,7 @@ public class MemberUserServiceImpl implements MemberUserService { | @@ -100,6 +100,7 @@ public class MemberUserServiceImpl implements MemberUserService { | ||
| 100 | user.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 默认开启 | 100 | user.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 默认开启 |
| 101 | user.setPassword(encodePassword(password)); // 加密密码 | 101 | user.setPassword(encodePassword(password)); // 加密密码 |
| 102 | user.setRegisterIp(registerIp); | 102 | user.setRegisterIp(registerIp); |
| 103 | + // TODO @疯狂:无状态,terminal 不从 servletuTILS 拿,而是通过 controller 传递给 service; | ||
| 103 | user.setRegisterTerminal(ServletUtils.getTerminal()); | 104 | user.setRegisterTerminal(ServletUtils.getTerminal()); |
| 104 | memberUserMapper.insert(user); | 105 | memberUserMapper.insert(user); |
| 105 | 106 |