| | |
| | | |
| | | 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; |
| | | } |
| | | |
| | | } |