Commit 0c1a6d49 by fz

1.将钥匙敏感信息加密

1 parent 6a71f1a9
......@@ -66,4 +66,6 @@ public interface SmartVehicleBlueKeyMapper {
* @return update count
*/
int updateByPrimaryKey(SmartVehicleBlueKey record);
int removeKeyByIds(List<Long> keyIds);
}
\ No newline at end of file
......@@ -36,6 +36,8 @@ public interface SmartVehicleBlueKeyService {
List<SmartVehicleBlueKey> selectByUserAndSn(Long userId, String sn);
List<SmartVehicleBlueKey> selectById(Long id);
int removeKeyByIds(List<Long> keyIds);
}
......
......@@ -135,14 +135,14 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
public R removeKeysByUser(SmartCarKeyUserRequest request) {
try {
long userId = Long.valueOf(request.getUserId());
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setIsDelete(1);
//逻辑删除蓝牙车钥匙设备
SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample();
example.createCriteria()
.andUserIdEqualTo(userId)
.andIsDeleteEqualTo(0);
List<SmartVehicleBlueKey> blueKeys = smartVehicleBlueKeyService.selectByExample(example);
List<Long> KeyIds = new ArrayList<>();
......@@ -151,13 +151,11 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
KeyIds = blueKeys.stream().map(SmartVehicleBlueKey::getId).collect(Collectors.toList());
}
//逻辑删除主钥匙
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey, example);
//主钥匙的分享钥匙关闭分享
if (CollectionUtils.isNotEmpty(KeyIds)) {
//主钥匙的分享钥匙关闭分享
smartVehicleBlueShareKeyService.closeShareKeyByMainKeyIds(KeyIds);
//逻辑删除主钥匙
smartVehicleBlueKeyService.removeKeyByIds(KeyIds);
}
} catch (Exception e) {
return R.error(e.getMessage());
......
......@@ -94,6 +94,11 @@ public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyServic
.andIsDeleteEqualTo(0);
return smartVehicleBlueKeyMapper.selectByExample(example);
}
@Override
public int removeKeyByIds(List<Long> keyIds) {
return smartVehicleBlueKeyMapper.removeKeyByIds(keyIds);
}
}
......
......@@ -375,4 +375,15 @@
share_status = #{shareStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</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>
\ 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!