Commit 7a60a21e authored by ZWT's avatar ZWT

Merge remote-tracking branch 'origin/master'

parents 0d42ef08 8b708408
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>gf_back</artifactId>
<groupId>gf</groupId>
<version>1.0.0-pps</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<description>光伏预测模块</description>
<groupId>gf</groupId>
<artifactId>C12-prediction</artifactId>
<modules>
<module>pps-core-prediction</module>
<module>pps-cloud-prediction</module>
</modules>
<packaging>pom</packaging>
<repositories>
<repository>
<id>central</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>xstartup-hz</id>
<url>http://dev.sunboxauto.com/HZ/_packaging/xstartup-hz/maven/v1</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>xstartup-cloud</groupId>
<artifactId>xstartup-cloud-parent-cloud</artifactId>
<version>1.15.169-xstartup-cloud</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>gf</groupId>
<artifactId>pps-cloud-prediction</artifactId>
<version>1.0.0-pps</version>
<properties>
<maven.build.timestamp.format>yyyy.MMdd.HHmmss</maven.build.timestamp.format>
</properties>
<build>
<plugins>
<!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<configuration combine.self="override">
<archive>
<manifestEntries>
<Component-Group-Name>${project.groupId}</Component-Group-Name>
<Component-Artifactid>${project.artifactId}</Component-Artifactid>
<Component-Version>${project.version}</Component-Version>
<Component-Build-Time>${maven.build.timestamp}</Component-Build-Time>
<Component-Description>${project.description}</Component-Description>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>central</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>xstartup-hz</id>
<url>http://dev.sunboxauto.com/HZ/_packaging/xstartup-hz/maven/v1</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>xstartup-cloud</groupId>
<artifactId>xstartup-cloud-parent-core</artifactId>
<version>1.15.169-xstartup-cloud</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>gf</groupId>
<artifactId>pps-core-prediction</artifactId>
<version>1.0.0-pps</version>
<properties>
<maven.build.timestamp.format>yyyy.MMdd.HHmmss</maven.build.timestamp.format>
</properties>
<dependencies>
<dependency>
<groupId>gf</groupId>
<artifactId>pps-common</artifactId>
<version>1.0.0-pps</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<configuration combine.self="override">
<archive>
<manifestEntries>
<Component-Group-Name>${project.groupId}</Component-Group-Name>
<Component-Artifactid>${project.artifactId}</Component-Artifactid>
<Component-Version>${project.version}</Component-Version>
<Component-Build-Time>${maven.build.timestamp}</Component-Build-Time>
<Component-Description>${project.description}</Component-Description>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>central</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>xstartup-hz</id>
<url>http://dev.sunboxauto.com/HZ/_packaging/xstartup-hz/maven/v1</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</project>
\ No newline at end of file
package pps.core.prediction.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 xstartup.annotation.XText;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@TableName("base_data")
public class BaseDataEnt implements Serializable {
@TableId(type = IdType.AUTO)
private Integer id;
@XText("组织id")
@TableField
private String ouId;
@XText("线路id")
@TableField
private Integer lineId;
@XText("日期")
@TableField
private Date dataDate;
@XText("风速")
@TableField
private BigDecimal windSpeed;
@XText("风向")
@TableField
private BigDecimal windDirection;
@XText("温度")
@TableField
private BigDecimal temperature;
@XText("压强")
@TableField
private BigDecimal pressure;
@XText("湿度")
@TableField
private BigDecimal humidity;
@XText("组件平面辐照度")
@TableField
private BigDecimal planeIrradiance;
@XText("全水平辐照度")
@TableField
private BigDecimal horizontalIrradiance;
@XText("实际功率")
@TableField
private BigDecimal power;
@XText("预测功率")
@TableField
private BigDecimal predictedPower;
@XText("天气")
@TableField
private BigDecimal weather;
public BigDecimal getWeather() {
return weather;
}
public void setWeather(BigDecimal weather) {
this.weather = weather;
}
public Integer getId() {
return this.id;
}
public void setId(Integer value) {
this.id = value;
}
public String getOuId() {
return this.ouId;
}
public void setOuId(String value) {
this.ouId = value;
}
public Integer getLineId() {
return this.lineId;
}
public void setLineId(Integer value) {
this.lineId = value;
}
public Date getDataDate() {
return this.dataDate;
}
public void setDataDate(Date value) {
this.dataDate = value;
}
public BigDecimal getWindSpeed() {
return this.windSpeed;
}
public void setWindSpeed(BigDecimal value) {
this.windSpeed = value;
}
public BigDecimal getWindDirection() {
return this.windDirection;
}
public void setWindDirection(BigDecimal value) {
this.windDirection = value;
}
public BigDecimal getTemperature() {
return this.temperature;
}
public void setTemperature(BigDecimal value) {
this.temperature = value;
}
public BigDecimal getPressure() {
return this.pressure;
}
public void setPressure(BigDecimal value) {
this.pressure = value;
}
public BigDecimal getHumidity() {
return this.humidity;
}
public void setHumidity(BigDecimal value) {
this.humidity = value;
}
public BigDecimal getPlaneIrradiance() {
return this.planeIrradiance;
}
public void setPlaneIrradiance(BigDecimal value) {
this.planeIrradiance = value;
}
public BigDecimal getHorizontalIrradiance() {
return this.horizontalIrradiance;
}
public void setHorizontalIrradiance(BigDecimal value) {
this.horizontalIrradiance = value;
}
public BigDecimal getPower() {
return this.power;
}
public void setPower(BigDecimal value) {
this.power = value;
}
public BigDecimal getPredictedPower() {
return this.predictedPower;
}
public void setPredictedPower(BigDecimal value) {
this.predictedPower = value;
}
}
package pps.core.prediction.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import xstartup.annotation.XText;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class BaseDataView implements Serializable {
@TableField
private Integer id;
@XText("组织id")
@TableField
private String ouId;
@XText("线路id")
@TableField
private Integer lineId;
@XText("日期")
@TableField
private Date dataDate;
@XText("风速")
@TableField
private BigDecimal windSpeed;
@XText("风向")
@TableField
private BigDecimal windDirection;
@XText("温度")
@TableField
private BigDecimal temperature;
@XText("压强")
@TableField
private BigDecimal pressure;
@XText("湿度")
@TableField
private BigDecimal humidity;
@XText("组件平面辐照度")
@TableField
private BigDecimal planeIrradiance;
@XText("全水平辐照度")
@TableField
private BigDecimal horizontalIrradiance;
@XText("实际功率")
@TableField
private BigDecimal power;
@XText("预测功率")
@TableField
private BigDecimal predictedPower;
@XText("天气")
@TableField
private BigDecimal weather;
public BigDecimal getWeather() {
return weather;
}
public void setWeather(BigDecimal weather) {
this.weather = weather;
}
public Integer getId() {
return this.id;
}
public void setId(Integer value) {
this.id = value;
}
public String getOuId() {
return this.ouId;
}
public void setOuId(String value) {
this.ouId = value;
}
public Integer getLineId() {
return this.lineId;
}
public void setLineId(Integer value) {
this.lineId = value;
}
public Date getDataDate() {
return this.dataDate;
}
public void setDataDate(Date value) {
this.dataDate = value;
}
public BigDecimal getWindSpeed() {
return this.windSpeed;
}
public void setWindSpeed(BigDecimal value) {
this.windSpeed = value;
}
public BigDecimal getWindDirection() {
return this.windDirection;
}
public void setWindDirection(BigDecimal value) {
this.windDirection = value;
}
public BigDecimal getTemperature() {
return this.temperature;
}
public void setTemperature(BigDecimal value) {
this.temperature = value;
}
public BigDecimal getPressure() {
return this.pressure;
}
public void setPressure(BigDecimal value) {
this.pressure = value;
}
public BigDecimal getHumidity() {
return this.humidity;
}
public void setHumidity(BigDecimal value) {
this.humidity = value;
}
public BigDecimal getPlaneIrradiance() {
return this.planeIrradiance;
}
public void setPlaneIrradiance(BigDecimal value) {
this.planeIrradiance = value;
}
public BigDecimal getHorizontalIrradiance() {
return this.horizontalIrradiance;
}
public void setHorizontalIrradiance(BigDecimal value) {
this.horizontalIrradiance = value;
}
public BigDecimal getPower() {
return this.power;
}
public void setPower(BigDecimal value) {
this.power = value;
}
public BigDecimal getPredictedPower() {
return this.predictedPower;
}
public void setPredictedPower(BigDecimal value) {
this.predictedPower = value;
}
}
package pps.core.prediction.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import pps.core.prediction.entity.BaseDataEnt;
@Repository(value="pps.core.prediction.mapper.BaseDataMapper")
public interface BaseDataMapper extends BaseMapper<BaseDataEnt> {
}
package pps.core.prediction.mapper;
import org.springframework.stereotype.Repository;
import pps.core.prediction.entity.BaseDataView;
import java.util.List;
@Repository(value="pps.core.prediction.mapper.BaseDataViewMapper")
public interface BaseDataViewMapper {
BaseDataView selectOne(BaseDataView record);
List<BaseDataView> selectList(BaseDataView record);
void batchInsert(List<BaseDataView> dataList);
}
package pps.core.prediction.module;
import pps.core.common.utils.ManifestComponentInfoHelper;
import xstartup.annotation.XText;
import xstartup.base.XContext;
import xstartup.base.XModule;
/**
* 间开制度模块
*
* @author ZWT
* @date 2023/08/29
*/
@XText("光伏预测模块")
public class PpsCorePredictionModule extends XModule {
protected PpsCorePredictionModule() {
super(1010);
}
@Override
protected void onStarted(XContext context) {
ManifestComponentInfoHelper.init(this.getClass().getClassLoader());
}
}
\ No newline at end of file
package pps.core.prediction.mybatis;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import pps.core.common.mybatis.MybaitisGlobalConfigSuppiler;
import xstartup.service.mybatis.XMybatis;
/**
* mybatis 配置类
*/
@Component
@EnableTransactionManagement
@MapperScan(sqlSessionTemplateRef = "sqlSessionTemplateRef.pps.core.prediction",
sqlSessionFactoryRef = "sqlSessionFactoryRef.pps.core.prediction",
basePackages = {"pps.core.prediction.mapper"})
public class PpsCorePredictionMybatis extends XMybatis {
@Override
public GlobalConfig getGlobalConfig() {
return MybaitisGlobalConfigSuppiler.INSTANCE.get();
}
}
package pps.core.prediction.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import pps.core.prediction.entity.BaseDataEnt;
import pps.core.prediction.entity.BaseDataView;
import pps.core.prediction.mapper.BaseDataMapper;
import pps.core.prediction.mapper.BaseDataViewMapper;
import pps.core.prediction.service.data.base_data.GetBaseDataInput;
import pps.core.prediction.service.data.base_data.GetBaseDataOutput;
import xstartup.annotation.XService;
import xstartup.base.XContext;
import xstartup.base.util.XCopyUtils;
import xstartup.data.*;
import xstartup.error.XError;
import xstartup.feature.api.annotation.XApiAnonymous;
import xstartup.feature.api.annotation.XApiGet;
@XService
public class PredictionService {
@XApiAnonymous
@XApiGet
public XSingleResult<GetBaseDataOutput> getBaseData(XContext context, GetBaseDataInput input){
BaseDataMapper mapper = context.getBean(BaseDataMapper.class);
QueryWrapper<BaseDataEnt> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(BaseDataEnt::getId, input.getId());
BaseDataEnt entity = mapper.selectOne(queryWrapper);
if(entity == null) {
return XSingleResult.error(context, XError.NotFound);
}
GetBaseDataOutput output = new GetBaseDataOutput();
XCopyUtils.copyObject(entity, output);
return XSingleResult.success(output);
}
@XApiAnonymous
@XApiGet
public XSingleResult<GetBaseDataOutput> getBaseDataView(XContext context, GetBaseDataInput input){
BaseDataViewMapper mapper = context.getBean(BaseDataViewMapper.class);
BaseDataView view = XCopyUtils.copyNewObject(input , BaseDataView.class);
BaseDataView entity = mapper.selectOne(view);
if(entity == null) {
return XSingleResult.error(context, XError.NotFound);
}
GetBaseDataOutput output = new GetBaseDataOutput();
XCopyUtils.copyObject(entity, output);
return XSingleResult.success(output);
}
}
package pps.core.prediction.service.data.base_data;
import xstartup.annotation.XText;
public class GetBaseDataInput {
private Integer id;
@XText("组织id")
private String ouId;
@XText("线路id")
private Integer lineId;
@XText("日期")
private String dataDate;
private String keyName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOuId() {
return ouId;
}
public void setOuId(String ouId) {
this.ouId = ouId;
}
public Integer getLineId() {
return lineId;
}
public void setLineId(Integer lineId) {
this.lineId = lineId;
}
public String getDataDate() {
return dataDate;
}
public void setDataDate(String dataDate) {
this.dataDate = dataDate;
}
public String getKeyName() {
return keyName;
}
public void setKeyName(String keyName) {
this.keyName = keyName;
}
}
package pps.core.prediction.service.data.base_data;
import xstartup.annotation.XText;
import java.math.BigDecimal;
import java.util.Date;
public class GetBaseDataOutput {
private Integer id;
@XText("组织id")
private String ouId;
@XText("线路id")
private Integer lineId;
@XText("日期")
private Date dataDate;
@XText("风速")
private BigDecimal windSpeed;
@XText("风向")
private BigDecimal windDirection;
@XText("温度")
private BigDecimal temperature;
@XText("压强")
private BigDecimal pressure;
@XText("湿度")
private BigDecimal humidity;
@XText("组件平面辐照度")
private BigDecimal planeIrradiance;
@XText("全水平辐照度")
private BigDecimal horizontalIrradiance;
@XText("实际功率")
private BigDecimal power;
@XText("预测功率")
private BigDecimal predictedPower;
@XText("天气")
private BigDecimal weather;
public BigDecimal getWeather() {
return weather;
}
public void setWeather(BigDecimal weather) {
this.weather = weather;
}
public Integer getId() {
return this.id;
}
public void setId(Integer value) {
this.id = value;
}
public String getOuId() {
return this.ouId;
}
public void setOuId(String value) {
this.ouId = value;
}
public Integer getLineId() {
return this.lineId;
}
public void setLineId(Integer value) {
this.lineId = value;
}
public Date getDataDate() {
return this.dataDate;
}
public void setDataDate(Date value) {
this.dataDate = value;
}
public BigDecimal getWindSpeed() {
return this.windSpeed;
}
public void setWindSpeed(BigDecimal value) {
this.windSpeed = value;
}
public BigDecimal getWindDirection() {
return this.windDirection;
}
public void setWindDirection(BigDecimal value) {
this.windDirection = value;
}
public BigDecimal getTemperature() {
return this.temperature;
}
public void setTemperature(BigDecimal value) {
this.temperature = value;
}
public BigDecimal getPressure() {
return this.pressure;
}
public void setPressure(BigDecimal value) {
this.pressure = value;
}
public BigDecimal getHumidity() {
return this.humidity;
}
public void setHumidity(BigDecimal value) {
this.humidity = value;
}
public BigDecimal getPlaneIrradiance() {
return this.planeIrradiance;
}
public void setPlaneIrradiance(BigDecimal value) {
this.planeIrradiance = value;
}
public BigDecimal getHorizontalIrradiance() {
return this.horizontalIrradiance;
}
public void setHorizontalIrradiance(BigDecimal value) {
this.horizontalIrradiance = value;
}
public BigDecimal getPower() {
return this.power;
}
public void setPower(BigDecimal value) {
this.power = value;
}
public BigDecimal getPredictedPower() {
return this.predictedPower;
}
public void setPredictedPower(BigDecimal value) {
this.predictedPower = value;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.BaseDataViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.BaseDataView">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR" />
<result column="line_id" property="lineId" jdbcType="INTEGER" />
<result column="data_date" property="dataDate" jdbcType="DATE" />
<result column="wind_speed" property="windSpeed" jdbcType="DECIMAL" />
<result column="wind_direction" property="windDirection" jdbcType="DECIMAL" />
<result column="temperature" property="temperature" jdbcType="DECIMAL" />
<result column="pressure" property="pressure" jdbcType="DECIMAL" />
<result column="humidity" property="humidity" jdbcType="DECIMAL" />
<result column="plane_Irradiance" property="planeIrradiance" jdbcType="DECIMAL" />
<result column="horizontal_Irradiance" property="horizontalIrradiance" jdbcType="DECIMAL" />
<result column="power" property="power" jdbcType="DECIMAL" />
<result column="predicted_power" property="predictedPower" jdbcType="DECIMAL" />
</resultMap>
<sql id="Base_Column_List">
id,
ou_id,
line_id,
data_date,
wind_speed,
wind_direction,
temperature,
pressure,
humidity,
plane_Irradiance,
horizontal_Irradiance,
power,
predicted_power
</sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.BaseDataView" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from base_data
where
id=#{id}
</select>
<select id="selectList" parameterType="pps.core.prediction.entity.BaseDataView" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from base_data
where
id=#{id}
</select>
<insert id="batchInsert">
insert into base_data(
ou_id,
line_id,
data_date,
wind_speed,
wind_direction,
temperature,
pressure,
humidity,
plane_Irradiance,
horizontal_Irradiance,
power,
predicted_power,
weather
) VALUES
<foreach collection ="list" item="item" separator =",">
(
#{item.ouId},
#{item.lineId},
#{item.dataDate},
#{item.windSpeed},
#{item.windDirection},
#{item.temperature},
#{item.pressure},
#{item.humidity},
#{item.planeIrradiance},
#{item.horizontalIrradiance},
#{item.power},
#{item.predictedPower},
#{item.weather}
)
</foreach>
</insert>
</mapper>
......@@ -54,6 +54,16 @@
<artifactId>pps-core-task</artifactId>
<version>${pps.version}</version>
</dependency>
<dependency>
<groupId>gf</groupId>
<artifactId>pps-core-prediction</artifactId>
<version>${pps.version}</version>
</dependency>
<dependency>
<groupId>gf</groupId>
<artifactId>pps-cloud-prediction</artifactId>
<version>${pps.version}</version>
</dependency>
<dependency>
<groupId>gf</groupId>
<artifactId>pps-dependency-all</artifactId>
......
......@@ -14,5 +14,6 @@
<module>D01-dependency</module>
<module>C09-base</module>
<module>C11-space</module>
<module>C12-prediction</module>
</modules>
</project>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment