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 0c1a6d49
authored
May 01, 2021
by
fz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.将钥匙敏感信息加密
1 parent
6a71f1a9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
7 deletions
src/main/java/com/glsx/smart/dao/mapper/SmartVehicleBlueKeyMapper.java
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/resources/mapper/SmartVehicleBlueKeyMapper.xml
src/main/java/com/glsx/smart/dao/mapper/SmartVehicleBlueKeyMapper.java
View file @
0c1a6d4
...
@@ -66,4 +66,6 @@ public interface SmartVehicleBlueKeyMapper {
...
@@ -66,4 +66,6 @@ public interface SmartVehicleBlueKeyMapper {
* @return update count
* @return update count
*/
*/
int
updateByPrimaryKey
(
SmartVehicleBlueKey
record
);
int
updateByPrimaryKey
(
SmartVehicleBlueKey
record
);
int
removeKeyByIds
(
List
<
Long
>
keyIds
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/com/glsx/smart/service/SmartVehicleBlueKeyService.java
View file @
0c1a6d4
...
@@ -36,6 +36,8 @@ public interface SmartVehicleBlueKeyService {
...
@@ -36,6 +36,8 @@ public interface SmartVehicleBlueKeyService {
List
<
SmartVehicleBlueKey
>
selectByUserAndSn
(
Long
userId
,
String
sn
);
List
<
SmartVehicleBlueKey
>
selectByUserAndSn
(
Long
userId
,
String
sn
);
List
<
SmartVehicleBlueKey
>
selectById
(
Long
id
);
List
<
SmartVehicleBlueKey
>
selectById
(
Long
id
);
int
removeKeyByIds
(
List
<
Long
>
keyIds
);
}
}
...
...
src/main/java/com/glsx/smart/service/impl/AiLockingKeyServiceImpl.java
View file @
0c1a6d4
...
@@ -135,14 +135,14 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
...
@@ -135,14 +135,14 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
public
R
removeKeysByUser
(
SmartCarKeyUserRequest
request
)
{
public
R
removeKeysByUser
(
SmartCarKeyUserRequest
request
)
{
try
{
try
{
long
userId
=
Long
.
valueOf
(
request
.
getUserId
());
long
userId
=
Long
.
valueOf
(
request
.
getUserId
());
SmartVehicleBlueKey
smartVehicleBlueKey
=
new
SmartVehicleBlueKey
();
smartVehicleBlueKey
.
setIsDelete
(
1
);
//逻辑删除蓝牙车钥匙设备
//逻辑删除蓝牙车钥匙设备
SmartVehicleBlueKeyExample
example
=
new
SmartVehicleBlueKeyExample
();
SmartVehicleBlueKeyExample
example
=
new
SmartVehicleBlueKeyExample
();
example
.
createCriteria
()
example
.
createCriteria
()
.
andUserIdEqualTo
(
userId
)
.
andUserIdEqualTo
(
userId
)
.
andIsDeleteEqualTo
(
0
);
.
andIsDeleteEqualTo
(
0
);
List
<
SmartVehicleBlueKey
>
blueKeys
=
smartVehicleBlueKeyService
.
selectByExample
(
example
);
List
<
SmartVehicleBlueKey
>
blueKeys
=
smartVehicleBlueKeyService
.
selectByExample
(
example
);
List
<
Long
>
KeyIds
=
new
ArrayList
<>();
List
<
Long
>
KeyIds
=
new
ArrayList
<>();
...
@@ -151,13 +151,11 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
...
@@ -151,13 +151,11 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
KeyIds
=
blueKeys
.
stream
().
map
(
SmartVehicleBlueKey:
:
getId
).
collect
(
Collectors
.
toList
());
KeyIds
=
blueKeys
.
stream
().
map
(
SmartVehicleBlueKey:
:
getId
).
collect
(
Collectors
.
toList
());
}
}
//逻辑删除主钥匙
smartVehicleBlueKeyService
.
updateByExampleSelective
(
smartVehicleBlueKey
,
example
);
//主钥匙的分享钥匙关闭分享
if
(
CollectionUtils
.
isNotEmpty
(
KeyIds
))
{
if
(
CollectionUtils
.
isNotEmpty
(
KeyIds
))
{
//主钥匙的分享钥匙关闭分享
smartVehicleBlueShareKeyService
.
closeShareKeyByMainKeyIds
(
KeyIds
);
smartVehicleBlueShareKeyService
.
closeShareKeyByMainKeyIds
(
KeyIds
);
//逻辑删除主钥匙
smartVehicleBlueKeyService
.
removeKeyByIds
(
KeyIds
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
R
.
error
(
e
.
getMessage
());
return
R
.
error
(
e
.
getMessage
());
...
...
src/main/java/com/glsx/smart/service/impl/SmartVehicleBlueKeyServiceImpl.java
View file @
0c1a6d4
...
@@ -94,6 +94,11 @@ public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyServic
...
@@ -94,6 +94,11 @@ public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyServic
.
andIsDeleteEqualTo
(
0
);
.
andIsDeleteEqualTo
(
0
);
return
smartVehicleBlueKeyMapper
.
selectByExample
(
example
);
return
smartVehicleBlueKeyMapper
.
selectByExample
(
example
);
}
}
@Override
public
int
removeKeyByIds
(
List
<
Long
>
keyIds
)
{
return
smartVehicleBlueKeyMapper
.
removeKeyByIds
(
keyIds
);
}
}
}
...
...
src/main/resources/mapper/SmartVehicleBlueKeyMapper.xml
View file @
0c1a6d4
...
@@ -375,4 +375,15 @@
...
@@ -375,4 +375,15 @@
share_status = #{shareStatus,jdbcType=TINYINT}
share_status = #{shareStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
<update
id=
"removeKeyByIds"
>
update smart_vehicle_blue_key
<set>
is_delete = 1
</set>
where id in
<foreach
close=
")"
collection=
"list"
index=
"index"
item=
"keyId"
open=
"("
separator=
","
>
#{keyId}
</foreach>
</update>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
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