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 {
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
JSONArray
getList
(
@RequestBody
SmartUserRelation
request
)
{
log
.
info
(
"用户参数:{}"
,
request
);
request
.
setUserId
(
91712228L
);
//
request.setUserId(91712228L);
SmartUserRelation
user
=
userRelationService
.
getSingle
(
request
);
if
(
user
==
null
){
return
null
;
}
return
this
.
getRemoteDevice
(
user
.
getThirdId
());
}
...
...
@@ -72,6 +75,9 @@ public class RemoteProductController {
JSONObject
json
=
JSON
.
parseObject
(
result
);
if
(
json
.
getInteger
(
"code"
).
equals
(
200
))
{
JSONArray
array
=
json
.
getJSONArray
(
"message"
);
if
(
array
==
null
||
array
.
size
()
<=
0
){
return
array
;
}
return
this
.
remoteDataHandle
(
array
);
}
}
...
...
@@ -102,7 +108,7 @@ public class RemoteProductController {
JSONObject
val
=
new
JSONObject
();
String
productId
=
object
.
getString
(
"product_id"
);
val
.
put
(
"productId"
,
productId
);
val
.
put
(
"uuid"
,
object
.
getString
(
"
uu
id"
));
val
.
put
(
"uuid"
,
object
.
getString
(
"id"
));
val
.
put
(
"productName"
,
object
.
getString
(
"product_name"
));
SmartProduct
product
=
this
.
compareProductId
(
productList
,
productId
);
if
(
product
!=
null
){
...
...
src/main/java/com/glsx/smart/controller/UserRelationController.java
View file @
9e5e1fb
...
...
@@ -68,6 +68,7 @@ public class UserRelationController {
request
.
setPhone
(
userRelation
.
getPhone
());
request
.
setChannel
(
userRelation
.
getChannel
());
//涂鸦
SmartUserRelation
user
=
userRelationService
.
getSingle
(
request
);
request
.
setUserId
(
userRelation
.
getUserId
());
if
(
user
!=
null
){
String
tuYaId
=
user
.
getThirdId
();
if
(
StringUtils
.
isEmpty
(
tuYaId
)){
...
...
@@ -75,9 +76,9 @@ public class UserRelationController {
tuYaId
=
this
.
syncUser
(
user
.
getPhone
(),
user
.
getPassword
());
request
.
setThirdId
(
tuYaId
);
request
.
setId
(
user
.
getId
());
userRelationService
.
updateByPrimaryKeySelective
(
request
);
}
}
userRelationService
.
updateByPrimaryKeySelective
(
request
);
return
R
.
ok
().
data
(
tuYaId
);
}
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;
*/
import
lombok.Data
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* 车家智能用户场景数据表
...
...
@@ -49,6 +50,11 @@ public class SmartSceneData {
private
String
paramKey
;
/**
* 设备id,取自param_value中select
*/
private
String
deviceId
;
/**
* 参数值 数组对象
*/
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 {
private
Byte
channel
;
/**
* 用户来源 ANDROID iOS
*/
private
String
source
;
/**
* 第三方平台用户id
*/
private
String
thirdId
;
...
...
src/main/resources/mapper/SmartSceneDataMapper.xml
View file @
9e5e1fb
...
...
@@ -11,10 +11,11 @@
<result
column=
"sort"
jdbcType=
"TINYINT"
property=
"sort"
/>
<result
column=
"param_key"
jdbcType=
"VARCHAR"
property=
"paramKey"
/>
<result
column=
"param_value"
jdbcType=
"VARCHAR"
property=
"paramValue"
/>
<result
column=
"device_id"
jdbcType=
"VARCHAR"
property=
"deviceId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--@mbg.generated-->
id, scene_id, `type`, sort, param_key, param_value
id, scene_id, `type`, sort, param_key,
device_id,
param_value
</sql>
<update
id=
"updateBatch"
parameterType=
"java.util.List"
>
<!--@mbg.generated-->
...
...
@@ -101,12 +102,12 @@
useGeneratedKeys=
"true"
>
<!--@mbg.generated-->
insert into smart_scene_data
(scene_id, `type`, sort, param_key, param_value)
(scene_id, `type`, sort, param_key,
device_id,
param_value)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.sceneId,jdbcType=BIGINT}, #{item.type,jdbcType=TINYINT},
#{item.sort,jdbcType=TINYINT},
#{item.
paramKey
,jdbcType=VARCHAR}, #{item.paramValue,jdbcType=VARCHAR})
#{item.sort,jdbcType=TINYINT},
#{item.paramKey,jdbcType=VARCHAR},
#{item.
deviceId
,jdbcType=VARCHAR}, #{item.paramValue,jdbcType=VARCHAR})
</foreach>
</insert>
<delete
id=
"deleteBySceneId"
parameterType=
"java.lang.Long"
>
...
...
src/main/resources/mapper/SmartUserRelationMapper.xml
View file @
9e5e1fb
...
...
@@ -12,13 +12,14 @@
<result
column=
"password"
jdbcType=
"VARCHAR"
property=
"password"
/>
<result
column=
"channel"
jdbcType=
"TINYINT"
property=
"channel"
/>
<result
column=
"third_id"
jdbcType=
"VARCHAR"
property=
"thirdId"
/>
<result
column=
"source"
jdbcType=
"VARCHAR"
property=
"source"
/>
<result
column=
"status"
jdbcType=
"TINYINT"
property=
"status"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--@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>
<update
id=
"updateBatch"
parameterType=
"java.util.List"
>
<!--@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