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
ade18623
Commit
ade18623
authored
Oct 12, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
8e86c1fc
0ba5b730
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
186 additions
and
147 deletions
+186
-147
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+3
-1
AlarmKafkaConsumer.java
...os/boot/module/jxiop/biz/consumer/AlarmKafkaConsumer.java
+1
-1
AlarmEvent.java
...yeejoin/amos/boot/module/jxiop/biz/entity/AlarmEvent.java
+3
-0
EquipAlarmEvent.java
...in/amos/boot/module/jxiop/biz/entity/EquipAlarmEvent.java
+3
-0
EquipmentSpecificIndex.java
.../boot/module/jxiop/biz/entity/EquipmentSpecificIndex.java
+84
-0
EquipmentSpecificIndexMapper.java
...odule/jxiop/biz/mapper2/EquipmentSpecificIndexMapper.java
+8
-0
AlarmEventServiceImpl.java
.../module/jxiop/biz/service/impl/AlarmEventServiceImpl.java
+55
-21
EquipAlarmEventServiceImpl.java
...le/jxiop/biz/service/impl/EquipAlarmEventServiceImpl.java
+22
-15
application-dev.properties
...op-warn-biz/src/main/resources/application-dev.properties
+1
-1
application.properties
...-jxiop-warn-biz/src/main/resources/application.properties
+1
-1
AlarmEventMapper.xml
...iz/src/main/resources/mapper/cluster/AlarmEventMapper.xml
+0
-53
EquipAlarmEventMapper.xml
...c/main/resources/mapper/cluster/EquipAlarmEventMapper.xml
+0
-54
EquipmentSpecificIndexMapper.xml
...resources/mapper/cluster/EquipmentSpecificIndexMapper.xml
+5
-0
No files found.
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 @
ade18623
...
@@ -1907,7 +1907,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -1907,7 +1907,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
}
}
}
List
<
Map
<
String
,
String
>>
maps
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
maps
=
new
ArrayList
<>();
Set
<
String
>
nums
=
new
HashSe
t
<>();
List
<
String
>
nums
=
new
ArrayLis
t
<>();
//此处组装数据 每一个Map代表一个逆变器
//此处组装数据 每一个Map代表一个逆变器
for
(
ESEquipments
esEquipments
:
listData1
)
{
for
(
ESEquipments
esEquipments
:
listData1
)
{
int
num
=
Integer
.
parseInt
(
esEquipments
.
getEquipmentNumber
().
substring
(
0
,
2
));
int
num
=
Integer
.
parseInt
(
esEquipments
.
getEquipmentNumber
().
substring
(
0
,
2
));
...
@@ -1945,6 +1945,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -1945,6 +1945,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
});
});
}
}
statusMaps
.
sort
(
Comparator
.
comparingInt
(
o
->
Integer
.
parseInt
(
o
.
get
(
"titie"
).
toString
())));
IPage
<
Map
<
String
,
String
>>
result
=
new
Page
<>();
IPage
<
Map
<
String
,
String
>>
result
=
new
Page
<>();
result
.
setRecords
(
statusMaps
);
result
.
setRecords
(
statusMaps
);
result
.
setCurrent
(
1
);
result
.
setCurrent
(
1
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/consumer/AlarmKafkaConsumer.java
View file @
ade18623
...
@@ -23,7 +23,7 @@ public class AlarmKafkaConsumer {
...
@@ -23,7 +23,7 @@ public class AlarmKafkaConsumer {
AlarmEventServiceImpl
alarmEventServiceImpl
;
AlarmEventServiceImpl
alarmEventServiceImpl
;
// 消费者来处理消息
// 消费者来处理消息
//
@KafkaListener(id="user1" , topics ={"${kafka.alarm.topic}"},groupId = "messageConsumerGroup")
@KafkaListener
(
id
=
"user1"
,
topics
={
"${kafka.alarm.topic}"
},
groupId
=
"messageConsumerGroup"
)
public
void
message1
(
List
<
ConsumerRecord
<
String
,
String
>>
consumerRecords
,
Acknowledgment
ack
){
public
void
message1
(
List
<
ConsumerRecord
<
String
,
String
>>
consumerRecords
,
Acknowledgment
ack
){
// 异步触发预警
// 异步触发预警
alarmEventServiceImpl
.
handleMessage
(
consumerRecords
);
alarmEventServiceImpl
.
handleMessage
(
consumerRecords
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/AlarmEvent.java
View file @
ade18623
...
@@ -32,4 +32,7 @@ public class AlarmEvent {
...
@@ -32,4 +32,7 @@ public class AlarmEvent {
@TableField
(
"value"
)
@TableField
(
"value"
)
private
String
value
;
private
String
value
;
@TableField
(
exist
=
false
)
private
String
time
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/EquipAlarmEvent.java
View file @
ade18623
...
@@ -44,4 +44,7 @@ public class EquipAlarmEvent {
...
@@ -44,4 +44,7 @@ public class EquipAlarmEvent {
@TableField
(
"value"
)
@TableField
(
"value"
)
private
String
value
;
private
String
value
;
@TableField
(
exist
=
false
)
private
String
time
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/EquipmentSpecificIndex.java
0 → 100644
View file @
ade18623
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
entity
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
@Data
@Accessors
(
chain
=
true
)
@TableName
(
"wl_equipment_specific_index"
)
public
class
EquipmentSpecificIndex
{
@TableField
(
"id"
)
private
Long
id
;
@TableField
(
"equipment_specific_id"
)
private
Long
address
;
@TableField
(
"value"
)
private
String
value
;
@TableField
(
"create_date"
)
private
Date
createDate
;
@TableField
(
"equipment_index_id"
)
private
Long
equipmentIndexId
;
@TableField
(
"update_date"
)
private
Date
updateDate
;
@TableField
(
"equipment_specific_name"
)
private
String
equipmentSpecificName
;
@TableField
(
"equipment_index_name"
)
private
String
equipmentIndexName
;
@TableField
(
"equipment_index_key"
)
private
String
equipmentIndexKey
;
@TableField
(
"value_label"
)
private
String
valueLabel
;
@TableField
(
"value_enum"
)
private
String
valueEnum
;
@TableField
(
"emergency_level_color"
)
private
String
emergencyLevelColor
;
@TableField
(
"is_alarm"
)
private
boolean
isAlarm
;
@TableField
(
"emergency_level"
)
private
String
emergencyLevel
;
@TableField
(
"emergency_level_describe"
)
private
String
emergencyLevelDescribe
;
@TableField
(
"trace_id"
)
private
String
traceId
;
@TableField
(
"index_address"
)
private
String
indexAddress
;
@TableField
(
"station"
)
private
String
station
;
@TableField
(
"quality"
)
private
boolean
quality
;
@TableField
(
"data_type"
)
private
String
dataType
;
@TableField
(
"time_stamp"
)
private
String
timeStamp
;
@TableField
(
"gateway_id"
)
private
String
gatewayId
;
@TableField
(
"unit"
)
private
String
unit
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/EquipmentSpecificIndexMapper.java
0 → 100644
View file @
ade18623
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
mapper2
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipmentSpecificIndex
;
public
interface
EquipmentSpecificIndexMapper
extends
BaseMapper
<
EquipmentSpecificIndex
>{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/AlarmEventServiceImpl.java
View file @
ade18623
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.kafka.clients.consumer.ConsumerRecord
;
import
org.apache.kafka.clients.consumer.ConsumerRecord
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.AlarmEventDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.AlarmEventDto
;
...
@@ -19,6 +24,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.DataGridMock;
...
@@ -19,6 +24,8 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.DataGridMock;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.AlarmEvent
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.AlarmEvent
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipAlarmEvent
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipAlarmEvent
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipmentSpecificIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.EquipmentSpecificIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.AlarmEventMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.AlarmEventMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.EquipAlarmEventMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.EquipAlarmEventMapper
;
...
@@ -27,7 +34,11 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
...
@@ -27,7 +34,11 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
@Autowired
@Autowired
private
EquipAlarmEventMapper
equipAlarmEventMapper
;
private
EquipAlarmEventMapper
equipAlarmEventMapper
;
@Autowired
private
EquipmentSpecificIndexMapper
equipmentSpecificIndexMapper
;
@Async
(
"jxiopAsyncExecutor"
)
public
void
handleMessage
(
List
<
ConsumerRecord
<
String
,
String
>>
record
)
{
public
void
handleMessage
(
List
<
ConsumerRecord
<
String
,
String
>>
record
)
{
List
<
AlarmEvent
>
alarmEvents
=
new
ArrayList
<>();
List
<
AlarmEvent
>
alarmEvents
=
new
ArrayList
<>();
List
<
EquipAlarmEvent
>
equipAlarmEvents
=
new
ArrayList
<>();
List
<
EquipAlarmEvent
>
equipAlarmEvents
=
new
ArrayList
<>();
...
@@ -37,7 +48,7 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
...
@@ -37,7 +48,7 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
String
indexName
=
obj
.
getString
(
"equipmentIndexName"
);
String
indexName
=
obj
.
getString
(
"equipmentIndexName"
);
String
gatewayId
=
obj
.
getString
(
"gatewayId"
);
String
gatewayId
=
obj
.
getString
(
"gatewayId"
);
String
value
=
obj
.
getString
(
"value"
);
String
value
=
obj
.
getString
(
"value"
);
String
valueLabel
=
obj
.
getString
(
"valueLabel"
);
String
valueLabel
=
obj
.
getString
(
"valueLabel"
);
if
(
"升压站"
.
equals
(
objName
))
{
if
(
"升压站"
.
equals
(
objName
))
{
AlarmEvent
alarmEvent
=
new
AlarmEvent
();
AlarmEvent
alarmEvent
=
new
AlarmEvent
();
alarmEvent
.
setEventDesc
(
indexName
);
alarmEvent
.
setEventDesc
(
indexName
);
...
@@ -49,25 +60,46 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
...
@@ -49,25 +60,46 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
alarmEvents
.
add
(
alarmEvent
);
alarmEvents
.
add
(
alarmEvent
);
}
else
{
}
else
{
EquipAlarmEvent
equipAlarmEvent
=
new
EquipAlarmEvent
();
EquipAlarmEvent
equipAlarmEvent
=
new
EquipAlarmEvent
();
//equipAlarmEvent.setEquipIndex(value);
if
(
indexName
.
contains
(
"实时故障"
)
&&
objName
.
contains
(
"风机"
))
{
equipAlarmEvent
.
setEquipName
(
objName
);
LambdaQueryWrapper
<
EquipmentSpecificIndex
>
wrapper
=
new
LambdaQueryWrapper
<>();
equipAlarmEvent
.
setEventDesc
(
indexName
);
wrapper
.
eq
(
EquipmentSpecificIndex:
:
getEquipmentSpecificName
,
objName
);
//equipAlarmEvent.setFrontModule(value);
EquipmentSpecificIndex
equipmentSpecificIndex
=
equipmentSpecificIndexMapper
.
selectOne
(
wrapper
);
equipAlarmEvent
.
setGatewayId
(
gatewayId
);
String
valueEnum
=
equipmentSpecificIndex
.
getValueEnum
();
equipAlarmEvent
.
setValue
(
value
);
JSONArray
arr
=
JSONObject
.
parseArray
(
valueEnum
);
equipAlarmEvents
.
add
(
equipAlarmEvent
);
for
(
Object
o:
arr
)
{
JSONObject
json
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
));
if
(
json
.
containsKey
(
value
))
{
String
warn
=
json
.
getString
(
value
);
if
(
warn
.
indexOf
(
"备留"
)
==
-
1
)
{
equipAlarmEvent
.
setEquipName
(
objName
);
equipAlarmEvent
.
setEventDesc
(
indexName
);
equipAlarmEvent
.
setGatewayId
(
gatewayId
);
equipAlarmEvent
.
setValue
(
warn
);
equipAlarmEvents
.
add
(
equipAlarmEvent
);
}
}
}
}
else
{
// equipAlarmEvent.setEquipIndex(value);
equipAlarmEvent
.
setEquipName
(
objName
);
equipAlarmEvent
.
setEventDesc
(
indexName
);
// equipAlarmEvent.setFrontModule(value);
equipAlarmEvent
.
setGatewayId
(
gatewayId
);
equipAlarmEvent
.
setValue
(
value
);
equipAlarmEvents
.
add
(
equipAlarmEvent
);
}
}
}
}
}
if
(
alarmEvents
.
size
()>
0
)
if
(
alarmEvents
.
size
()
>
0
)
{
{
this
.
baseMapper
.
save
(
alarmEvents
);
this
.
baseMapper
.
save
(
alarmEvents
);
}
}
if
(
equipAlarmEvents
.
size
()>
0
)
if
(
equipAlarmEvents
.
size
()
>
0
)
{
{
this
.
equipAlarmEventMapper
.
save
(
equipAlarmEvents
);
this
.
equipAlarmEventMapper
.
save
(
equipAlarmEvents
);
}
}
// System.out.println(record);
// System.out.println(record);
}
}
...
@@ -76,6 +108,8 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
...
@@ -76,6 +108,8 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
2
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
2
);
List
<
AlarmEvent
>
alarmEventList
=
this
.
baseMapper
.
getEventList
(
gatewayId
,
calendar
.
getTime
());
List
<
AlarmEvent
>
alarmEventList
=
this
.
baseMapper
.
getEventList
(
gatewayId
,
calendar
.
getTime
());
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
alarmEventList
.
forEach
(
i
->
{
alarmEventList
.
forEach
(
i
->
{
if
(
"true"
.
equals
(
i
.
getValue
()))
{
if
(
"true"
.
equals
(
i
.
getValue
()))
{
i
.
setValue
(
"合"
);
i
.
setValue
(
"合"
);
...
@@ -83,19 +117,19 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
...
@@ -83,19 +117,19 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
i
.
setValue
(
"分"
);
i
.
setValue
(
"分"
);
}
}
i
.
setStationName
(
"升压站"
);
i
.
setStationName
(
"升压站"
);
i
.
setTime
(
sdf
.
format
(
new
Date
(
i
.
getCreatedTime
())));
});
});
PageInfo
<
EquipAlarmEvent
>
page
=
new
PageInfo
(
alarmEventList
);
PageInfo
<
EquipAlarmEvent
>
page
=
new
PageInfo
(
alarmEventList
);
// 构建平台数据
// 构建平台数据
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
(
int
)
page
.
getTotal
(),
false
,
current
,
alarmEventList
);
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
(
int
)
page
.
getTotal
(),
false
,
current
,
alarmEventList
);
ColModel
colModelStationName
=
new
ColModel
(
"stationName"
,
"stationName"
,
"名称"
,
"名称"
,
"dataGrid"
,
ColModel
colModelStationName
=
new
ColModel
(
"stationName"
,
"stationName"
,
"名称"
,
"名称"
,
"dataGrid"
,
"stationName"
);
"stationName"
);
ColModel
colModelEventDesc
=
new
ColModel
(
"eventDesc"
,
"eventDesc"
,
"事件描述"
,
"事件描述"
,
"dataGrid"
,
"eventDesc"
);
ColModel
colModelEventDesc
=
new
ColModel
(
"eventDesc"
,
"eventDesc"
,
"事件描述"
,
"事件描述"
,
"dataGrid"
,
"eventDesc"
);
ColModel
colModelAlarmGroupName
=
new
ColModel
(
"alarmGroupName"
,
"alarmGroupName"
,
"事件告警组"
,
"事件告警组"
,
"dataGrid"
,
ColModel
colModelAlarmGroupName
=
new
ColModel
(
"alarmGroupName"
,
"alarmGroupName"
,
"事件告警组"
,
"事件告警组"
,
"dataGrid"
,
"alarmGroupName"
);
"alarmGroupName"
);
ColModel
colModelEventTime
=
new
ColModel
(
"createdTime"
,
"createdTime"
,
"事件发生时间"
,
"事件发生时间"
,
"dataGrid"
,
ColModel
colModelEventTime
=
new
ColModel
(
"time"
,
"time"
,
"事件发生时间"
,
"事件发生时间"
,
"dataGrid"
,
"createdTime"
);
"time"
);
ColModel
colModelEventMovement
=
new
ColModel
(
"value"
,
"value"
,
"事件值"
,
"事件值"
,
"dataGrid"
,
ColModel
colModelEventMovement
=
new
ColModel
(
"value"
,
"value"
,
"事件值"
,
"事件值"
,
"dataGrid"
,
"value"
);
"value"
);
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelStationName
,
colModelEventDesc
,
colModelAlarmGroupName
,
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelStationName
,
colModelEventDesc
,
colModelAlarmGroupName
,
colModelEventTime
,
colModelEventMovement
);
colModelEventTime
,
colModelEventMovement
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/EquipAlarmEventServiceImpl.java
View file @
ade18623
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
java.text.SimpleDateFormat
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -32,30 +34,35 @@ public class EquipAlarmEventServiceImpl
...
@@ -32,30 +34,35 @@ public class EquipAlarmEventServiceImpl
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
2
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
2
);
String
equipName
=
null
;
String
equipName
=
null
;
if
(
"箱变"
.
equals
(
frontModule
))
{
if
(
equipIndex
!=
null
&&
frontModule
!=
null
)
{
equipName
=
equipIndex
+
"子阵/箱变"
;
if
(
"箱变"
.
equals
(
frontModule
))
{
}
else
if
(
"逆变器"
.
equals
(
frontModule
))
{
equipName
=
equipIndex
+
"子阵/箱变"
;
String
[]
s
=
equipIndex
.
split
(
"-"
);
}
else
if
(
"逆变器"
.
equals
(
frontModule
))
{
equipName
=
s
[
0
]
+
"子阵/逆变器"
+
s
[
1
];
String
[]
s
=
equipIndex
.
split
(
"-"
);
}
else
if
(
"汇流箱"
.
equals
(
frontModule
))
{
equipName
=
s
[
0
]
+
"子阵/逆变器"
+
s
[
1
];
String
[]
s
=
equipIndex
.
split
(
"-"
);
}
else
if
(
"汇流箱"
.
equals
(
frontModule
))
{
if
(
"0"
.
equals
(
s
[
2
].
indexOf
(
0
)))
{
String
[]
s
=
equipIndex
.
split
(
"-"
);
s
[
2
]
=
s
[
2
].
substring
(
1
);
if
(
"0"
.
equals
(
s
[
2
].
indexOf
(
0
)))
{
s
[
2
]
=
s
[
2
].
substring
(
1
);
}
equipName
=
s
[
0
]
+
"子阵/逆变器"
+
s
[
1
]
+
"/#"
+
s
[
2
]
+
"汇流箱"
;
}
else
if
(
"风机"
.
equals
(
frontModule
))
{
equipName
=
equipIndex
+
"风机"
;
}
}
equipName
=
s
[
0
]
+
"子阵/逆变器"
+
s
[
1
]
+
"/#"
+
s
[
2
]
+
"汇流箱"
;
equipName
=
'%'
+
equipName
+
'%'
;
}
else
if
(
"风机"
.
equals
(
frontModule
))
{
equipName
=
equipIndex
+
"风机"
;
}
}
equipName
=
'%'
+
equipName
+
'%'
;
List
<
EquipAlarmEvent
>
alarmEventList
=
this
.
baseMapper
.
getEventList
(
gatewayId
,
equipName
,
null
,
List
<
EquipAlarmEvent
>
alarmEventList
=
this
.
baseMapper
.
getEventList
(
gatewayId
,
equipName
,
null
,
calendar
.
getTime
());
calendar
.
getTime
());
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
alarmEventList
.
forEach
(
i
->
{
alarmEventList
.
forEach
(
i
->
{
if
(
"true"
.
equals
(
i
.
getValue
()))
{
if
(
"true"
.
equals
(
i
.
getValue
()))
{
i
.
setValue
(
"合"
);
i
.
setValue
(
"合"
);
}
else
if
(
"false"
.
equals
(
i
.
getValue
()))
{
}
else
if
(
"false"
.
equals
(
i
.
getValue
()))
{
i
.
setValue
(
"分"
);
i
.
setValue
(
"分"
);
}
}
i
.
setTime
(
sdf
.
format
(
new
Date
(
i
.
getCreatedTime
())));
});
});
PageInfo
<
EquipAlarmEvent
>
page
=
new
PageInfo
(
alarmEventList
);
PageInfo
<
EquipAlarmEvent
>
page
=
new
PageInfo
(
alarmEventList
);
...
@@ -65,8 +72,8 @@ public class EquipAlarmEventServiceImpl
...
@@ -65,8 +72,8 @@ public class EquipAlarmEventServiceImpl
ColModel
colModelEventMovement
=
new
ColModel
(
"equipName"
,
"equipName"
,
"设备名称"
,
"设备名称"
,
"dataGrid"
,
ColModel
colModelEventMovement
=
new
ColModel
(
"equipName"
,
"equipName"
,
"设备名称"
,
"设备名称"
,
"dataGrid"
,
"equipName"
);
"equipName"
);
ColModel
colModelStationName
=
new
ColModel
(
"eventDesc"
,
"eventDesc"
,
"事件描述"
,
"事件描述"
,
"dataGrid"
,
"eventDesc"
);
ColModel
colModelStationName
=
new
ColModel
(
"eventDesc"
,
"eventDesc"
,
"事件描述"
,
"事件描述"
,
"dataGrid"
,
"eventDesc"
);
ColModel
colModelEventDesc
=
new
ColModel
(
"
createdTime"
,
"createdT
ime"
,
"事件发生时间"
,
"事件发生时间"
,
"dataGrid"
,
ColModel
colModelEventDesc
=
new
ColModel
(
"
time"
,
"t
ime"
,
"事件发生时间"
,
"事件发生时间"
,
"dataGrid"
,
"
createdT
ime"
);
"
t
ime"
);
ColModel
colModelValueDesc
=
new
ColModel
(
"value"
,
"value"
,
"事件值"
,
"事件值"
,
"dataGrid"
,
"value"
);
ColModel
colModelValueDesc
=
new
ColModel
(
"value"
,
"value"
,
"事件值"
,
"事件值"
,
"dataGrid"
,
"value"
);
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEventMovement
,
colModelStationName
,
colModelEventDesc
,
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEventMovement
,
colModelStationName
,
colModelEventDesc
,
colModelValueDesc
);
colModelValueDesc
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/resources/application-dev.properties
View file @
ade18623
...
@@ -7,7 +7,7 @@ spring.db1.datasource.password=Yeejoin@2020
...
@@ -7,7 +7,7 @@ spring.db1.datasource.password=Yeejoin@2020
spring.db1.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
spring.db1.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
## db2-sync_data
## db2-sync_data
spring.db2.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url
=
jdbc:mysql://139.9.173.44:3306/
jxiop_sync_data
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.url
=
jdbc:mysql://139.9.173.44:3306/
equipment
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.username
=
root
spring.db2.datasource.username
=
root
spring.db2.datasource.password
=
Yeejoin@2020
spring.db2.datasource.password
=
Yeejoin@2020
spring.db2.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
spring.db2.datasource.driver-class-name
:
com.mysql.cj.jdbc.Driver
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/resources/application.properties
View file @
ade18623
spring.application.name
=
AMOS-JXIOP-WARN
spring.application.name
=
AMOS-JXIOP-WARN
server.servlet.context-path
=
/jxiop-warn
server.servlet.context-path
=
/jxiop-warn
server.port
=
33
4
00
server.port
=
33
5
00
server.uri-encoding
=
UTF-8
server.uri-encoding
=
UTF-8
spring.profiles.active
=
dev
spring.profiles.active
=
dev
spring.jackson.time-zone
=
GMT+8
spring.jackson.time-zone
=
GMT+8
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/resources/mapper/cluster/AlarmEventMapper.xml
deleted
100644 → 0
View file @
8e86c1fc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.mapper2.AlarmEventMapper"
>
<select
id=
"getAlarmEventList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.dto.AlarmEventDto"
>
select
station_name as stationName,
event_desc as eventDesc,
alarm_group_name as alarmGroupName,
event_time as eventTime,
(case event_movement
WHEN 'true' then '告警'
WHEN 'false' then '恢复'
ELSE event_movement end ) as eventMovement
from
fault_alarm_event
<where>
<if
test=
"gatewayId != null and gatewayId != ''"
>
gateway_id = #{gatewayId}
</if>
<if
test=
"stationId != null and stationId != ''"
>
station_id = #{stationId}
</if>
AND #{time}
<
= event_time
</where>
ORDER BY event_time DESC LIMIT #{current}, #{size}
</select>
<select
id=
"getLastDataBySort"
resultType=
"java.lang.String"
>
select
sort
from
fault_alarm_event
<where>
<if
test=
"gatewayId != null and gatewayId != ''"
>
gateway_id = #{gatewayId}
</if>
</where>
order by sort desc limit 1
</select>
<select
id=
"getOldAlarmsBySort"
resultType=
"java.lang.String"
>
select
event_desc
from
fault_alarm_event
where
gateway_id = #{gatewayId} and sort = #{sort}
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/resources/mapper/cluster/EquipAlarmEventMapper.xml
deleted
100644 → 0
View file @
8e86c1fc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.mapper2.EquipAlarmEventMapper"
>
<select
id=
"getAlarmEventList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.dto.EquipAlarmEventDto"
>
SELECT
*
FROM
equip_alarm_event a
JOIN ( SELECT sequence_nbr FROM equip_alarm_event
<where>
<if
test=
"gatewayId != null and gatewayId != ''"
>
AND gateway_id = #{gatewayId}
</if>
<if
test=
"equipIndex!= null and equipIndex != ''"
>
AND equip_index = #{equipIndex}
</if>
<if
test=
"frontModule!= null and frontModule != ''"
>
AND front_module = #{frontModule}
</if>
AND #{time}
<
= created_time
</where>
ORDER BY created_time DESC LIMIT #{current}, #{size} ) b ON a.sequence_nbr = b.sequence_nbr
</select>
<select
id=
"getLastDataBySort"
resultType=
"java.lang.String"
>
select
sort
from
equip_alarm_event
<where>
<if
test=
"gatewayId != null and gatewayId != ''"
>
gateway_id = #{gatewayId}
</if>
</where>
order by sort desc limit 1
</select>
<select
id=
"getOldDataBySort"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.EquipAlarmEvent"
>
select
*
from
equip_alarm_event
<where>
<if
test=
"sort != null and sort != ''"
>
sort = #{sort}
</if>
AND gateway_id = #{gatewayId}
</where>
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/resources/mapper/cluster/EquipmentSpecificIndexMapper.xml
0 → 100644
View file @
ade18623
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.mapper2.EquipmentSpecificIndexMapper"
>
</mapper>
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