Browse Source

#App光伏首页

zhongwei
yang_shj 2 years ago
parent
commit
ad67c646d4
  1. 89
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicLoadGenerateVo.java
  2. 89
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicStationAppVo.java
  3. 87
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicSubordinateAppVo.java
  4. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicSubordinateVo.java
  5. 29
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java
  6. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java
  7. 45
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java

89
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicLoadGenerateVo.java

@ -0,0 +1,89 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author ysj
* @date 2023/03/29 15:14:34
* @version 4.0.0
*/
@Data
@ApiModel(value = "水利站点首页对象")
public class PhotovoltaicLoadGenerateVo {
@ApiModelProperty(value = "机构Id")
private Long deptId;
@ApiModelProperty(value = "机构名称")
private String deptName;
@ApiModelProperty(value = "站点编码")
private String stationCode;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "投运时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private LocalDateTime operationTime;
@ApiModelProperty(value = "总装机容量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacity;
@ApiModelProperty(value = "安全运行天数")
private Integer runDay;
@ApiModelProperty(value = "总发电负荷")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "日发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDay;
@ApiModelProperty(value = "月发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateMon;
@ApiModelProperty(value = "年发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateYear;
@ApiModelProperty(value = "总发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
@ApiModelProperty(value = "站点实时温度")
private String temp;
@ApiModelProperty(value = "站点收益")
private Double income;
@ApiModelProperty(value = "逆变器数量")
private Integer inverterCount;
@ApiModelProperty(value = "七日内天气")
private List<Daily> weather;
@ApiModelProperty(value = "发电排行")
private List<PhotovoltaicDeviceVo> devices;
@ApiModelProperty(value = "年发电量完成百分比")
private List<PowerYearVo> generateSurvey;
@ApiModelProperty(value = "设备信息")
private List<PhotovoltaicDeviceChartsVo> charts;
}

89
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicStationAppVo.java

@ -0,0 +1,89 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author ysj
* @date 2023/03/29 15:14:34
* @version 4.0.0
*/
@Data
@ApiModel(value = "水利站点首页对象")
public class PhotovoltaicStationAppVo {
@ApiModelProperty(value = "机构Id")
private Long deptId;
@ApiModelProperty(value = "机构名称")
private String deptName;
@ApiModelProperty(value = "站点编码")
private String stationCode;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "投运时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
private LocalDateTime operationTime;
@ApiModelProperty(value = "总装机容量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacity;
@ApiModelProperty(value = "安全运行天数")
private Integer runDay;
@ApiModelProperty(value = "总发电负荷")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "日发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDay;
@ApiModelProperty(value = "月发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateMon;
@ApiModelProperty(value = "年发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateYear;
@ApiModelProperty(value = "总发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
@ApiModelProperty(value = "站点实时温度")
private String temp;
@ApiModelProperty(value = "站点收益")
private Double income;
@ApiModelProperty(value = "逆变器数量")
private Integer inverterCount;
@ApiModelProperty(value = "七日内天气")
private List<Daily> weather;
@ApiModelProperty(value = "发电排行")
private List<PhotovoltaicDeviceVo> devices;
@ApiModelProperty(value = "年发电量完成百分比")
private List<PowerYearVo> generateSurvey;
@ApiModelProperty(value = "设备信息")
private List<PhotovoltaicDeviceChartsVo> charts;
}

87
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicSubordinateAppVo.java

@ -0,0 +1,87 @@
package com.hnac.hzims.operational.main.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.hnac.hzims.hzimsweather.response.weather.Daily;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
* @date 2023/03/24 09:58:57
* @version 4.0.0
*/
@Data
@ApiModel(value = "发电量数据")
public class PhotovoltaicSubordinateAppVo {
@ApiModelProperty(value = "机构ID")
private Long deptId;
@ApiModelProperty(value = "机构名称")
private String deptName;
@ApiModelProperty(value = "地市编码")
private String areaCode;
@ApiModelProperty(value = "地市名称")
private String areaName;
@ApiModelProperty(value = "光伏站点类型:0-个体光伏站 1-厂房光伏站")
private Long type;
@ApiModelProperty("经度(东经)")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Float lgtd;
@ApiModelProperty("纬度(北纬)")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Float lttd;
@ApiModelProperty(value = "容量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacity;
@ApiModelProperty(value = "功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generation;
@ApiModelProperty(value = "发电占比")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generationRate;
@ApiModelProperty(value = "容量利用率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double capacityUse;
@ApiModelProperty(value = "电站利用率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double stationUse;
@ApiModelProperty(value = "站点实时温度")
private String temp;
@ApiModelProperty(value = "七日内天气")
private List<Daily> weather;
@ApiModelProperty(value = "排序")
private Integer sort;
@ApiModelProperty(value = "站点数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long stationCount;
@ApiModelProperty(value = "站点使用数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long stationUseCount;
}

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/SubordinateVo.java → hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicSubordinateVo.java

@ -17,7 +17,7 @@ import java.util.List;
*/ */
@Data @Data
@ApiModel(value = "发电量数据") @ApiModel(value = "发电量数据")
public class SubordinateVo { public class PhotovoltaicSubordinateVo {
@ApiModelProperty(value = "机构ID") @ApiModelProperty(value = "机构ID")
private Long deptId; private Long deptId;

29
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java

@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
public class PhotovoltaicController extends BladeController { public class PhotovoltaicController extends BladeController {
private final PhotovoltaicService service; private final PhotovoltaicService service;
@ApiLog @ApiLog
@ApiOperation("集团/区域关键指标") @ApiOperation("集团/区域关键指标")
@GetMapping("/KPIs") @GetMapping("/KPIs")
@ -32,6 +33,7 @@ public class PhotovoltaicController extends BladeController {
public R KPIs(@ApiParam(value = "集团/区域机构编号") Long deptId) { public R KPIs(@ApiParam(value = "集团/区域机构编号") Long deptId) {
return R.data(service.KPIs(deptId)); return R.data(service.KPIs(deptId));
} }
@ApiLog @ApiLog
@ApiOperation("集团/区域发电量") @ApiOperation("集团/区域发电量")
@GetMapping("/generation") @GetMapping("/generation")
@ -40,6 +42,7 @@ public class PhotovoltaicController extends BladeController {
@ApiParam(value = "查询类型:0-周 1-月 -2年") String type) { @ApiParam(value = "查询类型:0-周 1-月 -2年") String type) {
return R.data(service.generation(deptId, type)); return R.data(service.generation(deptId, type));
} }
@ApiLog @ApiLog
@ApiOperation("集团/区域下属数据占比") @ApiOperation("集团/区域下属数据占比")
@GetMapping("/subordinate") @GetMapping("/subordinate")
@ -54,4 +57,30 @@ public class PhotovoltaicController extends BladeController {
public R station(@ApiParam(value = "站点机构ID") Long deptId) { public R station(@ApiParam(value = "站点机构ID") Long deptId) {
return R.data(service.station(deptId)); return R.data(service.station(deptId));
} }
@ApiLog
@ApiOperation("App区域下属数据")
@GetMapping("/app_subordinate")
@ApiOperationSupport(order = 3)
public R app_subordinate(@ApiParam(value = "区域/站点机构编号") Long deptId) {
return R.data(service.app_subordinate(deptId));
}
@ApiLog
@ApiOperation("App光伏站点数据")
@GetMapping("/app_station")
@ApiOperationSupport(order = 3)
public R app_station(@ApiParam(value = "区域/站点机构编号") Long deptId) {
return R.data(service.app_station(deptId));
}
@ApiLog
@ApiOperation("App功率/发电量查询")
@GetMapping("/app_load_generate")
@ApiOperationSupport(order = 3)
public R app_load_generate(@ApiParam(value = "区域/站点机构编号") Long deptId,
@ApiParam(value = "查询类型: 0 - 发电量 1 - 功率") Long type) {
return R.data(service.app_load_generate(deptId,type));
}
} }

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java

@ -1,9 +1,6 @@
package com.hnac.hzims.operational.main.service; package com.hnac.hzims.operational.main.service;
import com.hnac.hzims.operational.main.vo.GenerationVo; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.main.vo.PhotovoltaicKPIsVo;
import com.hnac.hzims.operational.main.vo.PhotovoltaicStationVo;
import com.hnac.hzims.operational.main.vo.SubordinateVo;
import java.util.List; import java.util.List;
@ -27,8 +24,17 @@ public interface PhotovoltaicService {
List<GenerationVo> generation(Long deptId,String type); List<GenerationVo> generation(Long deptId,String type);
// 集团/区域下属数据占比 // 集团/区域下属数据占比
List<SubordinateVo> subordinate(Long deptId); List<PhotovoltaicSubordinateVo> subordinate(Long deptId);
// 站点数据 // 站点数据
PhotovoltaicStationVo station(Long deptId); PhotovoltaicStationVo station(Long deptId);
// app区域数据
PhotovoltaicStationAppVo app_subordinate(Long deptId);
// app站点数据
PhotovoltaicStationAppVo app_station(Long deptId);
// App功率/发电量查询
PhotovoltaicLoadGenerateVo app_load_generate(Long deptId, Long type);
} }

45
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java

@ -685,7 +685,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
* @return * @return
*/ */
@Override @Override
public List<SubordinateVo> subordinate(Long deptId) { public List<PhotovoltaicSubordinateVo> subordinate(Long deptId) {
// 获取区域或者站点map结构 // 获取区域或者站点map结构
Map<Dept,List<StationEntity>> map = sideHustleService.getAreaOrStaion(deptId,Collections.singletonList(HomePageConstant.PHOTOVOLTAIC)); Map<Dept,List<StationEntity>> map = sideHustleService.getAreaOrStaion(deptId,Collections.singletonList(HomePageConstant.PHOTOVOLTAIC));
if(MapUtils.isEmpty(map)){ if(MapUtils.isEmpty(map)){
@ -696,9 +696,9 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
// 指标数据 // 指标数据
List<PhotovoltaicTargetVo> deviceTargets = (List<PhotovoltaicTargetVo>) redisTemplate.opsForValue().get(load_photovoltaic_target_key); List<PhotovoltaicTargetVo> deviceTargets = (List<PhotovoltaicTargetVo>) redisTemplate.opsForValue().get(load_photovoltaic_target_key);
// 遍历数据 // 遍历数据
List<SubordinateVo> list = new ArrayList<>(); List<PhotovoltaicSubordinateVo> list = new ArrayList<>();
for (Map.Entry<Dept,List<StationEntity>> entry : map.entrySet()) { for (Map.Entry<Dept,List<StationEntity>> entry : map.entrySet()) {
SubordinateVo subordinate = new SubordinateVo(); PhotovoltaicSubordinateVo subordinate = new PhotovoltaicSubordinateVo();
if(ObjectUtil.isEmpty(entry.getValue())){ if(ObjectUtil.isEmpty(entry.getValue())){
continue; continue;
} }
@ -753,9 +753,9 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
return new ArrayList<>(); return new ArrayList<>();
} }
// 总数据 : 发电量 、 容量 、 电站数 // 总数据 : 发电量 、 容量 、 电站数
Double sumGeneration = list.stream().mapToDouble(SubordinateVo::getGeneration).sum(); Double sumGeneration = list.stream().mapToDouble(PhotovoltaicSubordinateVo::getGeneration).sum();
Double sumLoad = list.stream().mapToDouble(SubordinateVo::getCapacity).sum(); Double sumLoad = list.stream().mapToDouble(PhotovoltaicSubordinateVo::getCapacity).sum();
Double sumStationCount = list.stream().mapToDouble(SubordinateVo::getStationCount).sum(); Double sumStationCount = list.stream().mapToDouble(PhotovoltaicSubordinateVo::getStationCount).sum();
// 计算 :集团发电占比 电站利用率 容量利用率 // 计算 :集团发电占比 电站利用率 容量利用率
return list.stream().map(subordinate ->{ return list.stream().map(subordinate ->{
if (Math.abs(sumGeneration) <= 0) { if (Math.abs(sumGeneration) <= 0) {
@ -774,7 +774,7 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
subordinate.setStationUse(BigDecimal.valueOf(subordinate.getStationUseCount() / sumStationCount * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue()); subordinate.setStationUse(BigDecimal.valueOf(subordinate.getStationUseCount() / sumStationCount * 100L).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue());
} }
return subordinate; return subordinate;
}).sorted(Comparator.comparing(SubordinateVo::getCapacity)).collect(Collectors.toList()); }).sorted(Comparator.comparing(PhotovoltaicSubordinateVo::getCapacity)).collect(Collectors.toList());
} }
/** /**
@ -831,6 +831,37 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
} }
/** /**
* App区域下属数据
* @param deptId
* @return
*/
@Override
public PhotovoltaicStationAppVo app_subordinate(Long deptId) {
return null;
}
/**
* App光伏站点数据
* @param deptId
* @return
*/
@Override
public PhotovoltaicStationAppVo app_station(Long deptId) {
return null;
}
/**
* App功率/发电量查询
* @param deptId
* @param type
* @return
*/
@Override
public PhotovoltaicLoadGenerateVo app_load_generate(Long deptId, Long type) {
return null;
}
/**
* 获取实时温度 * 获取实时温度
* @param weather * @param weather
* @param code * @param code

Loading…
Cancel
Save