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 fa20ff7e
authored
Apr 22, 2021
by
fz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.如果没有钥匙名称,设置默认钥匙名称
1 parent
8ff77ea0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
src/main/java/com/glsx/smart/service/impl/AiLockingKeyServiceImpl.java
src/main/java/com/glsx/smart/service/impl/AiLockingKeyServiceImpl.java
View file @
fa20ff7
...
@@ -76,6 +76,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
...
@@ -76,6 +76,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
newKey
.
setAutoSenseStatus
(
0
);
newKey
.
setAutoSenseStatus
(
0
);
newKey
.
setIsDelete
(
0
);
newKey
.
setIsDelete
(
0
);
newKey
.
setMobileCode
(
"0"
);
newKey
.
setMobileCode
(
"0"
);
newKey
.
setKeyName
(
"钥匙1"
);
smartVehicleBlueKeyService
.
insert
(
newKey
);
smartVehicleBlueKeyService
.
insert
(
newKey
);
//返回,crep用密文传输
//返回,crep用密文传输
...
@@ -114,6 +115,9 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
...
@@ -114,6 +115,9 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
throw
new
BusinessException
(
ResultEnum
.
ENCRYPT_EXCEP_2
);
throw
new
BusinessException
(
ResultEnum
.
ENCRYPT_EXCEP_2
);
}
}
if
(
StringUtils
.
isBlank
(
carkey
.
getKeyName
())){
response
.
setKeyName
(
"钥匙1"
);
}
response
.
setCrepCode
(
crep_encrypt
);
response
.
setCrepCode
(
crep_encrypt
);
response
.
setSecretKey
(
secret_key_encrypt
);
response
.
setSecretKey
(
secret_key_encrypt
);
return
R
.
ok
().
data
(
response
);
return
R
.
ok
().
data
(
response
);
...
@@ -147,6 +151,9 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
...
@@ -147,6 +151,9 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
}
}
if
(
StringUtils
.
isBlank
(
carkey
.
getKeyName
())){
carkey
.
setKeyName
(
"钥匙1"
);
}
//更新,crep用明文存储
//更新,crep用明文存储
carkey
.
setSn
(
request
.
getSn
());
carkey
.
setSn
(
request
.
getSn
());
carkey
.
setUserId
(
Long
.
valueOf
(
request
.
getUserId
()));
carkey
.
setUserId
(
Long
.
valueOf
(
request
.
getUserId
()));
...
@@ -240,6 +247,17 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
...
@@ -240,6 +247,17 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
SmartVehicleBlueKeyExample
example
=
new
SmartVehicleBlueKeyExample
();
SmartVehicleBlueKeyExample
example
=
new
SmartVehicleBlueKeyExample
();
example
.
createCriteria
().
andUserIdEqualTo
(
Long
.
valueOf
(
request
.
getUserId
())).
andIsDeleteEqualTo
(
0
);
example
.
createCriteria
().
andUserIdEqualTo
(
Long
.
valueOf
(
request
.
getUserId
())).
andIsDeleteEqualTo
(
0
);
List
<
SmartVehicleBlueKey
>
keyList
=
smartVehicleBlueKeyService
.
selectByExample
(
example
);
List
<
SmartVehicleBlueKey
>
keyList
=
smartVehicleBlueKeyService
.
selectByExample
(
example
);
//给没有名称的钥匙设置名字
if
(
CollectionUtils
.
isNotEmpty
(
keyList
)){
int
num
=
1
;
for
(
int
i
=
0
;
i
<
keyList
.
size
();
i
++){
SmartVehicleBlueKey
key
=
keyList
.
get
(
i
);
if
(
StringUtils
.
isBlank
(
key
.
getKeyName
())){
key
.
setKeyName
(
"钥匙"
+
num
++);
}
}
}
return
R
.
ok
().
data
(
keyList
);
return
R
.
ok
().
data
(
keyList
);
}
}
...
...
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