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
3ad9b36a
Commit
3ad9b36a
authored
Oct 23, 2023
by
tianchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1光伏预测调整,预测算法页面
parent
c8807de3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
+48
-2
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/PlantPredictedPowerLongTermDataCloudServiceImpl.java
...vice/PlantPredictedPowerLongTermDataCloudServiceImpl.java
+48
-2
No files found.
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/PlantPredictedPowerLongTermDataCloudServiceImpl.java
View file @
3ad9b36a
...
@@ -30,6 +30,7 @@ import xstartup.feature.api.annotation.XApiGet;
...
@@ -30,6 +30,7 @@ import xstartup.feature.api.annotation.XApiGet;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -96,20 +97,65 @@ public class PlantPredictedPowerLongTermDataCloudServiceImpl implements PlantPre
...
@@ -96,20 +97,65 @@ public class PlantPredictedPowerLongTermDataCloudServiceImpl implements PlantPre
longTermDataMapper
.
delete
(
longTermDataWrapper
);
longTermDataMapper
.
delete
(
longTermDataWrapper
);
PlantPredictedPowerLongTermDataViewMapper
longTermDataViewMapper
=
context
.
getBean
(
PlantPredictedPowerLongTermDataViewMapper
.
class
);
PlantPredictedPowerLongTermDataViewMapper
longTermDataViewMapper
=
context
.
getBean
(
PlantPredictedPowerLongTermDataViewMapper
.
class
);
List
<
PlantPredictedPowerLongTermDataEnt
>
batchList
=
new
ArrayList
<>();
List
<
PlantPredictedPowerLongTermDataEnt
>
batchList
=
new
ArrayList
<>();
for
(
PlantPredictedPowerLongTermDataEnt
item
:
insertList
){
List
<
String
>
timeList
=
Arrays
.
asList
(
"15"
,
"30"
,
"45"
);
for
(
int
i
=
0
;
i
<
insertList
.
size
();
i
++){
PlantPredictedPowerLongTermDataEnt
item
=
insertList
.
get
(
i
);
Date
date
=
XDateUtils
.
parse
(
item
.
getDataDate
());
Date
date
=
XDateUtils
.
parse
(
item
.
getDataDate
());
item
.
setYearTime
(
XDateUtils
.
getYear
(
date
)+
""
);
item
.
setYearTime
(
XDateUtils
.
getYear
(
date
)+
""
);
item
.
setMonthTime
(
String
.
format
(
"%02d"
,
XDateUtils
.
getMonth
(
date
)));
item
.
setMonthTime
(
String
.
format
(
"%02d"
,
XDateUtils
.
getMonth
(
date
)));
item
.
setDayTime
(
String
.
format
(
"%02d"
,
XDateUtils
.
getDay
(
date
)));
item
.
setDayTime
(
String
.
format
(
"%02d"
,
XDateUtils
.
getDay
(
date
)));
item
.
setHourTime
(
String
.
format
(
"%02d"
,
XDateUtils
.
getHour24
(
date
)));
item
.
setHourTime
(
String
.
format
(
"%02d"
,
XDateUtils
.
getHour24
(
date
)));
item
.
setMinTime
(
String
.
format
(
"%02d"
,
XDateUtils
.
getMinute
(
date
))
+
":00"
);
item
.
setMinTime
(
String
.
format
(
"%02d"
,
XDateUtils
.
getMinute
(
date
))
+
":00"
);
//longTermDataMapper.insert(item);
batchList
.
add
(
item
);
batchList
.
add
(
item
);
if
(
i
<
insertList
.
size
()
-
1
){
for
(
int
y
=
0
;
y
<
timeList
.
size
()
;
y
++)
{
PlantPredictedPowerLongTermDataEnt
dao
=
XCopyUtils
.
copyNewObject
(
item
);
dao
.
setMinTime
(
timeList
.
get
(
y
)
+
":00"
);
dao
.
setDataDate
(
dao
.
getYearTime
()
+
"-"
+
dao
.
getMonthTime
()
+
"-"
+
dao
.
getDayTime
()
+
" "
+
dao
.
getHourTime
()
+
":"
+
dao
.
getMinTime
());
int
I_i
=
i
+
1
;
BigDecimal
temperature_1
=
insertList
.
get
(
i
).
getTemperature
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
i
).
getTemperature
();
BigDecimal
temperature_2
=
insertList
.
get
(
I_i
).
getTemperature
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
I_i
).
getTemperature
();
dao
.
setTemperature
(
temperature_1
.
add
(
temperature_2
.
subtract
(
temperature_1
).
multiply
(
new
BigDecimal
(
0.3
*(
y
+
1
)))));
BigDecimal
humidity_1
=
insertList
.
get
(
i
).
getHumidity
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
i
).
getHumidity
();
BigDecimal
humidity_2
=
insertList
.
get
(
I_i
).
getHumidity
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
I_i
).
getHumidity
();
dao
.
setHumidity
(
humidity_1
.
add
(
humidity_2
.
subtract
(
humidity_1
).
multiply
(
new
BigDecimal
(
0.3
*(
y
+
1
)))));
BigDecimal
windSpeed_1
=
insertList
.
get
(
i
).
getWindSpeed
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
i
).
getWindSpeed
();
BigDecimal
windSpeed_2
=
insertList
.
get
(
I_i
).
getWindSpeed
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
I_i
).
getWindSpeed
();
dao
.
setWindSpeed
(
windSpeed_1
.
add
(
windSpeed_2
.
subtract
(
windSpeed_1
).
multiply
(
new
BigDecimal
(
0.3
*(
y
+
1
)))));
BigDecimal
pressure_1
=
insertList
.
get
(
i
).
getPressure
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
i
).
getPressure
();
BigDecimal
pressure_2
=
insertList
.
get
(
I_i
).
getPressure
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
I_i
).
getPressure
();
dao
.
setPressure
(
pressure_1
.
add
(
pressure_2
.
subtract
(
pressure_1
).
multiply
(
new
BigDecimal
(
0.3
*(
y
+
1
)))));
BigDecimal
planeIrradiance_1
=
insertList
.
get
(
i
).
getPlaneIrradiance
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
i
).
getPlaneIrradiance
();
BigDecimal
planeIrradiance_2
=
insertList
.
get
(
I_i
).
getPlaneIrradiance
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
I_i
).
getPlaneIrradiance
();
dao
.
setPlaneIrradiance
(
planeIrradiance_1
.
add
(
planeIrradiance_2
.
subtract
(
planeIrradiance_1
).
multiply
(
new
BigDecimal
(
0.3
*(
y
+
1
)))));
BigDecimal
horizontalIrradiance_1
=
insertList
.
get
(
i
).
getHorizontalIrradiance
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
i
).
getHorizontalIrradiance
();
BigDecimal
horizontalIrradiance_2
=
insertList
.
get
(
I_i
).
getHorizontalIrradiance
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
I_i
).
getHorizontalIrradiance
();
dao
.
setHorizontalIrradiance
(
horizontalIrradiance_1
.
add
(
horizontalIrradiance_2
.
subtract
(
horizontalIrradiance_1
).
multiply
(
new
BigDecimal
(
0.3
*(
y
+
1
)))));
BigDecimal
power_1
=
insertList
.
get
(
i
).
getPower
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
i
).
getPower
();
BigDecimal
power_2
=
insertList
.
get
(
I_i
).
getPower
()
==
null
?
new
BigDecimal
(
0
)
:
insertList
.
get
(
I_i
).
getPower
();
dao
.
setPower
(
power_1
.
add
(
power_2
.
subtract
(
power_1
).
multiply
(
new
BigDecimal
(
0.3
*(
y
+
1
)))));
batchList
.
add
(
dao
);
}
}
if
(
batchList
.
size
()
>
500
){
if
(
batchList
.
size
()
>
500
){
longTermDataViewMapper
.
insertBatch
(
batchList
);
longTermDataViewMapper
.
insertBatch
(
batchList
);
batchList
=
new
ArrayList
<>();
batchList
=
new
ArrayList
<>();
}
}
}
}
// for(PlantPredictedPowerLongTermDataEnt item : insertList){
// Date date = XDateUtils.parse(item.getDataDate());
// item.setYearTime(XDateUtils.getYear(date)+"");
// item.setMonthTime(String.format("%02d", XDateUtils.getMonth(date)));
// item.setDayTime(String.format("%02d", XDateUtils.getDay(date)));
// item.setHourTime(String.format("%02d", XDateUtils.getHour24(date)));
// item.setMinTime(String.format("%02d", XDateUtils.getMinute(date)) + ":00");
// //longTermDataMapper.insert(item);
// batchList.add(item);
// if(batchList.size() > 500){
// longTermDataViewMapper.insertBatch(batchList);
// batchList = new ArrayList<>();
// }
// }
if
(
batchList
.
size
()
>
0
)
if
(
batchList
.
size
()
>
0
)
longTermDataViewMapper
.
insertBatch
(
batchList
);
longTermDataViewMapper
.
insertBatch
(
batchList
);
}
}
...
...
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