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
a4f032a3
Commit
a4f032a3
authored
Jun 27, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
e89864e9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
IPointSystemService.java
.../com/yeejoin/equipmanage/service/IPointSystemService.java
+1
-1
PointSystemServiceImpl.java
...join/equipmanage/service/impl/PointSystemServiceImpl.java
+8
-10
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IPointSystemService.java
View file @
a4f032a3
...
@@ -10,6 +10,6 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
...
@@ -10,6 +10,6 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
public
interface
IPointSystemService
{
public
interface
IPointSystemService
{
//触发风险预警
//触发风险预警
public
void
sendWarning
(
String
address
,
String
value
);
public
void
sendWarning
(
String
address
,
String
value
,
String
valueLabe
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/PointSystemServiceImpl.java
View file @
a4f032a3
...
@@ -45,7 +45,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
...
@@ -45,7 +45,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
protected
EmqKeeper
emqKeeper
;
protected
EmqKeeper
emqKeeper
;
@Override
@Override
public
void
sendWarning
(
String
address
,
String
value
)
{
public
void
sendWarning
(
String
address
,
String
value
,
String
valueLabe
)
{
try
{
try
{
//通过测点地址获取,和对应值 获取kks
//通过测点地址获取,和对应值 获取kks
QueryWrapper
<
PointSystem
>
pointSystemWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PointSystem
>
pointSystemWrapper
=
new
QueryWrapper
<>();
...
@@ -74,8 +74,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
...
@@ -74,8 +74,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
eqdata
=
(
JSONObject
)
list
.
get
(
0
);
eqdata
=
(
JSONObject
)
list
.
get
(
0
);
//组装数据,发送预警
//组装数据,发送预警
WarningDto
warningDto
=
setWarningDto
(
pointSystem
,
eqdata
);
WarningDto
warningDto
=
setWarningDto
(
pointSystem
,
eqdata
,
valueLabe
);
emqKeeper
.
getMqttClient
().
publish
(
STATIONWARNING
,
JSON
.
toJSONString
(
warningDto
).
getBytes
(),
0
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
STATIONWARNING
,
JSON
.
toJSONString
(
warningDto
).
getBytes
(),
0
,
false
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -85,28 +84,27 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
...
@@ -85,28 +84,27 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
}
}
public
WarningDto
setWarningDto
(
PointSystem
pointSystem
,
JSONObject
eqdata
){
public
WarningDto
setWarningDto
(
PointSystem
pointSystem
,
JSONObject
eqdata
,
String
valueLabe
){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
time
=
sdf
.
format
(
new
Date
());
String
time
=
sdf
.
format
(
new
Date
());
String
warningObjectCode
=
pointSystem
.
getKks
();
String
warningObjectCode
=
pointSystem
.
getKks
();
List
<
TabContent
>
tabContent
=
new
ArrayList
<>();
List
<
TabContent
>
tabContent
=
new
ArrayList
<>();
tabContent
.
add
(
new
TabContent
(
"KKS编码"
,
TEXT
,
warningObjectCode
,
"key1"
));
tabContent
.
add
(
new
TabContent
(
"KKS编码"
,
TEXT
,
warningObjectCode
,
"key1"
));
tabContent
.
add
(
new
TabContent
(
"设备名称"
,
TEXT
,
eqdata
.
get
(
"kksms"
),
"key2"
));
tabContent
.
add
(
new
TabContent
(
"设备名称"
,
TEXT
,
eqdata
.
get
(
"kksms"
),
"key2"
));
tabContent
.
add
(
new
TabContent
(
"发生时间"
,
TEXT
,
time
,
"key3"
));
tabContent
.
add
(
new
TabContent
(
"告警原因"
,
TEXT
,
valueLabe
,
"key3"
));
tabContent
.
add
(
new
TabContent
(
"发生时间"
,
TEXT
,
time
,
"key4"
));
DynamicDetails
dynamicDetails
=
new
DynamicDetails
(
TABNAME
,
tabContent
);
DynamicDetails
dynamicDetails
=
new
DynamicDetails
(
TABNAME
,
tabContent
);
List
<
DynamicDetails
>
dynamicDetailsList
=
new
ArrayList
<>();
List
<
DynamicDetails
>
dynamicDetailsList
=
new
ArrayList
<>();
dynamicDetailsList
.
add
(
dynamicDetails
);
dynamicDetailsList
.
add
(
dynamicDetails
);
StringBu
ffer
indexKey
=
new
StringBuff
er
(
pointSystem
.
getStation
())
StringBu
ilder
indexKey
=
new
StringBuild
er
(
pointSystem
.
getStation
())
.
append
(
"#"
)
.
append
(
"#"
)
.
append
(
pointSystem
.
getNumber
())
.
append
(
pointSystem
.
getNumber
())
.
append
(
"#"
)
.
append
(
"#"
)
.
append
(
pointSystem
.
getFunctionNum
());
.
append
(
pointSystem
.
getFunctionNum
());
StringBuffer
indexValue
=
new
StringBuffer
(
pointSystem
.
getPointType
())
String
indexValue
=
valueLabe
;
.
append
(
"#"
)
.
append
(
pointSystem
.
getValue
());
WarningDto
WarningDto
=
new
WarningDto
(
WarningDto
WarningDto
=
new
WarningDto
(
indexKey
.
toString
(),
indexKey
.
toString
(),
indexValue
.
toString
()
,
indexValue
,
null
,
null
,
(
String
)
eqdata
.
get
(
"sourceAttributionDesc"
),
(
String
)
eqdata
.
get
(
"sourceAttributionDesc"
),
(
String
)
eqdata
.
get
(
"sourceAttribution"
),
(
String
)
eqdata
.
get
(
"sourceAttribution"
),
...
...
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