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
11cd929f
Commit
11cd929f
authored
Sep 07, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
541608fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
18 deletions
+80
-18
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+80
-18
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+0
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
11cd929f
...
...
@@ -991,10 +991,13 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"设备发电量 "
)
@GetMapping
(
"/equipGeneratingCapacity"
)
public
ResponseModel
<
ResultsData
>
equipGeneratingCapacity
(
@RequestParam
(
value
=
"current"
)
int
current
,
public
IPage
<
Map
<
String
,
Object
>
>
equipGeneratingCapacity
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"stationId"
)
String
stationId
)
{
Page
<
ESEquipments
>
result
=
new
Page
<
ESEquipments
>(
current
,
size
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
BoolQueryBuilder
boolMustAll
=
QueryBuilders
.
boolQuery
();
//警情状态
...
...
@@ -1002,7 +1005,12 @@ public class MonitorFanIdxController extends BaseController {
String
[]
keys
=
new
String
[]
{
"日发电量"
,
"月发电量"
,
"年发电量"
};
List
<
String
>
list
=
Arrays
.
asList
(
keys
);
BoolQueryBuilder
boolQueryBuilder
=
QueryBuilders
.
boolQuery
();
boolQueryBuilder
.
must
((
QueryBuilders
.
termsQuery
(
"equipmentIndexName.keyword"
,
list
))).
must
(
QueryBuilders
.
matchQuery
(
"gatewayId.keyword"
,
"1668801435891929089"
));
if
(!
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
boolQueryBuilder
.
must
((
QueryBuilders
.
termsQuery
(
"equipmentIndexName.keyword"
,
list
))).
must
(
QueryBuilders
.
matchQuery
(
"gatewayId.keyword"
,
gatewayId
)).
must
(
QueryBuilders
.
matchQuery
(
"frontModule"
,
"逆变器"
));
}
else
{
boolQueryBuilder
.
must
((
QueryBuilders
.
termsQuery
(
"equipmentIndexName.keyword"
,
list
))).
must
(
QueryBuilders
.
matchQuery
(
"gatewayId.keyword"
,
gatewayId
));
}
should
.
add
(
boolQueryBuilder
);
// 创建查询构造器
...
...
@@ -1035,30 +1043,42 @@ public class MonitorFanIdxController extends BaseController {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
key
);
for
(
ESEquipments
equip
:
resultMap
.
get
(
key
))
{
switch
(
equip
.
getEquipmentIndexName
()){
if
(!
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
float
value
=
equip
.
getValueDouble
();
float
v
=
CommonConstans
.
pvGenPoweActor
.
floatValue
();
equip
.
setValueDouble
(
value
*
v
);
}
String
value
=
String
.
format
(
"%.4f"
,
equip
.
getValueDouble
());
switch
(
equip
.
getEquipmentIndexName
()){
case
"日发电量"
:
map
.
put
(
"dayNum"
,
equip
.
getValueDouble
()
);
map
.
put
(
"dayNum"
,
value
);
break
;
case
"月发电量"
:
map
.
put
(
"monthNum"
,
equip
.
getValueDouble
()
);
map
.
put
(
"monthNum"
,
value
);
break
;
case
"年发电量"
:
map
.
put
(
"yearNum"
,
equip
.
getValueDouble
()
);
map
.
put
(
"yearNum"
,
value
);
break
;
}
}
esEquipmentsMap
.
add
(
map
);
}
//构建平台数据
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
esEquipmentsMap
.
size
(),
false
,
current
,
esEquipmentsMap
);
ColModel
colModelEquipmentNumber
=
new
ColModel
(
"name"
,
"name"
,
"设备名称"
,
"设备名称"
,
"dataGrid"
,
"name"
);
ColModel
colModelPower
=
new
ColModel
(
"dayNum"
,
"dayNum"
,
"日发电量"
,
"日发电量"
,
"dataGrid"
,
"dayNum"
);
ColModel
colModelWindSpeed
=
new
ColModel
(
"monthNum"
,
"monthNum"
,
"月发电量"
,
"月发电量"
,
"dataGrid"
,
"monthNum"
);
ColModel
colModelWind
=
new
ColModel
(
"yearNum"
,
"yearNum"
,
"年发电量"
,
"年发电量"
,
"dataGrid"
,
"yearNum"
);
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEquipmentNumber
,
colModelPower
,
colModelWindSpeed
,
colModelWind
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
ResponseHelper
.
buildResponse
(
resultsData
);
IPage
<
Map
<
String
,
Object
>>
page
=
new
Page
<>();
page
.
setTotal
(
esEquipmentsMap
.
size
());
page
.
setSize
(
999
);
page
.
setCurrent
(
1
);
page
.
setRecords
(
esEquipmentsMap
);
return
page
;
// //构建平台数据
// DataGridMock DataGridMock = new DataGridMock(current, esEquipmentsMap.size(), false, current, esEquipmentsMap);
// ColModel colModelEquipmentNumber = new ColModel("name", "name", "设备名称", "设备名称", "dataGrid", "name");
// ColModel colModelPower = new ColModel("dayNum", "dayNum", "日发电量", "日发电量", "dataGrid", "dayNum");
// ColModel colModelWindSpeed = new ColModel("monthNum", "monthNum", "月发电量", "月发电量", "dataGrid", "monthNum");
// ColModel colModelWind = new ColModel("yearNum", "yearNum", "年发电量", "年发电量", "dataGrid", "yearNum");
// List<ColModel> listColModel = Arrays.asList(colModelEquipmentNumber, colModelPower, colModelWindSpeed, colModelWind);
// ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
// return ResponseHelper.buildResponse(resultsData);
}
...
...
@@ -1117,7 +1137,7 @@ public class MonitorFanIdxController extends BaseController {
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@Scheduled
(
cron
=
"0
0/10
* * * ? "
)
@Scheduled
(
cron
=
"0
/30 *
* * * ? "
)
@ApiOperation
(
value
=
"接入情况 "
)
@GetMapping
(
"/accessSituation"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
accessSituation
(){
...
...
@@ -1141,7 +1161,7 @@ public class MonitorFanIdxController extends BaseController {
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@Scheduled
(
cron
=
"0
0/10
* * * ? "
)
@Scheduled
(
cron
=
"0
/30 *
* * * ? "
)
@ApiOperation
(
value
=
"区域接入情况 "
)
@GetMapping
(
"/qyAccessSituation"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
qyAccessSituation
(){
...
...
@@ -1169,4 +1189,46 @@ public class MonitorFanIdxController extends BaseController {
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"健康运行百分比 "
)
@GetMapping
(
"/getFanStatusByZC"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getFanStatusByZC
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
List
<
IndexDto
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusStatistics
(
stationId
);
int
healthNum
=
0
;
int
sum
=
0
;
for
(
IndexDto
indexDto
:
fanStatusList
)
{
if
(
indexDto
.
getEquipmentIndexName
().
equals
(
"正常运行"
)){
healthNum
=
Integer
.
parseInt
(
indexDto
.
getCountString
());
}
sum
+=
Integer
.
parseInt
(
indexDto
.
getCountString
());
}
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>()
;
hashMap
.
put
(
"title"
,
healthNum
+
"/"
+
sum
);
double
percent
=
(
double
)
healthNum
/
sum
*
100
;
int
value
=
(
int
)
percent
;
String
[]
values
=
new
String
[]{
String
.
valueOf
(
value
)};
hashMap
.
put
(
"seriesData"
,
values
);
return
ResponseHelper
.
buildResponse
(
hashMap
);
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"单个风机状态"
)
@GetMapping
(
"/getFanStatusByEquipNum"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getFanStatusList
(
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
,
@RequestParam
(
value
=
"equip"
)
String
equipNum
)
{
List
<
IndexDto
>
fanStatusList
=
monitorFanIndicator
.
getFanStatusList
(
stationId
);
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>()
;
String
status
=
""
;
for
(
IndexDto
indexDto
:
fanStatusList
)
{
if
(
indexDto
.
getEquipmentNumber
().
equals
(
equipNum
)){
status
=
indexDto
.
getState
();
}
}
hashMap
.
put
(
"status"
,
status
);
return
ResponseHelper
.
buildResponse
(
hashMap
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
11cd929f
This diff is collapsed.
Click to expand it.
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