Quellcode durchsuchen

修改查询报表数据限制

xueyiming vor 6 Monaten
Ursprung
Commit
6536b4f1cd

+ 6 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/exterior/impl/ThirdPartyServiceImpl.java

@@ -3,6 +3,7 @@ package com.tzld.longarticle.recommend.server.service.exterior.impl;
 import com.alibaba.fastjson.JSON;
 import com.aliyun.odps.data.Record;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
+import com.tzld.longarticle.recommend.server.common.constant.TimeConstant;
 import com.tzld.longarticle.recommend.server.common.enums.GhTypeEnum;
 import com.tzld.longarticle.recommend.server.common.enums.SecretEnum;
 import com.tzld.longarticle.recommend.server.common.enums.StatusEnum;
@@ -142,9 +143,12 @@ public class ThirdPartyServiceImpl implements ThirdPartyService {
         if (secretEnum == SecretEnum.SECRET_ENUM_2) {
             return CommonResponse.create(500, "数据不存在");
         }
-        String channel = secretEnum.channel;
+
+        //10点后可查询前一天数据
+        long nowTimestamp = System.currentTimeMillis() / 1000;
+        long limitTime = nowTimestamp - 34L * TimeConstant.HOUR;
         long targetTime = DateUtils.dateStrToTimestamp(date, "yyyy-MM-dd");
-        long limitTime = DateUtils.dateStrToTimestamp(canViewReportDate, "yyyy-MM-dd");
+        String channel = secretEnum.channel;
         if (targetTime > limitTime) {
             return CommonResponse.create(500, "数据不存在");
         }