Commit a63d99d9 authored by 喻春霖's avatar 喻春霖

fixed

parents fa60a88d 0f3a8f19
...@@ -212,12 +212,17 @@ public class StatisticsController { ...@@ -212,12 +212,17 @@ public class StatisticsController {
if(latestDays > 30){ if(latestDays > 30){
type = 2; 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<>(); List<Map<String,Object>> dataList = new ArrayList<>();
Date endDate = new Date(); Date endDate = new Date();
System.out.println("authUserTypes startTime is " + startDate.getTime());
System.out.println("authUserTypes endTime is " + endDate.getTime());
while(!startDate.after(endDate)){ while(!startDate.after(endDate)){
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("loginSuccessFlag", true); param.put("loginSuccessFlag", true);
...@@ -265,14 +270,25 @@ public class StatisticsController { ...@@ -265,14 +270,25 @@ public class StatisticsController {
@ResponseBody @ResponseBody
public MapMessage authUserTypeSum(@RequestParam(value = "clientId", required = false) String clientId, @RequestParam(value = "latestDays", defaultValue = "7") Integer latestDays) { 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<>(); Map<String,Object> param = new HashMap<>();
param.put("loginSuccessFlag", true); param.put("loginSuccessFlag", true);
if (clientId != null){ if (clientId != null){
param.put("clientId",clientId); param.put("clientId",clientId);
} }
Date startDate = getStartDay(latestDays);
long days = DateUtils.dayDiff(new Date(), startDate); long days = DateUtils.dayDiff(new Date(), startDate);
long all_auth = authLogService.count(param, 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