feat(数据中心): 新增历史记录和数据分析查询

This commit is contained in:
gx_ma
2026-03-05 16:32:10 +08:00
parent 913dd73f6e
commit 1e362f233b
36 changed files with 1254 additions and 24 deletions

View File

@@ -230,4 +230,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
System.out.println(s1);
}
/**
* 日期去除毫秒
* @param time 时间
* @return java.util.Date
*/
public static Date dateRemoveMs(Date time) {
String s = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, time);
return DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, s);
}
}

View File

@@ -229,4 +229,40 @@ public class CollectionUtils {
public static <T> Collection<T> singleton(T deptId) {
return deptId == null ? Collections.emptyList() : Collections.singleton(deptId);
}
/**
* 开始分页
*
* @param list 传入的list集合
* @param pageNum 页码
* @param pageSize 每页多少条数据
* @return
*/
public static List startPage(List list, Integer pageNum,
Integer pageSize) {
if (list == null) {
return null;
}
if (list.size() == 0) {
return null;
}
Integer count = list.size(); // 记录总数
Integer pageCount = 0; // 页数
if (count % pageSize == 0) {
pageCount = count / pageSize;
} else {
pageCount = count / pageSize + 1;
}
int fromIndex = 0; // 开始索引
int toIndex = 0; // 结束索引
if (!pageNum.equals(pageCount)) {
fromIndex = (pageNum - 1) * pageSize;
toIndex = fromIndex + pageSize;
} else {
fromIndex = (pageNum - 1) * pageSize;
toIndex = count;
}
List pageList = list.subList(fromIndex, toIndex);
return pageList;
}
}