Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-kafkaconsumer-gpsbs
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 04d7b5fb
authored
Jan 04, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化Gps基站消费逻辑
1 parent
3e6b7efb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
src/main/java/cn/com/glsx/kafka/service/TransitHandleService.java
src/main/java/cn/com/glsx/kafka/service/TransitHandleService.java
View file @
04d7b5f
...
@@ -11,10 +11,11 @@ import com.glsx.plat.redis.utils.RedisUtils;
...
@@ -11,10 +11,11 @@ import com.glsx.plat.redis.utils.RedisUtils;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
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.beans.factory.annotation.Qualifier
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.SessionCallback
;
import
org.springframework.data.redis.core.SessionCallback
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -35,7 +36,8 @@ public class TransitHandleService {
...
@@ -35,7 +36,8 @@ public class TransitHandleService {
private
RedisUtils
redisUtils
;
private
RedisUtils
redisUtils
;
@Autowired
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
@Qualifier
(
"restRedisTemplate"
)
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
@Autowired
@Autowired
private
RemoteDeviceLocationService
remoteDeviceLocationService
;
private
RemoteDeviceLocationService
remoteDeviceLocationService
;
...
@@ -144,7 +146,7 @@ public class TransitHandleService {
...
@@ -144,7 +146,7 @@ public class TransitHandleService {
// 通过sn从 redis中获取数据 并入库
// 通过sn从 redis中获取数据 并入库
List
<
DeviceLocationDto
>
deviceLocationList
=
Lists
.
newArrayList
();
List
<
DeviceLocationDto
>
deviceLocationList
=
Lists
.
newArrayList
();
stringR
edisTemplate
.
executePipelined
(
new
SessionCallback
<
Object
>()
{
r
edisTemplate
.
executePipelined
(
new
SessionCallback
<
Object
>()
{
@Override
@Override
public
Object
execute
(
RedisOperations
redisOperations
)
throws
DataAccessException
{
public
Object
execute
(
RedisOperations
redisOperations
)
throws
DataAccessException
{
snTempList
.
forEach
(
sn
->
{
snTempList
.
forEach
(
sn
->
{
...
@@ -171,7 +173,7 @@ public class TransitHandleService {
...
@@ -171,7 +173,7 @@ public class TransitHandleService {
});
});
return
null
;
return
null
;
}
}
},
stringR
edisTemplate
.
getValueSerializer
());
},
r
edisTemplate
.
getValueSerializer
());
// 数据入库
// 数据入库
remoteDeviceLocationService
.
saveOrUpdateDeviceLocationData
(
deviceLocationList
);
remoteDeviceLocationService
.
saveOrUpdateDeviceLocationData
(
deviceLocationList
);
// 将sn解锁
// 将sn解锁
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment