| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @GetMapping(value = "/photovoltaicAndConsumption") |
| | | public AjaxResult<PhotovoltaicAndConsumptionVO> photovoltaicAndConsumption() { |
| | | //需调用接口 获取光伏发电量 |
| | | |
| | | return AjaxResult.success(new PhotovoltaicAndConsumptionVO()); |
| | | List<Integer> siteIds= Arrays.asList(25,26); |
| | | PhotovoltaicAndConsumptionVO vo = new PhotovoltaicAndConsumptionVO(); |
| | | List<TScreenContent> list = screenContentService.list(new LambdaQueryWrapper<TScreenContent>().in(TScreenContent::getSiteId, siteIds)); |
| | | if(list==null|| list.isEmpty()){ |
| | | return AjaxResult.success(vo); |
| | | } |
| | | vo.setGreenElectricityToday(list.get(0).getGreenElectricityToday()); |
| | | list.remove(0); |
| | | list.forEach(x->{ |
| | | vo.setGreenElectricityToday(vo.getGreenElectricityToday().add(x.getGreenElectricityToday())); |
| | | }); |
| | | return AjaxResult.success(vo); |
| | | } |
| | | |
| | | |