Ver Fonte

实时数据

yumeng há 4 anos atrás
pai
commit
20a286d7a0

+ 1 - 1
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -81,7 +81,7 @@ public class SampleTest {
     @Test
     public void getDepartment() throws ParseException {
 
-        JSONArray campaignDate = realTimeDataService.getCampaignDate(20209274L, "7abeae7f7708bda8111c62f985da84e7", 20209274L, "2020-09-27", "2020-09-27");
+        JSONArray campaignDate = realTimeDataService.getCampaignDate(7865319L, "7abeae7f7708bda8111c62f985da84e7", 20209274L, "2020-09-27", "2020-09-27");
 
         System.err.println(campaignDate);
 //        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();

+ 9 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouRealTimeDataServiceImpl.java

@@ -48,7 +48,11 @@ public class KuaishouRealTimeDataServiceImpl implements IKuaishouRealTimeDataSer
             if (!Check.isNull(jsonObject)) {
                 Integer code = jsonObject.getInteger("code");
                 if (code == 0) {
-                    return jsonObject.getJSONArray("details");
+                    JSONObject data = jsonObject.getJSONObject("data");
+                    if (!Check.isNull(data)) {
+                        return data.getJSONArray("details");
+                    }
+
                 }
             }
 
@@ -91,7 +95,10 @@ public class KuaishouRealTimeDataServiceImpl implements IKuaishouRealTimeDataSer
             if (!Check.isNull(jsonObject)) {
                 Integer code = jsonObject.getInteger("code");
                 if (code == 0) {
-                    return jsonObject.getJSONArray("details");
+                    JSONObject data = jsonObject.getJSONObject("data");
+                    if (!Check.isNull(data)) {
+                        return data.getJSONArray("details");
+                    }
                 }
             }