Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gf_back
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianchao
gf_back
Commits
c222a1ab
Commit
c222a1ab
authored
Sep 20, 2023
by
tianchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1增加30天预测数据定时任务
parent
d48500b6
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
345 additions
and
9 deletions
+345
-9
C09-base/pps-cloud-base/src/main/java/pps/cloud/base/service/BasePhotovoltaicPlantCloudService.java
...cloud/base/service/BasePhotovoltaicPlantCloudService.java
+3
-0
C09-base/pps-core-base/src/main/java/pps/core/base/service/BasePhotovoltaicPlantCloudServiceImpl.java
...e/base/service/BasePhotovoltaicPlantCloudServiceImpl.java
+16
-1
C10-task/pps-core-task/pom.xml
C10-task/pps-core-task/pom.xml
+12
-0
C10-task/pps-core-task/src/main/java/pps/core/task/job/PlantPredictedPowerLongTermDataJob.java
...pps/core/task/job/PlantPredictedPowerLongTermDataJob.java
+23
-0
C12-prediction/pps-cloud-prediction/src/main/java/pps/cloud/prediction/service/PlantPredictedPowerLongTermDataCloudService.java
.../service/PlantPredictedPowerLongTermDataCloudService.java
+13
-0
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/entity/PlantPowerDataEnt.java
...in/java/pps/core/prediction/entity/PlantPowerDataEnt.java
+60
-0
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/entity/PlantPredictedPowerLongTermDataEnt.java
...prediction/entity/PlantPredictedPowerLongTermDataEnt.java
+68
-0
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/mapper/PlantPowerDataMapper.java
...java/pps/core/prediction/mapper/PlantPowerDataMapper.java
+10
-0
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/mapper/PlantPredictedPowerLongTermDataMapper.java
...diction/mapper/PlantPredictedPowerLongTermDataMapper.java
+10
-0
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/PlantPredictedPowerDataService.java
...re/prediction/service/PlantPredictedPowerDataService.java
+18
-1
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/PlantPredictedPowerLongTermDataCloudServiceImpl.java
...vice/PlantPredictedPowerLongTermDataCloudServiceImpl.java
+102
-0
D03-deploy/deploy-pps-all/src/main/java/app/DeployPpsAllApplication.java
...oy-pps-all/src/main/java/app/DeployPpsAllApplication.java
+3
-4
D03-deploy/deploy-pps-all/src/main/resources/deploy-pps-all.app.properties
...-pps-all/src/main/resources/deploy-pps-all.app.properties
+2
-1
D03-deploy/deploy-pps-task/src/main/java/app/DeployPpsTaskApplication.java
...-pps-task/src/main/java/app/DeployPpsTaskApplication.java
+3
-1
D03-deploy/deploy-pps-task/src/main/resources/deploy-pps-task.app.properties
...ps-task/src/main/resources/deploy-pps-task.app.properties
+2
-1
No files found.
C09-base/pps-cloud-base/src/main/java/pps/cloud/base/service/BasePhotovoltaicPlantCloudService.java
View file @
c222a1ab
...
@@ -10,6 +10,9 @@ import xstartup.data.XListResult;
...
@@ -10,6 +10,9 @@ import xstartup.data.XListResult;
@XService
@XService
public
interface
BasePhotovoltaicPlantCloudService
{
public
interface
BasePhotovoltaicPlantCloudService
{
@XText
(
"获取电站"
)
XListResult
<
GetBasePhotovoltaicPlantCloudOutput
>
getBasePhotovoltaicPlantViewList
(
XContext
context
,
GetBasePhotovoltaicPlantCloudInput
input
);
@XText
(
"获取电站"
)
@XText
(
"获取电站"
)
XListResult
<
GetBasePhotovoltaicPlantCloudOutput
>
getBasePhotovoltaicPlantList
(
XContext
context
,
GetBasePhotovoltaicPlantCloudInput
input
);
XListResult
<
GetBasePhotovoltaicPlantCloudOutput
>
getBasePhotovoltaicPlantList
(
XContext
context
,
GetBasePhotovoltaicPlantCloudInput
input
);
}
}
C09-base/pps-core-base/src/main/java/pps/core/base/service/BasePhotovoltaicPlantCloudServiceImpl.java
View file @
c222a1ab
package
pps.core.base.service
;
package
pps.core.base.service
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
pps.cloud.base.service.BasePhotovoltaicPlantCloudService
;
import
pps.cloud.base.service.BasePhotovoltaicPlantCloudService
;
import
pps.cloud.base.service.data.base_photovoltaic_plant.GetBasePhotovoltaicPlantCloudInput
;
import
pps.cloud.base.service.data.base_photovoltaic_plant.GetBasePhotovoltaicPlantCloudInput
;
import
pps.cloud.base.service.data.base_photovoltaic_plant.GetBasePhotovoltaicPlantCloudOutput
;
import
pps.cloud.base.service.data.base_photovoltaic_plant.GetBasePhotovoltaicPlantCloudOutput
;
import
pps.core.base.constant.ScadaConstant
;
import
pps.core.base.constant.ScadaConstant
;
import
pps.core.base.entity.BasePhotovoltaicPlantEnt
;
import
pps.core.base.entity.BasePhotovoltaicPlantView
;
import
pps.core.base.entity.BasePhotovoltaicPlantView
;
import
pps.core.base.mapper.BasePhotovoltaicPlantMapper
;
import
pps.core.base.mapper.BasePhotovoltaicPlantViewMapper
;
import
pps.core.base.mapper.BasePhotovoltaicPlantViewMapper
;
import
pps.core.common.constant.BusinessConstant
;
import
xstartup.annotation.XService
;
import
xstartup.annotation.XService
;
import
xstartup.base.XContext
;
import
xstartup.base.XContext
;
import
xstartup.base.util.XCopyUtils
;
import
xstartup.data.XListResult
;
import
xstartup.data.XListResult
;
import
java.util.List
;
import
java.util.List
;
...
@@ -15,11 +20,21 @@ import java.util.List;
...
@@ -15,11 +20,21 @@ import java.util.List;
@XService
@XService
public
class
BasePhotovoltaicPlantCloudServiceImpl
implements
BasePhotovoltaicPlantCloudService
{
public
class
BasePhotovoltaicPlantCloudServiceImpl
implements
BasePhotovoltaicPlantCloudService
{
@Override
@Override
public
XListResult
<
GetBasePhotovoltaicPlantCloudOutput
>
getBasePhotovoltaicPlantList
(
XContext
context
,
GetBasePhotovoltaicPlantCloudInput
input
)
{
public
XListResult
<
GetBasePhotovoltaicPlantCloudOutput
>
getBasePhotovoltaicPlant
View
List
(
XContext
context
,
GetBasePhotovoltaicPlantCloudInput
input
)
{
BasePhotovoltaicPlantViewMapper
mapper
=
context
.
getBean
(
BasePhotovoltaicPlantViewMapper
.
class
);
BasePhotovoltaicPlantViewMapper
mapper
=
context
.
getBean
(
BasePhotovoltaicPlantViewMapper
.
class
);
BasePhotovoltaicPlantView
view
=
new
BasePhotovoltaicPlantView
();
BasePhotovoltaicPlantView
view
=
new
BasePhotovoltaicPlantView
();
view
.
setIsDeleted
(
ScadaConstant
.
IS_DELETE_FLASE
);
view
.
setIsDeleted
(
ScadaConstant
.
IS_DELETE_FLASE
);
List
<
BasePhotovoltaicPlantView
>
plantList
=
mapper
.
selectPlantDetailList
(
view
);
List
<
BasePhotovoltaicPlantView
>
plantList
=
mapper
.
selectPlantDetailList
(
view
);
return
null
;
return
null
;
}
}
@Override
public
XListResult
<
GetBasePhotovoltaicPlantCloudOutput
>
getBasePhotovoltaicPlantList
(
XContext
context
,
GetBasePhotovoltaicPlantCloudInput
input
)
{
BasePhotovoltaicPlantMapper
mapper
=
context
.
getBean
(
BasePhotovoltaicPlantMapper
.
class
);
QueryWrapper
<
BasePhotovoltaicPlantEnt
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
lambda
().
eq
(
BasePhotovoltaicPlantEnt:
:
getIsDeleted
,
BusinessConstant
.
ONE
);
List
<
BasePhotovoltaicPlantEnt
>
list
=
mapper
.
selectList
(
queryWrapper
);
List
<
GetBasePhotovoltaicPlantCloudOutput
>
outPuts
=
XCopyUtils
.
copyNewList
(
list
,
GetBasePhotovoltaicPlantCloudOutput
.
class
);
return
XListResult
.
success
(
outPuts
);
}
}
}
C10-task/pps-core-task/pom.xml
View file @
c222a1ab
...
@@ -51,6 +51,18 @@
...
@@ -51,6 +51,18 @@
<version>
1.0.0-pps
</version>
<version>
1.0.0-pps
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
gf
</groupId>
<artifactId>
pps-cloud-prediction
</artifactId>
<version>
1.0.0-pps
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
gf
</groupId>
<artifactId>
pps-cloud-prediction
</artifactId>
<version>
1.0.0-pps
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
C10-task/pps-core-task/src/main/java/pps/core/task/job/PlantPredictedPowerLongTermDataJob.java
0 → 100644
View file @
c222a1ab
package
pps.core.task.job
;
import
pps.cloud.base.service.BaseWatherCloudService
;
import
pps.cloud.prediction.service.PlantPredictedPowerLongTermDataCloudService
;
import
xstartup.annotation.XService
;
import
xstartup.annotation.XText
;
import
xstartup.base.XContext
;
import
xstartup.data.XServiceResult
;
import
xstartup.error.XError
;
import
xstartup.service.job.XJob
;
import
xstartup.service.job.annotation.XCronTrigger
;
@XText
(
"天气数据,每8小时执行一次"
)
@XService
public
class
PlantPredictedPowerLongTermDataJob
implements
XJob
{
@XCronTrigger
(
value
=
"0 45 1 * * ?"
)
@Override
public
XServiceResult
execute
(
XContext
context
)
{
PlantPredictedPowerLongTermDataCloudService
cloudService
=
context
.
getBean
(
PlantPredictedPowerLongTermDataCloudService
.
class
);
cloudService
.
runPlantPredictedPowerLongTermData
(
context
);
return
XServiceResult
.
error
(
context
,
XError
.
NotFound
);
}
}
C12-prediction/pps-cloud-prediction/src/main/java/pps/cloud/prediction/service/PlantPredictedPowerLongTermDataCloudService.java
0 → 100644
View file @
c222a1ab
package
pps.cloud.prediction.service
;
import
xstartup.annotation.XService
;
import
xstartup.annotation.XText
;
import
xstartup.base.XContext
;
import
xstartup.data.XServiceResult
;
@XService
@XText
(
"光伏预测长期"
)
public
interface
PlantPredictedPowerLongTermDataCloudService
{
@XText
(
"定时运行预测长期数据"
)
XServiceResult
runPlantPredictedPowerLongTermData
(
XContext
context
);
}
\ No newline at end of file
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/entity/PlantPowerDataEnt.java
0 → 100644
View file @
c222a1ab
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
lombok.Data
;
import
xstartup.annotation.XText
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
@TableName
(
"plant_power_data"
)
public
class
PlantPowerDataEnt
implements
Serializable
{
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@XText
(
"线路id"
)
@TableField
private
String
plantId
;
@XText
(
"日期"
)
@TableField
private
String
dataDate
;
@XText
(
"温度"
)
@TableField
private
BigDecimal
temperature
;
@XText
(
"湿度"
)
@TableField
private
BigDecimal
humidity
;
@XText
(
"风速"
)
@TableField
private
BigDecimal
windSpeed
;
@XText
(
"风向"
)
@TableField
private
BigDecimal
windDirection
;
@XText
(
"压强"
)
@TableField
private
BigDecimal
pressure
;
@XText
(
"组件平面辐照度"
)
@TableField
private
BigDecimal
planeIrradiance
;
@XText
(
"全水平辐照度"
)
@TableField
private
BigDecimal
horizontalIrradiance
;
@XText
(
"实际功率"
)
@TableField
private
BigDecimal
power
;
}
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/entity/PlantPredictedPowerLongTermDataEnt.java
0 → 100644
View file @
c222a1ab
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
lombok.Data
;
import
xstartup.annotation.XText
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Data
@TableName
(
"plant_predicted_power_long_term_data"
)
public
class
PlantPredictedPowerLongTermDataEnt
implements
Serializable
{
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
@XText
(
"线路id"
)
@TableField
private
String
plantId
;
@XText
(
"日期"
)
@TableField
private
String
dataDate
;
@XText
(
"温度"
)
@TableField
private
BigDecimal
temperature
;
@XText
(
"湿度"
)
@TableField
private
BigDecimal
humidity
;
@XText
(
"风速"
)
@TableField
private
BigDecimal
windSpeed
;
@XText
(
"风向"
)
@TableField
private
BigDecimal
windDirection
;
@XText
(
"压强"
)
@TableField
private
BigDecimal
pressure
;
@XText
(
"组件平面辐照度"
)
@TableField
private
BigDecimal
planeIrradiance
;
@XText
(
"全水平辐照度"
)
@TableField
private
BigDecimal
horizontalIrradiance
;
@XText
(
"预测功率"
)
@TableField
private
BigDecimal
power
;
@XText
(
"预测功率"
)
@TableField
(
exist
=
false
)
private
BigDecimal
predictedPower
;
@XText
(
"创建时间"
)
@TableField
private
Date
createTime
;
}
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/mapper/PlantPowerDataMapper.java
0 → 100644
View file @
c222a1ab
package
pps.core.prediction.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
pps.core.prediction.entity.PlantPowerDataEnt
;
@Repository
(
value
=
"pps.core.prediction.mapper.PlantPowerDataMapper"
)
public
interface
PlantPowerDataMapper
extends
BaseMapper
<
PlantPowerDataEnt
>
{
}
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/mapper/PlantPredictedPowerLongTermDataMapper.java
0 → 100644
View file @
c222a1ab
package
pps.core.prediction.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
pps.core.prediction.entity.PlantPredictedPowerLongTermDataEnt
;
@Repository
(
value
=
"pps.core.prediction.mapper.PlantPredictedPowerLongTermDataMapper"
)
public
interface
PlantPredictedPowerLongTermDataMapper
extends
BaseMapper
<
PlantPredictedPowerLongTermDataEnt
>
{
}
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/PlantPredictedPowerDataService.java
View file @
c222a1ab
...
@@ -2,7 +2,9 @@ package pps.core.prediction.service;
...
@@ -2,7 +2,9 @@ package pps.core.prediction.service;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
pps.core.prediction.entity.PlantPredictedPowerDataEnt
;
import
pps.core.prediction.entity.PlantPredictedPowerDataEnt
;
import
pps.core.prediction.entity.PlantPredictedPowerLongTermDataEnt
;
import
pps.core.prediction.mapper.PlantPredictedPowerDataMapper
;
import
pps.core.prediction.mapper.PlantPredictedPowerDataMapper
;
import
pps.core.prediction.mapper.PlantPredictedPowerLongTermDataMapper
;
import
pps.core.prediction.service.data.plant_predicted_power_data.GetPlantPredictedPowerDataInput
;
import
pps.core.prediction.service.data.plant_predicted_power_data.GetPlantPredictedPowerDataInput
;
import
pps.core.prediction.service.data.plant_predicted_power_data.GetPlantPredictedPowerDataOutput
;
import
pps.core.prediction.service.data.plant_predicted_power_data.GetPlantPredictedPowerDataOutput
;
import
xstartup.annotation.XService
;
import
xstartup.annotation.XService
;
...
@@ -72,7 +74,7 @@ public class PlantPredictedPowerDataService {
...
@@ -72,7 +74,7 @@ public class PlantPredictedPowerDataService {
@XApiGet
@XApiGet
@XText
(
"根据电站预测30天的预测数据"
)
@XText
(
"根据电站预测30天的预测数据"
)
public
XListResult
<
GetPlantPredictedPowerDataOutput
>
getThirtyPlantPredictedPowerData
(
XContext
context
,
GetPlantPredictedPowerDataInput
input
){
public
XListResult
<
GetPlantPredictedPowerDataOutput
>
getThirtyPlantPredictedPowerData
_delete
(
XContext
context
,
GetPlantPredictedPowerDataInput
input
){
//今年(7天总值)/去年(7天的总值) 同比值
//今年(7天总值)/去年(7天的总值) 同比值
PlantPredictedPowerDataMapper
mapper
=
context
.
getBean
(
PlantPredictedPowerDataMapper
.
class
);
PlantPredictedPowerDataMapper
mapper
=
context
.
getBean
(
PlantPredictedPowerDataMapper
.
class
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
...
@@ -106,4 +108,19 @@ public class PlantPredictedPowerDataService {
...
@@ -106,4 +108,19 @@ public class PlantPredictedPowerDataService {
return
XListResult
.
success
(
outputs
);
return
XListResult
.
success
(
outputs
);
}
}
@XApiGet
@XText
(
"根据电站预测30天的预测数据"
)
public
XListResult
<
GetPlantPredictedPowerDataOutput
>
getThirtyPlantPredictedPowerData
(
XContext
context
,
GetPlantPredictedPowerDataInput
input
){
PlantPredictedPowerLongTermDataMapper
mapper
=
context
.
getBean
(
PlantPredictedPowerLongTermDataMapper
.
class
);
Date
date
=
new
Date
();
QueryWrapper
<
PlantPredictedPowerLongTermDataEnt
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"id, plant_id, data_date, temperature, humidity, wind_speed, wind_direction, pressure, plane_irradiance, horizontal_irradiance, power as predicted_power, create_time"
);
queryWrapper
.
lambda
().
eq
(
PlantPredictedPowerLongTermDataEnt:
:
getPlantId
,
input
.
getPlantId
());
queryWrapper
.
lambda
().
ge
(
PlantPredictedPowerLongTermDataEnt:
:
getDataDate
,
date
);
queryWrapper
.
lambda
().
le
(
PlantPredictedPowerLongTermDataEnt:
:
getDataDate
,
XDateUtils
.
addMonth
(
date
,
1
));
List
<
PlantPredictedPowerLongTermDataEnt
>
list
=
mapper
.
selectList
(
queryWrapper
);
List
<
GetPlantPredictedPowerDataOutput
>
outputs
=
XCopyUtils
.
copyNewList
(
list
,
GetPlantPredictedPowerDataOutput
.
class
);
return
XListResult
.
success
(
outputs
);
}
}
}
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/PlantPredictedPowerLongTermDataCloudServiceImpl.java
0 → 100644
View file @
c222a1ab
package
pps.core.prediction.service
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.apache.commons.lang3.StringUtils
;
import
pps.cloud.base.service.BasePhotovoltaicPlantCloudService
;
import
pps.cloud.base.service.data.base_photovoltaic_plant.GetBasePhotovoltaicPlantCloudInput
;
import
pps.cloud.base.service.data.base_photovoltaic_plant.GetBasePhotovoltaicPlantCloudOutput
;
import
pps.cloud.prediction.service.IPlantPredictedPowerCloudService
;
import
pps.cloud.prediction.service.PlantPredictedPowerLongTermDataCloudService
;
import
pps.cloud.prediction.service.data.plant_predicted_power_data.DynamicQueryPlantPredictedPowerInput
;
import
pps.cloud.prediction.service.data.plant_predicted_power_data.DynamicQueryPlantPredictedPowerOutput
;
import
pps.core.prediction.entity.PlantPowerDataEnt
;
import
pps.core.prediction.entity.PlantPredictedPowerDataEnt
;
import
pps.core.prediction.entity.PlantPredictedPowerLongTermDataEnt
;
import
pps.core.prediction.mapper.PlantPowerDataMapper
;
import
pps.core.prediction.mapper.PlantPredictedPowerDataMapper
;
import
pps.core.prediction.mapper.PlantPredictedPowerLongTermDataMapper
;
import
pps.core.prediction.service.data.plant_predicted_power_data.GetPlantPredictedPowerDataOutput
;
import
xstartup.annotation.XService
;
import
xstartup.annotation.XText
;
import
xstartup.base.XContext
;
import
xstartup.base.util.XCopyUtils
;
import
xstartup.base.util.XDateUtils
;
import
xstartup.data.XListResult
;
import
xstartup.data.XServiceResult
;
import
xstartup.feature.api.annotation.XApiAnonymous
;
import
xstartup.feature.api.annotation.XApiGet
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* 光伏预测Cloud模块
*
* @author ZWT
* @date 2023/09/13 19:05
*/
@XService
public
class
PlantPredictedPowerLongTermDataCloudServiceImpl
implements
PlantPredictedPowerLongTermDataCloudService
{
@XText
(
"定时运行预测长期数据"
)
@Override
@XApiGet
@XApiAnonymous
public
XServiceResult
runPlantPredictedPowerLongTermData
(
XContext
context
)
{
//获取所有的电站
BasePhotovoltaicPlantCloudService
cloudService
=
context
.
getBean
(
BasePhotovoltaicPlantCloudService
.
class
);
XListResult
<
GetBasePhotovoltaicPlantCloudOutput
>
result
=
cloudService
.
getBasePhotovoltaicPlantList
(
context
,
new
GetBasePhotovoltaicPlantCloudInput
());
if
(!
result
.
isSuccess
())
return
XServiceResult
.
error
(
500
,
"未查询到电站数据"
);
List
<
GetBasePhotovoltaicPlantCloudOutput
>
list
=
result
.
getResult
();
PlantPowerDataMapper
powerDataMapper
=
context
.
getBean
(
PlantPowerDataMapper
.
class
);
Date
currentDate
=
new
Date
();
for
(
GetBasePhotovoltaicPlantCloudOutput
output
:
list
){
//获取最近七天的实际数据
QueryWrapper
<
PlantPowerDataEnt
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
" IFNULL(avg(power ) , 0 ) power "
);
queryWrapper
.
lambda
().
eq
(
PlantPowerDataEnt:
:
getPlantId
,
output
.
getId
());
queryWrapper
.
lambda
().
ge
(
PlantPowerDataEnt:
:
getDataDate
,
XDateUtils
.
addDays
(
currentDate
,
-
7
));
PlantPowerDataEnt
currentEnt
=
powerDataMapper
.
selectOne
(
queryWrapper
);
//获取同期七天的实际数据
queryWrapper
.
clear
();
queryWrapper
.
select
(
" IFNULL(avg(power ) , 0 ) power "
);
queryWrapper
.
lambda
().
eq
(
PlantPowerDataEnt:
:
getPlantId
,
output
.
getId
());
queryWrapper
.
lambda
().
ge
(
PlantPowerDataEnt:
:
getDataDate
,
XDateUtils
.
addYear
(
currentDate
,
-
1
));
PlantPowerDataEnt
lastEnt
=
powerDataMapper
.
selectOne
(
queryWrapper
);
//获取同比 = 当前/同期
BigDecimal
compare
=
new
BigDecimal
(
1
);
if
(
lastEnt
.
getPower
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
compare
=
currentEnt
.
getPower
().
divide
(
lastEnt
.
getPower
()
,
6
,
BigDecimal
.
ROUND_HALF_UP
);
//获取同期30天数据
queryWrapper
.
clear
();
queryWrapper
.
select
(
" plant_id, data_date, temperature, humidity, wind_speed, wind_direction, pressure, plane_irradiance, horizontal_irradiance, power "
);
queryWrapper
.
lambda
().
eq
(
PlantPowerDataEnt:
:
getPlantId
,
output
.
getId
());
queryWrapper
.
lambda
().
ge
(
PlantPowerDataEnt:
:
getDataDate
,
XDateUtils
.
addYear
(
currentDate
,
-
1
));
queryWrapper
.
lambda
().
le
(
PlantPowerDataEnt:
:
getDataDate
,
XDateUtils
.
addMonth
(
currentDate
,
-
11
));
List
<
PlantPowerDataEnt
>
lastList
=
powerDataMapper
.
selectList
(
queryWrapper
);
//未来30天=同期30*同比
List
<
PlantPredictedPowerLongTermDataEnt
>
insertList
=
new
ArrayList
<>();
for
(
PlantPowerDataEnt
item
:
lastList
){
item
.
setPower
(
item
.
getPower
().
multiply
(
compare
));
item
.
setDataDate
(
XDateUtils
.
getString
(
XDateUtils
.
addYear
(
XDateUtils
.
parse
(
item
.
getDataDate
())
,
1
)));
PlantPredictedPowerLongTermDataEnt
insertData
=
XCopyUtils
.
copyNewObject
(
item
,
PlantPredictedPowerLongTermDataEnt
.
class
);
insertData
.
setCreateTime
(
currentDate
);
insertList
.
add
(
insertData
);
}
//插入数据前,先删除数据
PlantPredictedPowerLongTermDataMapper
longTermDataMapper
=
context
.
getBean
(
PlantPredictedPowerLongTermDataMapper
.
class
);
QueryWrapper
<
PlantPredictedPowerLongTermDataEnt
>
longTermDataWrapper
=
new
QueryWrapper
<>();
longTermDataWrapper
.
lambda
().
eq
(
PlantPredictedPowerLongTermDataEnt:
:
getPlantId
,
output
.
getId
());
longTermDataWrapper
.
lambda
().
ge
(
PlantPredictedPowerLongTermDataEnt:
:
getDataDate
,
currentDate
);
longTermDataWrapper
.
lambda
().
le
(
PlantPredictedPowerLongTermDataEnt:
:
getDataDate
,
XDateUtils
.
addMonth
(
currentDate
,
1
));
longTermDataMapper
.
delete
(
longTermDataWrapper
);
insertList
.
forEach
(
item
->{
longTermDataMapper
.
insert
(
item
);
});
}
return
XServiceResult
.
OK
;
}
}
D03-deploy/deploy-pps-all/src/main/java/app/DeployPpsAllApplication.java
View file @
c222a1ab
package
app
;
package
app
;
import
pps.core.task.job.SpaceOptimizeLongJob
;
import
pps.core.task.job.*
;
import
pps.core.task.job.SpaceOptimizeMidJob
;
import
pps.core.task.job.TestJob
;
import
pps.core.task.job.WeatherJob
;
import
xstartup.base.XStartup
;
import
xstartup.base.XStartup
;
import
xstartup.base.conf.XServerConf
;
import
xstartup.base.conf.XServerConf
;
import
xstartup.base.conf.XServiceConf
;
import
xstartup.base.conf.XServiceConf
;
...
@@ -36,6 +33,8 @@ public class DeployPpsAllApplication {
...
@@ -36,6 +33,8 @@ public class DeployPpsAllApplication {
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
WeatherJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
WeatherJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
SpaceOptimizeLongJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
SpaceOptimizeLongJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
SpaceOptimizeMidJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
SpaceOptimizeMidJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
PlantPredictedPowerLongTermDataJob
.
class
));
//startup.enable(XCloudHuaweiCseFeature.class);
//startup.enable(XCloudHuaweiCseFeature.class);
startup
.
run
(
args
);
startup
.
run
(
args
);
}
}
...
...
D03-deploy/deploy-pps-all/src/main/resources/deploy-pps-all.app.properties
View file @
c222a1ab
...
@@ -56,7 +56,8 @@ x.server.host=127.0.0.1
...
@@ -56,7 +56,8 @@ x.server.host=127.0.0.1
x.job.service
=
pps.core.task.job.TestJob,
\
x.job.service
=
pps.core.task.job.TestJob,
\
pps.core.task.job.SpaceOptimizeLongJob,
\
pps.core.task.job.SpaceOptimizeLongJob,
\
pps.core.task.job.SpaceOptimizeMidJob,
\
pps.core.task.job.SpaceOptimizeMidJob,
\
pps.core.task.job.WeatherJob
pps.core.task.job.WeatherJob,
\
pps.core.task.job.PlantPredictedPowerLongTermDataJob
# redis
# redis
x.cache.type
=
@x.cache.type@
x.cache.type
=
@x.cache.type@
...
...
D03-deploy/deploy-pps-task/src/main/java/app/DeployPpsTaskApplication.java
View file @
c222a1ab
...
@@ -33,13 +33,15 @@ public class DeployPpsTaskApplication {
...
@@ -33,13 +33,15 @@ public class DeployPpsTaskApplication {
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
WeatherJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
WeatherJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
SpaceOptimizeLongJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
SpaceOptimizeLongJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
SpaceOptimizeMidJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
SpaceOptimizeMidJob
.
class
));
startup
.
enable
(
XJobFeature
.
class
).
config
(
new
XJobServiceConf
(
PlantPredictedPowerLongTermDataJob
.
class
));
startup
.
enable
(
XRpcFeature
.
class
);
startup
.
enable
(
XRpcFeature
.
class
);
startup
.
enable
(
XCloudHuaweiCseFeature
.
class
)
startup
.
enable
(
XCloudHuaweiCseFeature
.
class
)
.
config
(
XCloudBundlesConf
.
with
(
.
config
(
XCloudBundlesConf
.
with
(
// XCloudBundle.naming("pps-workflow").addModule("pps", "cloud", "task"),
// XCloudBundle.naming("pps-workflow").addModule("pps", "cloud", "task"),
XCloudBundle
.
naming
(
"pps-base-info"
).
addModule
(
"pps"
,
"cloud"
,
"system"
),
XCloudBundle
.
naming
(
"pps-base-info"
).
addModule
(
"pps"
,
"cloud"
,
"system"
),
XCloudBundle
.
naming
(
"pps-base-info"
).
addModule
(
"pps"
,
"cloud"
,
"base"
)));
XCloudBundle
.
naming
(
"pps-base-info"
).
addModule
(
"pps"
,
"cloud"
,
"system"
),
XCloudBundle
.
naming
(
"pps-base-prediction"
).
addModule
(
"pps"
,
"cloud"
,
"prediction"
)));
startup
.
run
(
args
);
startup
.
run
(
args
);
}
}
...
...
D03-deploy/deploy-pps-task/src/main/resources/deploy-pps-task.app.properties
View file @
c222a1ab
...
@@ -10,7 +10,8 @@ pps.core.common.mq-config.ackImsMq=@pps.core.common.mq-config.ackImsMq@
...
@@ -10,7 +10,8 @@ pps.core.common.mq-config.ackImsMq=@pps.core.common.mq-config.ackImsMq@
x.job.service
=
pps.core.task.job.TestJob,
\
x.job.service
=
pps.core.task.job.TestJob,
\
pps.core.task.job.SpaceOptimizeLongJob,
\
pps.core.task.job.SpaceOptimizeLongJob,
\
pps.core.task.job.SpaceOptimizeMidJob,
\
pps.core.task.job.SpaceOptimizeMidJob,
\
pps.core.task.job.WeatherJob
pps.core.task.job.WeatherJob,
\
pps.core.task.job.PlantPredictedPowerLongTermDataJob
#\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
#\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
x.log.level
=
@x.log.level@
x.log.level
=
@x.log.level@
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment