|
@@ -22,10 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
@@ -22,10 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
22
|
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
|
22
|
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
|
|
23
|
import org.springframework.stereotype.Service;
|
23
|
import org.springframework.stereotype.Service;
|
|
24
|
|
24
|
|
|
25
|
-import java.util.HashMap;
|
|
|
|
26
|
-import java.util.LinkedHashMap;
|
|
|
|
27
|
-import java.util.List;
|
|
|
|
28
|
-import java.util.Map;
|
25
|
+import java.text.SimpleDateFormat;
|
|
|
|
26
|
+import java.util.*;
|
|
29
|
|
27
|
|
|
30
|
/**
|
28
|
/**
|
|
31
|
* @Description: 日志管理
|
29
|
* @Description: 日志管理
|
|
@@ -96,6 +94,10 @@ public class AiragLogServiceImpl extends ServiceImpl<AiragLogMapper, AiragLog> i |
|
@@ -96,6 +94,10 @@ public class AiragLogServiceImpl extends ServiceImpl<AiragLogMapper, AiragLog> i |
|
96
|
todayWrapper.apply("DATE(create_time) = CURDATE()");
|
94
|
todayWrapper.apply("DATE(create_time) = CURDATE()");
|
|
97
|
long todayCount = this.count(todayWrapper);
|
95
|
long todayCount = this.count(todayWrapper);
|
|
98
|
|
96
|
|
|
|
|
97
|
+ Date earlisetTime = airagLogMapper.getEarliestTime();
|
|
|
|
98
|
+ SimpleDateFormat sft = new SimpleDateFormat("yyyy年MM月dd日");
|
|
|
|
99
|
+ String earliestTime = sft.format(earlisetTime);
|
|
|
|
100
|
+
|
|
99
|
// 2. 获取昨日问答次数
|
101
|
// 2. 获取昨日问答次数
|
|
100
|
QueryWrapper<AiragLog> yesterdayWrapper = new QueryWrapper<>();
|
102
|
QueryWrapper<AiragLog> yesterdayWrapper = new QueryWrapper<>();
|
|
101
|
yesterdayWrapper.apply("DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)");
|
103
|
yesterdayWrapper.apply("DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)");
|
|
@@ -143,6 +145,7 @@ public class AiragLogServiceImpl extends ServiceImpl<AiragLogMapper, AiragLog> i |
|
@@ -143,6 +145,7 @@ public class AiragLogServiceImpl extends ServiceImpl<AiragLogMapper, AiragLog> i |
|
143
|
result.put("yesterdayCount", yesterdayCount);
|
145
|
result.put("yesterdayCount", yesterdayCount);
|
|
144
|
result.put("growthRate", Math.round(growthRate * 100.0) / 100.0); // 保留两位小数
|
146
|
result.put("growthRate", Math.round(growthRate * 100.0) / 100.0); // 保留两位小数
|
|
145
|
result.put("todayCount", todayCount);
|
147
|
result.put("todayCount", todayCount);
|
|
|
|
148
|
+ result.put("earliestTime", earliestTime);
|
|
146
|
result.put("rejectedCount", rejectedCount);
|
149
|
result.put("rejectedCount", rejectedCount);
|
|
147
|
result.put("totalCount", totalCount);
|
150
|
result.put("totalCount", totalCount);
|
|
148
|
result.put("averageCount", averageCount);
|
151
|
result.put("averageCount", averageCount);
|