奥体项目接口修改
正在显示
1 个修改的文件
包含
10 行增加
和
0 行删除
... | @@ -1617,6 +1617,16 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { | ... | @@ -1617,6 +1617,16 @@ public class OlympicCenterServiceImpl implements IOlympicCenterService { |
1617 | String start = dataDate + " 00:00:00"; | 1617 | String start = dataDate + " 00:00:00"; |
1618 | String end = dataDate + " 23:59:59"; | 1618 | String end = dataDate + " 23:59:59"; |
1619 | List<Map<String, Object>> dataList = factoryInfoService.queryReportData(AT_ID, pgField, start, end,"hour"); | 1619 | List<Map<String, Object>> dataList = factoryInfoService.queryReportData(AT_ID, pgField, start, end,"hour"); |
1620 | // 使用Comparator和Collections.sort()对列表进行排序 | ||
1621 | Collections.sort(dataList, new Comparator<Map<String, Object>>() { | ||
1622 | @Override | ||
1623 | public int compare(Map<String, Object> map1, Map<String, Object> map2) { | ||
1624 | // 根据"time"键的值进行升序排序 | ||
1625 | String time1 = (String) map1.get("time"); | ||
1626 | String time2 = (String) map2.get("time"); | ||
1627 | return time1.compareTo(time2); | ||
1628 | } | ||
1629 | }); | ||
1620 | for (Map<String, Object> map : dataList) { | 1630 | for (Map<String, Object> map : dataList) { |
1621 | Map<String, Object> newMap = new HashMap<>(); | 1631 | Map<String, Object> newMap = new HashMap<>(); |
1622 | for (Map.Entry<String, Object> entry : map.entrySet()) { | 1632 | for (Map.Entry<String, Object> entry : map.entrySet()) { | ... | ... |
-
请 注册 或 登录 后发表评论