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
cf1ce75d
Commit
cf1ce75d
authored
Dec 11, 2024
by
张森
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单位问题处理
parent
bd37eb1a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+2
-2
MqttWarningReceiveServiceImpl.java
...uipmanage/service/impl/MqttWarningReceiveServiceImpl.java
+11
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
cf1ce75d
...
@@ -1627,8 +1627,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -1627,8 +1627,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
BizMessage
bizMessage
=
new
BizMessage
();
BizMessage
bizMessage
=
new
BizMessage
();
bizMessage
.
setIndexKey
(
indexKey
);
bizMessage
.
setIndexKey
(
indexKey
);
bizMessage
.
setIndexValue
(
String
.
valueOf
(
divide
));
bizMessage
.
setIndexValue
(
String
.
valueOf
(
divide
));
String
message
=
"当前值为%s
米
,%s报警阈值%s"
;
String
message
=
"当前值为%s
%s
,%s报警阈值%s"
;
String
format
=
String
.
format
(
message
,
nowValue
,
messageLevel
,
"≥10%"
);
String
format
=
String
.
format
(
message
,
nowValue
,
equipmentSpecificIndex
.
getUnit
(),
messageLevel
,
"≥10%"
);
RiskBizInfoVo
riskBizInfoVo
=
fetchData
(
equipmentSpecificIndex
,
extra
,
source
,
format
);
RiskBizInfoVo
riskBizInfoVo
=
fetchData
(
equipmentSpecificIndex
,
extra
,
source
,
format
);
riskBizInfoVo
.
setWarningObjectCode
(
businessId
);
riskBizInfoVo
.
setWarningObjectCode
(
businessId
);
riskBizInfoVo
.
getDynamicDetails
().
get
(
0
).
setTabContent
(
tableContentVos
);
riskBizInfoVo
.
getDynamicDetails
().
get
(
0
).
setTabContent
(
tableContentVos
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttWarningReceiveServiceImpl.java
View file @
cf1ce75d
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex
;
import
com.yeejoin.equipmanage.common.vo.IotDataVO
;
import
com.yeejoin.equipmanage.common.vo.IotDataVO
;
import
com.yeejoin.equipmanage.common.vo.TopicEntityVo
;
import
com.yeejoin.equipmanage.common.vo.TopicEntityVo
;
import
com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService
;
import
com.yeejoin.equipmanage.service.MqttWaringReceiveService
;
import
com.yeejoin.equipmanage.service.MqttWaringReceiveService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
@Service
@Service
...
@@ -49,6 +54,8 @@ public class MqttWarningReceiveServiceImpl implements MqttWaringReceiveService {
...
@@ -49,6 +54,8 @@ public class MqttWarningReceiveServiceImpl implements MqttWaringReceiveService {
@Autowired
@Autowired
MqttReceiveServiceImpl
mqttReceiveService
;
MqttReceiveServiceImpl
mqttReceiveService
;
@Autowired
IEquipmentSpecificIndexService
equipmentSpecificIndexService
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -66,6 +73,10 @@ public class MqttWarningReceiveServiceImpl implements MqttWaringReceiveService {
...
@@ -66,6 +73,10 @@ public class MqttWarningReceiveServiceImpl implements MqttWaringReceiveService {
equipmentSpeIndex
.
setBizOrgCode
(
messageObj
.
get
(
"biz_org_code"
).
toString
());
equipmentSpeIndex
.
setBizOrgCode
(
messageObj
.
get
(
"biz_org_code"
).
toString
());
equipmentSpeIndex
.
setBizOrgName
(
messageObj
.
get
(
"biz_org_name"
).
toString
());
equipmentSpeIndex
.
setBizOrgName
(
messageObj
.
get
(
"biz_org_name"
).
toString
());
equipmentSpeIndex
.
setIotCode
(
messageObj
.
get
(
"iot_code"
).
toString
());
equipmentSpeIndex
.
setIotCode
(
messageObj
.
get
(
"iot_code"
).
toString
());
List
<
EquipmentSpecificIndex
>
indexList
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexBySpeIotCode
(
messageObj
.
get
(
"iot_code"
).
toString
());
List
<
EquipmentSpecificIndex
>
collect
=
indexList
.
stream
().
filter
(
item
->
!
ObjectUtils
.
isEmpty
(
item
.
getNameKey
())
&&
item
.
getNameKey
().
equalsIgnoreCase
(
messageObj
.
get
(
REALTIME_IOT_INDEX_KEY
).
toString
())).
collect
(
Collectors
.
toList
());
equipmentSpeIndex
.
setUnit
(
CollUtil
.
isNotEmpty
(
collect
)
?
collect
.
get
(
0
).
getUnit
()
:
"m"
);
isAlarmFlag
(
equipmentSpeIndex
,
iotDataVO
);
isAlarmFlag
(
equipmentSpeIndex
,
iotDataVO
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
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