Sfoglia il codice sorgente

时数据统计处理

zhaoxian 4 anni fa
parent
commit
7a3f8ad76b

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/EtlKuaishouReportAccountHourlyMapper.java

@@ -20,7 +20,7 @@ public interface EtlKuaishouReportAccountHourlyMapper extends BaseMapper<EtlKuai
 
     void replaceBatch(@Param("list") List<EtlKuaishouReportAccountHourly> list);
 
-    EtlKuaishouReportAccountHourly getOnedayAggregateByHour(@Param("startTime") String startTime, @Param("accountId") Long accountId, @Param("hour") Integer hour);
+    EtlKuaishouReportAccountHourly getOnedayAggregateByHour(@Param("startTime") String startTime, @Param("accountId") Long accountId);
 
     List<JSONObject> getOnedayEtlReportList(@Param("startTime") String startTime, @Param("accountId") Long accountId,@Param("value") String value,@Param("type") String type);
 

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountDailyMapper.xml

@@ -250,6 +250,7 @@
         AND stat_date &gt;= #{startTime}
         AND stat_date &lt;= #{endTime}
         group by stat_date
+        order by stat_date
     </select>
 
 

+ 0 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/EtlKuaishouReportAccountHourlyMapper.xml

@@ -116,7 +116,6 @@
         FROM ctop_etl_kuaishou_report_account_hourly
         WHERE account_id = #{accountId}
           AND stat_date = #{startTime}
-          AND stat_hour = #{hour}
     </select>
 
     <select id="getOnedayEtlReportList" resultType="com.alibaba.fastjson.JSONObject">

+ 2 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/EtlKuaishouReportAccountHourlyServiceImpl.java

@@ -77,13 +77,9 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
         EtlKuaishouReportAccountHourly today = null;
         EtlKuaishouReportAccountHourly yesterday = null;
         if (endTime.equals(startTime)) {
-            Integer hour = DateUtils.getHour(DateUtils.now());
-            today = etlHourlyAccountMapper.getOnedayAggregateByHour(startTime, accountId, hour);
+            today = etlHourlyAccountMapper.getOnedayAggregateByHour(startTime, accountId);
             String lastDay = DateUtils.getLastDay(startTime, 1);
-            yesterday = etlHourlyAccountMapper.getOnedayAggregateByHour(lastDay, accountId, hour);
-            if (Check.isNull(today) && hour > 0) {
-                today = etlHourlyAccountMapper.getOnedayAggregateByHour(startTime, accountId, hour - 1);
-            }
+            yesterday = etlHourlyAccountMapper.getOnedayAggregateByHour(lastDay, accountId);
         } else {
             today = etlDailyAccountMapper.getOnedayAggregatebyDaily(startTime, endTime, accountId);
             int days = DateUtils.dateDiff(startTime, endTime);