| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.enums.RoleLevelStatus; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.redis.RedisService; |
| | | import com.sandu.common.security.LoginUserInfo; |
| | | import com.sandu.common.security.token.TokenProvider; |
| | |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | |
| | | if (removeById(id)) { |
| | | //删角色关系表信息 |
| | | flag = clientRoleRelationService.removeById(one); |
| | | List<Pole> poles = SpringContextHolder.getBean(PoleService.class).list(Wrappers.lambdaQuery(Pole.class).eq(Pole::getClientId, id)); |
| | | poles.forEach( |
| | | pole -> { |
| | | pole.setClientId(-1L); |
| | | pole.setUserId(-1L); |
| | | } |
| | | ); |
| | | //删除 |
| | | flag = SpringContextHolder.getBean(PoleService.class).updateBatchById(poles); |
| | | //删除失败回滚数据 |
| | | if (!flag) { |
| | | throw new BusinessException("删除用户失败!"); |
| | |
| | | |
| | | /** |
| | | * \ |
| | | * 其他类用来查找客户id使用 如果没有上级客户 这返回用户ID |
| | | * 其他类用来查找客户id使用 如果没有上级客户 返回-1 |
| | | * |
| | | * @param |
| | | * @return |
| | |
| | | if (one != null && one.getSuperiorId() != null) { |
| | | return one.getSuperiorId(); |
| | | } else { |
| | | return userId; |
| | | return -1L; |
| | | } |
| | | |
| | | } |