| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.RolePowerDto; |
| | | import com.yuanchu.mom.dto.UserPageDto; |
| | | import com.yuanchu.mom.mapper.PowerMapper; |
| | | import com.yuanchu.mom.mapper.RoleMapper; |
| | | import com.yuanchu.mom.mapper.UserMapper; |
| | | import com.yuanchu.mom.pojo.Menu; |
| | | import com.yuanchu.mom.pojo.Power; |
| | | import com.yuanchu.mom.pojo.Role; |
| | | import com.yuanchu.mom.pojo.User; |
| | | import com.yuanchu.mom.service.RoleService; |
| | | import com.yuanchu.mom.service.UserService; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.DigestUtils; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private PowerMapper powerMapper; |
| | | |
| | | private GetLook getLook; |
| | | private UserMapper userMapper; |
| | | |
| | | @Override |
| | | public List<Role> selectList() { |
| | |
| | | public int upRole(RolePowerDto rolePowerDto) { |
| | | Role role = new Role(); |
| | | role.setName(rolePowerDto.getRoleName()); |
| | | role.setCategory(rolePowerDto.getCategory()); |
| | | role.setId(rolePowerDto.getRoleId2()); |
| | | int up = roleMapper.updateById(role); |
| | | if (up == 1){ |
| | |
| | | } |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String getRole() { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | Integer roleId = userMapper.selectById(userId).getRoleId(); |
| | | Role role = roleMapper.selectById(roleId); |
| | | return role.getName(); |
| | | } |
| | | } |