mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	code review:数据统计
This commit is contained in:
		| @@ -6,4 +6,4 @@ | ||||
|  * 4. 地域统计 | ||||
|  * 5. 会员概览 | ||||
|  */ | ||||
| package cn.iocoder.yudao.module.statistics.controller.member; | ||||
| package cn.iocoder.yudao.module.statistics.controller.admin.member; | ||||
| @@ -1,4 +1,4 @@ | ||||
| package cn.iocoder.yudao.module.statistics.controller.product; | ||||
| package cn.iocoder.yudao.module.statistics.controller.admin.product; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| @@ -32,6 +32,7 @@ public class TradeStatisticsController { | ||||
|     @Resource | ||||
|     private TradeStatisticsService tradeStatisticsService; | ||||
|  | ||||
|     // TODO @疯狂:要不这个就是 /trend/summary 的特例,前端自己查询两次? | ||||
|     @GetMapping("/summary") | ||||
|     @Operation(summary = "获得交易统计") | ||||
|     @PreAuthorize("@ss.hasPermission('statistics:trade:query')") | ||||
| @@ -39,6 +40,7 @@ public class TradeStatisticsController { | ||||
|         return success(tradeStatisticsService.getTradeSummaryComparison()); | ||||
|     } | ||||
|  | ||||
|     // TODO @疯狂:直接 comparison?主要 trend 和 comparison 二选一,一个是数据趋势,一个是数据对比哈; | ||||
|     @GetMapping("/trend/summary") | ||||
|     @Operation(summary = "获得交易状况统计") | ||||
|     @PreAuthorize("@ss.hasPermission('statistics:trade:query')") | ||||
|   | ||||
| @@ -36,4 +36,5 @@ public class TradeTrendSummaryRespVO { | ||||
|  | ||||
|     @Schema(description = "商品退款金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||||
|     private Integer orderRefundPrice; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,4 @@ | ||||
| /** | ||||
|  * TODO 芋艿:占位 | ||||
|  */ | ||||
| package cn.iocoder.yudao.module.statistics.controller.app; | ||||
| @@ -1 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.statistics.controller; | ||||
| @@ -26,7 +26,8 @@ public interface TradeStatisticsService { | ||||
|      * | ||||
|      * @return 统计数据对照 | ||||
|      */ | ||||
|     TradeStatisticsComparisonRespVO<TradeTrendSummaryRespVO> getTradeTrendSummaryComparison(LocalDateTime beginTime, LocalDateTime endTime); | ||||
|     TradeStatisticsComparisonRespVO<TradeTrendSummaryRespVO> getTradeTrendSummaryComparison( | ||||
|             LocalDateTime beginTime, LocalDateTime endTime); | ||||
|  | ||||
|     /** | ||||
|      * 获得交易状况明细 | ||||
| @@ -34,4 +35,5 @@ public interface TradeStatisticsService { | ||||
|      * @return 统计数据列表 | ||||
|      */ | ||||
|     List<TradeTrendSummaryRespVO> getTradeStatisticsList(LocalDateTime beginTime, LocalDateTime endTime); | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -79,6 +79,7 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService { | ||||
|      * @return 交易数据 | ||||
|      */ | ||||
|     private TradeSummaryRespBO getTradeSummaryByMonths(int months) { | ||||
|         // TODO @疯狂:可以在 LocalDateUtils 封装方法;获得月份的开始;以及结束两个方法;然后这里就可以直接调用了 | ||||
|         // 月份开始时间 | ||||
|         LocalDateTime beginOfMonth = LocalDateTime.now() | ||||
|                 .plusMonths(months) | ||||
|   | ||||
| @@ -19,4 +19,5 @@ public class TradeSummaryRespBO { | ||||
|      * 合计 | ||||
|      */ | ||||
|     private Integer summary; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="cn.iocoder.yudao.module.statistics.dal.mysql.trade.TradeStatisticsMapper"> | ||||
|  | ||||
|     <select id="selectByTimeBetween" | ||||
|             resultType="cn.iocoder.yudao.module.statistics.controller.admin.trade.vo.TradeTrendSummaryRespVO"> | ||||
|         SELECT | ||||
| @@ -35,4 +36,5 @@ | ||||
|           AND deleted = FALSE | ||||
|         GROUP BY date | ||||
|     </select> | ||||
|  | ||||
| </mapper> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV