Commit 0c1a6d49 by fz

1.将钥匙敏感信息加密

1 parent 6a71f1a9
...@@ -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
...@@ -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);
} }
......
...@@ -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());
......
...@@ -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);
}
} }
......
...@@ -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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!