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 9e5e1fba
authored
Apr 11, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
2 parents
970793e6
bf119d7f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
9 deletions
src/main/java/com/glsx/smart/controller/RemoteProductController.java
src/main/java/com/glsx/smart/controller/UserRelationController.java
src/main/java/com/glsx/smart/dao/entity/SmartSceneData.java
src/main/java/com/glsx/smart/dao/entity/SmartUserRelation.java
src/main/resources/mapper/SmartSceneDataMapper.xml
src/main/resources/mapper/SmartUserRelationMapper.xml
src/main/java/com/glsx/smart/controller/RemoteProductController.java
View file @
9e5e1fb
...
@@ -56,8 +56,11 @@ public class RemoteProductController {
...
@@ -56,8 +56,11 @@ public class RemoteProductController {
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
JSONArray
getList
(
@RequestBody
SmartUserRelation
request
)
{
public
JSONArray
getList
(
@RequestBody
SmartUserRelation
request
)
{
log
.
info
(
"用户参数:{}"
,
request
);
log
.
info
(
"用户参数:{}"
,
request
);
request
.
setUserId
(
91712228L
);
//
request.setUserId(91712228L);
SmartUserRelation
user
=
userRelationService
.
getSingle
(
request
);
SmartUserRelation
user
=
userRelationService
.
getSingle
(
request
);
if
(
user
==
null
){
return
null
;
}
return
this
.
getRemoteDevice
(
user
.
getThirdId
());
return
this
.
getRemoteDevice
(
user
.
getThirdId
());
}
}
...
@@ -72,6 +75,9 @@ public class RemoteProductController {
...
@@ -72,6 +75,9 @@ public class RemoteProductController {
JSONObject
json
=
JSON
.
parseObject
(
result
);
JSONObject
json
=
JSON
.
parseObject
(
result
);
if
(
json
.
getInteger
(
"code"
).
equals
(
200
))
{
if
(
json
.
getInteger
(
"code"
).
equals
(
200
))
{
JSONArray
array
=
json
.
getJSONArray
(
"message"
);
JSONArray
array
=
json
.
getJSONArray
(
"message"
);
if
(
array
==
null
||
array
.
size
()
<=
0
){
return
array
;
}
return
this
.
remoteDataHandle
(
array
);
return
this
.
remoteDataHandle
(
array
);
}
}
}
}
...
@@ -102,7 +108,7 @@ public class RemoteProductController {
...
@@ -102,7 +108,7 @@ public class RemoteProductController {
JSONObject
val
=
new
JSONObject
();
JSONObject
val
=
new
JSONObject
();
String
productId
=
object
.
getString
(
"product_id"
);
String
productId
=
object
.
getString
(
"product_id"
);
val
.
put
(
"productId"
,
productId
);
val
.
put
(
"productId"
,
productId
);
val
.
put
(
"uuid"
,
object
.
getString
(
"
uu
id"
));
val
.
put
(
"uuid"
,
object
.
getString
(
"id"
));
val
.
put
(
"productName"
,
object
.
getString
(
"product_name"
));
val
.
put
(
"productName"
,
object
.
getString
(
"product_name"
));
SmartProduct
product
=
this
.
compareProductId
(
productList
,
productId
);
SmartProduct
product
=
this
.
compareProductId
(
productList
,
productId
);
if
(
product
!=
null
){
if
(
product
!=
null
){
...
...
src/main/java/com/glsx/smart/controller/UserRelationController.java
View file @
9e5e1fb
...
@@ -68,6 +68,7 @@ public class UserRelationController {
...
@@ -68,6 +68,7 @@ public class UserRelationController {
request
.
setPhone
(
userRelation
.
getPhone
());
request
.
setPhone
(
userRelation
.
getPhone
());
request
.
setChannel
(
userRelation
.
getChannel
());
//涂鸦
request
.
setChannel
(
userRelation
.
getChannel
());
//涂鸦
SmartUserRelation
user
=
userRelationService
.
getSingle
(
request
);
SmartUserRelation
user
=
userRelationService
.
getSingle
(
request
);
request
.
setUserId
(
userRelation
.
getUserId
());
if
(
user
!=
null
){
if
(
user
!=
null
){
String
tuYaId
=
user
.
getThirdId
();
String
tuYaId
=
user
.
getThirdId
();
if
(
StringUtils
.
isEmpty
(
tuYaId
)){
if
(
StringUtils
.
isEmpty
(
tuYaId
)){
...
@@ -75,9 +76,9 @@ public class UserRelationController {
...
@@ -75,9 +76,9 @@ public class UserRelationController {
tuYaId
=
this
.
syncUser
(
user
.
getPhone
(),
user
.
getPassword
());
tuYaId
=
this
.
syncUser
(
user
.
getPhone
(),
user
.
getPassword
());
request
.
setThirdId
(
tuYaId
);
request
.
setThirdId
(
tuYaId
);
request
.
setId
(
user
.
getId
());
request
.
setId
(
user
.
getId
());
userRelationService
.
updateByPrimaryKeySelective
(
request
);
}
}
}
}
userRelationService
.
updateByPrimaryKeySelective
(
request
);
return
R
.
ok
().
data
(
tuYaId
);
return
R
.
ok
().
data
(
tuYaId
);
}
}
String
password
=
MD5
.
create
().
digestHex
(
Constants
.
DEFAULT_PASSWORD
);
String
password
=
MD5
.
create
().
digestHex
(
Constants
.
DEFAULT_PASSWORD
);
...
...
src/main/java/com/glsx/smart/dao/entity/SmartSceneData.java
View file @
9e5e1fb
...
@@ -9,11 +9,12 @@ package com.glsx.smart.dao.entity;
...
@@ -9,11 +9,12 @@ package com.glsx.smart.dao.entity;
*/
*/
import
lombok.Data
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
/**
* 车家智能用户场景数据表
* 车家智能用户场景数据表
...
@@ -49,6 +50,11 @@ public class SmartSceneData {
...
@@ -49,6 +50,11 @@ public class SmartSceneData {
private
String
paramKey
;
private
String
paramKey
;
/**
/**
* 设备id,取自param_value中select
*/
private
String
deviceId
;
/**
* 参数值 数组对象
* 参数值 数组对象
*/
*/
private
String
paramValue
;
private
String
paramValue
;
...
...
src/main/java/com/glsx/smart/dao/entity/SmartUserRelation.java
View file @
9e5e1fb
...
@@ -57,6 +57,11 @@ public class SmartUserRelation implements Serializable {
...
@@ -57,6 +57,11 @@ public class SmartUserRelation implements Serializable {
private
Byte
channel
;
private
Byte
channel
;
/**
/**
* 用户来源 ANDROID iOS
*/
private
String
source
;
/**
* 第三方平台用户id
* 第三方平台用户id
*/
*/
private
String
thirdId
;
private
String
thirdId
;
...
...
src/main/resources/mapper/SmartSceneDataMapper.xml
View file @
9e5e1fb
...
@@ -11,10 +11,11 @@
...
@@ -11,10 +11,11 @@
<result
column=
"sort"
jdbcType=
"TINYINT"
property=
"sort"
/>
<result
column=
"sort"
jdbcType=
"TINYINT"
property=
"sort"
/>
<result
column=
"param_key"
jdbcType=
"VARCHAR"
property=
"paramKey"
/>
<result
column=
"param_key"
jdbcType=
"VARCHAR"
property=
"paramKey"
/>
<result
column=
"param_value"
jdbcType=
"VARCHAR"
property=
"paramValue"
/>
<result
column=
"param_value"
jdbcType=
"VARCHAR"
property=
"paramValue"
/>
<result
column=
"device_id"
jdbcType=
"VARCHAR"
property=
"deviceId"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
<!--@mbg.generated-->
id, scene_id, `type`, sort, param_key, param_value
id, scene_id, `type`, sort, param_key,
device_id,
param_value
</sql>
</sql>
<update
id=
"updateBatch"
parameterType=
"java.util.List"
>
<update
id=
"updateBatch"
parameterType=
"java.util.List"
>
<!--@mbg.generated-->
<!--@mbg.generated-->
...
@@ -101,12 +102,12 @@
...
@@ -101,12 +102,12 @@
useGeneratedKeys=
"true"
>
useGeneratedKeys=
"true"
>
<!--@mbg.generated-->
<!--@mbg.generated-->
insert into smart_scene_data
insert into smart_scene_data
(scene_id, `type`, sort, param_key, param_value)
(scene_id, `type`, sort, param_key,
device_id,
param_value)
values
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.sceneId,jdbcType=BIGINT}, #{item.type,jdbcType=TINYINT},
(#{item.sceneId,jdbcType=BIGINT}, #{item.type,jdbcType=TINYINT},
#{item.sort,jdbcType=TINYINT},
#{item.sort,jdbcType=TINYINT},
#{item.paramKey,jdbcType=VARCHAR},
#{item.
paramKey
,jdbcType=VARCHAR}, #{item.paramValue,jdbcType=VARCHAR})
#{item.
deviceId
,jdbcType=VARCHAR}, #{item.paramValue,jdbcType=VARCHAR})
</foreach>
</foreach>
</insert>
</insert>
<delete
id=
"deleteBySceneId"
parameterType=
"java.lang.Long"
>
<delete
id=
"deleteBySceneId"
parameterType=
"java.lang.Long"
>
...
...
src/main/resources/mapper/SmartUserRelationMapper.xml
View file @
9e5e1fb
...
@@ -12,13 +12,14 @@
...
@@ -12,13 +12,14 @@
<result
column=
"password"
jdbcType=
"VARCHAR"
property=
"password"
/>
<result
column=
"password"
jdbcType=
"VARCHAR"
property=
"password"
/>
<result
column=
"channel"
jdbcType=
"TINYINT"
property=
"channel"
/>
<result
column=
"channel"
jdbcType=
"TINYINT"
property=
"channel"
/>
<result
column=
"third_id"
jdbcType=
"VARCHAR"
property=
"thirdId"
/>
<result
column=
"third_id"
jdbcType=
"VARCHAR"
property=
"thirdId"
/>
<result
column=
"source"
jdbcType=
"VARCHAR"
property=
"source"
/>
<result
column=
"status"
jdbcType=
"TINYINT"
property=
"status"
/>
<result
column=
"status"
jdbcType=
"TINYINT"
property=
"status"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
<!--@mbg.generated-->
id, `name`, user_id, phone, `password`, channel, third_id, `status`, remark, create_time
id, `name`, user_id, phone, `password`, channel, third_id, `s
ource`, `s
tatus`, remark, create_time
</sql>
</sql>
<update
id=
"updateBatch"
parameterType=
"java.util.List"
>
<update
id=
"updateBatch"
parameterType=
"java.util.List"
>
<!--@mbg.generated-->
<!--@mbg.generated-->
...
...
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