2021与蓝度共同重构项目,服务端
liuhaonan
2022-04-19 7e2175df8ed913a858296d4fde0d268879a91daf
首页
已修改3个文件
46 ■■■■■ 文件已修改
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/resources/application-test.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
@@ -194,4 +194,37 @@
        return resultList;
    }
    /**
     * 单灯节能率
     */
    public List<Map<String, Object>> controlEnergySaving() {
        List<LightBo> listLight = baseMapper.listLight(SecurityUtils.getUserId(), null);
        return null;
    }
    /**
     * 用户拥有的路灯
     */
    public List<Light> listLight() {
        List<LightBo> listLight = baseMapper.listLight(SecurityUtils.getUserId(), null);
        if (CollectionUtil.isEmpty(listLight)) {
            throw new BusinessException("没有路灯数据");
        }
        List<String> deviceCodeList = listLight.stream().map(LightBo::getDeviceCode).collect(Collectors.toList());
        List<LightReportData> reportDataList = lightReportDataService.list(Wrappers.<LightReportData>lambdaQuery().in(LightReportData::getDeviceCode, deviceCodeList));
        if (CollectionUtil.isEmpty(reportDataList)) {
            throw new BusinessException("没有路灯数据");
        }
        List<Light> lightList = new ArrayList<>();
        for (String deviceCode : deviceCodeList) {
            Light light = getLight(deviceCode);
            lightList.add(light);
        }
        return lightList;
    }
}
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -775,4 +775,15 @@
        }
        return one;
    }
//    /**
//     * 用户总单灯节能率
//     */
//    public Double getPoleEnergy() {
//        Double energy = 0.0;
//
//
//        return energy;
//    }
}
ximon-admin/src/main/resources/application-test.yml
@@ -37,7 +37,7 @@
    enable: true
listenter:
  isOpen: true
  isOpen: false
minio: