|
@@ -55,19 +55,6 @@ public class PangolinReportAppHourServiceImpl extends ServiceImpl<PangolinReport
|
|
|
List<JSONObject> dataList = new ArrayList<>();
|
|
|
for(int i=0;i<24;i++){
|
|
|
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);
|
|
|
}
|
|
|
resultMap.put("data",dataList);
|
|
@@ -76,6 +63,21 @@ public class PangolinReportAppHourServiceImpl extends ServiceImpl<PangolinReport
|
|
|
}
|
|
|
|
|
|
private JSONObject getComparedDate(Integer appId,Integer hour,String userId,String type,String today, String yesterday, String sevenDaysAgo, String compareTime1, String compareTime2,List<Long>projectIds,List<String> accountNames) {
|
|
|
- return pangolinReportAppHourMapper.getComparedDate(appId,hour,userId,type,today, yesterday,sevenDaysAgo,compareTime1,compareTime2,projectIds,accountNames);
|
|
|
+ JSONObject data = pangolinReportAppHourMapper.getComparedDate(appId,hour,userId,type,today, yesterday,sevenDaysAgo,compareTime1,compareTime2,projectIds,accountNames);
|
|
|
+ System.out.println(data.toJSONString());
|
|
|
+ if(null==data||data.toJSONString().equals("null")){
|
|
|
+ data = new JSONObject();
|
|
|
+ data.put("today",0);
|
|
|
+ data.put("yesterday",0);
|
|
|
+ data.put("sevendaysAgo",0);
|
|
|
+ data.put("hour",hour);
|
|
|
+ if(null!=compareTime1&&!compareTime1.trim().equals("")){
|
|
|
+ data.put(compareTime1,0);
|
|
|
+ }
|
|
|
+ if(null!=compareTime2&&!compareTime2.trim().equals("")){
|
|
|
+ data.put(compareTime2,0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return data;
|
|
|
}
|
|
|
}
|