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
7831941b
Commit
7831941b
authored
Jun 18, 2025
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
34102153
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
JxiopCarIotListerServiceImpl.java
...quipmanage/service/impl/JxiopCarIotListerServiceImpl.java
+10
-7
WlCarMileageServiceImpl.java
...oin/equipmanage/service/impl/WlCarMileageServiceImpl.java
+0
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/JxiopCarIotListerServiceImpl.java
View file @
7831941b
...
@@ -34,9 +34,7 @@ import java.net.HttpURLConnection;
...
@@ -34,9 +34,7 @@ import java.net.HttpURLConnection;
import
java.net.URL
;
import
java.net.URL
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -62,6 +60,8 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -62,6 +60,8 @@ public class JxiopCarIotListerServiceImpl {
private
EmqKeeper
emqkeeper
;
private
EmqKeeper
emqkeeper
;
@Autowired
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
@Autowired
private
static
Map
<
String
,
Object
>
cache
=
new
HashMap
<>();
// @Async("equipAsyncExecutor")
// @Async("equipAsyncExecutor")
...
@@ -72,9 +72,11 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -72,9 +72,11 @@ public class JxiopCarIotListerServiceImpl {
String
iotCode
=
measurement
+
deviceName
;
String
iotCode
=
measurement
+
deviceName
;
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
))
{
if
(
iWlCarMileageService
.
getUncompleteMileagByIotCode
(
iotCode
)&&
cache
.
get
(
iotCode
)==
null
)
{
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
());
...
@@ -97,15 +99,16 @@ public class JxiopCarIotListerServiceImpl {
...
@@ -97,15 +99,16 @@ 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"
);
if
(
ObjectUtils
.
isEmpty
(
redisTemplate
.
opsForValue
().
get
(
iotCode
)))
{
if
(
ObjectUtils
.
isEmpty
(
redisTemplate
.
opsForValue
().
get
(
iotCode
)))
{
redisTemplate
.
opsForValue
().
set
(
iotCode
,
coordinate
,
5
,
TimeUnit
.
MINUTES
);
redisTemplate
.
opsForValue
().
set
(
iotCode
,
coordinate
,
5
,
TimeUnit
.
MINUTES
);
logger
.
info
(
"首次入库redis:{}"
,
iotCode
);
//
logger.info("首次入库redis:{}", iotCode);
}
else
{
}
else
{
if
(!
String
.
valueOf
(
redisTemplate
.
opsForValue
().
get
(
iotCode
)).
equals
(
coordinate
))
{
if
(!
String
.
valueOf
(
redisTemplate
.
opsForValue
().
get
(
iotCode
)).
equals
(
coordinate
))
{
logger
.
info
(
"更新入库redis:{},旧:{},新:{}"
,
iotCode
,
redisTemplate
.
opsForValue
().
get
(
iotCode
),
coordinate
);
//
logger.info("更新入库redis:{},旧:{},新:{}", iotCode, redisTemplate.opsForValue().get(iotCode), coordinate);
redisTemplate
.
opsForValue
().
set
(
iotCode
,
coordinate
,
5
,
TimeUnit
.
MINUTES
);
redisTemplate
.
opsForValue
().
set
(
iotCode
,
coordinate
,
5
,
TimeUnit
.
MINUTES
);
}
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/WlCarMileageServiceImpl.java
View file @
7831941b
This diff is collapsed.
Click to expand it.
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