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
3856da1e
Commit
3856da1e
authored
Dec 16, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得到的
parent
dde9bc7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
29 deletions
+63
-29
C02-system/pps-core-system/src/main/resources/mybatis/mapper/pps/core/system/SysAreaViewMapper.xml
...rces/mybatis/mapper/pps/core/system/SysAreaViewMapper.xml
+15
-1
C09-base/pps-core-base/src/main/java/pps/core/base/service/BaseEnergyStorageCloudServiceImpl.java
.../core/base/service/BaseEnergyStorageCloudServiceImpl.java
+1
-1
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/HomePageService.java
...ain/java/pps/core/prediction/service/HomePageService.java
+47
-27
No files found.
C02-system/pps-core-system/src/main/resources/mybatis/mapper/pps/core/system/SysAreaViewMapper.xml
View file @
3856da1e
...
@@ -70,7 +70,8 @@
...
@@ -70,7 +70,8 @@
T.ID
T.ID
</select>
</select>
<select
id=
"selectSysAreaPath"
parameterType=
"pps.core.system.entity.SysAreaView"
resultMap=
"BaseResultMap"
>
<select
id=
"selectSysAreaPath"
parameterType=
"pps.core.system.entity.SysAreaView"
resultMap=
"BaseResultMap"
databaseId=
"MySQL"
>
SELECT CONCAT(B.`NAME`, '/', C.`NAME`) AS `NAME`
SELECT CONCAT(B.`NAME`, '/', C.`NAME`) AS `NAME`
FROM SYS_AREA B
FROM SYS_AREA B
JOIN SYS_AREA C ON B.ID = C.PARENT_ID
JOIN SYS_AREA C ON B.ID = C.PARENT_ID
...
@@ -79,6 +80,19 @@
...
@@ -79,6 +80,19 @@
AND (B.ID = #{id} OR C.ID = #{id}) LIMIT 1
AND (B.ID = #{id} OR C.ID = #{id}) LIMIT 1
</select>
</select>
<select
id=
"selectSysAreaPath"
parameterType=
"pps.core.system.entity.SysAreaView"
resultMap=
"BaseResultMap"
databaseId=
"Oracle"
>
SELECT *
FROM (SELECT B.NAME || '/' || C.NAME AS NAME
FROM SYS_AREA B
JOIN SYS_AREA C ON B.ID = C.PARENT_ID
WHERE B.LEV = 1
AND C.LEV = 2
AND (B.ID = #{id} OR C.ID = #{id})
ORDER BY C.ID)
WHERE ROWNUM = 1
</select>
<resultMap
id=
"ExtResultMap"
type=
"pps.core.system.entity.SysAreaView"
extends=
"BaseResultMap"
>
<resultMap
id=
"ExtResultMap"
type=
"pps.core.system.entity.SysAreaView"
extends=
"BaseResultMap"
>
<result
column=
"PROVINCE"
property=
"province"
/>
<result
column=
"PROVINCE"
property=
"province"
/>
<result
column=
"CITY"
property=
"city"
/>
<result
column=
"CITY"
property=
"city"
/>
...
...
C09-base/pps-core-base/src/main/java/pps/core/base/service/BaseEnergyStorageCloudServiceImpl.java
View file @
3856da1e
...
@@ -41,7 +41,7 @@ public class BaseEnergyStorageCloudServiceImpl implements IBaseEnergyStorageClou
...
@@ -41,7 +41,7 @@ public class BaseEnergyStorageCloudServiceImpl implements IBaseEnergyStorageClou
List
<
BaseEnergyStorageDeviceEnt
>
list
=
mapper
.
selectList
(
new
LambdaQueryWrapper
<
BaseEnergyStorageDeviceEnt
>()
List
<
BaseEnergyStorageDeviceEnt
>
list
=
mapper
.
selectList
(
new
LambdaQueryWrapper
<
BaseEnergyStorageDeviceEnt
>()
.
eq
(
BaseModel:
:
getIsDeleted
,
BusinessConstant
.
ONE
)
.
eq
(
BaseModel:
:
getIsDeleted
,
BusinessConstant
.
ONE
)
.
eq
(
CharSequenceUtil
.
isNotBlank
(
ouId
),
BaseEnergyStorageDeviceEnt:
:
getOuId
,
ouId
)
.
eq
(
CharSequenceUtil
.
isNotBlank
(
ouId
),
BaseEnergyStorageDeviceEnt:
:
getOuId
,
ouId
)
.
in
(
CollUtil
.
isNotEmpty
(
ouIds
),
BaseEnergyStorageDeviceEnt:
:
getOuId
,
ouId
)
.
in
(
CollUtil
.
isNotEmpty
(
ouIds
),
BaseEnergyStorageDeviceEnt:
:
getOuId
,
ouId
s
)
);
);
return
XListResult
.
success
(
XCopyUtils
.
copyNewList
(
list
,
DynamicQueryBaseEnergyStorageDeviceOutput
.
class
));
return
XListResult
.
success
(
XCopyUtils
.
copyNewList
(
list
,
DynamicQueryBaseEnergyStorageDeviceOutput
.
class
));
}
}
...
...
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/HomePageService.java
View file @
3856da1e
...
@@ -200,19 +200,24 @@ public class HomePageService {
...
@@ -200,19 +200,24 @@ public class HomePageService {
String
oilFieldCode
=
ServiceUtil
.
getOilFieldCode
(
context
);
String
oilFieldCode
=
ServiceUtil
.
getOilFieldCode
(
context
);
switch
(
oilFieldCode
)
{
switch
(
oilFieldCode
)
{
case
BusinessConstant
.
ENV_CQ
:
case
BusinessConstant
.
ENV_CQ
:
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
queryWrapper
.
select
(
"NVL( ROUND( SUM( photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power"
,
"NVL( ROUND( SUM( daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption"
,
"NVL( ROUND( SUM( daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production"
);
}
else
{
queryWrapper
.
select
(
"IFNULL( ROUND( SUM( photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power"
,
"IFNULL( ROUND( SUM( daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption"
,
"IFNULL( ROUND( SUM( daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production"
);
}
//实时站
//实时站
Set
<
String
>
set
=
this
.
getPlantList
(
context
,
ouIds
).
stream
()
.
map
(
GetBasePhotovoltaicPlantCloudOutput:
:
getStationName
)
.
collect
(
Collectors
.
toSet
());
ThirdDailyAccumulationUpdateMapper
mapper
=
context
.
getBean
(
ThirdDailyAccumulationUpdateMapper
.
class
);
ThirdDailyAccumulationUpdateMapper
mapper
=
context
.
getBean
(
ThirdDailyAccumulationUpdateMapper
.
class
);
ThirdDailyAccumulationUpdateEnt
ent
=
mapper
.
selectOne
(
new
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>()
ThirdDailyAccumulationUpdateEnt
ent
=
mapper
.
selectOne
(
queryWrapper
.
lambda
()
.
select
(
"IFNULL( ROUND( SUM( photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power"
,
"IFNULL( ROUND( SUM( daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption"
,
"IFNULL( ROUND( SUM( daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production"
)
.
lambda
()
.
eq
(
ThirdDailyAccumulationUpdateEnt:
:
getSaveDate
,
beginOfDay
)
.
eq
(
ThirdDailyAccumulationUpdateEnt:
:
getSaveDate
,
beginOfDay
)
.
eq
(
ThirdDailyAccumulationUpdateEnt:
:
getSystemSource
,
oilFieldCode
)
.
eq
(
ThirdDailyAccumulationUpdateEnt:
:
getSystemSource
,
oilFieldCode
)
.
in
(
ThirdDailyAccumulationUpdateEnt:
:
getStationName
,
set
)
.
in
(
ThirdDailyAccumulationUpdateEnt:
:
getStationName
,
this
.
getPlantList
(
context
,
ouIds
).
stream
()
.
map
(
GetBasePhotovoltaicPlantCloudOutput:
:
getStationName
)
.
collect
(
Collectors
.
toSet
()))
);
);
if
(
ObjectUtil
.
isNotNull
(
ent
))
{
if
(
ObjectUtil
.
isNotNull
(
ent
))
{
cumulativeProduction
=
ent
.
getDailyLiquidProduction
();
cumulativeProduction
=
ent
.
getDailyLiquidProduction
();
...
@@ -438,6 +443,7 @@ public class HomePageService {
...
@@ -438,6 +443,7 @@ public class HomePageService {
BigDecimal
powerConsumption
=
BigDecimal
.
ZERO
;
BigDecimal
powerConsumption
=
BigDecimal
.
ZERO
;
EnergyConsumptionAnalysisMapper
mapper
=
context
.
getBean
(
EnergyConsumptionAnalysisMapper
.
class
);
EnergyConsumptionAnalysisMapper
mapper
=
context
.
getBean
(
EnergyConsumptionAnalysisMapper
.
class
);
//当前配置
//当前配置
boolean
equals
=
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
);
String
oilFieldCode
=
ServiceUtil
.
getOilFieldCode
(
context
);
String
oilFieldCode
=
ServiceUtil
.
getOilFieldCode
(
context
);
if
(
CharSequenceUtil
.
isBlank
(
stationId
))
{
if
(
CharSequenceUtil
.
isBlank
(
stationId
))
{
stationId
=
context
.
getSession
(
PpsUserSession
.
class
).
getOuId
();
stationId
=
context
.
getSession
(
PpsUserSession
.
class
).
getOuId
();
...
@@ -450,13 +456,12 @@ public class HomePageService {
...
@@ -450,13 +456,12 @@ public class HomePageService {
.
collect
(
Collectors
.
groupingBy
(
DynamicQueryBasePowerLineOutput:
:
getOuId
));
.
collect
(
Collectors
.
groupingBy
(
DynamicQueryBasePowerLineOutput:
:
getOuId
));
stationList
=
new
ArrayList
<>(
4
);
stationList
=
new
ArrayList
<>(
4
);
for
(
Map
.
Entry
<
String
,
List
<
DynamicQueryBasePowerLineOutput
>>
entry
:
listMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
DynamicQueryBasePowerLineOutput
>>
entry
:
listMap
.
entrySet
())
{
List
<
String
>
lineNameList
=
entry
.
getValue
().
stream
()
.
map
(
DynamicQueryBasePowerLineOutput:
:
getLineName
)
.
collect
(
Collectors
.
toList
());
EnergyConsumptionAnalysisEnt
ent
=
mapper
.
selectOne
(
new
QueryWrapper
<
EnergyConsumptionAnalysisEnt
>()
EnergyConsumptionAnalysisEnt
ent
=
mapper
.
selectOne
(
new
QueryWrapper
<
EnergyConsumptionAnalysisEnt
>()
.
select
(
"IFNULL( SUM( power_consumption ), 0 ) AS power_consumption"
)
.
select
(
equals
?
"NVL( SUM( power_consumption ), 0 ) AS power_consumption"
:
"IFNULL( SUM( power_consumption ), 0 ) AS power_consumption"
)
.
lambda
()
.
lambda
()
.
in
(
EnergyConsumptionAnalysisEnt:
:
getStationName
,
lineNameList
)
.
in
(
EnergyConsumptionAnalysisEnt:
:
getStationName
,
entry
.
getValue
().
stream
()
.
map
(
DynamicQueryBasePowerLineOutput:
:
getLineName
)
.
collect
(
Collectors
.
toList
()))
.
eq
(
EnergyConsumptionAnalysisEnt:
:
getDataDate
,
startTime
)
.
eq
(
EnergyConsumptionAnalysisEnt:
:
getDataDate
,
startTime
)
.
eq
(
EnergyConsumptionAnalysisEnt:
:
getSystemSource
,
oilFieldCode
)
.
eq
(
EnergyConsumptionAnalysisEnt:
:
getSystemSource
,
oilFieldCode
)
);
);
...
@@ -472,7 +477,7 @@ public class HomePageService {
...
@@ -472,7 +477,7 @@ public class HomePageService {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isNotEmpty
(
lineNameList
))
{
if
(
CollUtil
.
isNotEmpty
(
lineNameList
))
{
List
<
EnergyConsumptionAnalysisEnt
>
list
=
mapper
.
selectList
(
new
QueryWrapper
<
EnergyConsumptionAnalysisEnt
>()
List
<
EnergyConsumptionAnalysisEnt
>
list
=
mapper
.
selectList
(
new
QueryWrapper
<
EnergyConsumptionAnalysisEnt
>()
.
select
(
"IFNULL( SUM( power_consumption ), 0 ) AS power_consumption"
,
"station_name"
)
.
select
(
equals
?
"NVL( SUM( power_consumption ), 0 ) AS power_consumption"
:
"IFNULL( SUM( power_consumption ), 0 ) AS power_consumption"
,
"station_name"
)
.
lambda
()
.
lambda
()
.
in
(
EnergyConsumptionAnalysisEnt:
:
getStationName
,
lineNameList
)
.
in
(
EnergyConsumptionAnalysisEnt:
:
getStationName
,
lineNameList
)
.
eq
(
EnergyConsumptionAnalysisEnt:
:
getDataDate
,
startTime
)
.
eq
(
EnergyConsumptionAnalysisEnt:
:
getDataDate
,
startTime
)
...
@@ -615,14 +620,23 @@ public class HomePageService {
...
@@ -615,14 +620,23 @@ public class HomePageService {
//区分环境
//区分环境
switch
(
oilFieldCode
)
{
switch
(
oilFieldCode
)
{
case
BusinessConstant
.
ENV_CQ
:
case
BusinessConstant
.
ENV_CQ
:
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
queryWrapper
.
select
(
"NVL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power"
,
"NVL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption"
,
"NVL( SUM( daily_liquid_production ), 0 ) AS daily_liquid_production"
,
"NVL( SUM( energy_storage_discharge ), 0 ) AS energy_storage_discharge"
,
"NVL( SUM( in_place_consumption ), 0 ) AS in_place_consumption"
);
}
else
{
queryWrapper
.
select
(
"IFNULL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power"
,
"IFNULL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption"
,
"IFNULL( SUM( daily_liquid_production ), 0 ) AS daily_liquid_production"
,
"IFNULL( SUM( energy_storage_discharge ), 0 ) AS energy_storage_discharge"
,
"IFNULL( SUM( in_place_consumption ), 0 ) AS in_place_consumption"
);
}
ThirdDailyAccumulationUpdateMapper
analysisMapper
=
context
.
getBean
(
ThirdDailyAccumulationUpdateMapper
.
class
);
ThirdDailyAccumulationUpdateMapper
analysisMapper
=
context
.
getBean
(
ThirdDailyAccumulationUpdateMapper
.
class
);
ThirdDailyAccumulationUpdateEnt
analysisEnt
=
analysisMapper
.
selectOne
(
new
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>()
ThirdDailyAccumulationUpdateEnt
analysisEnt
=
analysisMapper
.
selectOne
(
queryWrapper
.
lambda
()
.
select
(
"IFNULL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power"
,
"IFNULL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption"
,
"IFNULL( SUM( daily_liquid_production ), 0 ) AS daily_liquid_production"
,
"IFNULL( SUM( energy_storage_discharge ), 0 ) AS energy_storage_discharge"
,
"IFNULL( SUM( in_place_consumption ), 0 ) AS in_place_consumption"
)
.
lambda
()
.
in
(
ThirdDailyAccumulationUpdateEnt:
:
getStationName
,
lineNameList
)
.
in
(
ThirdDailyAccumulationUpdateEnt:
:
getStationName
,
lineNameList
)
.
eq
(
ThirdDailyAccumulationUpdateEnt:
:
getSystemSource
,
oilFieldCode
)
.
eq
(
ThirdDailyAccumulationUpdateEnt:
:
getSystemSource
,
oilFieldCode
)
);
);
...
@@ -653,12 +667,18 @@ public class HomePageService {
...
@@ -653,12 +667,18 @@ public class HomePageService {
.
divide
(
BusinessConstant
.
BIG_DECIMAL_10000
,
2
,
RoundingMode
.
HALF_UP
);
.
divide
(
BusinessConstant
.
BIG_DECIMAL_10000
,
2
,
RoundingMode
.
HALF_UP
);
break
;
break
;
case
BusinessConstant
.
ENV_SY
:
case
BusinessConstant
.
ENV_SY
:
QueryWrapper
<
StationDailyProductionSituationEnt
>
wrapper
=
new
QueryWrapper
<>();
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
wrapper
.
select
(
"NVL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power"
,
"NVL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption"
,
"NVL( SUM( electricity_charge_city ), 0 ) AS electricity_charge_city"
);
}
else
{
wrapper
.
select
(
"IFNULL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power"
,
"IFNULL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption"
,
"IFNULL( SUM( electricity_charge_city ), 0 ) AS electricity_charge_city"
);
}
StationDailyProductionSituationMapper
dailyMapper
=
context
.
getBean
(
StationDailyProductionSituationMapper
.
class
);
StationDailyProductionSituationMapper
dailyMapper
=
context
.
getBean
(
StationDailyProductionSituationMapper
.
class
);
StationDailyProductionSituationEnt
dailyEnt
=
dailyMapper
.
selectOne
(
new
QueryWrapper
<
StationDailyProductionSituationEnt
>()
StationDailyProductionSituationEnt
dailyEnt
=
dailyMapper
.
selectOne
(
wrapper
.
lambda
()
.
select
(
"IFNULL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power"
,
"IFNULL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption"
,
"IFNULL( SUM( electricity_charge_city ), 0 ) AS electricity_charge_city"
)
.
lambda
()
.
in
(
StationDailyProductionSituationEnt:
:
getStationName
,
lineNameList
)
.
in
(
StationDailyProductionSituationEnt:
:
getStationName
,
lineNameList
)
.
eq
(
StationDailyProductionSituationEnt:
:
getSystemSource
,
oilFieldCode
)
.
eq
(
StationDailyProductionSituationEnt:
:
getSystemSource
,
oilFieldCode
)
);
);
...
...
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