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