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
a0260da6
Commit
a0260da6
authored
Jun 24, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:【装备】添加指标告警iot数据唯一标识traceId
parent
1f364474
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
10 deletions
+70
-10
EquipmentSpecificAlarm.java
...oin/equipmanage/common/entity/EquipmentSpecificAlarm.java
+3
-0
EquipmentSpecificAlarmLog.java
.../equipmanage/common/entity/EquipmentSpecificAlarmLog.java
+3
-0
EquipmentSpecificIndex.java
...oin/equipmanage/common/entity/EquipmentSpecificIndex.java
+3
-1
IotDataVO.java
...ain/java/com/yeejoin/equipmanage/common/vo/IotDataVO.java
+5
-0
ConfirmAlarmServiceImpl.java
...oin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
+1
-7
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+10
-2
changelog-master.xml
...m-equip/src/main/resources/changelog/changelog-master.xml
+2
-0
wl-3.6.0.xml
...ot-system-equip/src/main/resources/changelog/wl-3.6.0.xml
+43
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificAlarm.java
View file @
a0260da6
...
@@ -108,6 +108,9 @@ public class EquipmentSpecificAlarm extends BaseEntity {
...
@@ -108,6 +108,9 @@ public class EquipmentSpecificAlarm extends BaseEntity {
@TableField
(
"confirm_date"
)
@TableField
(
"confirm_date"
)
private
Date
confirmDate
;
private
Date
confirmDate
;
@ApiModelProperty
(
value
=
"iot数据上报唯一id"
)
private
String
traceId
;
@ApiModelProperty
(
value
=
"画布id"
)
@ApiModelProperty
(
value
=
"画布id"
)
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
Long
sceneId
;
private
Long
sceneId
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificAlarmLog.java
View file @
a0260da6
...
@@ -132,6 +132,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
...
@@ -132,6 +132,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField
(
"status"
)
@TableField
(
"status"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
value
=
"iot数据上报唯一id"
)
private
String
traceId
;
@ApiModelProperty
(
value
=
"画布id"
)
@ApiModelProperty
(
value
=
"画布id"
)
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
Long
sceneId
;
private
Long
sceneId
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/entity/EquipmentSpecificIndex.java
View file @
a0260da6
...
@@ -75,6 +75,9 @@ public class EquipmentSpecificIndex extends BaseEntity {
...
@@ -75,6 +75,9 @@ public class EquipmentSpecificIndex extends BaseEntity {
*/
*/
@TableField
(
value
=
"emergency_level_describe"
)
@TableField
(
value
=
"emergency_level_describe"
)
private
String
emergencyLevelDescribe
;
private
String
emergencyLevelDescribe
;
@ApiModelProperty
(
value
=
"iot数据上报唯一id"
)
private
String
traceId
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
nameKey
;
private
String
nameKey
;
...
@@ -143,5 +146,4 @@ public class EquipmentSpecificIndex extends BaseEntity {
...
@@ -143,5 +146,4 @@ public class EquipmentSpecificIndex extends BaseEntity {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
buildId
;
private
String
buildId
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/vo/IotDataVO.java
View file @
a0260da6
...
@@ -16,4 +16,9 @@ public class IotDataVO {
...
@@ -16,4 +16,9 @@ public class IotDataVO {
private
String
key
;
private
String
key
;
private
Object
value
;
private
Object
value
;
/**
* iot数据上报唯一id
*/
private
String
traceId
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/ConfirmAlarmServiceImpl.java
View file @
a0260da6
...
@@ -4,12 +4,9 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,12 +4,9 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.mchange.lang.DoubleUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.amos.feign.systemctl.model.MessageModel
;
import
com.yeejoin.equipmanage.common.dto.UserDto
;
import
com.yeejoin.equipmanage.common.dto.UserDto
;
import
com.yeejoin.equipmanage.common.entity.*
;
import
com.yeejoin.equipmanage.common.entity.*
;
...
@@ -26,7 +23,6 @@ import com.yeejoin.equipmanage.remote.WebMqttHandler;
...
@@ -26,7 +23,6 @@ import com.yeejoin.equipmanage.remote.WebMqttHandler;
import
com.yeejoin.equipmanage.service.*
;
import
com.yeejoin.equipmanage.service.*
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
...
@@ -37,10 +33,8 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
...
@@ -37,10 +33,8 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
ucar.ma2.ArrayDouble
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
ConfirmAlarmServiceImpl
extends
ServiceImpl
<
ConfirmAlarmMapper
,
EquipmentSpecificAlarm
>
implements
IConfirmAlarmService
{
public
class
ConfirmAlarmServiceImpl
extends
ServiceImpl
<
ConfirmAlarmMapper
,
EquipmentSpecificAlarm
>
implements
IConfirmAlarmService
{
...
@@ -184,7 +178,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
...
@@ -184,7 +178,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
set
(
EquipmentSpecific:
:
getRealtimeIotIndexUpdateDate
,
new
Date
()).
set
(
EquipmentSpecific:
:
getRealtimeIotIndexUpdateDate
,
new
Date
()).
eq
(
EquipmentSpecific:
:
getId
,
alarm
.
getEquipmentSpecificId
());
eq
(
EquipmentSpecific:
:
getId
,
alarm
.
getEquipmentSpecificId
());
equipmentSpecificSerivce
.
update
(
wrapper
);
equipmentSpecificSerivce
.
update
(
wrapper
);
MqttReceiveServiceImpl
.
upAlarmLogStatus
(
alarmLog
.
getIotCode
(),
alarmLog
.
getEquipmentSpecificIndexKey
(),
equipmentSpecificAlarmLogService
);
MqttReceiveServiceImpl
.
upAlarmLogStatus
(
alarmLog
.
getIotCode
(),
alarmLog
.
getEquipmentSpecificIndexKey
(),
null
,
equipmentSpecificAlarmLogService
);
}
}
// 如果是批量确警,先查询,再确警,用于批量消息推送
// 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch
=
ent
.
getIsBatch
();
isBatch
=
ent
.
getIsBatch
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
a0260da6
...
@@ -21,6 +21,7 @@ import org.springframework.transaction.support.TransactionSynchronization;
...
@@ -21,6 +21,7 @@ import org.springframework.transaction.support.TransactionSynchronization;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
...
@@ -288,7 +289,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -288,7 +289,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
EquipmentSpecificIndex
equipmentSpeIndex
=
new
EquipmentSpecificIndex
();
EquipmentSpecificIndex
equipmentSpeIndex
=
new
EquipmentSpecificIndex
();
BeanUtils
.
copyProperties
(
equipmentSpecificIndex
,
equipmentSpeIndex
);
BeanUtils
.
copyProperties
(
equipmentSpecificIndex
,
equipmentSpeIndex
);
String
value
=
iotDataVO
.
getValue
().
toString
();
String
value
=
iotDataVO
.
getValue
().
toString
();
String
traceId
=
iotDataVO
.
getTraceId
().
toString
();
equipmentSpeIndex
.
setValue
(
value
);
equipmentSpeIndex
.
setValue
(
value
);
equipmentSpeIndex
.
setTraceId
(
traceId
);
equipmentSpeIndex
.
setValueLabel
(
valueTranslate
(
value
,
equipmentSpecificIndex
.
getValueEnum
()));
equipmentSpeIndex
.
setValueLabel
(
valueTranslate
(
value
,
equipmentSpecificIndex
.
getValueEnum
()));
equipmentSpeIndex
.
setUpdateDate
(
new
Date
());
equipmentSpeIndex
.
setUpdateDate
(
new
Date
());
equipmentSpecificIndexService
.
updateById
(
equipmentSpeIndex
);
equipmentSpecificIndexService
.
updateById
(
equipmentSpeIndex
);
...
@@ -384,7 +387,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -384,7 +387,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
}
public
static
List
<
EquipmentSpecificAlarmLog
>
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
public
static
List
<
EquipmentSpecificAlarmLog
>
upAlarmLogStatus
(
String
iotCode
,
String
equipmentSpecificIndexKey
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
)
{
String
traceId
,
IEquipmentSpecificAlarmLogService
equipmentSpecificAlarmLogService
)
{
LambdaQueryWrapper
<
EquipmentSpecificAlarmLog
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
EquipmentSpecificAlarmLog
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getIotCode
,
iotCode
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getIotCode
,
iotCode
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
equipmentSpecificIndexKey
);
queryWrapper
.
eq
(
EquipmentSpecificAlarmLog:
:
getEquipmentSpecificIndexKey
,
equipmentSpecificIndexKey
);
...
@@ -394,6 +397,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -394,6 +397,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
logs
.
forEach
(
x
->
{
logs
.
forEach
(
x
->
{
x
.
setCleanTime
(
new
Date
());
x
.
setCleanTime
(
new
Date
());
x
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
x
.
setStatus
(
AlarmStatusEnum
.
HF
.
getCode
());
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
x
.
setTraceId
(
traceId
);
}
});
});
if
(!
logs
.
isEmpty
())
{
if
(!
logs
.
isEmpty
())
{
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
equipmentSpecificAlarmLogService
.
updateBatchById
(
logs
);
...
@@ -590,6 +596,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -590,6 +596,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
action
.
setFrequency
((
action
.
getFrequency
()
+
1
));
action
.
setFrequency
((
action
.
getFrequency
()
+
1
));
}
}
// 更新所在系统,设备可能编辑过
// 更新所在系统,设备可能编辑过
action
.
setTraceId
(
equipmentSpecificIndex
.
getTraceId
());
action
.
setSystemIds
(
equipmentSpecificIndex
.
getSystemId
());
action
.
setSystemIds
(
equipmentSpecificIndex
.
getSystemId
());
action
.
setSystemCodes
(
this
.
getSystemCodeBySpeId
(
equipmentSpecificIndex
.
getSystemId
()));
action
.
setSystemCodes
(
this
.
getSystemCodeBySpeId
(
equipmentSpecificIndex
.
getSystemId
()));
action
.
setUpdateDate
(
new
Date
());
action
.
setUpdateDate
(
new
Date
());
...
@@ -738,7 +745,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -738,7 +745,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
}
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQDQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
}
else
{
}
else
{
equipmentAlarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
equipmentAlarmLogs
.
addAll
(
upAlarmLogStatus
(
action
.
getIotCode
(),
action
.
getEquipmentSpecificIndexKey
(),
action
.
getTraceId
(),
equipmentSpecificAlarmLogService
));
equipmentSpecificAlarmLogService
));
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
mqttSendGateway
.
sendToMqtt
(
TopicEnum
.
EQYQR
.
getTopic
(),
JSONArray
.
toJSON
(
action
).
toString
());
bool
=
Boolean
.
TRUE
;
bool
=
Boolean
.
TRUE
;
...
@@ -890,6 +897,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -890,6 +897,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
}
action
.
setUpdateDate
(
new
Date
());
action
.
setUpdateDate
(
new
Date
());
// 更新所在系统,设备可能编辑过,更新所在系统、装备名称、装备定义code
// 更新所在系统,设备可能编辑过,更新所在系统、装备名称、装备定义code
action
.
setTraceId
(
equipmentSpcIndex
.
getTraceId
());
action
.
setSystemIds
(
equipmentSpcIndex
.
getSystemId
());
action
.
setSystemIds
(
equipmentSpcIndex
.
getSystemId
());
action
.
setSystemCodes
(
this
.
getSystemCodeBySpeId
(
equipmentSpcIndex
.
getSystemId
()));
action
.
setSystemCodes
(
this
.
getSystemCodeBySpeId
(
equipmentSpcIndex
.
getSystemId
()));
action
.
setEquipmentSpecificName
(
equipmentSpcIndex
.
getEquipmentSpecificName
());
action
.
setEquipmentSpecificName
(
equipmentSpcIndex
.
getEquipmentSpecificName
());
...
...
amos-boot-system-equip/src/main/resources/changelog/changelog-master.xml
View file @
a0260da6
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
<include
file=
"wl-3.0.1.xml"
relativeToChangelogFile=
"true"
/>
<include
file=
"wl-3.0.1.xml"
relativeToChangelogFile=
"true"
/>
<include
file=
"wl-3.6.0.xml"
relativeToChangelogFile=
"true"
/>
<!--全量包含视图和函数-->
<!--全量包含视图和函数-->
<include
file=
"sql-task-all.xml"
relativeToChangelogFile=
"true"
/>
<include
file=
"sql-task-all.xml"
relativeToChangelogFile=
"true"
/>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
amos-boot-system-equip/src/main/resources/changelog/wl-3.6.0.xml
0 → 100644
View file @
a0260da6
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
<changeSet
author=
"gaojianqiang"
id=
"20220624-1732-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_equipment_specific_index"
columnName=
"trace_id"
/>
</not>
</preConditions>
<comment>
新增属性字段 trace_id
</comment>
<sql>
alter table `wl_equipment_specific_index` add column `trace_id` varchar(64) DEFAULT NULL COMMENT 'iot数据上报唯一id';
</sql>
</changeSet>
<changeSet
author=
"gaojianqiang"
id=
"20220624-1732-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_equipment_specific_alarm"
columnName=
"trace_id"
/>
</not>
</preConditions>
<comment>
新增属性字段 trace_id
</comment>
<sql>
alter table `wl_equipment_specific_alarm` add column `trace_id` varchar(64) DEFAULT NULL COMMENT 'iot数据上报唯一id';
</sql>
</changeSet>
<changeSet
author=
"gaojianqiang"
id=
"20220624-1732-3"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"wl_equipment_specific_alarm_log"
columnName=
"trace_id"
/>
</not>
</preConditions>
<comment>
新增属性字段 trace_id
</comment>
<sql>
alter table `wl_equipment_specific_alarm_log` add column `trace_id` varchar(64) DEFAULT NULL COMMENT 'iot数据上报唯一id';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
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