|
@@ -10,7 +10,6 @@ import org.springframework.stereotype.Component;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.persagy.common.constant.SaasCommonConstant;
|
|
import com.persagy.common.constant.SaasCommonConstant;
|
|
import com.persagy.common.exception.BusinessException;
|
|
import com.persagy.common.exception.BusinessException;
|
|
@@ -139,11 +138,9 @@ public class SaasRoleMenuHandler {
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
public boolean deleteSaasRole(SaasRoleDeleteVO deleteVO) {
|
|
public boolean deleteSaasRole(SaasRoleDeleteVO deleteVO) {
|
|
- LambdaUpdateWrapper<SaasRole> updateWrapper = new SaasRole.Builder().createUpdateWrapper().idEq(deleteVO.getId())
|
|
|
|
- .validEq(SaasCommonConstant.STATUS_1).builderUpdateWrapper();
|
|
|
|
- updateWrapper.set(SaasRole::getUpdateUser, deleteVO.getAccountId());
|
|
|
|
- updateWrapper.set(SaasRole::getValid, SaasCommonConstant.STATUS_0);
|
|
|
|
- boolean result = this.saasRoleService.update(updateWrapper);
|
|
|
|
|
|
+ LambdaQueryWrapper<SaasRole> updateWrapper = new SaasRole.Builder().createQueryWrapper().idEq(deleteVO.getId())
|
|
|
|
+ .validEq(SaasCommonConstant.STATUS_1).builderQueryWrapper();
|
|
|
|
+ boolean result = this.saasRoleService.remove(updateWrapper);
|
|
if (result) {
|
|
if (result) {
|
|
// 1.级联删除账号和角色关联关系
|
|
// 1.级联删除账号和角色关联关系
|
|
LambdaQueryWrapper<SaasAccountRole> accountRoleWrapper = new SaasAccountRole.Builder().createQueryWrapper().roleIdEq(deleteVO.getId()).builderQueryWrapper();
|
|
LambdaQueryWrapper<SaasAccountRole> accountRoleWrapper = new SaasAccountRole.Builder().createQueryWrapper().roleIdEq(deleteVO.getId()).builderQueryWrapper();
|