|  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
 |  |  | import com.moral.api.entity.*; | 
 |  |  | import com.moral.api.mapper.*; | 
 |  |  | import com.moral.api.pojo.redisBean.AccountInfoDTO; | 
 |  |  | import com.moral.api.service.ManageRoleService; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import com.moral.api.util.LogUtils; | 
 |  |  | import com.moral.constant.Constants; | 
 |  |  | import com.moral.constant.ResponseCodeEnum; | 
 |  |  | import com.moral.util.TokenUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  | 
 |  |  | import javax.servlet.http.HttpServletRequest; | 
 |  |  | import java.text.SimpleDateFormat; | 
 |  |  | import java.util.*; | 
 |  |  | import java.util.function.Predicate; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * <p> | 
 |  |  | 
 |  |  |             manageRoleMap.put("key",manageRole.getId()); | 
 |  |  |             manageRolesList.add(manageRoleMap); | 
 |  |  |         } | 
 |  |  |         //除admin账号外  admin角色不可见 | 
 |  |  |         AccountInfoDTO accountInfo = (AccountInfoDTO) TokenUtils.getUserInfo(); | 
 |  |  |         List<ManageRole> roles = accountInfo.getRoles(); | 
 |  |  |         if(!roles.get(0).getName().equals("admin")){ | 
 |  |  |             manageRolesList.removeIf(new Predicate<Map<String, Object>>() { | 
 |  |  |                 @Override | 
 |  |  |                 public boolean test(Map<String, Object> map) { | 
 |  |  |                     if(map.get("name").equals("admin")) | 
 |  |  |                         return true; | 
 |  |  |                     return false; | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |         resultMap.put("manageRoles",manageRolesList); | 
 |  |  |         int totalNumber = manageRoleMapper.selectCount(wrapper); | 
 |  |  |         resultMap.put("totalNumber",totalNumber); |