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
5b3e6f4d
Commit
5b3e6f4d
authored
Jul 28, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
0ea8867e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
132 additions
and
2 deletions
+132
-2
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+43
-2
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+89
-0
No files found.
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 @
5b3e6f4d
...
...
@@ -234,7 +234,7 @@ public class MonitorFanIdxController extends BaseController {
data6
.
put
(
"title"
,
columnMap
.
get
(
"有功功率"
).
toString
());
objects
.
add
(
data6
);
Map
<
String
,
Object
>
data7
=
new
HashMap
<>();
data7
.
put
(
"title"
,
(
double
)
columnMap
.
get
(
"日发电量"
)/(
double
)
columnMap
.
get
(
"装机容量"
)*
1000
);
data7
.
put
(
"title"
,
Double
.
parseDouble
(
columnMap
.
get
(
"日发电量"
).
toString
())/
Double
.
parseDouble
(
columnMap
.
get
(
"装机容量"
).
toString
()
)*
1000
);
objects
.
add
(
data7
);
IPage
<
Map
<
String
,
Object
>>
result
=
new
Page
<>();
...
...
@@ -607,7 +607,8 @@ public class MonitorFanIdxController extends BaseController {
data
.
put
(
"title5"
,
7.47
);
//辐照强度
data
.
put
(
"title6"
,
columnMap
.
get
(
"年发电量"
).
toString
());
data
.
put
(
"title7"
,
columnMap
.
get
(
"有功功率"
).
toString
());
data
.
put
(
"title8"
,(
double
)
columnMap
.
get
(
"日发电量"
)/(
double
)
columnMap
.
get
(
"装机容量"
)*
1000
);
//日利用小时
data
.
put
(
"title8"
,
Double
.
parseDouble
(
columnMap
.
get
(
"日发电量"
).
toString
())/
Double
.
parseDouble
(
columnMap
.
get
(
"装机容量"
).
toString
())*
1000
);
//日利用小时
data
.
put
(
"title9"
,
columnMap
.
get
(
"总辐射累计"
).
toString
());
//总辐射日累计
data
.
put
(
"title0"
,
7.47
);
//综合效率
return
ResponseHelper
.
buildResponse
(
data
);
...
...
@@ -658,4 +659,44 @@ public class MonitorFanIdxController extends BaseController {
}
return
ResponseHelper
.
buildResponse
(
monitorFanIndicator
.
getStatisticsInfo
(
gatewayId
,
equipmentIndexName
));
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"码速表"
)
@GetMapping
(
"/SpeedIndicator"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
SpeedIndicator
(
@RequestParam
(
value
=
"equipNum"
,
required
=
false
)
String
equipNum
,
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"equipmentIndexName"
,
required
=
false
)
String
equipmentIndexName
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
return
ResponseHelper
.
buildResponse
(
monitorFanIndicator
.
SpeedIndicator
(
gatewayId
,
equipNum
,
equipmentIndexName
));
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"箱变实时开关状态"
)
@GetMapping
(
"/equipSwitchStatus"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getEquipSwitchStatus
()
{
LambdaQueryWrapper
<
StationBasic
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
wrapper
);
for
(
StationBasic
stationBasic
:
stationBasics
)
{
String
fanGatewayId
=
stationBasic
.
getFanGatewayId
();
monitorFanIndicatorImpl
.
getEquipSwitchStatus
(
stationBasic
);
}
return
CommonResponseUtil
.
success
();
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"汇流箱支路电流离散率"
)
@GetMapping
(
"/collectingBox"
)
public
ResponseModel
<
ResultsData
>
collectingBox
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"stationId"
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
return
ResponseHelper
.
buildResponse
(
monitorFanIndicatorImpl
.
collectingBox
(
gatewayId
,
current
,
size
));
}
}
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 @
5b3e6f4d
...
...
@@ -1479,5 +1479,94 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return
s
;
}
public
HashMap
<
String
,
Object
>
SpeedIndicator
(
String
gatewayId
,
String
equipmentNumber
,
String
equipmentIndexName
){
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentNumber ='"
+
equipmentNumber
+
"' and equipmentIndexName = '"
+
equipmentIndexName
+
"'"
;
List
<
IndicatorsDto
>
list
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
list
)){
resultMap
.
put
(
"value"
,
list
.
get
(
0
).
getValue
());
}
return
resultMap
;
}
public
void
getEquipSwitchStatus
(
StationBasic
stationBasic
){
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
Long
stationId
=
stationBasic
.
getSequenceNbr
();
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName =~/合闸/"
;
List
<
IndicatorsDto
>
list
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
list
)){
Map
<
String
,
List
<
IndicatorsDto
>>
collect
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
IndicatorsDto:
:
getEquipmentNumber
));
for
(
String
s
:
collect
.
keySet
())
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
collect
.
get
(
s
).
stream
().
forEach
(
e
->{
String
picturl
=
""
;
if
(
e
.
getValue
().
equals
(
"true"
)){
picturl
=
pictureUrl
+
"dlg-h-red.png"
;
}
else
{
picturl
=
pictureUrl
+
"dlg-h-green.png"
;
}
if
(
e
.
getEquipmentIndexName
().
contains
(
"合闸"
)){
resultMap
.
put
(
e
.
getEquipmentIndexName
().
substring
(
0
,
3
),
picturl
);
}
else
{
resultMap
.
put
(
"gy"
,
picturl
);
}
});
IPage
<
Map
<
String
,
Object
>>
result
=
new
Page
<>();
List
<
Map
<
String
,
Object
>>
data
=
new
ArrayList
<>();
data
.
add
(
resultMap
);
result
.
setRecords
(
data
);
result
.
setCurrent
(
1
);
result
.
setTotal
(
100
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
stationId
+
"/xbjg/"
+
s
,
JSON
.
toJSONString
(
result
).
getBytes
(),
0
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
}
}
public
ResultsData
collectingBox
(
String
gatewayId
,
int
current
,
int
size
){
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
ArrayList
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName =~/路电流/ "
;
List
<
IndicatorsDto
>
list
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
list
)){
Map
<
String
,
List
<
IndicatorsDto
>>
collect
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
IndicatorsDto:
:
getEquipmentNumber
));
for
(
String
s
:
collect
.
keySet
())
{
List
<
IndicatorsDto
>
indicatorsDtos
=
collect
.
get
(
s
);
Double
avageValue
=
0.0
;
avageValue
=
indicatorsDtos
.
stream
().
filter
(
e
->
!
ObjectUtils
.
isEmpty
(
e
.
getValue
())).
mapToDouble
(
l
->
Double
.
parseDouble
((
String
)
l
.
getValue
())).
average
().
getAsDouble
();
avageValue
=
Double
.
valueOf
(
String
.
format
(
"%.2f"
,
avageValue
));
resultMap
.
put
(
"avg"
,
avageValue
);
String
[]
name
=
s
.
split
(
"-"
);
resultMap
.
put
(
"zz"
,
"#"
+
name
[
0
]+
"子阵"
);
resultMap
.
put
(
"nbq"
,
"逆变器"
+
name
[
1
]);
resultMap
.
put
(
"hlx"
,
"#"
+
name
[
2
]+
"汇流箱"
);
resultMap
.
put
(
"lsv"
,
"1.7840"
);
resultList
.
add
(
resultMap
);
}
}
//构建平台数据
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
resultList
.
size
(),
false
,
current
,
resultList
);
ColModel
colModelEventMovement
=
new
ColModel
(
"zz"
,
"zz"
,
"子阵"
,
"子阵"
,
"dataGrid"
,
"zz"
);
ColModel
colModelStationName
=
new
ColModel
(
"nbq"
,
"nbq"
,
"逆变器"
,
"逆变器"
,
"dataGrid"
,
"nvq"
);
ColModel
colModelEventDesc
=
new
ColModel
(
"hlx"
,
"hlx"
,
"汇流箱"
,
"汇流箱"
,
"dataGrid"
,
"hlx"
);
ColModel
colModelAlarmGroupName
=
new
ColModel
(
"avg"
,
"avg"
,
"支路电流平均值"
,
"支路电流平均值"
,
"dataGrid"
,
"avg"
);
ColModel
colModelEventTime
=
new
ColModel
(
"lsl"
,
"lsv"
,
"支路电流离散率"
,
"支路电流离散率"
,
"dataGrid"
,
"lsv"
);
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEventMovement
,
colModelStationName
,
colModelEventDesc
,
colModelAlarmGroupName
,
colModelEventTime
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
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