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
7c0f50b3
Commit
7c0f50b3
authored
Nov 07, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预警存入 td相关
parent
9f7d2709
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
180 additions
and
7 deletions
+180
-7
WarningRecordStatusMessage.java
...oot/module/jxiop/biz/emqx/WarningRecordStatusMessage.java
+34
-3
FanWarningRecordServiceImpl.java
...e/jxiop/biz/service/impl/FanWarningRecordServiceImpl.java
+10
-0
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+0
-0
PvWarningRecordServiceImpl.java
...le/jxiop/biz/service/impl/PvWarningRecordServiceImpl.java
+10
-0
FanWaringRecordMapper.java
...oot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
+6
-0
PvWaringRecordMapper.java
...boot/module/jxiop/biz/tdMapper2/PvWaringRecordMapper.java
+4
-0
FanWarningRecord.java
...amos/boot/module/jxiop/biz/tdengine/FanWarningRecord.java
+5
-2
PvWarningRecord.java
.../amos/boot/module/jxiop/biz/tdengine/PvWarningRecord.java
+4
-2
FanWarningRecord.xml
.../src/main/resources/mapper/tdengine2/FanWarningRecord.xml
+54
-0
PvWarningRecord.xml
...z/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
+53
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/emqx/WarningRecordStatusMessage.java
View file @
7c0f50b3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
emqx
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
emqx
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -7,9 +8,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...
@@ -7,9 +8,11 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HealthStatusIndicatorServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -45,6 +48,18 @@ public class WarningRecordStatusMessage extends EmqxListener {
...
@@ -45,6 +48,18 @@ public class WarningRecordStatusMessage extends EmqxListener {
@Autowired
@Autowired
private
IdxBizPvWarningRecordServiceImpl
idxBizPvWarningRecordService
;
private
IdxBizPvWarningRecordServiceImpl
idxBizPvWarningRecordService
;
@Autowired
private
FanWaringRecordMapper
fanWaringRecordMapper
;
@Autowired
private
PvWaringRecordMapper
pvWaringRecordMapper
;
@Autowired
FanWarningRecordServiceImpl
fanWarningRecordService
;
@Autowired
PvWarningRecordServiceImpl
pvWarningRecordService
;
@PostConstruct
@PostConstruct
void
init
()
throws
Exception
{
void
init
()
throws
Exception
{
new
Thread
(
taskRunnable
).
start
();
new
Thread
(
taskRunnable
).
start
();
...
@@ -96,6 +111,13 @@ public class WarningRecordStatusMessage extends EmqxListener {
...
@@ -96,6 +111,13 @@ public class WarningRecordStatusMessage extends EmqxListener {
lambda
.
in
(
IdxBizFanWarningRecord:
:
getSequenceNbr
,
traceIds
);
lambda
.
in
(
IdxBizFanWarningRecord:
:
getSequenceNbr
,
traceIds
);
idxBizFanWarningRecordService
.
update
(
lambda
);
idxBizFanWarningRecordService
.
update
(
lambda
);
LambdaUpdateWrapper
<
FanWarningRecord
>
lambdaTd
=
new
LambdaUpdateWrapper
<>();
lambdaTd
.
set
(
FanWarningRecord:
:
getDisposotionState
,
"已处置"
);
lambdaTd
.
set
(
FanWarningRecord:
:
getStatus
,
"1"
);
lambdaTd
.
set
(
FanWarningRecord:
:
getDisposotionDate
,
DateUtil
.
now
());
lambdaTd
.
in
(
FanWarningRecord:
:
getTs
,
traceIds
);
fanWarningRecordService
.
update
(
lambdaTd
);
}
}
public
void
jxIopUpdatePv
(
JSONArray
analysisResult
)
{
public
void
jxIopUpdatePv
(
JSONArray
analysisResult
)
{
...
@@ -108,5 +130,14 @@ public class WarningRecordStatusMessage extends EmqxListener {
...
@@ -108,5 +130,14 @@ public class WarningRecordStatusMessage extends EmqxListener {
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionDate
,
new
Date
());
lambda
.
set
(
IdxBizPvWarningRecord:
:
getDisposotionDate
,
new
Date
());
lambda
.
in
(
IdxBizPvWarningRecord:
:
getSequenceNbr
,
traceIds
);
lambda
.
in
(
IdxBizPvWarningRecord:
:
getSequenceNbr
,
traceIds
);
idxBizPvWarningRecordService
.
update
(
lambda
);
idxBizPvWarningRecordService
.
update
(
lambda
);
// td
LambdaUpdateWrapper
<
PvWarningRecord
>
lambdaTd
=
new
LambdaUpdateWrapper
<>();
lambdaTd
.
set
(
PvWarningRecord:
:
getDisposotionState
,
"已处置"
);
lambdaTd
.
set
(
PvWarningRecord:
:
getStatus
,
"1"
);
lambdaTd
.
set
(
PvWarningRecord:
:
getDisposotionDate
,
DateUtil
.
now
());
lambdaTd
.
in
(
PvWarningRecord:
:
getTs
,
traceIds
);
pvWarningRecordService
.
update
(
lambdaTd
);
}
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/FanWarningRecordServiceImpl.java
0 → 100644
View file @
7c0f50b3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
@Service
public
class
FanWarningRecordServiceImpl
extends
BaseService
<
FanWarningRecord
,
FanWarningRecord
,
FanWaringRecordMapper
>
{
}
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 @
7c0f50b3
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PvWarningRecordServiceImpl.java
0 → 100644
View file @
7c0f50b3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
@Service
public
class
PvWarningRecordServiceImpl
extends
BaseService
<
PvWarningRecord
,
PvWarningRecord
,
PvWaringRecordMapper
>
{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
View file @
7c0f50b3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
tdMapper2
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
tdMapper2
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.List
;
...
@@ -10,4 +14,6 @@ import java.util.Map;
...
@@ -10,4 +14,6 @@ import java.util.Map;
public
interface
FanWaringRecordMapper
extends
BaseMapper
<
FanWarningRecord
>
{
public
interface
FanWaringRecordMapper
extends
BaseMapper
<
FanWarningRecord
>
{
public
List
<
Map
<
String
,
Object
>>
selectFanWarningNum
(
String
station
);
public
List
<
Map
<
String
,
Object
>>
selectFanWarningNum
(
String
station
);
int
saveBatchWarningRecords
(
@Param
(
"list"
)
List
<
FanWarningRecord
>
list
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/PvWaringRecordMapper.java
View file @
7c0f50b3
...
@@ -3,7 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
...
@@ -3,7 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
PvWaringRecordMapper
extends
BaseMapper
<
PvWarningRecord
>
{
public
interface
PvWaringRecordMapper
extends
BaseMapper
<
PvWarningRecord
>
{
int
saveBatchWarningRecords
(
@Param
(
"list"
)
List
<
PvWarningRecord
>
list
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdengine/FanWarningRecord.java
View file @
7c0f50b3
...
@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdengine;
...
@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdengine;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@Data
@TableName
(
value
=
""
,
autoResultMap
=
true
)
@TableName
(
value
=
"
fan_warning_record
"
,
autoResultMap
=
true
)
public
class
FanWarningRecord
{
public
class
FanWarningRecord
implements
Serializable
{
private
Long
ts
;
private
Long
ts
;
private
String
recDate
;
private
String
recDate
;
private
String
disposotionState
;
private
String
disposotionState
;
...
@@ -25,4 +27,5 @@ public class FanWarningRecord {
...
@@ -25,4 +27,5 @@ public class FanWarningRecord {
private
String
disposotionDate
;
private
String
disposotionDate
;
private
String
kks
;
private
String
kks
;
private
String
warningPeriod
;
private
String
warningPeriod
;
private
String
status
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdengine/PvWarningRecord.java
View file @
7c0f50b3
...
@@ -4,10 +4,11 @@ import com.baomidou.mybatisplus.annotation.TableField;
...
@@ -4,10 +4,11 @@ import com.baomidou.mybatisplus.annotation.TableField;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
@Data
@Data
@TableName
(
value
=
""
,
autoResultMap
=
true
)
@TableName
(
value
=
"
pv_warning_record
"
,
autoResultMap
=
true
)
public
class
PvWarningRecord
{
public
class
PvWarningRecord
implements
Serializable
{
private
Long
ts
;
private
Long
ts
;
private
String
recDate
;
private
String
recDate
;
private
String
disposotionState
;
private
String
disposotionState
;
...
@@ -28,4 +29,5 @@ public class PvWarningRecord {
...
@@ -28,4 +29,5 @@ public class PvWarningRecord {
private
String
disposotionDate
;
private
String
disposotionDate
;
private
String
kks
;
private
String
kks
;
private
String
warningPeriod
;
private
String
warningPeriod
;
private
String
status
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanWarningRecord.xml
View file @
7c0f50b3
...
@@ -2,6 +2,60 @@
...
@@ -2,6 +2,60 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!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.tdMapper2.FanWaringRecordMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper"
>
<insert
id=
"saveBatchWarningRecords"
>
insert
into
fan_warning_record
<!-- (ts,-->
<!-- rec_date,-->
<!-- disposotion_state,-->
<!-- health_index_seq,-->
<!-- health_index,-->
<!-- analysis_point_id,-->
<!-- warning_name,-->
<!-- arae,-->
<!-- station,-->
<!-- subarray,-->
<!-- manufacturer,-->
<!-- device_type,-->
<!-- equipment_name,-->
<!-- gateway_id,-->
<!-- index_address,-->
<!-- content,-->
<!-- point_name,-->
<!-- health_level,-->
<!-- disposotion_date,-->
<!-- kks,-->
<!-- warning_period,-->
<!-- status)-->
values
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
(#{item.ts, jdbcType=TIMESTAMP},
#{item.recDate, jdbcType=VARCHAR},
#{item.disposotionState, jdbcType=VARCHAR},
<!-- #{item.healthIndexSeq, jdbcType=VARCHAR},-->
#{item.healthIndex, jdbcType=VARCHAR},
#{item.analysisPointId, jdbcType=VARCHAR},
#{item.warningName, jdbcType=VARCHAR},
#{item.arae, jdbcType=VARCHAR},
#{item.station, jdbcType=VARCHAR},
#{item.subSystem, jdbcType=VARCHAR},
#{item.number, jdbcType=VARCHAR},
#{item.equipmentName, jdbcType=VARCHAR},
#{item.gatewayId, jdbcType=VARCHAR},
#{item.indexAddress, jdbcType=VARCHAR},
#{item.content, jdbcType=VARCHAR},
#{item.pointName, jdbcType=VARCHAR},
#{item.healthLevel, jdbcType=VARCHAR},
#{item.disposotionDate, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR},
#{item.warningPeriod, jdbcType=VARCHAR},
#{item.status, jdbcType=VARCHAR})
</foreach>
</insert>
<select
id=
"selectFanWarningNum"
resultType=
"map"
>
<select
id=
"selectFanWarningNum"
resultType=
"map"
>
SELECT `b`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
SELECT `b`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
View file @
7c0f50b3
<?xml version="1.0" encoding="UTF-8"?>
<?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">
<!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.tdMapper2.PvWaringRecordMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper"
>
<insert
id=
"saveBatchWarningRecords"
>
insert
into
pv_warning_record
(ts,
rec_date,
disposotion_state,
health_index_seq,
health_index,
analysis_point_id,
warning_name,
arae,
station,
subarray,
manufacturer,
device_type,
equipment_name,
gateway_id,
index_address,
content,
point_name,
health_level,
disposotion_date,
kks,
warning_period,
status)
values
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
(#{item.ts, jdbcType=TIMESTAMP},
#{item.recDate, jdbcType=VARCHAR},
#{item.disposotionState, jdbcType=VARCHAR},
#{item.healthIndexSeq, jdbcType=VARCHAR},
#{item.healthIndex, jdbcType=VARCHAR},
#{item.analysisPointId, jdbcType=VARCHAR},
#{item.warningName, jdbcType=VARCHAR},
#{item.arae, jdbcType=VARCHAR},
#{item.station, jdbcType=VARCHAR},
#{item.subarray, jdbcType=VARCHAR},
#{item.manufacturer, jdbcType=VARCHAR},
#{item.deviceType, jdbcType=VARCHAR},
#{item.equipmentName, jdbcType=VARCHAR},
#{item.gatewayId, jdbcType=VARCHAR},
#{item.indexAddress, jdbcType=VARCHAR},
#{item.content, jdbcType=VARCHAR},
#{item.pointName, jdbcType=VARCHAR},
#{item.healthLevel, jdbcType=VARCHAR},
#{item.disposotionDate, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR},
#{item.warningPeriod, jdbcType=VARCHAR},
#{item.status, jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
</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