Explorar el Código

code review:统计代码

YunaiV hace 1 año
padre
commit
fef808d88c
Se han modificado 32 ficheros con 73 adiciones y 181 borrados
  1. 2 0
      yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java
  2. 5 3
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/infra/ApiAccessLogStatisticsMapper.java
  3. 3 2
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/member/MemberStatisticsMapper.java
  4. 2 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/pay/PayWalletStatisticsMapper.java
  5. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/AfterSaleStatisticsMapper.java
  6. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/BrokerageStatisticsMapper.java
  7. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeOrderStatisticsMapper.java
  8. 2 0
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeStatisticsMapper.java
  9. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/infra/ApiAccessLogStatisticsService.java
  10. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/infra/ApiAccessLogStatisticsServiceImpl.java
  11. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsService.java
  12. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java
  13. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsService.java
  14. 5 6
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsServiceImpl.java
  15. 1 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsService.java
  16. 13 14
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsServiceImpl.java
  17. 1 0
      yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/bo/WalletSummaryRespBO.java
  18. 6 4
      yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/infra/ApiAccessLogStatisticsMapper.xml
  19. 4 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/member/MemberStatisticsMapper.xml
  20. 5 4
      yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/pay/PayWalletStatisticsMapper.xml
  21. 4 2
      yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/AfterSaleStatisticsMapper.xml
  22. 3 1
      yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/BrokerageStatisticsMapper.xml
  23. 7 5
      yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeOrderStatisticsMapper.xml
  24. 2 0
      yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeStatisticsMapper.xml
  25. 0 10
      yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/api/aftersale/TradeAfterSaleApi.java
  26. 0 10
      yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/api/brokerage/TradeBrokerageApi.java
  27. 0 19
      yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/api/order/TradeOrderApi.java
  28. 0 21
      yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/api/aftersale/TradeAfterSaleApiImpl.java
  29. 0 21
      yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/api/brokerage/TradeBrokerageApiImpl.java
  30. 0 14
      yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/api/order/TradeOrderApiImpl.java
  31. 0 10
      yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/wallet/PayWalletApi.java
  32. 0 24
      yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/api/wallet/PayWalletApiImpl.java

+ 2 - 0
yudao-framework/yudao-spring-boot-starter-biz-ip/src/main/java/cn/iocoder/yudao/framework/ip/core/utils/AreaUtils.java

@@ -132,7 +132,9 @@ public class AreaUtils {
         return convertList(areas.values(), func, area -> type.getType().equals(area.getType()));
     }
 
+    // TODO @疯狂:注释写下;
     public static Integer getParentIdByType(Integer id, @NonNull AreaTypeEnum type) {
+        // TODO @疯狂:这种不要用 while true;因为万一脏数据,可能会死循环;可以转换成 for (int i = 0; i < Byte.MAX; i++) 一般是优先层级;
         do {
             Area area = AreaUtils.getArea(id);
             if (area == null) {

+ 5 - 3
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/infra/ApiAccessLogStatisticsMapper.java

@@ -7,15 +7,17 @@ import org.apache.ibatis.annotations.Param;
 import java.time.LocalDateTime;
 
 /**
- * API 访问日志统计 Mapper
+ * API 访问日志统计 Mapper
  *
  * @author owen
  */
 @Mapper
 public interface ApiAccessLogStatisticsMapper extends BaseMapperX<Object> {
 
-    Integer selectCountByIp(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime);
+    Integer selectCountByIp(@Param("beginTime") LocalDateTime beginTime,
+                            @Param("endTime") LocalDateTime endTime);
 
-    Integer selectCountByUserId(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime);
+    Integer selectCountByUserId(@Param("beginTime") LocalDateTime beginTime,
+                                @Param("endTime") LocalDateTime endTime);
 
 }

+ 3 - 2
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/member/MemberStatisticsMapper.java

@@ -10,7 +10,7 @@ import java.time.LocalDateTime;
 import java.util.List;
 
 /**
- * 会员统计 Mapper
+ * 会员信息的统计 Mapper
  *
  * @author owen
  */
@@ -21,6 +21,7 @@ public interface MemberStatisticsMapper extends BaseMapperX<Object> {
 
     List<MemberSexStatisticsRespVO> selectSummaryListBySex();
 
-    Integer selectUserCount(@Param("beginTime") LocalDateTime beginTime, @Param("endTime") LocalDateTime endTime);
+    Integer selectUserCount(@Param("beginTime") LocalDateTime beginTime,
+                            @Param("endTime") LocalDateTime endTime);
 
 }

+ 2 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/pay/PayWalletStatisticsMapper.java

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Param;
 import java.time.LocalDateTime;
 
 /**
- * 交易统计 Mapper
+ * 支付钱包的统计 Mapper
  *
  * @author owen
  */
@@ -29,6 +29,7 @@ public interface PayWalletStatisticsMapper extends BaseMapperX<TradeStatisticsDO
                                                             @Param("endTime") LocalDateTime endTime,
                                                             @Param("bizType") Integer bizType);
 
+    // TODO @疯狂:是不是搞个单独的 BO 呀;
     MemberSummaryRespVO selectRechargeSummaryGroupByWalletId(@Param("beginTime") LocalDateTime beginTime,
                                                              @Param("endTime") LocalDateTime endTime,
                                                              @Param("payStatus") Boolean payStatus);

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/AfterSaleStatisticsMapper.java

@@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Param;
 import java.time.LocalDateTime;
 
 /**
- * 交易统计 Mapper
+ * 售后订单的统计 Mapper
  *
  * @author owen
  */

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/BrokerageStatisticsMapper.java

@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
 import java.time.LocalDateTime;
 
 /**
- * 交易统计 Mapper
+ * 订单分销的统计 Mapper
  *
  * @author owen
  */

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeOrderStatisticsMapper.java

@@ -10,7 +10,7 @@ import java.time.LocalDateTime;
 import java.util.List;
 
 /**
- * 交易统计 Mapper
+ * 交易订单的统计 Mapper
  *
  * @author owen
  */

+ 2 - 0
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/mysql/trade/TradeStatisticsMapper.java

@@ -19,6 +19,7 @@ import java.util.List;
 @Mapper
 public interface TradeStatisticsMapper extends BaseMapperX<TradeStatisticsDO> {
 
+    // TODO @疯狂:这个要不要也挪到 xml 里,保持统一?
     @Select("SELECT IFNULL(SUM(order_create_count), 0) AS count, IFNULL(SUM(order_pay_price), 0) AS summary " +
             "FROM trade_statistics " +
             "WHERE time BETWEEN #{beginTime} AND #{endTime} AND deleted = FALSE")
@@ -33,4 +34,5 @@ public interface TradeStatisticsMapper extends BaseMapperX<TradeStatisticsDO> {
 
     Integer selectExpensePriceByTimeBetween(@Param("beginTime") LocalDateTime beginTime,
                                             @Param("endTime") LocalDateTime endTime);
+
 }

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/infra/ApiAccessLogStatisticsService.java

@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.statistics.service.infra;
 import java.time.LocalDateTime;
 
 /**
- * API 访问日志统计 Service 接口
+ * API 访问日志统计 Service 接口
  *
  * @author owen
  */

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/infra/ApiAccessLogStatisticsServiceImpl.java

@@ -8,7 +8,7 @@ import javax.annotation.Resource;
 import java.time.LocalDateTime;
 
 /**
- * API 访问日志统计 Service 实现类
+ * API 访问日志统计 Service 实现类
  *
  * @author owen
  */

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsService.java

@@ -9,7 +9,7 @@ import java.time.LocalDateTime;
 import java.util.List;
 
 /**
- * 会员统计 Service 接口
+ * 会员信息的统计 Service 接口
  *
  * @author owen
  */

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/member/MemberStatisticsServiceImpl.java

@@ -24,7 +24,7 @@ import java.util.Optional;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
 
 /**
- * 会员统计 Service 实现类
+ * 会员信息的统计 Service 实现类
  *
  * @author owen
  */

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsService.java

@@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.statistics.service.trade.bo.WalletSummaryRespBO;
 import java.time.LocalDateTime;
 
 /**
- * 钱包统计 Service 接口
+ * 钱包统计 Service 接口
  *
  * @author owen
  */

+ 5 - 6
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsServiceImpl.java

@@ -12,7 +12,7 @@ import javax.annotation.Resource;
 import java.time.LocalDateTime;
 
 /**
- * 钱包统计 Service 实现类
+ * 钱包统计 Service 实现类
  *
  * @author owen
  */
@@ -31,11 +31,10 @@ public class PayWalletStatisticsServiceImpl implements PayWalletStatisticsServic
                 beginTime, endTime, PayRefundStatusEnum.SUCCESS.getStatus());
         Integer walletPayPrice = payWalletStatisticsMapper.selectPriceSummaryByBizTypeAndCreateTimeBetween(
                 beginTime, endTime, PayWalletBizTypeEnum.PAYMENT.getType());
-
-        paySummary.setOrderWalletPayPrice(walletPayPrice);
-        paySummary.setRechargeRefundCount(refundSummary.getRechargeRefundCount());
-        paySummary.setRechargeRefundPrice(refundSummary.getRechargeRefundPrice());
-
+        // 拼接
+        paySummary.setOrderWalletPayPrice(walletPayPrice)
+                .setRechargeRefundCount(refundSummary.getRechargeRefundCount())
+                .setRechargeRefundPrice(refundSummary.getRechargeRefundPrice());
         return paySummary;
     }
 

+ 1 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeOrderStatisticsService.java

@@ -7,7 +7,7 @@ import java.time.LocalDateTime;
 import java.util.List;
 
 /**
- * 交易订单统计 Service 接口
+ * 交易订单统计 Service 接口
  *
  * @author owen
  */

+ 13 - 14
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/TradeStatisticsServiceImpl.java

@@ -45,16 +45,15 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService {
 
     @Override
     public TradeStatisticsComparisonRespVO<TradeSummaryRespVO> getTradeSummaryComparison() {
-        // 昨天的数据
+        // 1.1 昨天的数据
         TradeSummaryRespBO yesterdayData = getTradeSummaryByDays(-1);
-        // 前天的数据(用于对照昨天的数据)
+        // 1.2 前天的数据(用于对照昨天的数据)
         TradeSummaryRespBO beforeYesterdayData = getTradeSummaryByDays(-2);
-
-        // 本月数据;
+        // 2.1 本月数据
         TradeSummaryRespBO monthData = getTradeSummaryByMonths(0);
-        // 上月数据(用于对照本月的数据)
+        // 2.2 上月数据(用于对照本月的数据)
         TradeSummaryRespBO lastMonthData = getTradeSummaryByMonths(-1);
-
+        // 转换返回
         return TradeStatisticsConvert.INSTANCE.convert(yesterdayData, beforeYesterdayData, monthData, lastMonthData);
     }
 
@@ -81,31 +80,31 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService {
 
     @Override
     public String statisticsYesterdayTrade() {
-        // 处理统计参数
         LocalDateTime yesterday = LocalDateTime.now().minusDays(1);
         LocalDateTime beginTime = LocalDateTimeUtil.beginOfDay(yesterday);
         LocalDateTime endTime = LocalDateTimeUtil.endOfDay(yesterday);
-        // 统计
+        // 1.1 统计订单
         StopWatch stopWatch = new StopWatch("交易统计");
         stopWatch.start("统计订单");
         TradeOrderSummaryRespBO orderSummary = tradeOrderStatisticsService.getOrderSummary(beginTime, endTime);
         stopWatch.stop();
-
+        // 1.2 统计售后
         stopWatch.start("统计售后");
         AfterSaleSummaryRespBO afterSaleSummary = afterSaleStatisticsService.getAfterSaleSummary(beginTime, endTime);
         stopWatch.stop();
-
+        // 1.3 统计佣金
         stopWatch.start("统计佣金");
         Integer brokerageSettlementPrice = brokerageStatisticsService.getBrokerageSettlementPriceSummary(beginTime, endTime);
         stopWatch.stop();
-
+        // 1.4 统计充值
         stopWatch.start("统计充值");
         WalletSummaryRespBO walletSummary = payWalletStatisticsService.getWalletSummary(beginTime, endTime);
         stopWatch.stop();
-        // 插入数据
-        TradeStatisticsDO entity = TradeStatisticsConvert.INSTANCE.convert(yesterday, orderSummary, afterSaleSummary, brokerageSettlementPrice, walletSummary);
+
+        // 2. 插入数据
+        TradeStatisticsDO entity = TradeStatisticsConvert.INSTANCE.convert(yesterday, orderSummary, afterSaleSummary,
+                brokerageSettlementPrice, walletSummary);
         tradeStatisticsMapper.insert(entity);
-        // 返回计时结果
         return stopWatch.prettyPrint();
     }
 

+ 1 - 0
yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/bo/WalletSummaryRespBO.java

@@ -9,6 +9,7 @@ import lombok.Data;
  */
 @Data
 public class WalletSummaryRespBO {
+
     /**
      * 总支付金额(余额),单位:分
      */

+ 6 - 4
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/infra/ApiAccessLogStatisticsMapper.xml

@@ -1,20 +1,22 @@
 <?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.infra.ApiAccessLogStatisticsMapper">
+
     <select id="selectCountByIp" resultType="java.lang.Integer">
         SELECT COUNT(1)
         FROM infra_api_access_log
-        WHERE deleted = FALSE
-          AND create_time BETWEEN #{beginTime} AND #{endTime}
+        WHERE create_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
         GROUP BY user_ip
     </select>
 
     <select id="selectCountByUserId" resultType="java.lang.Integer">
         SELECT COUNT(1)
         FROM infra_api_access_log
-        WHERE user_id != 0
-          AND deleted = FALSE
+        WHERE user_id > 0
           AND create_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
         GROUP BY user_id
     </select>
+
 </mapper>

+ 4 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/member/MemberStatisticsMapper.xml

@@ -8,6 +8,7 @@
         FROM member_user
         WHERE deleted = FALSE
         GROUP BY area_id
+        <!-- TODO @疯狂:order by 是不是交给内存哈 -->
         ORDER BY userCount DESC
     </select>
 
@@ -17,6 +18,7 @@
         FROM member_user
         WHERE deleted = FALSE
         GROUP BY sex
+        <!-- TODO @疯狂:order by 是不是交给内存哈 -->
         ORDER BY userCount DESC
     </select>
 
@@ -31,4 +33,5 @@
             AND create_time &lt;= #{endTime}
         </if>
     </select>
-</mapper>
+
+</mapper>

+ 5 - 4
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/pay/PayWalletStatisticsMapper.xml

@@ -7,8 +7,8 @@
                SUM(pay_price) AS rechargePayPrice
         FROM pay_wallet_recharge
         WHERE pay_status = #{payStatus}
-          AND deleted = FALSE
           AND pay_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
     </select>
 
     <select id="selectRechargeSummaryByRefundTimeBetween"
@@ -17,16 +17,16 @@
                SUM(pay_price) AS rechargeRefundPrice
         FROM pay_wallet_recharge
         WHERE refund_status = #{refundStatus}
-          AND deleted = FALSE
           AND refund_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
     </select>
 
     <select id="selectPriceSummaryByBizTypeAndCreateTimeBetween" resultType="java.lang.Integer">
         SELECT SUM(price)
         FROM pay_wallet_transaction
         WHERE biz_type = #{bizType}
-          AND deleted = FALSE
           AND create_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
     </select>
 
     <select id="selectRechargeSummaryGroupByWalletId"
@@ -35,13 +35,14 @@
                SUM(pay_price) AS rechargePrice
         FROM pay_wallet_recharge
         WHERE pay_status = #{payStatus}
-          AND deleted = FALSE
         <if test="beginTime != null">
             AND pay_time >= #{beginTime}
         </if>
         <if test="endTime != null">
             AND pay_time &lt;= #{endTime}
         </if>
+            AND deleted = FALSE
         GROUP BY wallet_id
     </select>
+
 </mapper>

+ 4 - 2
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/AfterSaleStatisticsMapper.xml

@@ -1,12 +1,14 @@
 <?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.AfterSaleStatisticsMapper">
+
     <select id="selectSummaryByRefundTimeBetween"
             resultType="cn.iocoder.yudao.module.statistics.service.trade.bo.AfterSaleSummaryRespBO">
         SELECT COUNT(1)          AS afterSaleCount,
                SUM(refund_price) AS afterSaleRefundPrice
         FROM trade_after_sale
-        WHERE deleted = FALSE
-          AND refund_time BETWEEN #{beginTime} AND #{endTime}
+        WHERE refund_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
     </select>
+
 </mapper>

+ 3 - 1
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/BrokerageStatisticsMapper.xml

@@ -1,12 +1,14 @@
 <?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.BrokerageStatisticsMapper">
+
     <select id="selectSummaryPriceByStatusAndUnfreezeTimeBetween" resultType="java.lang.Integer">
         SELECT SUM(price)
         FROM trade_brokerage_record
         WHERE biz_type = #{bizType}
           AND status = #{status}
-          AND deleted = FALSE
           AND unfreeze_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
     </select>
+
 </mapper>

+ 7 - 5
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeOrderStatisticsMapper.xml

@@ -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.TradeOrderStatisticsMapper">
+
     <select id="selectSummaryListByAreaId"
             resultType="cn.iocoder.yudao.module.statistics.controller.admin.member.vo.MemberAreaStatisticsRespVO">
         SELECT receiver_area_id                                AS areaId,
@@ -33,25 +34,25 @@
     <select id="selectUserCountByPayTimeBetween" resultType="java.lang.Integer">
         SELECT COUNT(1)
         FROM trade_order
-        WHERE deleted = FALSE
+        WHERE pay_time BETWEEN #{beginTime} AND #{endTime}
           AND pay_status = TRUE
-          AND pay_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
         GROUP BY user_id
     </select>
 
     <select id="selectCountByCreateTimeBetween" resultType="java.lang.Integer">
         SELECT COUNT(1)
         FROM trade_order
-        WHERE deleted = FALSE
-          AND create_time BETWEEN #{beginTime} AND #{endTime}
+        WHERE create_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
     </select>
 
     <select id="selectCountByPayTimeBetween" resultType="java.lang.Integer">
         SELECT COUNT(1)
         FROM trade_order
         WHERE pay_status = TRUE
-          AND deleted = FALSE
           AND create_time BETWEEN #{beginTime} AND #{endTime}
+          AND deleted = FALSE
     </select>
 
     <select id="selectSummaryPriceByPayTimeBetween" resultType="java.lang.Integer">
@@ -61,4 +62,5 @@
           AND deleted = FALSE
           AND create_time BETWEEN #{beginTime} AND #{endTime}
     </select>
+
 </mapper>

+ 2 - 0
yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeStatisticsMapper.xml

@@ -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
@@ -48,4 +49,5 @@
             AND time &lt;= #{endTime}
         </if>
     </select>
+
 </mapper>

+ 0 - 10
yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/api/aftersale/TradeAfterSaleApi.java

@@ -1,10 +0,0 @@
-package cn.iocoder.yudao.module.trade.api.aftersale;
-
-/**
- * 售后 API 接口
- *
- * @author owen
- */
-public interface TradeAfterSaleApi {
-
-}

+ 0 - 10
yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/api/brokerage/TradeBrokerageApi.java

@@ -1,10 +0,0 @@
-package cn.iocoder.yudao.module.trade.api.brokerage;
-
-/**
- * 分销 API 接口
- *
- * @author owen
- */
-public interface TradeBrokerageApi {
-
-}

+ 0 - 19
yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/api/order/TradeOrderApi.java

@@ -28,25 +28,6 @@ public interface TradeOrderApi {
      */
     TradeOrderRespDTO getOrder(Long id);
 
-    /**
-     * 获取订单统计
-     *
-     * @param beginTime 起始时间
-     * @param endTime   截止时间
-     * @return 订单统计结果
-     */
-    TradeOrderSummaryRespDTO getOrderSummary(LocalDateTime beginTime, LocalDateTime endTime);
-
-    /**
-     * 更新拼团相关信息到订单
-     *
-     * @param orderId             订单编号
-     * @param activityId          拼团活动编号
-     * @param combinationRecordId 拼团记录编号
-     * @param headId              团长编号
-     */
-    void updateOrderCombinationInfo(Long orderId, Long activityId, Long combinationRecordId, Long headId);
-
     // TODO 芋艿:需要优化下;
     /**
      * 取消支付订单

+ 0 - 21
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/api/aftersale/TradeAfterSaleApiImpl.java

@@ -1,21 +0,0 @@
-package cn.iocoder.yudao.module.trade.api.aftersale;
-
-import cn.iocoder.yudao.module.trade.service.aftersale.AfterSaleService;
-import org.springframework.stereotype.Service;
-import org.springframework.validation.annotation.Validated;
-
-import javax.annotation.Resource;
-
-/**
- * 售后 API 接口实现类
- *
- * @author owen
- */
-@Service
-@Validated
-public class TradeAfterSaleApiImpl implements TradeAfterSaleApi {
-
-    @Resource
-    private AfterSaleService afterSaleService;
-
-}

+ 0 - 21
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/api/brokerage/TradeBrokerageApiImpl.java

@@ -1,21 +0,0 @@
-package cn.iocoder.yudao.module.trade.api.brokerage;
-
-import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageRecordService;
-import org.springframework.stereotype.Service;
-import org.springframework.validation.annotation.Validated;
-
-import javax.annotation.Resource;
-
-/**
- * 订单 API 接口实现类
- *
- * @author HUIHUI
- */
-@Service
-@Validated
-public class TradeBrokerageApiImpl implements TradeBrokerageApi {
-
-    @Resource
-    private BrokerageRecordService brokerageRecordService;
-
-}

+ 0 - 14
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/api/order/TradeOrderApiImpl.java

@@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.trade.api.order;
 
 import cn.iocoder.yudao.module.trade.api.order.dto.TradeOrderRespDTO;
 import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert;
-import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
 import cn.iocoder.yudao.module.trade.service.order.TradeOrderQueryService;
 import cn.iocoder.yudao.module.trade.service.order.TradeOrderUpdateService;
 import org.springframework.stereotype.Service;
@@ -12,9 +11,6 @@ import javax.annotation.Resource;
 import java.util.Collection;
 import java.util.List;
 
-import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.ORDER_NOT_FOUND;
-
 /**
  * 订单 API 接口实现类
  *
@@ -39,16 +35,6 @@ public class TradeOrderApiImpl implements TradeOrderApi {
         return TradeOrderConvert.INSTANCE.convert(tradeOrderQueryService.getOrder(id));
     }
 
-    @Override
-    public TradeOrderSummaryRespDTO getOrderSummary(LocalDateTime beginTime, LocalDateTime endTime) {
-        return tradeOrderQueryService.getOrderSummary(beginTime, endTime);
-    }
-
-    @Override
-    public void updateOrderCombinationInfo(Long orderId, Long activityId, Long combinationRecordId, Long headId) {
-        tradeOrderUpdateService.updateOrderCombinationInfo(orderId, activityId, combinationRecordId, headId);
-    }
-
     @Override
     public void cancelPaidOrder(Long userId, Long orderId) {
         tradeOrderUpdateService.cancelPaidOrder(userId, orderId);

+ 0 - 10
yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/wallet/PayWalletApi.java

@@ -1,10 +0,0 @@
-package cn.iocoder.yudao.module.pay.api.wallet;
-
-/**
- * 钱包 API 接口
- *
- * @author owen
- */
-public interface PayWalletApi {
-
-}

+ 0 - 24
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/api/wallet/PayWalletApiImpl.java

@@ -1,24 +0,0 @@
-package cn.iocoder.yudao.module.pay.api.wallet;
-
-import cn.iocoder.yudao.module.pay.service.wallet.PayWalletRechargeService;
-import cn.iocoder.yudao.module.pay.service.wallet.PayWalletTransactionService;
-import org.springframework.stereotype.Service;
-import org.springframework.validation.annotation.Validated;
-
-import javax.annotation.Resource;
-
-/**
- * 钱包 API 接口实现类
- *
- * @author owen
- */
-@Service
-@Validated
-public class PayWalletApiImpl implements PayWalletApi {
-
-    @Resource
-    private PayWalletRechargeService payWalletRechargeService;
-    @Resource
-    private PayWalletTransactionService payWalletTransactionService;
-
-}