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
59e10062
Commit
59e10062
authored
Oct 13, 2023
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改偏差率
parent
966888c5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
23 deletions
+60
-23
CommonConstans.java
.../amos/boot/module/jxiop/biz/constants/CommonConstans.java
+2
-0
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+6
-2
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+52
-21
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/constants/CommonConstans.java
View file @
59e10062
...
@@ -94,6 +94,8 @@ public class CommonConstans {
...
@@ -94,6 +94,8 @@ public class CommonConstans {
public
static
final
String
QueryStringEquipmentIndexName
=
"equipmentIndexName.keyword"
;
public
static
final
String
QueryStringEquipmentIndexName
=
"equipmentIndexName.keyword"
;
//es EquipIndexName 查绚关键字
//es EquipIndexName 查绚关键字
public
static
final
String
QueryStringEquipmentIndexNameNotKeyword
=
"equipmentIndexName"
;
public
static
final
String
QueryStringEquipmentIndexNameNotKeyword
=
"equipmentIndexName"
;
public
static
final
String
QueryStringEquipmentSpecificNameNotKeyword
=
"equipmentSpecificName.keyword"
;
//es gatewayId 查绚关键字
//es gatewayId 查绚关键字
public
static
final
String
QueryStringGateWayId
=
"gatewayId.keyword"
;
public
static
final
String
QueryStringGateWayId
=
"gatewayId.keyword"
;
public
static
final
String
QueryStringFrontMoudle
=
"frontModule.keyword"
;
public
static
final
String
QueryStringFrontMoudle
=
"frontModule.keyword"
;
...
...
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 @
59e10062
...
@@ -767,8 +767,12 @@ public class MonitorFanIdxController extends BaseController {
...
@@ -767,8 +767,12 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"汇流箱支路电流偏差率"
)
@ApiOperation
(
value
=
"汇流箱支路电流偏差率"
)
@GetMapping
(
"/getDeaviAtionRate"
)
@GetMapping
(
"/getDeaviAtionRate"
)
public
ResponseModel
<
Page
<
DeaviationRateDto
>>
getDeaviAtionRate
(
@RequestParam
(
value
=
"stationId"
)
String
stationId
,
String
equipNumber
)
{
public
ResponseModel
<
ResultsData
>
getDeaviAtionRate
(
@RequestParam
(
value
=
"stationId"
)
String
stationId
,
return
ResponseHelper
.
buildResponse
(
monitorFanIndicatorImpl
.
getDeaviAtionRate
(
stationId
,
equipNumber
));
@RequestParam
(
value
=
"zz"
)
String
zz
,
@RequestParam
(
value
=
"nbq"
)
String
nbq
,
@RequestParam
(
value
=
"hlx"
)
String
hlx
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
return
ResponseHelper
.
buildResponse
(
monitorFanIndicatorImpl
.
getDeaviAtionRate
(
gatewayId
,
zz
,
nbq
,
hlx
));
}
}
...
...
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 @
59e10062
...
@@ -2157,27 +2157,58 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -2157,27 +2157,58 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
}
public
Page
<
DeaviationRateDto
>
getDeaviAtionRate
(
String
stationId
,
String
equipNumber
)
{
public
ResultsData
getDeaviAtionRate
(
String
gatewayId
,
String
zz
,
String
nbq
,
String
hlx
)
{
StationCacheInfoDto
stationCacheInfoDto
=
commonServiceImpl
.
getStationCacheInfoDtoByStationId
(
stationId
);
ArrayList
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
Page
<
DeaviationRateDto
>
deaviationRateDtoPage
=
new
Page
<>(
1
,
100
);
Map
<
String
,
List
<
String
>>
queryConditon
=
new
HashMap
<>();
List
<
DeaviationRateDto
>
deaviationRateDtoList
=
new
ArrayList
<>();
queryConditon
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
gatewayId
));
Map
<
String
,
List
<
String
>>
queryCondition
=
new
HashMap
<>();
Map
<
String
,
String
>
likeMap
=
new
HashMap
<>();
queryCondition
.
put
(
CommonConstans
.
QueryStringEquipmentNumber
,
Arrays
.
asList
(
equipNumber
));
likeMap
.
put
(
CommonConstans
.
QueryStringEquipmentIndexNameNotKeyword
,
"路电流"
);
queryCondition
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
//hlx=hlx.replace("#0", "#");
Map
<
String
,
String
>
shouldCodtion
=
new
HashMap
<>();
//likeMap.put(CommonConstans.QueryStringEquipmentSpecificNameNotKeyword, hlx);
shouldCodtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
"路电流"
);
String
nhlx
=
zz
+
"/"
+
nbq
+
"/"
+
hlx
.
replace
(
"#0"
,
"#"
);
List
<
ESEquipments
>
indicatorsDtoList
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondition
,
shouldCodtion
,
ESEquipments
.
class
);
List
<
ESEquipments
>
list
=
commonServiceImpl
.
getListDataByCondtionsAndLike
(
queryConditon
,
null
,
Random
random
=
new
Random
();
ESEquipments
.
class
,
likeMap
);
indicatorsDtoList
.
forEach
(
esEquipments
->
{
DeaviationRateDto
deaviationRateDto
=
new
DeaviationRateDto
();
// Map<String, List<String>> queryConditon1 = new HashMap<>();
deaviationRateDto
.
setName
(
esEquipments
.
getEquipmentIndexName
());
// queryConditon1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
deaviationRateDto
.
setCurrentValue
(
esEquipments
.
getValue
());
// Map<String, String> likeMap1 = new HashMap<>();
deaviationRateDto
.
setOffset
(
String
.
valueOf
(
random
.
nextDouble
()));
// likeMap1.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "平均电流");
deaviationRateDto
.
setAttValue
(
String
.
valueOf
(
random
.
nextDouble
()));
// List<ESEquipments> list1 = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null,
deaviationRateDtoList
.
add
(
deaviationRateDto
);
// ESEquipments.class, likeMap1);
});
deaviationRateDtoPage
.
setRecords
(
deaviationRateDtoList
);
if
(!
ValidationUtil
.
isEmpty
(
list
))
{
return
deaviationRateDtoPage
;
list
=
list
.
stream
().
filter
(
i
->
i
.
getEquipmentSpecificName
().
contains
(
nhlx
)).
collect
(
Collectors
.
toList
());
Double
avageValue
=
0.0
;
avageValue
=
list
.
stream
().
filter
(
e
->
!
ObjectUtils
.
isEmpty
(
e
.
getValueF
()))
.
mapToDouble
(
l
->
Double
.
parseDouble
(
l
.
getValueF
().
toString
())).
average
().
getAsDouble
();
avageValue
=
Double
.
valueOf
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
avageValue
));
for
(
ESEquipments
s
:
list
)
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"hlx"
,
s
.
getEquipmentIndexName
());
double
now
=
Double
.
valueOf
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
s
.
getValueF
()));
resultMap
.
put
(
"now"
,
now
);
resultMap
.
put
(
"avg"
,
avageValue
);
double
c
=
now
-
avageValue
;
if
(
c
<
0
)
{
c
=
-
c
;
}
double
lsv
=
c
/
avageValue
;
lsv
=
Double
.
valueOf
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
lsv
));
resultMap
.
put
(
"lsv"
,
lsv
);
resultList
.
add
(
resultMap
);
}
}
// 构建平台数据
DataGridMock
DataGridMock
=
new
DataGridMock
(
0
,
resultList
.
size
(),
false
,
0
,
resultList
);
ColModel
colModelEventMovement
=
new
ColModel
(
"hlx"
,
"hlx"
,
"汇流箱"
,
"汇流箱"
,
"dataGrid"
,
"hlx"
);
ColModel
colModelStationName
=
new
ColModel
(
"now"
,
"now"
,
"当前值"
,
"当前值"
,
"dataGrid"
,
"now"
);
ColModel
colModelEventDesc
=
new
ColModel
(
"avg"
,
"avg"
,
"平均值"
,
"平均值"
,
"dataGrid"
,
"avg"
);
ColModel
colModelAlarmGroupName
=
new
ColModel
(
"pcv"
,
"pcv"
,
"偏差率"
,
"偏差率"
,
"dataGrid"
,
"pcv"
);
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEventMovement
,
colModelStationName
,
colModelEventDesc
,
colModelAlarmGroupName
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
resultsData
;
}
}
// @Scheduled(cron = "0 */10 * * * ?")
// @Scheduled(cron = "0 */10 * * * ?")
...
...
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