| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.AreaInfMapper; |
| | | import com.whyc.mapper.AuthiruzeInfMapper; |
| | | import com.whyc.mapper.LockInfMapper; |
| | | import com.whyc.mapper.UserInfMapper; |
| | | import com.whyc.pojo.db_area.AreaInf; |
| | | import com.whyc.pojo.db_area.AuthiruzeInf; |
| | | import com.whyc.pojo.db_area.KeyInf; |
| | | import com.whyc.pojo.db_area.LockInf; |
| | | import com.whyc.pojo.db_user.UserInf; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.MD5Util; |
| | | import com.whyc.util.PageInfoUtils; |
| | | import com.whyc.util.RSAUtil; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.authc.UnknownAccountException; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private AreaInfMapper ainfMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private AuthiruzeInfMapper authMapper; |
| | | |
| | | @Autowired(required = false) |
| | | private LockInfMapper linfMapper; |
| | | |
| | | //查询所有用户信息 |
| | | public Response getAllUser(String uname,String realName,Integer role, int pageCurr, int pageSize) { |
| | |
| | | List<UserInf> list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list!=null,list,"查询未被指定区域的用户"); |
| | | } |
| | | //查询当前用户授予权限的锁 |
| | | public Response getLockWithAuth() { |
| | | UserInf uinf=ActionUtil.getUser(); |
| | | QueryWrapper authwrapper=new QueryWrapper(); |
| | | authwrapper.eq("uid",uinf.getUid()); |
| | | List<AuthiruzeInf> auth=authMapper.selectList(authwrapper); |
| | | //获取锁信息 |
| | | List<Integer> lockIdList=auth.stream().map(AuthiruzeInf::getLockId).collect(Collectors.toList()); |
| | | QueryWrapper lockwrapper=new QueryWrapper(); |
| | | lockwrapper.in("lock_id",lockIdList); |
| | | List<KeyInf> list=linfMapper.selectList(lockwrapper); |
| | | return new Response().setII(1,list!=null,list,"查询当前用户授予权限的锁"); |
| | | } |
| | | } |