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 d0ef2ed0
authored
May 04, 2021
by
fz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.钥匙信息注册保存,给钥匙设置默认名字
1 parent
359013ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
src/main/java/com/glsx/smart/service/SmartVehicleBlueKeyService.java
src/main/java/com/glsx/smart/service/impl/AiLockingKeyServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartVehicleBlueKeyServiceImpl.java
src/main/java/com/glsx/smart/service/SmartVehicleBlueKeyService.java
View file @
d0ef2ed
...
...
@@ -2,7 +2,6 @@ package com.glsx.smart.service;
import
com.glsx.smart.dao.entity.SmartVehicleBlueKey
;
import
com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample
;
import
com.glsx.smart.dao.entity.SmartVehicleBlueShareKeyExample
;
import
java.util.List
;
...
...
@@ -38,6 +37,8 @@ public interface SmartVehicleBlueKeyService {
List
<
SmartVehicleBlueKey
>
selectById
(
Long
id
);
int
removeKeyByIds
(
List
<
Long
>
keyIds
);
long
countKeyByUser
(
long
userId
);
}
...
...
src/main/java/com/glsx/smart/service/impl/AiLockingKeyServiceImpl.java
View file @
d0ef2ed
...
...
@@ -359,11 +359,11 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
List
<
SmartCarKeyResponse
>
responseList
=
new
ArrayList
<>(
smartCarKeyResponseMap
.
values
());
//给没有名称的钥匙设置名字
AtomicInteger
num
=
new
AtomicInteger
(
1
);
responseList
.
stream
()
.
filter
(
key
->
StringUtils
.
isBlank
(
key
.
getKeyName
()))
.
forEach
(
key
->
key
.
setKeyName
(
"钥匙"
+
num
.
getAndIncrement
()));
//
//
给没有名称的钥匙设置名字
//
AtomicInteger num = new AtomicInteger(1);
//
responseList.stream()
//
.filter(key -> StringUtils.isBlank(key.getKeyName()))
//
.forEach(key -> key.setKeyName("钥匙" + num.getAndIncrement()));
//根据用户钥匙id,查询蓝牙,感应列表
...
...
@@ -517,6 +517,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
long
userId
=
Long
.
valueOf
(
request
.
getUserId
());
String
sn
=
request
.
getSn
();
long
count
=
smartVehicleBlueKeyService
.
countKeyByUser
(
userId
);
//如果sn没有车钥匙,生成只含有crep钥匙信息返回
SmartVehicleBlueKey
newKey
=
new
SmartVehicleBlueKey
();
newKey
.
setSn
(
sn
);
...
...
@@ -532,12 +534,11 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
//默认手机编号
newKey
.
setMobileCode
(
"0"
);
//默认车钥匙备注
newKey
.
setKeyName
(
"
"
);
newKey
.
setKeyName
(
"
钥匙"
+(++
count
)
);
//创建时间为现在
newKey
.
setCreateTime
(
new
Date
());
//默认0,正常数据
newKey
.
setIsDelete
(
0
);
newKey
.
setShareStatus
(
1
);
newKey
.
setPeripheralUuid
(
""
);
try
{
...
...
src/main/java/com/glsx/smart/service/impl/SmartVehicleBlueKeyServiceImpl.java
View file @
d0ef2ed
...
...
@@ -99,6 +99,14 @@ public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyServic
public
int
removeKeyByIds
(
List
<
Long
>
keyIds
)
{
return
smartVehicleBlueKeyMapper
.
removeKeyByIds
(
keyIds
);
}
@Override
public
long
countKeyByUser
(
long
userId
)
{
SmartVehicleBlueKeyExample
example
=
new
SmartVehicleBlueKeyExample
();
example
.
createCriteria
()
.
andUserIdEqualTo
(
userId
);
return
smartVehicleBlueKeyMapper
.
countByExample
(
example
);
}
}
...
...
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