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 b6cc8562
authored
Apr 24, 2021
by
fz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.保存注册信息,如果蓝牙地址有则更新,没有新增
1 parent
59fcb807
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
src/main/java/com/glsx/smart/service/impl/AiLockingKeyServiceImpl.java
src/main/java/com/glsx/smart/service/impl/AiLockingKeyServiceImpl.java
View file @
b6cc856
...
...
@@ -392,6 +392,17 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
String
mobileMac
=
request
.
getMobileMac
();
if
(
StringUtils
.
isNotBlank
(
mobileMac
))
{
try
{
SmartKeyBlueSenseExample
blueSenseExample
=
new
SmartKeyBlueSenseExample
();
blueSenseExample
.
createCriteria
()
.
andUserIdEqualTo
(
smartVehicleBlueKey
.
getUserId
())
.
andSnEqualTo
(
smartVehicleBlueKey
.
getSn
())
.
andMobileBlueMacEqualTo
(
mobileMac
)
.
andIsDeleteEqualTo
(
0
);
List
<
SmartKeyBlueSense
>
list
=
smartKeyBlueSenseService
.
selectByExample
(
blueSenseExample
);
if
(
CollectionUtils
.
isEmpty
(
list
)){
//如果手机mac不存在,新增
SmartKeyBlueSense
blueSense
=
SmartKeyBlueSense
.
builder
()
.
userId
(
smartVehicleBlueKey
.
getUserId
())
.
sn
(
smartVehicleBlueKey
.
getSn
())
...
...
@@ -400,9 +411,14 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
.
isDelete
(
0
)
.
autoSenseStatus
(
0
)
.
build
();
try
{
//新增车钥匙手机蓝牙mac,自动感应状态
smartKeyBlueSenseService
.
insert
(
blueSense
);
}
else
{
SmartKeyBlueSense
blueSense
=
list
.
get
(
0
);
blueSense
.
setMobileBlueMac
(
mobileMac
);
//新增车钥匙手机蓝牙mac,自动感应状态
smartKeyBlueSenseService
.
updateByPrimaryKeySelective
(
blueSense
);
}
}
catch
(
Exception
e
)
{
throw
new
BusinessException
(
ResultEnum
.
CAR_KEY_EXCEP_9
);
}
...
...
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