Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-service
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 6c5d9c35
authored
Apr 14, 2021
by
wnb0128
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
车家智能数据服务 场景数据删除优化--think.wang
1 parent
aa8476de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
src/main/java/com/glsx/smart/controller/UserKafkaController.java
src/main/java/com/glsx/smart/controller/UserKafkaController.java
View file @
6c5d9c3
...
@@ -3,6 +3,7 @@ package com.glsx.smart.controller;
...
@@ -3,6 +3,7 @@ package com.glsx.smart.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.glsx.smart.config.DeviceAddressProducer
;
import
com.glsx.smart.config.DeviceAddressProducer
;
import
com.glsx.smart.dao.entity.SmartScene
;
import
com.glsx.smart.dao.entity.SmartScene
;
import
com.glsx.smart.dao.entity.SmartSceneData
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
com.glsx.smart.dao.entity.SmartUserRelation
;
import
com.glsx.smart.pojo.pb.InstanceFence.Fence
;
import
com.glsx.smart.pojo.pb.InstanceFence.Fence
;
import
com.glsx.smart.service.*
;
import
com.glsx.smart.service.*
;
...
@@ -93,11 +94,13 @@ public class UserKafkaController {
...
@@ -93,11 +94,13 @@ public class UserKafkaController {
int
len
=
sceneList
.
size
();
int
len
=
sceneList
.
size
();
for
(
int
j
=
0
;
j
<
len
;
j
++)
{
for
(
int
j
=
0
;
j
<
len
;
j
++)
{
SmartScene
scene
=
sceneList
.
get
(
j
);
SmartScene
scene
=
sceneList
.
get
(
j
);
List
<
String
>
deviceList
=
userKafkaService
.
getSendDeviceList
(
List
<
SmartSceneData
>
dataList
=
sceneDataService
.
getBySceneId
(
scene
.
getId
());
sceneDataService
.
getBySceneId
(
scene
.
getId
()));
if
(
CollectionUtils
.
isNotEmpty
(
dataList
)){
if
(
CollectionUtils
.
isNotEmpty
(
deviceList
))
{
List
<
String
>
deviceList
=
userKafkaService
.
getSendDeviceList
(
dataList
);
for
(
String
deviceId
:
deviceList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
deviceList
))
{
addressProducer
.
pushUserDeviceData
(
deviceId
,
null
,
Fence
.
OperationType
.
DEL_VALUE
);
//删除设备信息
for
(
String
deviceId
:
deviceList
)
{
addressProducer
.
pushUserDeviceData
(
deviceId
,
null
,
Fence
.
OperationType
.
DEL_VALUE
);
//删除设备信息
}
}
}
}
}
//删除用户场景数据
//删除用户场景数据
...
...
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