zoujiajian hace 2 años
padre
commit
78cd875391

+ 1 - 1
netflix-dao/src/main/java/com/cyksj/mapper/OrderDonMapper.java

@@ -39,7 +39,7 @@ public interface OrderDonMapper extends BaseMapper<OrderDon> {
 
 	Integer selectCouponCodeUserNum(@Param("dsPopularizeId") Long dsPopularizeId, @Param("noOrderAllStatus") List<String> noOrderAllStatus);
 
-	ChannelPopularizeView countPopularizeOrderDetail(@Param("popularizeId") Long popularizeId, @Param("startTime") String startTime, @Param("endTime") String endTime);
+	ChannelPopularizeView countPopularizeOrderDetail(@Param("popularizeId") Long popularizeId, @Param("goodsId") Long goodsId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
 	BigDecimal selectThisMonthAppleOneMoney(@Param("skuIds") Set<Long> skuIds, @Param("startDate") String startDate, @Param("endDate") String endDate);
 

+ 6 - 0
netflix-dao/src/main/resources/mapper/OrderDonMapper.xml

@@ -142,6 +142,9 @@
         <if test="endTime != null and endTime != ''">
             and created_time &lt; #{endTime}
         </if>
+        <if test="goodsId != null">
+            and goods_id = #{goodsId}
+        </if>
         and status not in ('close', 'noPayment')) s1
         ,
         (select count(*) as refundCount, ifnull(sum(money),0) as refundMoney
@@ -153,6 +156,9 @@
         <if test="endTime != null and endTime != ''">
             and created_time &lt; #{endTime}
         </if>
+        <if test="goodsId != null">
+            and goods_id = #{goodsId}
+        </if>
         and status = 'refund')
         s2
     </select>

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/channel/CmsChannelPopularizeController.java

@@ -56,7 +56,7 @@ public class CmsChannelPopularizeController {
 
     @GetMapping
     @SaCheckPermission("promotion:view")
-    public Result<SearchResult<ChannelPopularizeView>> get(String startTime, String endTime) {
+    public Result<SearchResult<ChannelPopularizeView>> get(String startTime, String endTime, Long goodsId) {
         long adminId = StpUtil.getLoginIdAsLong();
         MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
         Boolean isRootRole = cmsUserService.isRootRole(adminId);
@@ -84,7 +84,7 @@ public class CmsChannelPopularizeController {
                     .eq(OrderDon::getIsWebPay, true)
                     .notIn(OrderDon::getStatus, Constant.noOrderStatus));
             data.setNumOfOrderWebPay(numOfOrderWebPay);
-            ChannelPopularizeView channelPopularizeView = orderDonMapper.countPopularizeOrderDetail(data.getId(), startTime, endTime);
+            ChannelPopularizeView channelPopularizeView = orderDonMapper.countPopularizeOrderDetail(data.getId(), goodsId, startTime, endTime);
             data.setOrderCount(channelPopularizeView.getOrderCount());
             data.setOrderMoney(channelPopularizeView.getOrderMoney());
             data.setRefundCount(channelPopularizeView.getRefundCount());