Browse Source

修改穿山甲爬虫查询逻辑

syh 5 years ago
parent
commit
1d6ec62091

+ 13 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/pangolin/service/impl/PangolinReportAppHourServiceImpl.java

@@ -55,6 +55,19 @@ public class PangolinReportAppHourServiceImpl extends ServiceImpl<PangolinReport
         List<JSONObject> dataList = new ArrayList<>();
         List<JSONObject> dataList = new ArrayList<>();
         for(int i=0;i<24;i++){
         for(int i=0;i<24;i++){
             JSONObject getData = this.getComparedDate(appId,i,userId,type,today,yesterday,sevenDaysAgo,compareTime1,compareTime2,projectIds,accountNames);
             JSONObject getData = this.getComparedDate(appId,i,userId,type,today,yesterday,sevenDaysAgo,compareTime1,compareTime2,projectIds,accountNames);
+            if(null == getData){
+                getData = new JSONObject();
+                getData.put("today",0);
+                getData.put("yesterday",0);
+                getData.put("sevendaysAgo",0);
+                getData.put("hour",i);
+                if(null!=compareTime1&&!compareTime1.trim().equals("")){
+                    getData.put(compareTime1,0);
+                }
+                if(null!=compareTime2&&!compareTime2.trim().equals("")){
+                    getData.put(compareTime2,0);
+                }
+            }
             dataList.add(getData);
             dataList.add(getData);
         }
         }
         resultMap.put("data",dataList);
         resultMap.put("data",dataList);