区域管理员登录查看自己管理区域,锁具和区域对应的用户--区域管理员
2个文件已修改
35 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/AppController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/AreaInfService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/AppController.java
@@ -2,6 +2,7 @@
import com.whyc.dto.Response;
import com.whyc.pojo.db_area.AuthiruzeInf;
import com.whyc.service.AreaInfService;
import com.whyc.service.AuthiruzeInfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -17,10 +18,20 @@
    @Autowired
    private AuthiruzeInfService authService;
    @ApiOperation(value = "普通用户登录查看自己授权记录")
    @Autowired
    private AreaInfService ainfService;
    @ApiOperation(value = "普通用户登录查看自己授权记录--普通用户")
    @GetMapping("getAuthByUid")
    public Response getAuthByUid(){
        return authService.getAuthByUid();
    }
    @ApiOperation(value = "区域管理员登录查看自己管理区域,锁具和区域对应的用户--区域管理员")
    @GetMapping("getInfByAreaManage")
    public Response getInfByAreaManage(){
        return ainfService.getInfByAreaManage();
    }
}
src/main/java/com/whyc/service/AreaInfService.java
@@ -16,7 +16,9 @@
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@@ -163,6 +165,26 @@
            }
        }
    }
    //区域管理员登录查看自己管理区域,锁具和区域对应的用户--区域管理员
    public Response getInfByAreaManage() {
        Map<String,Object> map=new HashMap<>();
        UserInf uinf=ActionUtil.getUser();
        List areaList=new ArrayList();
        areaList.add(uinf.getAreaId());
        getAllAreaId(uinf.getAreaId(),areaList);
        //通过区域id查询所有的锁
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.in("area_id",areaList);
        List<LockInf> linfs=linfMapper.selectList(linfWrapper);
        //通过区域id查询所有的用户
        QueryWrapper uinfWrapper=new QueryWrapper();
        uinfWrapper.in("area_id",areaList);
        List<UserInf> uinfs=uInfMapper.selectList(linfWrapper);
        map.put("areaNum",areaList.size());
        map.put("lockNum",linfs.size());
        map.put("userNum",uinfs.size());
        return new Response().setII(1,true,map,"区域管理员登录查看自己管理区域,锁具和区域对应的用户--区域管理员");
    }
    //查询所有区域下所有用户信息
/*    public Response getUinfById(Integer id, int pageNum, int pageSize) {