Browse Source

首页 日环比 精确到小时

zhaoxian 11 months ago
parent
commit
76e5f7bb4c

+ 2 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/SupplyChainMapper.java

@@ -84,7 +84,7 @@ public interface SupplyChainMapper {
 
     JSONObject selectOrderRate(@Param("promoterIds") List<String> promoterIds, @Param("itemIds") List<Long> itemIds, @Param("statDate") Long statDate, @Param("endDate") Long endDate);
 
-    JSONObject selectOrderRateBytedance(@Param("promoterIds") List<String> promoterIds, @Param("itemIds") List<Long> itemIds, @Param("statDate") Long statDate, @Param("endDate") Long endDate);
+    JSONObject selectOrderRateBytedance(@Param("promoterIds") List<String> promoterIds, @Param("itemIds") List<Long> itemIds, @Param("statDate") Long statDate, @Param("endDate") Long endDate, @Param("hour") int hour);
 
     List<JSONObject> getMonthOrderAmount(Map<String, Object> map);
 
@@ -183,6 +183,7 @@ public interface SupplyChainMapper {
     void replaceMgsKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
 
     void replaceRocketKuaiShouActivityOpenItemList(@Param("list") List<KuaiShouActivityOpenItemList> list);
+
     List<JSONObject> getKsChannelGmvHourByDate(@Param("userList") List<Long> userList, @Param("date") String date);
 
     List<JSONObject> getKsCourtshipGmvHourByDate(@Param("userList") List<Long> userList, @Param("date") String date);

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/ISupplyChainService.java

@@ -102,7 +102,7 @@ public interface ISupplyChainService {
 
     JSONObject selectOrderRate(List<String> promoterIds, List<Long> itemIds, Long statDate, Long endDate);
 
-    JSONObject selectOrderRateBytedance(List<String> promoterIds, List<Long> itemIds, Long startHourTemp, Long endHourTemp);
+    JSONObject selectOrderRateBytedance(List<String> promoterIds, List<Long> itemIds, Long startHourTemp, Long endHourTemp, int hour);
 
     List<JSONObject> getMonthOrderAmount(Map<String, Object> map);
 

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -548,7 +548,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         if ("1".equals(mediaId)) {
             Long startHourTemp = DateUtils.strDateToInt(startDate);
             Long endHourTemp = DateUtils.strDateToInt(endDate);
-            return supplyChainService.selectOrderRateBytedance(promoterIds, itemIds, startHourTemp, endHourTemp);
+            return supplyChainService.selectOrderRateBytedance(promoterIds, itemIds, startHourTemp, endHourTemp, hour);
         } else if ("2".equals(mediaId)) {
             Long startHourTemp = DateUtils.getStartLongTime(startDate); // startDate开始时间戳
             Long endHourTemp = DateUtils.getNowEndHourTemp(endDate, hour); // endDate结束时间戳

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java

@@ -225,8 +225,8 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
     }
 
     @Override
-    public JSONObject selectOrderRateBytedance(List<String> promoterIds, List<Long> itemIds, Long statDate, Long endDate) {
-        return supplyChainMapper.selectOrderRateBytedance(promoterIds, itemIds, statDate, endDate);
+    public JSONObject selectOrderRateBytedance(List<String> promoterIds, List<Long> itemIds, Long statDate, Long endDate, int hour) {
+        return supplyChainMapper.selectOrderRateBytedance(promoterIds, itemIds, statDate, endDate, hour);
     }
 
     @Override

+ 5 - 3
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -1522,6 +1522,9 @@
         FROM bytedance_order_list
         WHERE pay_success_time >= #{statDate}
         AND pay_success_time &lt;= #{endDate}
+        <if test='hour != null'>
+            AND pay_success_time_hour &lt;=#{hour}
+        </if>
         <if test='promoterIds != null and promoterIds.size() > 0'>
             AND author_short_id in
             <foreach collection="promoterIds" item="item" separator=","
@@ -2810,7 +2813,7 @@
 
 
     <select id="getKsCourtshipGmvHourByDate" resultType="com.alibaba.fastjson.JSONObject">
-        select stat_hour  as 'time',
+        select stat_hour as 'time',
         round(sum(pay_amount) / 100, 2) as 'charge'
         from kuaishou_supply_chain
         where stat_date = #{date}
@@ -2969,8 +2972,7 @@
         select tag, proportion
         from promoter_tag
         where promoter_id = #{promoterId}
-        order by tag_oid_num desc
-        limit 5
+        order by tag_oid_num desc limit 5
     </select>
 
 </mapper>