| | |
| | | @Autowired |
| | | private PowerDemandService powerDemandService; |
| | | |
| | | @Autowired |
| | | private PowerAdjustedFactorService powerAdjustedFactorService; |
| | | |
| | | @Resource |
| | | private DataPointApi dataPointApi; |
| | | |
| | |
| | | data.add(value); |
| | | dataList.add(data); |
| | | } |
| | | List<String> categories = DateUtils.getTimeScale(start, end, 5); |
| | | List<String> categories = DateUtils.getTimeScale(start, end, 60); |
| | | result.setCategories(categories); |
| | | result.setDataList(dataList); |
| | | |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @GetMapping("/adjust-factor") |
| | | @Operation(summary = "负荷移植-调整后的功率因数与无功倒送量") |
| | | public CommonResult<Map<String, Double>> getPowerAdjustFactor(@RequestParam Map<String, Object> params) { |
| | | List<PowerAdjustedFactorEntity> list = powerAdjustedFactorService.list(params); |
| | | List<PowerAdjustedFactorDTO> dtoList = ConvertUtils.sourceToTarget(list, PowerAdjustedFactorDTO.class); |
| | | Map<String, Double> result = new HashMap<>(); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return success(result); |
| | | } |
| | | List<String> points = new ArrayList<>(); |
| | | Map<String, Object> dataMap = new HashMap<>(); |
| | | for (PowerAdjustedFactorDTO dto : dtoList) { |
| | | points.add(dto.getPointNo()); |
| | | } |
| | | dataMap = dataPointApi.queryPointsRealValue(points); |
| | | for (PowerAdjustedFactorDTO powerAdjustedFactorDTO : dtoList) { |
| | | result.put(powerAdjustedFactorDTO.getName(), Double.parseDouble(dataMap.get(powerAdjustedFactorDTO.getPointNo()).toString())); |
| | | } |
| | | return success(result); |
| | | } |
| | | } |