From e78c5404e61427b5de8a0697d699ae59ddbdc7b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com>
Date: Thu, 24 Aug 2023 16:32:25 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../station/entity/StationEvaluation.java | 97 ++++++++++++++++++++++
.../hzims/operational/OperationApplication.java | 10 +++
.../controller/HydropowerStationController.java | 3 +-
.../controller/StationEvaluationController.java | 1 +
.../operational/station/mapper/StationMapper.java | 4 +
.../operational/station/mapper/StationMapper.xml | 8 ++
.../station/service/IStationService.java | 27 +++++-
.../station/service/impl/StationServiceImpl.java | 91 +++++++++++++++++++-
8 files changed, 234 insertions(+), 7 deletions(-)
create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEvaluation.java
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEvaluation.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEvaluation.java
new file mode 100644
index 0000000..b23dca9
--- /dev/null
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEvaluation.java
@@ -0,0 +1,97 @@
+package com.hnac.hzims.operational.station.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *
+ * 电站评分表
+ *
+ *
+ * @author dfy
+ * @since 2023-08-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("station_evaluation")
+public class StationEvaluation implements Serializable {
+
+ private static final long serialVersionUID=1L;
+
+ /**
+ * 编号
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 类别
+ */
+ @TableField("evaluation_name")
+ private String evaluationName;
+
+ /**
+ * 站点id
+ */
+ @TableField("station_id")
+ private Long stationId;
+
+ /**
+ * 父级
+ */
+ @TableField("parent_id")
+ private Long parentId;
+
+ /**
+ * 等级
+ */
+ @TableField("level")
+ private Integer level;
+
+ /**
+ * 分数
+ */
+ @TableField("minute")
+ private Integer minute;
+
+ /**
+ * 得分
+ */
+ @TableField("score")
+ private Integer score;
+
+ /**
+ * 描述
+ */
+ @TableField("description")
+ private String description;
+
+ /**
+ * 创建时间
+ */
+ @TableField("create_time")
+ private LocalDateTime createTime;
+
+ /**
+ * 更新时间
+ */
+ @TableField("update_time")
+ private LocalDateTime updateTime;
+
+ /**
+ * 逻辑删除
+ */
+ @TableField("is_deleted")
+ private Boolean deleted;
+
+
+}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/OperationApplication.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/OperationApplication.java
index 561d583..efb9cf6 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/OperationApplication.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/OperationApplication.java
@@ -38,6 +38,16 @@ import javax.annotation.Resource;
@Resource
public class OperationApplication extends SpringBootServletInitializer {
+
+ static {
+ System.setProperty("spring.cloud.nacos.discovery.server-addr", "http://hadoop:8848");
+ System.setProperty("spring.cloud.nacos.config.server-addr", "http://hadoop:8848");
+ System.setProperty("spring.cloud.nacos.username", "nacos");
+ System.setProperty("spring.cloud.nacos.password", "nacos");
+ }
+
+
+
public static void main(String[] args) {
BladeApplication.run(OperationalConstants.APP_NAME, OperationApplication.class, args);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/HydropowerStationController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/HydropowerStationController.java
index c0fd186..c2a389f 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/HydropowerStationController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/HydropowerStationController.java
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService;
-import com.hnac.hzims.operational.station.vo.StationQueryVo;
import com.hnac.hzims.operational.station.vo.StationsQueryVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -40,7 +39,7 @@ public class HydropowerStationController {
@GetMapping("pageList/{page}/{size}")
public R pageList(@PathVariable Long page,
@PathVariable Long size,
- StationQueryVo stationQueryVo) {
+ StationsQueryVo stationQueryVo) {
Page stationEntityPage = new Page<>(page, size);
IPage stationEntityIPage =
stationService.selectPageList(stationEntityPage, stationQueryVo);
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationEvaluationController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationEvaluationController.java
index fe95541..b0e603b 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationEvaluationController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationEvaluationController.java
@@ -1,6 +1,7 @@
package com.hnac.hzims.operational.station.controller;
+
import com.hnac.hzims.operational.station.entity.StationEvaluation;
import com.hnac.hzims.operational.station.service.StationEvaluationService;
import com.hnac.hzims.operational.station.vo.OneStationEvaluationVo;
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.java
index 7a3824b..5795087 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.java
@@ -6,6 +6,7 @@ import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.vo.HzimsStationCountVo;
import com.hnac.hzims.operational.station.vo.RefDomainOrStationVo;
import com.hnac.hzims.operational.station.vo.StationAndDeptVo;
+import com.hnac.hzims.operational.station.vo.StationsVo;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
@@ -274,4 +275,7 @@ public interface StationMapper extends UserDataScopeBaseMapper {
Integer getStationMaxOrder();
List getStationCount();
+
+
+ List stationVoCount();
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.xml
index d21120e..c955341 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.xml
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.xml
@@ -2,6 +2,7 @@
+
+
+
+
+
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
index 95fa28e..fbf2ec8 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
@@ -1,11 +1,13 @@
package com.hnac.hzims.operational.station.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.main.vo.StationCountVo;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.vo.HzimsStationCountVo;
import com.hnac.hzims.operational.station.vo.StationAndDeptVo;
import com.hnac.hzims.operational.station.vo.StationVO;
+import com.hnac.hzims.operational.station.vo.StationsQueryVo;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
@@ -27,7 +29,7 @@ public interface IStationService extends BaseService {
* 新建站点
*
* @param req 站点信息
- * @param update
+ * @param updateOrAdd
*/
void buildStation(StationEntity req, String updateOrAdd);
@@ -147,4 +149,27 @@ public interface IStationService extends BaseService {
* @return
*/
StationEntity getByStationId(Long id);
+
+
+ /**
+ * 对全县绿色水电站在水电GIS一张图上进行展示,直观展现绿色小水电站的分布信息。
+ * @param stationEntityPage
+ * @param stationQueryVo
+ * @return
+ */
+ IPage selectPageList(Page stationEntityPage, StationsQueryVo stationQueryVo);
+
+ /**
+ * 获取绿色小水站电站数据
+ * @return
+ */
+ Map getCount();
+
+
+ /**
+ * 对全县绿色水电站在水电GIS一张图上进行展示,直观展现绿色小水电站的分布信息。
+ * @param stationsQueryVo
+ * @return
+ */
+ List selectStationsQueryList(StationsQueryVo stationsQueryVo);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
index f741ce5..9f2a033 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.hnac.hzims.common.service.UserAuthDataService;
import com.hnac.hzims.fdp.feign.IQuestionClient;
@@ -17,10 +18,7 @@ import com.hnac.hzims.operational.station.entity.*;
import com.hnac.hzims.operational.station.mapper.ControlUsersMapper;
import com.hnac.hzims.operational.station.mapper.StationMapper;
import com.hnac.hzims.operational.station.service.*;
-import com.hnac.hzims.operational.station.vo.HzimsStationCountVo;
-import com.hnac.hzims.operational.station.vo.StationAndDeptVo;
-import com.hnac.hzims.operational.station.vo.StationPushConfigVO;
-import com.hnac.hzims.operational.station.vo.StationVO;
+import com.hnac.hzims.operational.station.vo.*;
import com.hnac.hzims.operational.station.wrapper.StationWrapper;
/*import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.project.ProjectClient;
@@ -54,6 +52,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
+import java.time.Year;
import java.util.*;
import java.util.stream.Collectors;
@@ -831,4 +830,88 @@ public class StationServiceImpl extends BaseServiceImpl selectPageList(Page stationEntityPage, StationsQueryVo stationQueryVo) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+
+
+ Page resultStationEntity = baseMapper.selectPage(stationEntityPage, queryWrapper);
+
+
+ return resultStationEntity;
+ }
+
+
+
+
+ /**
+ * 获取绿色小水站电站数据
+ *
+ * @return
+ */
+ @Override
+ public Map getCount() {
+ Map resultMap = new HashMap<>();
+ List stationVoList = baseMapper.stationVoCount();
+
+
+ List yesterday = new ArrayList<>();
+ Year year = Year.now();
+ for (int i = 0; i < 6; i++) {
+ Year newYear = year.minusYears(i);
+ yesterday.add(newYear.getValue());
+ }
+
+
+ for (StationsVo stationVo : stationVoList) {
+ Integer stationVoYear = stationVo.getYear();
+ //包含删除
+ if (yesterday.contains(stationVoYear)) {
+ yesterday.remove(stationVoYear);
+ }
+ }
+
+
+ for (Integer i : yesterday) {
+ StationsVo stationVo = new StationsVo();
+ stationVo.setYear(i);
+ stationVo.setCount(0);
+ stationVoList.add(stationVo);
+ }
+
+
+ //月份
+ List yearList = stationVoList.stream().map(StationsVo::getYear).collect(Collectors.toList());
+ resultMap.put("yearList", yearList);
+ resultMap.put("stationVoList", stationVoList);
+
+
+ return resultMap;
+ }
+
+
+ /**
+ * 对全县绿色水电站在水电GIS一张图上进行展示,直观展现绿色小水电站的分布信息。
+ *
+ * @param stationsQueryVo
+ * @return
+ */
+ @Override
+ public List selectStationsQueryList(StationsQueryVo stationsQueryVo) {
+
+ LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>();
+ lambdaQueryWrapper.eq(StringUtils.isNotEmpty(stationsQueryVo.getAreaCode()),
+ StationEntity::getAreaCode,
+ stationsQueryVo.getAreaCode());
+ return baseMapper.selectList(lambdaQueryWrapper);
+ }
}