| | |
| | | import com.iailab.framework.common.exception.enums.GlobalErrorCodeConstants; |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.ansteel.api.dto.PowerCapacitorStatusDTO; |
| | | import com.iailab.module.ansteel.api.dto.PowerControlDetDTO; |
| | | import com.iailab.module.ansteel.api.dto.PowerControlMainDTO; |
| | | import com.iailab.module.ansteel.api.dto.PowerNetFactorDTO; |
| | | import com.iailab.module.ansteel.api.dto.*; |
| | | import com.iailab.module.ansteel.api.entity.*; |
| | | import com.iailab.module.ansteel.api.service.*; |
| | | import com.iailab.module.data.api.point.DataPointApi; |
| | |
| | | @Autowired |
| | | private PowerControlDetService powerControlDetService; |
| | | |
| | | @Autowired |
| | | private PowerGenStatusDaoService powerGenStatusDaoService; |
| | | |
| | | @Resource |
| | | private DataPointApi dataPointApi; |
| | | |
| | |
| | | return success(result); |
| | | } |
| | | |
| | | @GetMapping("/gen-status/list") |
| | | @Operation(summary = "功率因数-发电机组实时状态") |
| | | public CommonResult<List<PowerGenStatusDTO>> getPowerGenStatusList(@RequestParam Map<String, Object> params) { |
| | | List<PowerGenStatusEntity> list = powerGenStatusDaoService.list(params); |
| | | List<PowerGenStatusDTO> result = ConvertUtils.sourceToTarget(list, PowerGenStatusDTO.class); |
| | | if (CollectionUtils.isEmpty(result)) { |
| | | return success(result); |
| | | } |
| | | for(PowerGenStatusDTO dto : result) { |
| | | List<String> points = new ArrayList<>(); |
| | | if (StringUtils.isNotBlank(dto.getCurP())) { |
| | | points.add(dto.getCurP()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getCurQ())) { |
| | | points.add(dto.getCurQ()); |
| | | } |
| | | if (!CollectionUtils.isEmpty(points)) { |
| | | Map<String, Object> pointsRealValue = dataPointApi.queryPointsRealValue(points); |
| | | if (pointsRealValue.get(dto.getCurP()) != null) { |
| | | dto.setCurP(pointsRealValue.get(dto.getCurP()).toString()); |
| | | } |
| | | if (pointsRealValue.get(dto.getCurQ()) != null) { |
| | | dto.setCurQ(pointsRealValue.get(dto.getCurQ()).toString()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return success(result); |
| | | } |
| | | |
| | | @GetMapping("/capacitor-status/list") |
| | | @Operation(summary = "功率因数-电容器投运状态") |
| | | public CommonResult<List<PowerCapacitorStatusDTO>> getPowerCapacitorStatusList(@RequestParam Map<String, Object> params) { |
| | |
| | | return success(ConvertUtils.sourceToTarget(list, PowerControlMainDTO.class)); |
| | | } |
| | | |
| | | @GetMapping("/control-main/update") |
| | | @Operation(summary = "功率因数-管控变电站修改上下限") |
| | | public CommonResult<Boolean> updatePowerControlMain(PowerControlMainDTO dto) { |
| | | if (StringUtils.isBlank(dto.getId())) { |
| | | return CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST); |
| | | } |
| | | PowerControlMainEntity entity = new PowerControlMainEntity(); |
| | | entity.setId(dto.getId()); |
| | | entity.setLimitH(dto.getLimitH()); |
| | | entity.setLimitL(dto.getLimitL()); |
| | | powerControlMainService.update(entity); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/control-det/list") |
| | | @Operation(summary = "功率因数-管控功率因数详情") |
| | | public CommonResult<List<PowerControlDetDTO>> getPowerControlDetList(@RequestParam Map<String, Object> params) { |