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 86c905b7
authored
Apr 14, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
2 parents
02dd48d7
6c5d9c35
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
src/main/java/com/glsx/smart/controller/UserKafkaController.java
src/main/java/com/glsx/smart/dao/entity/SmartScenceSupstatus.java
src/main/resources/mapper/SmartProductTypeMapper.xml
src/main/resources/mapper/SmartScenceSupstatusMapper.xml
src/main/java/com/glsx/smart/controller/UserKafkaController.java
View file @
86c905b
...
@@ -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,20 +94,21 @@ public class UserKafkaController {
...
@@ -93,20 +94,21 @@ 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
)){
List
<
String
>
deviceList
=
userKafkaService
.
getSendDeviceList
(
dataList
);
if
(
CollectionUtils
.
isNotEmpty
(
deviceList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
deviceList
))
{
for
(
String
deviceId
:
deviceList
)
{
for
(
String
deviceId
:
deviceList
)
{
addressProducer
.
pushUserDeviceData
(
deviceId
,
null
,
Fence
.
OperationType
.
DEL_VALUE
);
//删除设备信息
addressProducer
.
pushUserDeviceData
(
deviceId
,
null
,
Fence
.
OperationType
.
DEL_VALUE
);
//删除设备信息
}
}
}
}
}
//删除用户场景数据
//删除用户场景数据
int
i
=
sceneService
.
deleteByPrimaryKey
(
scene
.
getId
());
int
i
=
sceneService
.
deleteByPrimaryKey
(
scene
.
getId
());
if
(
i
>
0
){
if
(
i
>
0
){
sceneDataService
.
deleteBySceneId
(
scene
.
getId
());
sceneDataService
.
deleteBySceneId
(
scene
.
getId
());
sceneLogService
.
insertWrapper
(
scene
.
getUserId
(),
sceneLogService
.
insertWrapper
(
scene
.
getUserId
(),
"删除场景数据:"
+
scene
.
getId
(),
JSON
.
toJSONString
(
scene
));
"删除场景数据:"
+
scene
.
getId
(),
JSON
.
toJSONString
(
scene
));
return
true
;
}
}
}
}
}
}
...
...
src/main/java/com/glsx/smart/dao/entity/SmartScenceSupstatus.java
View file @
86c905b
package
com
.
glsx
.
smart
.
dao
.
entity
;
package
com
.
glsx
.
smart
.
dao
.
entity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
/**
* <p>Description:
* <p>Description:
...
@@ -58,4 +59,10 @@ public class SmartScenceSupstatus {
...
@@ -58,4 +59,10 @@ public class SmartScenceSupstatus {
*/
*/
@Column
(
name
=
"`type`"
)
@Column
(
name
=
"`type`"
)
private
String
type
;
private
String
type
;
/**
* 状态 1上线 0下线
*/
@Column
(
name
=
"status"
)
private
Byte
status
;
}
}
src/main/resources/mapper/SmartProductTypeMapper.xml
View file @
86c905b
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
<select
id=
"getAllConditionList"
resultMap=
"BaseResultMap"
>
<select
id=
"getAllConditionList"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
select
<include
refid=
"Base_Column_List"
/>
from smart_product_type where id in (select distinct product_id from smart_scence_supstatus)
from smart_product_type where id in (select distinct product_id from smart_scence_supstatus
where `status` = 1
)
</select>
</select>
<select
id=
"getAllContentList"
resultMap=
"BaseResultMap"
>
<select
id=
"getAllContentList"
resultMap=
"BaseResultMap"
>
...
...
src/main/resources/mapper/SmartScenceSupstatusMapper.xml
View file @
86c905b
...
@@ -11,15 +11,16 @@
...
@@ -11,15 +11,16 @@
<result
column=
"order_code"
jdbcType=
"VARCHAR"
property=
"orderCode"
/>
<result
column=
"order_code"
jdbcType=
"VARCHAR"
property=
"orderCode"
/>
<result
column=
"order_value"
jdbcType=
"VARCHAR"
property=
"orderValue"
/>
<result
column=
"order_value"
jdbcType=
"VARCHAR"
property=
"orderValue"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"status"
jdbcType=
"TINYINT"
property=
"status"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated generated on Fri Mar 19 17:23:04 CST 2021.-->
<!--@mbg.generated generated on Fri Mar 19 17:23:04 CST 2021.-->
id, scene_supstatus_code, scene_supstatus_value, product_id, order_code, order_value,
id, scene_supstatus_code, scene_supstatus_value, product_id, order_code, order_value,
`type`
`type`
, `status`
</sql>
</sql>
<select
id=
"getListByProductId"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
<select
id=
"getListByProductId"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from smart_scence_supstatus t where t.product_id = #{productId,jdbcType=VARCHAR}
from smart_scence_supstatus t where t.
`status` = 1 and t.
product_id = #{productId,jdbcType=VARCHAR}
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
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