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
abe94082
Commit
abe94082
authored
Dec 17, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得到的
parent
433a818a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
69 deletions
+16
-69
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/ThirdDataAccessCloudServiceImpl.java
...e/prediction/service/ThirdDataAccessCloudServiceImpl.java
+16
-69
No files found.
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/ThirdDataAccessCloudServiceImpl.java
View file @
abe94082
...
...
@@ -108,12 +108,8 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
LambdaQueryWrapper
<
ThirdActivePowerEnt
>
queryWrapper
=
new
LambdaQueryWrapper
<
ThirdActivePowerEnt
>()
.
select
(
ThirdActivePowerEnt:
:
getId
);
for
(
GetThirdActivePowerViewOutput
o
:
outputs
)
{
BigDecimal
photovoltaicPower
=
Optional
.
ofNullable
(
o
.
getPhotovoltaicPower
())
.
orElse
(
BigDecimal
.
ZERO
)
.
abs
();
BigDecimal
meterPower
=
Optional
.
ofNullable
(
o
.
getMeterPower
())
.
orElse
(
BigDecimal
.
ZERO
)
.
abs
();
BigDecimal
photovoltaicPower
=
ObjectUtil
.
defaultIfNull
(
o
.
getPhotovoltaicPower
(),
BigDecimal
.
ZERO
).
abs
();
BigDecimal
meterPower
=
ObjectUtil
.
defaultIfNull
(
o
.
getMeterPower
(),
BigDecimal
.
ZERO
).
abs
();
dtoList
.
add
(
ThirdActivePowerView
.
builder
()
.
id
(
BaseUtils
.
randomUUIDString
())
...
...
@@ -215,51 +211,6 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
});
}
/**
* 第三方光伏日发电量定时任务
*
* @param context 上下文
* @return {@link XServiceResult}
*/
public
XServiceResult
test2
(
XContext
context
)
{
IThirdPhotovoltaicPowerCloudService
service
=
context
.
getBean
(
IThirdPhotovoltaicPowerCloudService
.
class
);
XListResult
<
GetThirdPhotovoltaicPowerOutput
>
result
=
service
.
getPhotovoltaicPowerList
(
context
,
GetThirdPhotovoltaicPowerInput
.
builder
()
.
createDate
(
DateUtil
.
beginOfDay
(
DateUtil
.
yesterday
()))
.
build
());
result
.
throwIfFail
();
List
<
GetThirdPhotovoltaicPowerViewOutput
>
outputs
=
XCopyUtils
.
copyNewList
(
result
.
getResult
(),
GetThirdPhotovoltaicPowerViewOutput
.
class
);
if
(
CollUtil
.
isEmpty
(
outputs
))
{
return
XServiceResult
.
OK
;
}
BigDecimal
photovoltaicPower
;
List
<
ThirdPhotovoltaicPowerView
>
dtoList
=
new
ArrayList
<>(
outputs
.
size
());
for
(
GetThirdPhotovoltaicPowerViewOutput
output
:
outputs
)
{
photovoltaicPower
=
Optional
.
ofNullable
(
output
.
getPhotovoltaicPower
()).
orElse
(
BigDecimal
.
ZERO
);
photovoltaicPower
=
photovoltaicPower
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
?
BigDecimal
.
ZERO
:
photovoltaicPower
;
dtoList
.
add
(
ThirdPhotovoltaicPowerView
.
builder
()
.
id
(
BaseUtils
.
randomUUIDString
())
.
stationName
(
output
.
getStationName
())
.
createDate
(
output
.
getCreateDate
())
.
photovoltaicPower
(
photovoltaicPower
)
.
systemSource
(
"SY"
)
.
build
()
);
}
return
XTransactionHelper
.
begin
(
context
,
()
->
{
ThirdPhotovoltaicPowerViewMapper
mapper
=
context
.
getBean
(
ThirdPhotovoltaicPowerViewMapper
.
class
);
if
(
CollUtil
.
isNotEmpty
(
dtoList
))
{
if
(
dtoList
.
size
()
>
BaseUtils
.
BATCH_SIZE
)
{
List
<
List
<
ThirdPhotovoltaicPowerView
>>
subList
=
BaseUtils
.
getSubList
(
dtoList
);
subList
.
forEach
(
mapper:
:
batchInsertList
);
}
else
{
mapper
.
batchInsertList
(
dtoList
);
}
}
return
XServiceResult
.
OK
;
});
}
/**
* 第三方光伏日发电量定时任务
*
...
...
@@ -298,7 +249,7 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
BigDecimal
photovoltaicPower
;
List
<
ThirdPhotovoltaicPowerView
>
dtoList
=
new
ArrayList
<>(
outputs
.
size
());
for
(
GetThirdPhotovoltaicPowerViewOutput
output
:
outputs
)
{
photovoltaicPower
=
O
ptional
.
ofNullable
(
output
.
getPhotovoltaicPower
()).
orElse
(
BigDecimal
.
ZERO
);
photovoltaicPower
=
O
bjectUtil
.
defaultIfNull
(
output
.
getPhotovoltaicPower
(),
BigDecimal
.
ZERO
);
photovoltaicPower
=
photovoltaicPower
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
?
BigDecimal
.
ZERO
:
photovoltaicPower
;
dtoList
.
add
(
ThirdPhotovoltaicPowerView
.
builder
()
...
...
@@ -425,11 +376,11 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
List
<
String
>
stationNameList
=
new
ArrayList
<>(
outputs
.
size
());
for
(
GetCumulativePowerGenerationOutput
o
:
outputs
)
{
//数据处理
photovoltaicPower
=
O
ptional
.
ofNullable
(
o
.
getPhotovoltaicPower
()).
orElse
(
BigDecimal
.
ZERO
);
dailyElectricityConsumption
=
O
ptional
.
ofNullable
(
o
.
getDailyElectricityConsumption
()).
orElse
(
BigDecimal
.
ZERO
);
dailyLiquidProduction
=
O
ptional
.
ofNullable
(
o
.
getDailyLiquidProduction
()).
orElse
(
BigDecimal
.
ZERO
);
inPlaceConsumption
=
O
ptional
.
ofNullable
(
o
.
getInPlaceConsumption
()).
orElse
(
BigDecimal
.
ZERO
);
energyStorageDischarge
=
O
ptional
.
ofNullable
(
o
.
getEnergyStorageDischarge
()).
orElse
(
BigDecimal
.
ZERO
);
photovoltaicPower
=
O
bjectUtil
.
defaultIfNull
(
o
.
getPhotovoltaicPower
(),
BigDecimal
.
ZERO
);
dailyElectricityConsumption
=
O
bjectUtil
.
defaultIfNull
(
o
.
getDailyElectricityConsumption
(),
BigDecimal
.
ZERO
);
dailyLiquidProduction
=
O
bjectUtil
.
defaultIfNull
(
o
.
getDailyLiquidProduction
(),
BigDecimal
.
ZERO
);
inPlaceConsumption
=
O
bjectUtil
.
defaultIfNull
(
o
.
getInPlaceConsumption
(),
BigDecimal
.
ZERO
);
energyStorageDischarge
=
O
bjectUtil
.
defaultIfNull
(
o
.
getEnergyStorageDischarge
(),
BigDecimal
.
ZERO
);
photovoltaicPower
=
photovoltaicPower
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
?
BigDecimal
.
ZERO
:
photovoltaicPower
;
dailyElectricityConsumption
=
dailyElectricityConsumption
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
?
BigDecimal
.
ZERO
:
dailyElectricityConsumption
;
dailyLiquidProduction
=
dailyLiquidProduction
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
?
BigDecimal
.
ZERO
:
dailyLiquidProduction
;
...
...
@@ -473,11 +424,11 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
.
stationId
(
plantMap
.
get
(
o
.
getStationName
()))
.
stationName
(
o
.
getStationName
())
.
createDate
(
now
)
.
photovoltaicPower
(
O
ptional
.
ofNullable
(
o
.
getPhotovoltaicPower
()).
orElse
(
BigDecimal
.
ZERO
))
.
dailyElectricityConsumption
(
O
ptional
.
ofNullable
(
o
.
getDailyElectricityConsumption
()).
orElse
(
BigDecimal
.
ZERO
))
.
dailyLiquidProduction
(
O
ptional
.
ofNullable
(
o
.
getDailyLiquidProduction
()).
orElse
(
BigDecimal
.
ZERO
))
.
inPlaceConsumption
(
O
ptional
.
ofNullable
(
o
.
getInPlaceConsumption
()).
orElse
(
BigDecimal
.
ZERO
))
.
energyStorageDischarge
(
O
ptional
.
ofNullable
(
o
.
getEnergyStorageDischarge
()).
orElse
(
BigDecimal
.
ZERO
))
.
photovoltaicPower
(
O
bjectUtil
.
defaultIfNull
(
o
.
getPhotovoltaicPower
(),
BigDecimal
.
ZERO
))
.
dailyElectricityConsumption
(
O
bjectUtil
.
defaultIfNull
(
o
.
getDailyElectricityConsumption
(),
BigDecimal
.
ZERO
))
.
dailyLiquidProduction
(
O
bjectUtil
.
defaultIfNull
(
o
.
getDailyLiquidProduction
(),
BigDecimal
.
ZERO
))
.
inPlaceConsumption
(
O
bjectUtil
.
defaultIfNull
(
o
.
getInPlaceConsumption
(),
BigDecimal
.
ZERO
))
.
energyStorageDischarge
(
O
bjectUtil
.
defaultIfNull
(
o
.
getEnergyStorageDischarge
(),
BigDecimal
.
ZERO
))
.
systemSource
(
oilFieldCode
)
.
saveHour
(
now
)
.
build
()
...
...
@@ -556,7 +507,7 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
LambdaQueryWrapper
<
ThirdWellAvgActivePowerEnt
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
BigDecimal
avgActivePower
;
for
(
GetThirdWellAvgActivePowerOutput
o
:
outputs
)
{
avgActivePower
=
O
ptional
.
ofNullable
(
o
.
getAvgActivePower
()).
orElse
(
BigDecimal
.
ZERO
);
avgActivePower
=
O
bjectUtil
.
defaultIfNull
(
o
.
getAvgActivePower
(),
BigDecimal
.
ZERO
);
avgActivePower
=
avgActivePower
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
?
BigDecimal
.
ZERO
:
avgActivePower
;
o
.
setAvgActivePower
(
avgActivePower
);
dtoList
.
add
(
...
...
@@ -611,12 +562,8 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
BigDecimal
meterPower
;
String
oilFieldCode
=
ServiceUtil
.
getOilFieldCode
(
context
);
for
(
ThirdActivePowerExcelData
o
:
cachedDataList
)
{
photovoltaicPower
=
Optional
.
ofNullable
(
o
.
getPhotovoltaicPower
())
.
orElse
(
BigDecimal
.
ZERO
)
.
abs
();
meterPower
=
Optional
.
ofNullable
(
o
.
getMeterPower
())
.
orElse
(
BigDecimal
.
ZERO
)
.
abs
();
photovoltaicPower
=
ObjectUtil
.
defaultIfNull
(
o
.
getPhotovoltaicPower
(),
BigDecimal
.
ZERO
).
abs
();
meterPower
=
ObjectUtil
.
defaultIfNull
(
o
.
getMeterPower
(),
BigDecimal
.
ZERO
).
abs
();
dtoList
.
add
(
ThirdActivePowerView
.
builder
()
.
id
(
BaseUtils
.
randomUUIDString
())
...
...
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