| | |
| | | } |
| | | |
| | | @GetMapping("/adjust-factor") |
| | | @Operation(summary = "负荷移植-调整后的功率因数与无功倒送量") |
| | | @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); |
| | |
| | | List<String> points = new ArrayList<>(); |
| | | Map<String, Object> dataMap = new HashMap<>(); |
| | | for (PowerAdjustedFactorDTO dto : dtoList) { |
| | | if (StringUtils.isNotBlank(dto.getPointNo())) { |
| | | points.add(dto.getPointNo()); |
| | | } |
| | | } |
| | | if (!CollectionUtils.isEmpty(points)) { |
| | | dataMap = dataPointApi.queryPointsRealValue(points); |
| | | } |
| | | for (PowerAdjustedFactorDTO powerAdjustedFactorDTO : dtoList) { |
| | | result.put(powerAdjustedFactorDTO.getName(), Double.parseDouble(dataMap.get(powerAdjustedFactorDTO.getPointNo()).toString())); |
| | | Double value = dataMap.get(powerAdjustedFactorDTO.getPointNo()) == null ? 0 : Double.parseDouble(dataMap.get(powerAdjustedFactorDTO.getPointNo()).toString()); |
| | | result.put(powerAdjustedFactorDTO.getName(), value); |
| | | } |
| | | return success(result); |
| | | } |