Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
1649efad
Commit
1649efad
authored
Aug 01, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
c7a6f40d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
26 deletions
+79
-26
ElectricQuantity.java
...oin/amos/boot/module/jxiop/api/Enum/ElectricQuantity.java
+5
-1
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+47
-15
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+9
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+18
-10
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/Enum/ElectricQuantity.java
View file @
1649efad
...
...
@@ -11,7 +11,11 @@ public enum ElectricQuantity {
ZXYGZ
(
"正向总有功"
,
"zxzyg"
),
FXYGZ
(
"反向总有功"
,
"fxzyg"
),
ZXWGZ
(
"正向总无功"
,
"zxzwg"
),
FXWGZ
(
"反向总无功"
,
"fxzwg"
);
FXWGZ
(
"反向总无功"
,
"fxzwg"
),
ZGXWG
(
"总感性无功"
,
"zgxwg"
),
ZZXYG
(
"总正向有功"
,
"zzxwg"
),
ZRXWG
(
"总容性无功"
,
"zrxwg"
),
ZFXYG
(
"总反向有功"
,
"zfxyg"
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
1649efad
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.TreeDto;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl
;
...
...
@@ -566,7 +567,7 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"光伏-总概览"
)
@GetMapping
(
"/solarPowerOverview"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
solarPowerData
(
@RequestParam
(
value
=
"stationId"
)
String
stationId
)
{
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>
>>
solarPowerData
(
@RequestParam
(
value
=
"stationId"
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
...
...
@@ -574,17 +575,20 @@ public class MonitorFanIdxController extends BaseController {
String
boosterGatewayId
=
stationBasic
.
getBoosterGatewayId
();
String
[]
columnList
=
new
String
[]{
"日发电量"
,
"月发电量"
,
"年发电量"
};
String
[]
columnLists
=
new
String
[]{
"有功功率"
};
String
[]
syLists
=
new
String
[]{
"总辐射累计"
};
String
[]
syLists
=
new
String
[]{
"总辐射累计"
,
"总辐射"
};
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
for
(
String
column
:
columnList
)
{
Double
result
=
commonService
.
getTotalByIndicatior
(
gatewayId
,
column
);
columnMap
.
put
(
column
,
String
.
format
(
"%.2f"
,
result
));
}
for
(
String
column
:
syLists
)
{
Double
result
=
commonService
.
get
Total
ByIndicatior
(
boosterGatewayId
,
column
);
Double
result
=
commonService
.
get
Num
ByIndicatior
(
boosterGatewayId
,
column
);
columnMap
.
put
(
column
,
String
.
format
(
"%.2f"
,
result
));
}
for
(
String
column
:
columnLists
)
{
Double
result
=
commonService
.
getAvgvalueByIndicatior
(
gatewayId
,
column
);
columnMap
.
put
(
column
,
String
.
format
(
"%.2f"
,
result
));
...
...
@@ -597,19 +601,47 @@ public class MonitorFanIdxController extends BaseController {
columnMap
.
put
(
"装机容量"
,
capacityl
);
List
<
Map
<
String
,
Object
>>
objects
=
new
ArrayList
<>();
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"total1"
,
columnMap
.
get
(
"装机容量"
).
toString
());
data
.
put
(
"total2"
,
columnMap
.
get
(
"日发电量"
).
toString
());
data
.
put
(
"total3"
,
columnMap
.
get
(
"风机台数"
).
toString
().
replace
(
".0"
,
""
));
data
.
put
(
"total4"
,
columnMap
.
get
(
"月发电量"
).
toString
());
data
.
put
(
"total5"
,
7.47
);
//辐照强度
data
.
put
(
"total6"
,
columnMap
.
get
(
"年发电量"
).
toString
());
data
.
put
(
"total7"
,
String
.
format
(
"%.2f"
,
Double
.
parseDouble
(
columnMap
.
get
(
"有功功率"
).
toString
())/
1000
));
data
.
put
(
"total8"
,
String
.
format
(
"%.2f"
,
Double
.
parseDouble
(
columnMap
.
get
(
"日发电量"
).
toString
())/
(
Double
.
parseDouble
(
columnMap
.
get
(
"装机容量"
).
toString
())*
1000
)));
data
.
put
(
"total9"
,
columnMap
.
get
(
"总辐射累计"
).
toString
());
//总辐射日累计
data
.
put
(
"total0"
,
7.47
);
//综合效率
return
ResponseHelper
.
buildResponse
(
data
);
data
.
put
(
"title"
,
columnMap
.
get
(
"装机容量"
).
toString
());
objects
.
add
(
data
);
Map
<
String
,
Object
>
data1
=
new
HashMap
<>();
data1
.
put
(
"title"
,
columnMap
.
get
(
"日发电量"
).
toString
());
objects
.
add
(
data1
);
Map
<
String
,
Object
>
data2
=
new
HashMap
<>();
data2
.
put
(
"title"
,
columnMap
.
get
(
"风机台数"
).
toString
().
replace
(
".0"
,
""
));
objects
.
add
(
data2
);
Map
<
String
,
Object
>
data3
=
new
HashMap
<>();
data3
.
put
(
"title"
,
columnMap
.
get
(
"月发电量"
).
toString
());
objects
.
add
(
data3
);
Map
<
String
,
Object
>
data4
=
new
HashMap
<>();
data4
.
put
(
"title"
,
columnMap
.
get
(
"总辐射"
).
toString
());
objects
.
add
(
data4
);
Map
<
String
,
Object
>
data5
=
new
HashMap
<>();
data5
.
put
(
"title"
,
columnMap
.
get
(
"年发电量"
).
toString
());
objects
.
add
(
data5
);
Map
<
String
,
Object
>
data6
=
new
HashMap
<>();
data6
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
Double
.
parseDouble
(
columnMap
.
get
(
"有功功率"
).
toString
())/
1000
))
;
objects
.
add
(
data6
);
Map
<
String
,
Object
>
data7
=
new
HashMap
<>();
data7
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
Double
.
parseDouble
(
columnMap
.
get
(
"日发电量"
).
toString
())/
(
Double
.
parseDouble
(
columnMap
.
get
(
"装机容量"
).
toString
())*
1000
)));
objects
.
add
(
data7
);
Map
<
String
,
Object
>
data8
=
new
HashMap
<>();
data8
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
Double
.
parseDouble
(
columnMap
.
get
(
"总辐射累计"
).
toString
())));
objects
.
add
(
data8
);
Map
<
String
,
Object
>
data9
=
new
HashMap
<>();
data9
.
put
(
"title"
,
"84.00%"
);
//综合效率
objects
.
add
(
data9
);
IPage
<
Map
<
String
,
Object
>>
result
=
new
Page
<>();
result
.
setRecords
(
objects
);
result
.
setCurrent
(
1
);
result
.
setTotal
(
objects
.
size
());
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
1649efad
...
...
@@ -41,6 +41,15 @@ public class CommonServiceImpl {
totalvalue
=
mapList
.
stream
().
filter
(
stringObjectMap
->
!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
get
(
"value"
))).
mapToDouble
(
l
->
Double
.
parseDouble
((
String
)
l
.
get
(
"value"
))).
sum
();
return
Double
.
valueOf
(
String
.
format
(
"%.2f"
,
totalvalue
));
}
public
Double
getNumByIndicatior
(
String
gatewayId
,
String
indicator
){
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" where equipmentIndexName=~/"
+
indicator
+
"$/"
;
Double
totalvalue
=
0.0
;
List
<
Map
<
String
,
Object
>>
mapList
=
influxdbUtil
.
query
(
sql
);
totalvalue
=
mapList
.
stream
().
filter
(
stringObjectMap
->
!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
get
(
"value"
))).
mapToDouble
(
l
->
Double
.
parseDouble
((
String
)
l
.
get
(
"value"
))).
sum
();
return
Double
.
valueOf
(
String
.
format
(
"%.2f"
,
totalvalue
));
}
/**
* @deprecated 获取指标值平均值
* @param gatewayId 网关id 用于拼接sql语句
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
1649efad
...
...
@@ -651,7 +651,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
void
schedAddAlarmEventData
(
String
gatewayId
,
String
stationId
,
String
stationName
,
long
currentsort
){
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE systemType = '光字牌' and value = '
tru
e'"
;
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE systemType = '光字牌' and value = '
fals
e'"
;
List
<
IndicatorsDto
>
indicatorsDtoList
=
influxDButils
.
getListDataAll
(
sql
,
IndicatorsDto
.
class
);
List
<
AlarmEvent
>
newAlarmEvents
=
new
ArrayList
<>();
List
<
String
>
alarmsNames
=
new
ArrayList
<>();
...
...
@@ -1043,24 +1043,32 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List
<
IndicatorsDto
>
windSqlList
=
influxDButils
.
getListDataAll
(
sql
,
IndicatorsDto
.
class
);
Map
<
String
,
List
<
IndicatorsDto
>>
maps
=
windSqlList
.
stream
().
collect
(
Collectors
.
groupingBy
(
IndicatorsDto:
:
getSystemType
));
ArrayList
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
Set
<
ColModel
>
listColModel
=
new
LinkedHashSet
<>();
List
<
ColModel
>
listColModels
=
new
ArrayList
<>();
ColModel
name
=
new
ColModel
(
"name"
,
"name"
,
"测量点"
,
"测量点"
,
"dataGrid"
,
"name"
);
listColModel
.
add
(
name
);
for
(
Map
.
Entry
<
String
,
List
<
IndicatorsDto
>>
stringListEntry
:
maps
.
entrySet
())
{
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"name"
,
stringListEntry
.
getKey
());
for
(
IndicatorsDto
indicatorsDto
:
stringListEntry
.
getValue
())
{
stringStringHashMap
.
put
(
ElectricQuantity
.
getCode
(
indicatorsDto
.
getDisplayName
()),
String
.
format
(
"%.3f"
,
ObjectUtils
.
isEmpty
(
indicatorsDto
.
getValue
())?
0.0
:
Double
.
parseDouble
(
indicatorsDto
.
getValue
())));
stringStringHashMap
.
put
(
ElectricQuantity
.
getCode
(
indicatorsDto
.
getDisplayName
()),
String
.
format
(
"%.2f"
,
ObjectUtils
.
isEmpty
(
indicatorsDto
.
getValue
())?
0.0
:
Double
.
parseDouble
(
indicatorsDto
.
getValue
())));
String
key
=
ElectricQuantity
.
getCode
(
indicatorsDto
.
getDisplayName
());
ColModel
keyName
=
new
ColModel
(
key
,
key
,
indicatorsDto
.
getDisplayName
(),
indicatorsDto
.
getDisplayName
(),
"dataGrid"
,
key
);
listColModel
.
add
(
keyName
);
}
resultList
.
add
(
stringStringHashMap
);
}
listColModels
.
addAll
(
listColModel
);
//构建平台数据
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
resultList
.
size
(),
false
,
current
,
resultList
);
ColModel
colModelEventMovement
=
new
ColModel
(
"name"
,
"name"
,
"测量点"
,
"测量点"
,
"dataGrid"
,
"name"
);
ColModel
colModelStationName
=
new
ColModel
(
"zxzyg"
,
"zxzyg"
,
"正向总有功"
,
"正向总有功"
,
"dataGrid"
,
"zxzyg"
);
ColModel
colModelEventDesc
=
new
ColModel
(
"fxzyg"
,
"fxzyg"
,
"反向总有功"
,
"反向总有功"
,
"dataGrid"
,
"fxzyg"
);
ColModel
colModelAlarmGroupName
=
new
ColModel
(
"zxzwg"
,
"zxzwg"
,
"正向总无功"
,
"正向总无功"
,
"zxzwg"
,
"alarmGroupName"
);
ColModel
colModelEventTime
=
new
ColModel
(
"fxzwg"
,
"fxzwg"
,
"反向总无功"
,
"反向总无功"
,
"dataGrid"
,
"fxzwg"
);
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEventMovement
,
colModelStationName
,
colModelEventDesc
,
colModelAlarmGroupName
,
colModelEventTime
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
// ColModel colModelStationName = new ColModel("zxzyg", "zxzyg", "正向总有功", "正向总有功", "dataGrid", "zxzyg");
// ColModel colModelEventDesc = new ColModel("fxzyg", "fxzyg", "反向总有功", "反向总有功", "dataGrid", "fxzyg");
// ColModel colModelAlarmGroupName = new ColModel("zxzwg", "zxzwg", "正向总无功", "正向总无功", "dataGrid", "zxzwg");
// ColModel colModelEventTime = new ColModel("fxzwg", "fxzwg", "反向总无功", "反向总无功", "dataGrid", "fxzwg");
//List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc, colModelAlarmGroupName, colModelEventTime);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModels
);
return
resultsData
;
}
...
...
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