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
57e151fd
Commit
57e151fd
authored
Jun 18, 2025
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
7831941b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
20 deletions
+22
-20
PermissionInterceptorContext.java
...biz/common/interceptors/PermissionInterceptorContext.java
+2
-2
CarIotNewListener.java
...a/com/yeejoin/equipmanage/listener/CarIotNewListener.java
+1
-1
JxiopCarIotListerServiceImpl.java
...quipmanage/service/impl/JxiopCarIotListerServiceImpl.java
+10
-7
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+8
-9
application.properties
...ot-system-equip/src/main/resources/application.properties
+1
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/interceptors/PermissionInterceptorContext.java
View file @
57e151fd
...
@@ -22,9 +22,9 @@ public class PermissionInterceptorContext {
...
@@ -22,9 +22,9 @@ public class PermissionInterceptorContext {
public
static
void
clean
()
{
public
static
void
clean
()
{
if
(
requestContext
!=
null
)
{
if
(
requestContext
!=
null
)
{
logger
.
info
(
"PermissionInterceptorContext clean RestThreadLocal......Begin"
);
//
logger.info("PermissionInterceptorContext clean RestThreadLocal......Begin");
requestContext
.
remove
();
requestContext
.
remove
();
logger
.
info
(
"PermissionInterceptorContext clean RestThreadLocal......Done"
);
//
logger.info("PermissionInterceptorContext clean RestThreadLocal......Done");
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/listener/CarIotNewListener.java
View file @
57e151fd
...
@@ -82,7 +82,7 @@ public class CarIotNewListener extends EmqxListener {
...
@@ -82,7 +82,7 @@ public class CarIotNewListener extends EmqxListener {
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
throws
Exception
{
//logger.info("----收到物联消息::topic---------------" + topic);
//logger.info("----收到物联消息::topic---------------" + topic);
logger
.
info
(
"----收到物联消息::message---------------"
+
message
);
//
logger.info("----收到物联消息::message---------------" + message);
pooledExecutor
.
submit
(()
->
{
pooledExecutor
.
submit
(()
->
{
jxiopCarIotListerServiceImpl
.
processMessage
(
topic
,
message
);
jxiopCarIotListerServiceImpl
.
processMessage
(
topic
,
message
);
});
});
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/JxiopCarIotListerServiceImpl.java
View file @
57e151fd
...
@@ -61,7 +61,7 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -61,7 +61,7 @@ public class JxiopCarIotListerServiceImpl {
@Autowired
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
@Autowired
private
static
Map
<
String
,
Object
>
cache
=
new
HashMap
<>();
private
static
ConcurrentHashMap
<
String
,
Object
>
cache
=
new
Concurrent
HashMap
<>();
// @Async("equipAsyncExecutor")
// @Async("equipAsyncExecutor")
...
@@ -70,13 +70,17 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -70,13 +70,17 @@ public class JxiopCarIotListerServiceImpl {
String
deviceName
=
topic
.
split
(
"/"
)[
1
];
String
deviceName
=
topic
.
split
(
"/"
)[
1
];
//根据topic 组装iotCode
//根据topic 组装iotCode
String
iotCode
=
measurement
+
deviceName
;
String
iotCode
=
measurement
+
deviceName
;
//处理并发
if
(
cache
.
get
(
iotCode
)!=
null
)
{
return
;
}
cache
.
put
(
iotCode
,
iotCode
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
message
.
toString
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
message
.
toString
());
//判断是否有效坐标
//判断是否有效坐标
if
(!
ObjectUtils
.
isEmpty
(
jsonObject
.
get
(
"FireCar_Longitude"
))
&&
!
ObjectUtils
.
isEmpty
(
jsonObject
.
get
(
"FireCar_Latitude"
))
if
(!
ObjectUtils
.
isEmpty
(
jsonObject
.
get
(
"FireCar_Longitude"
))
&&
!
ObjectUtils
.
isEmpty
(
jsonObject
.
get
(
"FireCar_Latitude"
)))
{
&&
cache
.
get
(
iotCode
)==
null
)
{
//判断是否存在未结束进程,如果不存在,则进入判断插入开始节点
//判断是否存在未结束进程,如果不存在,则进入判断插入开始节点
if
(
iWlCarMileageService
.
getUncompleteMileagByIotCode
(
iotCode
)&&
cache
.
get
(
iotCode
)==
null
)
{
if
(
iWlCarMileageService
.
getUncompleteMileagByIotCode
(
iotCode
))
{
cache
.
put
(
iotCode
,
iotCode
);
WlCarMileage
wlCarMileage
=
new
WlCarMileage
();
WlCarMileage
wlCarMileage
=
new
WlCarMileage
();
wlCarMileage
.
setIotCode
(
iotCode
);
wlCarMileage
.
setIotCode
(
iotCode
);
wlCarMileage
.
setDate
(
new
Date
());
wlCarMileage
.
setDate
(
new
Date
());
...
@@ -99,7 +103,6 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -99,7 +103,6 @@ public class JxiopCarIotListerServiceImpl {
e
.
printStackTrace
();
e
.
printStackTrace
();
iWlCarMileageService
.
save
(
wlCarMileage
);
iWlCarMileageService
.
save
(
wlCarMileage
);
}
}
cache
.
remove
(
iotCode
);
}
}
this
.
updateCarLocation
(
jsonObject
,
iotCode
);
this
.
updateCarLocation
(
jsonObject
,
iotCode
);
String
coordinate
=
jsonObject
.
getString
(
"FireCar_Longitude"
)
+
","
+
jsonObject
.
getString
(
"FireCar_Latitude"
);
String
coordinate
=
jsonObject
.
getString
(
"FireCar_Longitude"
)
+
","
+
jsonObject
.
getString
(
"FireCar_Latitude"
);
...
@@ -113,7 +116,7 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -113,7 +116,7 @@ public class JxiopCarIotListerServiceImpl {
}
}
}
}
}
}
cache
.
remove
(
iotCode
);
}
}
public
String
getAddress
(
double
longitude
,
double
lantitude
)
{
public
String
getAddress
(
double
longitude
,
double
lantitude
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
57e151fd
...
@@ -364,7 +364,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -364,7 +364,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
handlerMqttIncrementMessage
(
String
topic
,
String
message
)
{
public
void
handlerMqttIncrementMessage
(
String
topic
,
String
message
)
{
TopicEntityVo
topicEntity
=
new
TopicEntityVo
();
TopicEntityVo
topicEntity
=
new
TopicEntityVo
();
topicEntity
.
setTopic
(
topic
);
topicEntity
.
setTopic
(
topic
);
topicEntity
.
setMessage
(
message
);
topicEntity
.
setMessage
(
message
);
...
@@ -410,15 +409,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -410,15 +409,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
log
.
info
(
String
.
format
(
"收到mqtt消息:%s"
,
message
));
log
.
info
(
String
.
format
(
"收到mqtt消息:%s"
,
message
));
// 发送emq消息转kafka
// 发送emq消息转kafka
JSONObject
jsonObject
=
new
JSONObject
();
//
JSONObject jsonObject = new JSONObject();
jsonObject
.
put
(
"topic"
,
topic
);
//
jsonObject.put("topic", topic);
jsonObject
.
put
(
"data"
,
message
);
//
jsonObject.put("data", message);
try
{
//
try {
emqKeeper
.
getMqttClient
().
publish
(
"emq.iot.created"
,
jsonObject
.
toString
().
getBytes
(),
1
,
false
);
//
emqKeeper.getMqttClient().publish("emq.iot.created", jsonObject.toString().getBytes(), 1, false);
}
catch
(
MqttException
e
)
{
//
} catch (MqttException e) {
log
.
info
(
String
.
format
(
"发送eqm转kafka消息失败:%s"
,
e
.
getMessage
()));
//
log.info(String.format("发送eqm转kafka消息失败:%s", e.getMessage()));
}
//
}
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
if
(!
StringUtils
.
isEmpty
(
traceId
))
{
String
finalTraceId
=
traceId
;
String
finalTraceId
=
traceId
;
...
...
amos-boot-system-equip/src/main/resources/application.properties
View file @
57e151fd
...
@@ -9,7 +9,7 @@ spring.datasource.driver-class-name=com.kingbase8.Driver
...
@@ -9,7 +9,7 @@ spring.datasource.driver-class-name=com.kingbase8.Driver
#mybatis mapper file
#mybatis mapper file
mybatis.mapper-locations
=
classpath:mapper/*.xml
mybatis.mapper-locations
=
classpath:mapper/*.xml
#mybatis-plus
#mybatis-plus
mybatis-plus.configuration.log-impl
=
org.apache.ibatis.logging.
stdout.StdOut
Impl
mybatis-plus.configuration.log-impl
=
org.apache.ibatis.logging.
nologging.NoLogging
Impl
# mybatis entity package
# mybatis entity package
mybatis.type-aliases-package
=
com.yeejoin.equipmanage.common.entity
mybatis.type-aliases-package
=
com.yeejoin.equipmanage.common.entity
spring.jackson.time-zone
=
GMT+8
spring.jackson.time-zone
=
GMT+8
...
...
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