This commit is contained in:
周源 2021-07-20 16:49:07 +08:00
parent a7295537b6
commit c15912c3cb
3 changed files with 14 additions and 2 deletions

View File

@ -175,7 +175,7 @@ public class ApiStatisticsContactController extends ApiBaseController {
countList.add(activityCount);
}
}
Dict dict = Dict.create().set("monthList", DateUtils.getMonthStrList()).set("count", countList);
Dict dict = Dict.create().set("monthList", DateUtils.getMonthStrList()).set("countList", countList);
render(Ret.ok().data(dict));
}

View File

@ -120,7 +120,7 @@ public class ApiStatisticsOfficeController extends ApiBaseController {
//默认当前年
Date date = DateUtil.date();
String year = Convert.toStr(DateUtil.year(date));
String month = Convert.toStr(DateUtil.month(date));
String month = DateUtils.getCurrentMonth();
String yearMonth = year + "-" + month;
DecimalFormat df = new DecimalFormat("0.00");

View File

@ -257,4 +257,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
return monthList;
}
public static String getCurrentMonth() {
String monthStr;
Calendar cal = Calendar.getInstance();
int month = cal.get(Calendar.MONTH) + 1;
if (month < 10) {
monthStr = "0" + month;
} else {
monthStr = month + "";
}
return monthStr;
}
}