From 7db50f7d4c7cbbe3870573c4922e7d80beff290e Mon Sep 17 00:00:00 2001 From: yang_shj Date: Thu, 23 Mar 2023 17:01:50 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=85=89=E4=BC=8F=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/main/vo/PhotovoltaicKPIsVo.java | 34 ++++++ .../service/impl/AbnormalAlarmServiceImpl.java | 9 +- .../main/controller/HomePageController.java | 115 --------------------- .../main/controller/HydropowerController.java | 115 +++++++++++++++++++++ .../main/controller/PhotovoltaicController.java | 35 +++++++ .../main/service/PhotovoltaicService.java | 15 +++ .../main/service/impl/PhotovoltaicServiceImpl.java | 30 ++++++ 7 files changed, 236 insertions(+), 117 deletions(-) create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicKPIsVo.java delete mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HomePageController.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicKPIsVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicKPIsVo.java new file mode 100644 index 0000000..128489f --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicKPIsVo.java @@ -0,0 +1,34 @@ +package com.hnac.hzims.operational.main.vo; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author ysj + * @date 2023/03/23 16:54:36 + * @version 4.0.0 + */ +@Data +@ApiModel(value = "光伏集团/区域关键指标") +public class PhotovoltaicKPIsVo { + + @ApiModelProperty(value = "光伏站点数量") + private Integer count; + + @ApiModelProperty(value = "装机容量:单位-kw") + private Double installedCapacity; + + @ApiModelProperty(value = "负荷:单位-kw") + private Double load; + + @ApiModelProperty(value = "年发电量:单位-kWh") + private Double powerYear; + + @ApiModelProperty(value = "月发电量:单位-kWh") + private Double powerMon; + + @ApiModelProperty(value = "日发电量:单位-kWh") + private Double powerDay; +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java index 108bd1f..577d016 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java @@ -140,7 +140,8 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl o.getCode().equals(item.getStation())).collect(Collectors.toList())).map(o->o.get(0).getName()).orElse(null); if(ObjectUtil.isEmpty(queryEntity) || !flag){ HistoryAbnormalAlarmEntity entity = new HistoryAbnormalAlarmEntity(); @@ -154,9 +155,13 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl> stationCount(@ApiParam(value = "站点服务类型:1、云服务站点; 2、代运维服务站点", required = true) Integer serveType, Long deptId) { - List stationList = homePageService.getStationCount(deptId,serveType); - return R.data(stationList); - } - - @ApiOperation("关键指标:水电站、风电站、光伏站") - @GetMapping("/powerStation") - @ApiOperationSupport(order = 2) - public R> powerStation(@ApiParam(value = "站点服务类型:1、云服务站点; 2、代运维服务站点", required = true)Integer serveType,Long deptId) { - List powerTargetVoList = homePageService.powerTarget(serveType,deptId); - return R.data(powerTargetVoList); - } - - @ApiOperation("关键指标:储能站、水利") - @GetMapping("/storageConservancy") - @ApiOperationSupport(order = 3) - public R> storageConservancy(@ApiParam(value = "站点服务类型:1、云服务站点; 2、代运维服务站点", required = true) Integer serveType,Long deptId) { - List crucialTargetVoList = homePageService.storageConservancy(serveType,deptId); - return R.data(crucialTargetVoList); - } - - @ApiOperation("关键指标:暂定其他站") - @GetMapping("/waterAffairs") - @ApiOperationSupport(order = 4) - public R waterAffairs(@ApiParam(value = "站点服务类型:1、云服务站点; 2、代运维服务站点", required = true) Integer serveType,Long deptId) { - OtherStationVo waterAffairsVoList = homePageService.otherStation(serveType,deptId); - return R.data(waterAffairsVoList); - } - - @ApiOperation("水电站数据获取") - @GetMapping("/getHydropowerData") - @ApiOperationSupport(order = 5) - public R> getHydropowerData(@ApiParam(value = "区域id", required = true) Long deptId) { - List hydropowerScoreVoList = homePageService.getHydropowerData(deptId); - return R.data(hydropowerScoreVoList); - } - - - @ApiOperation("年计划发电完成趋势") - @GetMapping("/planAactualTrend") - @ApiOperationSupport(order = 6) - public R> planActualTrend(@ApiParam(value = "区域机构ID") Long deptId) { - return R.data(homePageService.planActualTrend(deptId)); - } - - @ApiOperation("计划发电趋势") - @GetMapping("/planGenerationTrend") - @ApiOperationSupport(order = 7) - public R>> planGenerationTrend(@ApiParam(value = "区域机构ID") Long deptId) { - return homePageService.planGenerationTrend(deptId, 0, 2); - } - - @ApiOperation("区域发电占比") - @GetMapping("/areaGenerationMakeUp") - @ApiOperationSupport(order = 9) - public R>> areaGenerationMakeUp(@ApiParam(value = "区域机构ID") Long deptId) { - return homePageService.areaGenerationMakeUp(deptId, 0, 2); - } - - - @ApiOperation("统计") - @GetMapping("/getCount") - @ApiOperationSupport(order = 10) - public R>> getCount(@ApiParam(value = "区域机构ID") Long deptId) { - return homePageService.getCount(deptId, 0, 2); - } - - - @ApiOperation("获取区域") - @GetMapping("/getArea") - @ApiOperationSupport(order = 11) - public R> getArea(@ApiParam(value = "区域机构ID") Long deptId) { - return homePageService.getArea(deptId); - } - - - @ApiOperation("站点首页") - @GetMapping("/stationHome") - @ApiOperationSupport(order = 11) - public R> homeStation(@ApiParam(value = "区域机构ID") Long deptId) { - return R.data(homePageService.homeStation(deptId)); - } - -} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java new file mode 100644 index 0000000..8fdca62 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java @@ -0,0 +1,115 @@ +package com.hnac.hzims.operational.main.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.main.service.IHomePageService; +import com.hnac.hzims.operational.main.vo.*; +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.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.constraints.NotNull; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/homePage") +@Api(value = "水电站-首页", tags = "水电站-首页") +@AllArgsConstructor +public class HydropowerController extends BladeController { + + @NotNull + private final IHomePageService homePageService; + + @ApiOperation("服务厂站统计") + @GetMapping("/stationCensus") + @ApiOperationSupport(order = 1) + public R> stationCount(@ApiParam(value = "站点服务类型:1、云服务站点; 2、代运维服务站点", required = true) Integer serveType, Long deptId) { + List stationList = homePageService.getStationCount(deptId,serveType); + return R.data(stationList); + } + + @ApiOperation("关键指标:水电站、风电站、光伏站") + @GetMapping("/powerStation") + @ApiOperationSupport(order = 2) + public R> powerStation(@ApiParam(value = "站点服务类型:1、云服务站点; 2、代运维服务站点", required = true)Integer serveType,Long deptId) { + List powerTargetVoList = homePageService.powerTarget(serveType,deptId); + return R.data(powerTargetVoList); + } + + @ApiOperation("关键指标:储能站、水利") + @GetMapping("/storageConservancy") + @ApiOperationSupport(order = 3) + public R> storageConservancy(@ApiParam(value = "站点服务类型:1、云服务站点; 2、代运维服务站点", required = true) Integer serveType,Long deptId) { + List crucialTargetVoList = homePageService.storageConservancy(serveType,deptId); + return R.data(crucialTargetVoList); + } + + @ApiOperation("关键指标:暂定其他站") + @GetMapping("/waterAffairs") + @ApiOperationSupport(order = 4) + public R waterAffairs(@ApiParam(value = "站点服务类型:1、云服务站点; 2、代运维服务站点", required = true) Integer serveType,Long deptId) { + OtherStationVo waterAffairsVoList = homePageService.otherStation(serveType,deptId); + return R.data(waterAffairsVoList); + } + + @ApiOperation("水电站数据获取") + @GetMapping("/getHydropowerData") + @ApiOperationSupport(order = 5) + public R> getHydropowerData(@ApiParam(value = "区域id", required = true) Long deptId) { + List hydropowerScoreVoList = homePageService.getHydropowerData(deptId); + return R.data(hydropowerScoreVoList); + } + + + @ApiOperation("年计划发电完成趋势") + @GetMapping("/planAactualTrend") + @ApiOperationSupport(order = 6) + public R> planActualTrend(@ApiParam(value = "区域机构ID") Long deptId) { + return R.data(homePageService.planActualTrend(deptId)); + } + + @ApiOperation("计划发电趋势") + @GetMapping("/planGenerationTrend") + @ApiOperationSupport(order = 7) + public R>> planGenerationTrend(@ApiParam(value = "区域机构ID") Long deptId) { + return homePageService.planGenerationTrend(deptId, 0, 2); + } + + @ApiOperation("区域发电占比") + @GetMapping("/areaGenerationMakeUp") + @ApiOperationSupport(order = 9) + public R>> areaGenerationMakeUp(@ApiParam(value = "区域机构ID") Long deptId) { + return homePageService.areaGenerationMakeUp(deptId, 0, 2); + } + + + @ApiOperation("统计") + @GetMapping("/getCount") + @ApiOperationSupport(order = 10) + public R>> getCount(@ApiParam(value = "区域机构ID") Long deptId) { + return homePageService.getCount(deptId, 0, 2); + } + + + @ApiOperation("获取区域") + @GetMapping("/getArea") + @ApiOperationSupport(order = 11) + public R> getArea(@ApiParam(value = "区域机构ID") Long deptId) { + return homePageService.getArea(deptId); + } + + + @ApiOperation("站点首页") + @GetMapping("/stationHome") + @ApiOperationSupport(order = 11) + public R> homeStation(@ApiParam(value = "区域机构ID") Long deptId) { + return R.data(homePageService.homeStation(deptId)); + } + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java new file mode 100644 index 0000000..0b6cb91 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/PhotovoltaicController.java @@ -0,0 +1,35 @@ +package com.hnac.hzims.operational.main.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.operational.main.service.PhotovoltaicService; +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.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 + * @date 2023/03/23 16:47:52 + * @version 4.0.0 + */ +@RestController +@RequestMapping("/photovoltaic") +@Api(value = "光伏-首页", tags = "光伏-首页") +@AllArgsConstructor +public class PhotovoltaicController extends BladeController { + + private final PhotovoltaicService service; + + @ApiOperation("集团/区域关键指标") + @GetMapping("/KPIs") + @ApiOperationSupport(order = 1) + public R KPIs(@ApiParam(value = "集团/区域机构编号") Long deptId) { + return R.data(service.KPIs(deptId)); + } + +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java new file mode 100644 index 0000000..197c359 --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/PhotovoltaicService.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.operational.main.service; + +import com.hnac.hzims.operational.main.vo.PhotovoltaicKPIsVo; + +/** + * @author ysj + * @date 2023/03/23 16:49:52 + * @version 4.0.0 + */ +public interface PhotovoltaicService { + + + // 集团/区域关键指标 + PhotovoltaicKPIsVo KPIs(Long deptId); +} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java new file mode 100644 index 0000000..63bb0bd --- /dev/null +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java @@ -0,0 +1,30 @@ +package com.hnac.hzims.operational.main.service.impl; + +import com.hnac.hzims.operational.main.service.PhotovoltaicService; +import com.hnac.hzims.operational.main.vo.PhotovoltaicKPIsVo; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + + +/** + * @author ysj + * @date 2023/03/23 16:51:43 + * @version 4.0.0 + */ +@Service +@RequiredArgsConstructor +public class PhotovoltaicServiceImpl implements PhotovoltaicService { + + /** + * 集团/区域关键指标 + * @param deptId + * @return + */ + @Override + public PhotovoltaicKPIsVo KPIs(Long deptId) { + PhotovoltaicKPIsVo kpi = new PhotovoltaicKPIsVo(); + + + return kpi; + } +}