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
7b9291ba
Commit
7b9291ba
authored
Oct 17, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
83026b57
3873e6c6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
16 deletions
+25
-16
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+3
-5
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+13
-8
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+2
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+7
-3
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 @
7b9291ba
...
...
@@ -15,7 +15,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.IdxBizPvPointProcessVariableCl
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.component.influxdb.InfluxdbUtil
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
...
...
@@ -109,8 +108,7 @@ public class CommonServiceImpl {
private
IdxBizFanPointVarCorrelationMapper
idxBizFanPointVarCorrelationMapper
;
@Autowired
private
IdxBizPvPointVarCorrelationMapper
idxBizPvPointVarCorrelationMapper
;
@Autowired
private
InfluxdbUtil
influxdbUtil
;
@Autowired
private
IndicatorDataMapper
indicatorDataMapper
;
@Autowired
...
...
@@ -1609,7 +1607,7 @@ public class CommonServiceImpl {
logger
.
info
(
"------------------------------------------调用健康指数计算算法结束----------------------------------------"
);
logger
.
info
(
"------------------------------------------开始计算预警----------------------------------------"
);
healthStatusIndicatorService
.
healthWarningMinute
(
calendar
);
healthStatusIndicatorService
.
healthWarningMinute
(
calendar
,
time
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
...
...
@@ -1754,7 +1752,7 @@ public class CommonServiceImpl {
throw
new
RuntimeException
(
e
);
}
healthStatusIndicatorService
.
healthWarningMinuteGF
(
calendar
);
healthStatusIndicatorService
.
healthWarningMinuteGF
(
calendar
,
time
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
7b9291ba
...
...
@@ -106,11 +106,12 @@ public class HealthStatusIndicatorServiceImpl {
// @Scheduled(cron = "0 0 */1 * * ?")
@Async
(
"async"
)
public
void
healthWarningMinuteGF
(
Calendar
calendar
)
{
public
void
healthWarningMinuteGF
(
Calendar
calendar
,
Date
time
)
{
// Calendar calendar = Calendar.getInstance();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
LambdaQueryWrapper
<
IdxBizPvHealthIndex
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
IdxBizPvHealthIndex:
:
getAnalysisType
,
"按时刻"
);
wrapper
.
ne
(
IdxBizPvHealthIndex:
:
getHealthLevel
,
"安全"
);
...
...
@@ -211,7 +212,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setStatus
(
"0"
);
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizPvWarningRecord
.
setRecDate
(
new
Date
()
);
idxBizPvWarningRecord
.
setRecDate
(
time
);
idxBizPvWarningRecord
.
setManufacturer
(
idxBizPvHealthIndices
.
get
(
0
).
getManufacturer
());
idxBizPvWarningRecord
.
setPointName
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
());
idxBizPvWarningRecord
.
setHealthIndexSeq
(
idxBizPvHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
...
...
@@ -237,6 +238,7 @@ public class HealthStatusIndicatorServiceImpl {
@Scheduled
(
cron
=
"0 0 0/1 * * ?"
)
@Async
(
"async"
)
public
void
healthWarningHourGF
()
{
Date
time
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
5
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
@@ -345,7 +347,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setStatus
(
"0"
);
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizPvWarningRecord
.
setRecDate
(
new
Date
()
);
idxBizPvWarningRecord
.
setRecDate
(
time
);
idxBizPvWarningRecord
.
setManufacturer
(
idxBizPvHealthIndices
.
get
(
0
).
getManufacturer
());
idxBizPvWarningRecord
.
setPointName
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
());
idxBizPvWarningRecord
.
setHealthIndexSeq
(
idxBizPvHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
...
...
@@ -370,6 +372,7 @@ public class HealthStatusIndicatorServiceImpl {
@Async
(
"async"
)
public
void
healthWarningDayGF
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
Date
time
=
new
Date
();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)-
3
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
...
@@ -473,7 +476,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setStatus
(
"0"
);
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizPvWarningRecord
.
setRecDate
(
new
Date
()
);
idxBizPvWarningRecord
.
setRecDate
(
time
);
idxBizPvWarningRecord
.
setManufacturer
(
idxBizPvHealthIndices
.
get
(
0
).
getManufacturer
());
idxBizPvWarningRecord
.
setPointName
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
());
idxBizPvWarningRecord
.
setHealthIndexSeq
(
idxBizPvHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
...
...
@@ -491,7 +494,7 @@ public class HealthStatusIndicatorServiceImpl {
// @Scheduled(cron = "0 0 */1 * * ?")
@Async
(
"async"
)
public
void
healthWarningMinute
(
Calendar
calendar
)
{
public
void
healthWarningMinute
(
Calendar
calendar
,
Date
time
)
{
// Calendar calendar = Calendar.getInstance();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
@@ -605,7 +608,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setStatus
(
"0"
);
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizFanWarningRecord
.
setRecDate
(
new
Date
()
);
idxBizFanWarningRecord
.
setRecDate
(
time
);
idxBizFanWarningRecord
.
setNumber
(
idxBizFanHealthIndices
.
get
(
0
).
getNumber
());
idxBizFanWarningRecord
.
setPointName
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
());
idxBizFanWarningRecord
.
setHealthIndexSeq
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
...
...
@@ -629,6 +632,7 @@ public class HealthStatusIndicatorServiceImpl {
@Scheduled
(
cron
=
"0 0 0/1 * * ?"
)
@Async
(
"async"
)
public
void
healthWarningHour
()
{
Date
time
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
5
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
@@ -734,7 +738,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setStatus
(
"0"
);
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizFanWarningRecord
.
setRecDate
(
new
Date
()
);
idxBizFanWarningRecord
.
setRecDate
(
time
);
idxBizFanWarningRecord
.
setNumber
(
idxBizFanHealthIndices
.
get
(
0
).
getNumber
());
idxBizFanWarningRecord
.
setHealthIndexSeq
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
idxBizFanWarningRecord
.
setHealthLevel
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthLevel
());
...
...
@@ -757,6 +761,7 @@ public class HealthStatusIndicatorServiceImpl {
@Scheduled
(
cron
=
"0 0 0 0/1 * ? "
)
@Async
(
"async"
)
public
void
healthWarningDay
()
{
Date
time
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)-
3
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
...
@@ -865,7 +870,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setStatus
(
"0"
);
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
idxBizFanWarningRecord
.
setRecDate
(
new
Date
()
);
idxBizFanWarningRecord
.
setRecDate
(
time
);
idxBizFanWarningRecord
.
setNumber
(
idxBizFanHealthIndices
.
get
(
0
).
getNumber
());
idxBizFanWarningRecord
.
setHealthIndexSeq
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthIndex
().
toString
());
idxBizFanWarningRecord
.
setHealthLevel
(
idxBizFanHealthIndices
.
get
(
0
).
getHealthLevel
());
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
7b9291ba
...
...
@@ -727,6 +727,7 @@
SUBARRAY
)
) a
where equipmentName is not null and equipmentName != ''
GROUP BY
a.equipmentName
</select>
...
...
@@ -763,6 +764,7 @@
EQUIPMENT_NAME
)
) a
where subSystem is not null and subSystem != ''
GROUP BY
a.subSystem
...
...
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 @
7b9291ba
...
...
@@ -569,8 +569,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List
<
String
>
axisData
=
new
ArrayList
<>();
Integer
size
=
indicatorDataListWindSpeed
.
size
()
>
indicatorDataListActivePower
.
size
()
?
indicatorDataListActivePower
.
size
()
:
indicatorDataListWindSpeed
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
windSpeeds
.
add
(
indicatorDataListWindSpeed
.
get
(
i
).
getValue
(
));
activePowers
.
add
(
indicatorDataListActivePower
.
get
(
i
).
getValue
(
));
windSpeeds
.
add
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
indicatorDataListWindSpeed
.
get
(
i
).
getValue
()
));
activePowers
.
add
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
indicatorDataListActivePower
.
get
(
i
).
getValue
()
));
axisData
.
add
(
DateUtil
.
format
(
indicatorDataListWindSpeed
.
get
(
i
).
getCreatedTime
(),
"HH:mm"
));
}
List
<
Map
<
String
,
Object
>>
seriesData
=
new
ArrayList
<>();
...
...
@@ -1005,13 +1005,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
map
.
put
(
"url"
,
fanStatusImagePathPrefix
+
File
.
separator
+
"风机-"
+
fantStatus
+
".gif"
);
statusMaps
.
add
(
map
);
}
Collator
instance
=
Collator
.
getInstance
(
Locale
.
CHINA
);
Collections
.
sort
(
statusMaps
,
(
e1
,
e2
)
->
{
return
instance
.
compare
(
e1
.
get
(
"title1"
),
e2
.
get
(
"title1"
));
});
IPage
<
Map
<
String
,
Object
>>
result
=
new
Page
<>();
result
.
setRecords
(
statusMaps
);
result
.
setCurrent
(
1
);
result
.
setTotal
(
statusMaps
.
size
());
i
+=
1
;
try
{
emqKeeper
.
getMqttClient
().
publish
(
stationId
+
"/fj/group
"
+
i
,
JSON
.
toJSONString
(
result
).
getBytes
(),
0
,
fals
e
);
emqKeeper
.
getMqttClient
().
publish
(
stationId
+
"/fj/group
1"
+
i
,
JSON
.
toJSONString
(
result
).
getBytes
(),
1
,
tru
e
);
}
catch
(
MqttException
e
)
{
log
.
info
(
"消息发送失败"
);
e
.
printStackTrace
();
...
...
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