zxl
2025-02-19 002372c5cfd2c9b9881fda5e527c2b6c4ee4d599
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
@@ -372,16 +372,21 @@
     */
    @Override
    public Map<String, Object> home(HomeQuery monitorQuery) {
        System.out.println(monitorQuery + "~~~~~~~~~~~~~打印");
        Map<String, Object> dataMap = new HashMap<>();
        Map<String, Object> monthMap1 = new HashMap<>();
        Map<String, Object> monthMap2 = new HashMap<>();
        List<Map<String, Object>> home = baseMapper.home(monitorQuery);
        if (ObjectUtils.isNotEmpty(home)) {
            //拿到数据库 循环查询
            System.out.println(home + "~~~~~~~~~~~~~打印");
            for (Map<String, Object> map : home) {
                //得到map的 months键的值  num1键的值 组装为新对象
                monthMap1.put(map.get("months").toString(), map.get("num1"));
                //得到map的 months键的值  num2键的值 组装为新对象
                monthMap2.put(map.get("months").toString(), map.get("num2"));
            }
            //home 的下标0的 map的 name键的值
            dataMap.put("name", home.get(0).get("name"));
            dataMap.put("state", monthMap1);
            dataMap.put("state2", monthMap2);
@@ -965,7 +970,7 @@
                        ))
                        .append("loseCount", new Document("$sum",
                                new Document("$cond", Arrays.asList(
                                        new Document("$eq", Arrays.asList("$recordStatus", -1)),
                                        new Document("$in", Arrays.asList("$recordStatus", Arrays.asList(-1, 0))),
                                        1,
                                        0
                                ))