Browse Source

初始化项目

zhongwei
段飞宇 1 year ago
parent
commit
e78c5404e6
  1. 97
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEvaluation.java
  2. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/OperationApplication.java
  3. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/HydropowerStationController.java
  4. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationEvaluationController.java
  5. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.java
  6. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.xml
  7. 27
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
  8. 91
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

97
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;
/**
* <p>
* 电站评分表
* </p>
*
* @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;
}

10
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);
}

3
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<StationEntity> stationEntityPage = new Page<>(page, size);
IPage<StationEntity> stationEntityIPage =
stationService.selectPageList(stationEntityPage, stationQueryVo);

1
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;

4
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<StationEntity> {
Integer getStationMaxOrder();
List<HzimsStationCountVo> getStationCount();
List<StationsVo> stationVoCount();
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/mapper/StationMapper.xml

@ -2,6 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.operational.station.mapper.StationMapper">
<select id="selectInRefDept" resultType="com.hnac.hzims.operational.station.entity.StationEntity">
SELECT * FROM hzims_station WHERE IS_DELETED = 0 and REF_DEPT IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
@ -447,4 +448,11 @@
and not type is null
group by type
</select>
<select id="stationVoCount" resultType="com.hnac.hzims.operational.station.vo.StationsVo">
select date_format(create_time,'%Y') year, count(1) count
from hzims_station group by year
</select>
</mapper>

27
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<StationEntity> {
* 新建站点
*
* @param req 站点信息
* @param update
* @param updateOrAdd
*/
void buildStation(StationEntity req, String updateOrAdd);
@ -147,4 +149,27 @@ public interface IStationService extends BaseService<StationEntity> {
* @return
*/
StationEntity getByStationId(Long id);
/**
* 对全县绿色水电站在水电GIS一张图上进行展示直观展现绿色小水电站的分布信息
* @param stationEntityPage
* @param stationQueryVo
* @return
*/
IPage<StationEntity> selectPageList(Page<StationEntity> stationEntityPage, StationsQueryVo stationQueryVo);
/**
* 获取绿色小水站电站数据
* @return
*/
Map<String, Object> getCount();
/**
* 对全县绿色水电站在水电GIS一张图上进行展示直观展现绿色小水电站的分布信息
* @param stationsQueryVo
* @return
*/
List<StationEntity> selectStationsQueryList(StationsQueryVo stationsQueryVo);
}

91
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<StationMapper, StationEn
return stationEntity;
}
/**
* 对全县绿色水电站在水电GIS一张图上进行展示直观展现绿色小水电站的分布信息
*
* @param stationEntityPage
* @param stationQueryVo
* @return
*/
@Override
public IPage<StationEntity> selectPageList(Page<StationEntity> stationEntityPage, StationsQueryVo stationQueryVo) {
QueryWrapper<StationEntity> queryWrapper = new QueryWrapper<>();
Page<StationEntity> resultStationEntity = baseMapper.selectPage(stationEntityPage, queryWrapper);
return resultStationEntity;
}
/**
* 获取绿色小水站电站数据
*
* @return
*/
@Override
public Map<String, Object> getCount() {
Map<String, Object> resultMap = new HashMap<>();
List<StationsVo> stationVoList = baseMapper.stationVoCount();
List<Integer> 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<Integer> 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<StationEntity> selectStationsQueryList(StationsQueryVo stationsQueryVo) {
LambdaQueryWrapper<StationEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(stationsQueryVo.getAreaCode()),
StationEntity::getAreaCode,
stationsQueryVo.getAreaCode());
return baseMapper.selectList(lambdaQueryWrapper);
}
}

Loading…
Cancel
Save