|
@@ -107,10 +107,12 @@ public class KuaishouAccountReportDailyDwServiceImpl extends ServiceImpl<Kuaisho
|
|
|
yesterday = kuaishouAccountReportDailyDwMapper.getHourcharge(projectId, DateUtils.getDateInteger(DateUtils.getLastDay(startTime, 1)));
|
|
|
} else {
|
|
|
today = kuaishouAccountReportDailyDwMapper.getDatacharge(projectId, startTimeInt, endTimeInt);
|
|
|
+ fillingDates(startTime, endTime, today);
|
|
|
int days = DateUtils.dateDiff(startTime, endTime);
|
|
|
String endTime2 = DateUtils.getLastDay(startTime, 1);
|
|
|
String startTime2 = DateUtils.getLastDay(endTime2, days);
|
|
|
yesterday = kuaishouAccountReportDailyDwMapper.getDatacharge(projectId, DateUtils.getDateInteger(startTime2), DateUtils.getDateInteger(endTime2));
|
|
|
+ fillingDates(startTime2, endTime2, yesterday);
|
|
|
}
|
|
|
JSONObject data = new JSONObject();
|
|
|
data.put("today", today);
|
|
@@ -118,6 +120,25 @@ public class KuaishouAccountReportDailyDwServiceImpl extends ServiceImpl<Kuaisho
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 补充日期
|
|
|
+ */
|
|
|
+ private void fillingDates(String startTime, String endTime, List<JSONObject> today) {
|
|
|
+ long dayNum = DateUtils.getDiscrepantDays(startTime, endTime) + 1;
|
|
|
+ int size = today.size();
|
|
|
+ if (dayNum - size != 0) {
|
|
|
+ List<String> days = DateUtils.getDays(startTime, endTime);
|
|
|
+ for (String day : days) {
|
|
|
+ if (!today.contains(day)) {
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.put("time", day);
|
|
|
+ obj.put("charge", 0.00);
|
|
|
+ today.add(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Result<Object> getProjectReport(Long projectId, String startTime, String endTime, Integer pageSize, Integer pageNo) throws Exception {
|
|
|
Integer startTimeInt = DateUtils.getDateInteger(startTime);
|