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
a35b4bb4
Commit
a35b4bb4
authored
Aug 17, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
c26914d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
28 deletions
+26
-28
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+26
-28
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
a35b4bb4
...
...
@@ -61,7 +61,7 @@ public class CommonServiceImpl {
String
gkzxzjskey2
;
//----------------健康指数值计算相关请求属性配置------------------------
@Value
(
"${
gkzxzjs.url:8804dc58-508b-4e73-8346-5aa8d808746f
}"
)
@Value
(
"${
jkzsjs.url:d6c175af-50e2-4ea9-9006-f091cdfe203e
}"
)
String
jkzsjsurl
;
...
...
@@ -663,7 +663,7 @@ public class CommonServiceImpl {
return
dateFormat
.
format
(
timeStr
);
}
@Scheduled
(
cron
=
"0
/10 *
* * * ?"
)
@Scheduled
(
cron
=
"0
0/10
* * * ?"
)
private
void
healthWarningMinute
()
{
List
<
IdxBizFanPointProcessVariableClassificationDto
>
data
=
idxBizFanPointProcessVariableClassificationMapper
.
getInfluxDBData
();
Map
<
String
,
List
<
IdxBizFanPointProcessVariableClassificationDto
>>
maps
=
data
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizFanPointProcessVariableClassificationDto:
:
getGatewayId
));
...
...
@@ -707,49 +707,47 @@ public class CommonServiceImpl {
LambdaQueryWrapper
<
IdxBizFanPointVarCentralValue
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
<
IdxBizFanPointVarCentralValue
>
idxBizUhefs
=
idxBizFanPointVarCentralValueMapper
.
selectList
(
wrapper
);
List
<
Map
<
String
,
Object
>>
datas
=
new
ArrayList
<>();
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
for
(
IdxBizFanPointVarCentralValue
idxBizUhef
:
idxBizUhefs
)
{
double
value1
=
0.00
;
double
value2
=
0.00
;
double
value3
=
0.00
;
double
value4
=
0.00
;
for
(
IdxBizFanPointProcessVariableClassificationDto
datum
:
data
)
{
if
(
idxBizUhef
.
getProcessPoint1Id
().
equals
(
datum
.
getSequenceNbr
())){
value1
=
datum
.
getCurrentValue
();
}
if
(
idxBizUhef
.
getProcessPoint2Id
().
equals
(
datum
.
getSequenceNbr
()))
{
value2
=
datum
.
getCurrentValue
();
}
if
(
idxBizUhef
.
getProcessPoint3Id
().
equals
(
datum
.
getSequenceNbr
()))
{
value3
=
datum
.
getCurrentValue
();
}
if
(
idxBizUhef
.
getAnalysisPointId
().
equals
(
datum
.
getSequenceNbr
()))
{
value4
=
datum
.
getCurrentValue
();
}
}
if
(
idxBizUhef
.
getProcess1Min
()
<
value1
&&
value1
<
idxBizUhef
.
getProcess1Max
()
&&
idxBizUhef
.
getProcess2Min
()
<
value2
&&
value2
<
idxBizUhef
.
getPorcess2Max
()
&&
idxBizUhef
.
getProcess3Min
()
<
value3
&&
value3
<
idxBizUhef
.
getProcess3Max
()){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
IdxBizFanPointProcessVariableClassificationDto
datum
:
data
)
{
if
(
idxBizUhef
.
getProcessPoint1Id
().
equals
(
datum
.
getSequenceNbr
())){
value1
=
datum
.
getCurrentValue
();
}
if
(
idxBizUhef
.
getProcessPoint2Id
().
equals
(
datum
.
getSequenceNbr
()))
{
value2
=
datum
.
getCurrentValue
();
}
if
(
idxBizUhef
.
getProcessPoint3Id
().
equals
(
datum
.
getSequenceNbr
()))
{
value3
=
datum
.
getCurrentValue
();
}
if
(
idxBizUhef
.
getAnalysisPointId
().
equals
(
datum
.
getSequenceNbr
()))
{
value4
=
datum
.
getCurrentValue
();
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
idxBizUhef
.
getProcess1Min
()
<=
value1
&&
value1
<=
idxBizUhef
.
getProcess1Max
()
&&
idxBizUhef
.
getProcess2Min
()
<=
value2
&&
value2
<=
idxBizUhef
.
getPorcess2Max
()
&&
idxBizUhef
.
getProcess3Min
()
<=
value3
&&
value3
<=
idxBizUhef
.
getProcess3Max
()){
map
.
put
(
"analysVariable"
,
value4
);
map
.
put
(
"stdDev"
,
idxBizUhef
.
getAnalysisStdDev
());
map
.
put
(
"centerValue"
,
idxBizUhef
.
getAnalysisCenterValue
());
map
.
put
(
"analysVariableId"
,
idxBizUhef
.
getAnalysisPointId
());
datas
.
add
(
map
);
resultMap
.
put
(
idxBizUhef
.
getAnalysisPointId
(),
map
);
}
}
if
(!
datas
.
isEmpty
())
{
Collection
<
Map
<
String
,
Object
>>
values
=
resultMap
.
values
();
if
(!
values
.
isEmpty
())
{
logger
.
info
(
"------------------------------------------开始调用健康指数计算算法开始----------------------------------------"
);
HashMap
<
String
,
Object
>
realParams
=
new
HashMap
<>();
realParams
.
put
(
gkzxzjskey1
,
data
s
);
realParams
.
put
(
gkzxzjskey1
,
value
s
);
String
response
=
HttpUtil
.
createPost
(
baseUrl
+
jkzsjsurl
).
body
(
JSON
.
toJSONString
(
realParams
)).
execute
().
body
();
try
{
logger
.
info
(
"--------------------repsonse: "
+
response
);
TimeUnit
.
SECONDS
.
sleep
(
sleepTime
);
logger
.
info
(
"------------------------------------------调用健康指数计算算法结束----------------------------------------"
);
}
catch
(
Interrupted
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
...
...
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