Commit fc1ab4fd authored by wangsong's avatar wangsong

update date range

parent a02dbf5c
......@@ -212,7 +212,14 @@ public class StatisticsController {
if(latestDays > 30){
type = 2;
}
Date startDate = getStartDay(latestDays);
Date startDate;
if(type == 1){
startDate = getStartDay(latestDays -1);
}else {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -(latestDays/ 30 - 1));
startDate = calendar.getTime();
}
List<Map<String,Object>> dataList = new ArrayList<>();
Date endDate = new Date();
......@@ -265,14 +272,25 @@ public class StatisticsController {
@ResponseBody
public MapMessage authUserTypeSum(@RequestParam(value = "clientId", required = false) String clientId, @RequestParam(value = "latestDays", defaultValue = "7") Integer latestDays) {
int type = 1; // 1: 日数据 2: 月数据
if(latestDays > 30){
type = 2;
}
Date startDate;
if(type == 1){
startDate = getStartDay(latestDays -1);
}else {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -(latestDays/ 30 - 1));
startDate = calendar.getTime();
}
Map<String,Object> param = new HashMap<>();
param.put("loginSuccessFlag", true);
if (clientId != null){
param.put("clientId",clientId);
}
Date startDate = getStartDay(latestDays);
long days = DateUtils.dayDiff(new Date(), startDate);
long all_auth = authLogService.count(param, startDate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment