From 69eb41b08ea93e19ea08d3575619ac0530d320ec Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 7 Jul 2023 14:15:50 +0800 Subject: [PATCH] =?UTF-8?q?#=E9=A3=8E=E7=94=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/main/vo/WindScoreVo.java | 64 ++++++++++++++++++++++ .../service/operation/impl/ReportServiceImpl.java | 2 +- .../alert/service/impl/AlarmHandleServiceImpl.java | 2 +- .../main/controller/WindHomeController.java | 37 +++++++++++++ .../operational/main/service/WindHomeService.java | 12 ++++ .../service/impl/AreaMonthReportServiceImpl.java | 2 +- .../main/service/impl/WindHomeServiceImpl.java | 21 +++++++ 7 files changed, 137 insertions(+), 3 deletions(-) create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/WindScoreVo.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/WindHomeController.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/WindHomeService.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/WindScoreVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/WindScoreVo.java new file mode 100644 index 0000000..9ca6bea --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/WindScoreVo.java @@ -0,0 +1,64 @@ +package com.hnac.hzims.operational.main.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author ysj + */ +@Data +@ApiModel(value = "水电站分计对象") +public class WindScoreVo { + + @ApiModelProperty(value = "机构Id") + private Long departId; + + @ApiModelProperty(value = "机构名称") + private String departName; + + @ApiModelProperty(value = "站点数量") + private Integer stationCount; + + @ApiModelProperty(value = "总装机容量") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double installedCapacity; + + @ApiModelProperty(value = "年平均风速") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double capacityRate; + + @ApiModelProperty(value = "总有功功率") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double load; + + @ApiModelProperty(value = "年总发电量") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double generateYear; + + @ApiModelProperty(value = "月总发电量") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double generateMon; + + @ApiModelProperty(value = "日总发电量") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double generateDay; + + @ApiModelProperty(value = "年计划发电量") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double plan; + + @ApiModelProperty(value = "年计划完成率") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double planRate; + + @ApiModelProperty(value = "近年发电量集合") + private List powerYearVoList; + + @ApiModelProperty(value = "今年计划发电趋势集合") + private List powerMonthVoList; +} diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ReportServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ReportServiceImpl.java index df04ec4..67695dd 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ReportServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/ReportServiceImpl.java @@ -488,7 +488,7 @@ public class ReportServiceImpl implements ReportService { if(ObjectUtil.isEmpty(dept)){ return; } - R> userR = userClient.userListByDeptId(dept.getId()); + R> userR = userClient.userListByDeptAndChildrenWithAuth(dept.getId()); if(!userR.isSuccess() && CollectionUtil.isEmpty(userR.getData())){ return; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java index a2fb1b9..a151d74 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java @@ -140,7 +140,7 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl users = new ArrayList<>(); result.getData().forEach(dept->{ - users.addAll(userClient.userListByDeptId(dept.getId()).getData()); + users.addAll(userClient.userListByDeptAndChildrenWithAuth(dept.getId()).getData()); }); return users.stream().distinct().collect(Collectors.toList()); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/WindHomeController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/WindHomeController.java new file mode 100644 index 0000000..329aef3 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/WindHomeController.java @@ -0,0 +1,37 @@ +package com.hnac.hzims.operational.main.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.main.service.WindHomeService; +import com.hnac.hzims.operational.main.vo.HydropowerScoreVo; +import com.hnac.hzims.operational.main.vo.WindScoreVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.log.annotation.ApiLog; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author ysj + */ +@RestController +@RequestMapping("/windHome") +@Api(value = "风电首页", tags = "风电-首页") +@AllArgsConstructor +public class WindHomeController extends BladeController { + + private final WindHomeService service; + + @ApiLog + @ApiOperation("水电站集团/区域指标") + @GetMapping("/KPIs") + @ApiOperationSupport(order = 1) + public R KPIs(@ApiParam(value = "站点机构ID") Long deptId) { + return R.data(service.KPIs(deptId)); + } + +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/WindHomeService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/WindHomeService.java new file mode 100644 index 0000000..9643554 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/WindHomeService.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.operational.main.service; + +import com.hnac.hzims.operational.main.vo.WindScoreVo; + +/** + * @author ysj + */ +public interface WindHomeService { + + + WindScoreVo KPIs(Long deptId); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java index 75a3d25..0786826 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java @@ -583,7 +583,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { if(ObjectUtil.isEmpty(dept)){ return; } - R> userR = userClient.userListByDeptId(dept.getId()); + R> userR = userClient.userListByDeptAndChildrenWithAuth(dept.getId()); if(!userR.isSuccess() && CollectionUtil.isEmpty(userR.getData())){ return; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java new file mode 100644 index 0000000..920bfe9 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.operational.main.service.impl; + +import com.hnac.hzims.operational.main.service.WindHomeService; +import com.hnac.hzims.operational.main.vo.WindScoreVo; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author ysj + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class WindHomeServiceImpl implements WindHomeService { + + @Override + public WindScoreVo KPIs(Long deptId) { + return null; + } +} \ No newline at end of file