| | |
| | | if (StringUtils.isBlank(dto.getQueryType())) { |
| | | return CommonResult.error(GlobalErrorCodeConstants.BAD_REQUEST, "queryType不能为空"); |
| | | } |
| | | |
| | | log.info("id={}", dto.getId()); |
| | | PowerGenStatusEntity powerGenStatus = powerGenStatusDaoService.getById(dto.getId()); |
| | | if (powerGenStatus == null) { |
| | | log.info("未找到code对应的数据: {}", dto.getId()); |
| | |
| | | } |
| | | |
| | | String queryType = dto.getQueryType().toUpperCase(); |
| | | log.info("queryType={}", queryType); |
| | | String pointNo; |
| | | switch (queryType.toUpperCase()) { |
| | | case "P": |
| | |
| | | pointNo = powerGenStatus.getCurQ(); |
| | | break; |
| | | case "COS": |
| | | pointNo = powerGenStatus.getCurCOS(); |
| | | pointNo = powerGenStatus.getCurCos(); |
| | | break; |
| | | default: |
| | | throw new IllegalArgumentException("不支持的queryType: " + queryType); |
| | | } |
| | | log.info("开始查询,pointNo={}", pointNo); |
| | | |
| | | // 默认查最近24小时 |
| | | Date end = Optional.ofNullable(dto.getEndTime()).orElseGet(() -> { |