whyclxw
2025-03-25 a7fef2846505b08e0711345b17902e7381612d23
src/main/java/com/whyc/service/AreaInfService.java
@@ -2,13 +2,17 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.HomeCtlGroupDto;
import com.whyc.dto.Response;
import com.whyc.mapper.*;
import com.whyc.pojo.db_area.AreaInf;
import com.whyc.pojo.db_area.AreaUser;
import com.whyc.pojo.db_area.KeyInf;
import com.whyc.pojo.db_area.LockInf;
import com.whyc.pojo.db_lock_ram.LockCtlLog;
import com.whyc.pojo.db_lock_ram.LockReport;
import com.whyc.pojo.db_user.UserInf;
import com.whyc.util.ActionUtil;
import com.whyc.util.PageInfoUtils;
@@ -20,6 +24,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.LogRecord;
import java.util.stream.Collectors;
@Service
@@ -43,11 +48,23 @@
    @Autowired(required = false)
    private AreaUserService areaUserService;
   //查看当前用户管理的所有区域
    @Autowired(required = false)
    private LockCtlLogService ctlLogService;
    @Autowired(required = false)
    private UserInfMapper uinfMapper;
    @Autowired(required = false)
    private LockReportService reportService;
    //查看当前用户管理的所有区域
   public List getAllAreaUser(int uid,int urole){
       //获取用户所管理的区域
       List<Integer> list =areaUserService.setAreaId(uid);
       List areaList=new ArrayList();
       areaList.addAll(list);
       if (urole==1) {
           for (Integer aid:list) {
               List list1=new ArrayList();
@@ -55,12 +72,18 @@
               areaList.addAll(list1);
           }
       }
       if (urole==2) {
          List<AreaInf> allList=mapper.selectList(null);
          List<Integer> idList=allList.stream().map(AreaInf::getId)
                   .collect(Collectors.toList());
           areaList.addAll(idList);
       }
       return areaList;
   }
    //查询所有区域信息
    public Response getAllAreaInf() {
        UserInf uinf= ActionUtil.getUser();
    public Response getAllAreaInf(String uname) {
        UserInf uinf=uinfMapper.getUinfByUname(uname);
        if(uinf.getUrole()!=2) {//当前用户不是超级管理员
            List areaList=getAllAreaUser(uinf.getUid(),uinf.getUrole());
            List<AreaInf> list1 = mapper.selectAreaByUid(areaList, 1);
@@ -71,7 +94,8 @@
        }
    }
    //添加区域
    public Response addArea(Integer parentId, String areaName,String areaDescript) {
    @Transactional
    public Response addArea(Integer parentId, List<AreaUser> areaUserList, String areaName,String areaDescript) {
        AreaInf ainf=new AreaInf();
        ainf.setParentId(0);
        ainf.setAreaLevel(1);
@@ -92,6 +116,24 @@
            ainf.setIdPath(painf.getIdPath()+"_"+parentId);
        }
        int flag= mapper.insert(ainf);
        if(areaUserList!=null&&areaUserList.size()>0){
            //将对应关系添加到areauser中
            QueryWrapper ainfWrapper=new QueryWrapper();
            ainfWrapper.eq("parent_id",parentId);
            ainfWrapper.eq("area_name",areaName);
            ainfWrapper.last("limit 1");
            AreaInf area=mapper.selectOne(ainfWrapper);
            areaUserService.insertAreaUser(area.getId(),areaUserList);
            //将用户urole改为1
            List<Integer> uidList=areaUserList.stream().map(AreaUser::getUid) // 提取用户名
                .collect(Collectors.toList());
            UpdateWrapper userWrapper=new UpdateWrapper();
            userWrapper.set("urole",1);
            userWrapper.in("uid",uidList);
            userWrapper.eq("urole",0);
            uInfMapper.update(null,userWrapper);
        }
        return new Response().set(1,flag>0);
    }
    //删除区域
@@ -99,14 +141,14 @@
        //验证区域是否被用户管理
        List<AreaUser> listUser=areaUserService.getAreaUser(id);
        if(listUser!=null&&listUser.size()>0){
            return  new Response().set(1,false,"区域是被用户管理");
            return  new Response().set(1,false,"区域下存在用户,拒绝删除");
        }
        //验证区域是否存在锁
        QueryWrapper wrapperLock=new QueryWrapper();
        wrapperLock.eq("area_id",id);
        List<LockInf> listLock=linfMapper.selectList(wrapperLock);
        if(listLock!=null&&listLock.size()>0){
            return  new Response().set(1,false,"区域存在锁");
            return  new Response().set(1,false,"区域下存在锁,拒绝删除");
        }
        delAll(id);
        return new Response().set(1,true);
@@ -144,8 +186,10 @@
        updateAll(id,newPath);
        //删除旧的区域对应关系
        areaUserService.delteAreaUser(id);
        //将新的插入
        areaUserService.insertAreaUser(id,areaUserList);
        if(areaUserList!=null&&areaUserList.size()>0){
            //将新的插入
            areaUserService.insertAreaUser(id,areaUserList);
        }
        return new Response().set(1,true);
    }
    public void updateAll(Integer id, String newPath) {
@@ -188,26 +232,24 @@
        }
    }
    //区域管理员登录查看自己管理区域,锁具和区域对应的用户--区域管理员
    public Response getInfByAreaManage() {
    public Response getInfByAreaManage(String uname) {
        Map<String,Object> map=new HashMap<>();
        UserInf uinf=ActionUtil.getUser();
        UserInf uinf=uinfMapper.getUinfByUname(uname);
        List areaList=getAllAreaUser(uinf.getUid(),uinf.getUrole());
        //通过区域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);
        List<String> uids=areaUserService.selectUidByAreaId(areaList);
        map.put("areaNum",areaList.size());
        map.put("lockNum",linfs.size());
        map.put("userNum",uinfs.size());
        map.put("userNum",uids.size());
        return new Response().setII(1,true,map,"区域管理员登录查看自己管理区域,锁具和区域对应的用户--区域管理员");
    }
    //区域管理员点击管理的区域跳转--区域管理员
    public Response getAinfByManage() {
        UserInf uinf=ActionUtil.getUser();
    public Response getAinfByManage(String uname) {
        UserInf uinf=uinfMapper.getUinfByUname(uname);
        List areaList=getAllAreaUser(uinf.getUid(),uinf.getUrole());
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.in("id",areaList);
@@ -228,64 +270,354 @@
        return new Response().setII(1,linfs!=null,linfs,"区域管理员点击指定区域查看所有的锁信息--区域管理员");
    }
    //查询所有区域下所有用户信息
    /* public Response getUinfById(Integer id, int pageNum, int pageSize) {
        //获取获取id下所有的区域id
        List uinfList=new ArrayList();
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("id",id);
        wrapper.last("limit 1");
        AreaInf ainf=mapper.selectOne(wrapper);
        if(ainf!=null){
            uinfList.add(ainf.getAreaUname());
        }
        getAllUinfId(id,uinfList);
        QueryWrapper wrapper1=new QueryWrapper();
        wrapper1.select("uid","uname","CREATE_TIME");
        wrapper1.in("uname",uinfList);
        List<UserInf> list=uInfMapper.selectList(wrapper1);
        PageInfo pageInfo=PageInfoUtils.list2PageInfo(list,pageNum,pageSize);
        return new Response().setII(1,list!=null,pageInfo,"查询所有区域下所有用户信息");
    }*/
    //区域管理员点击查看开锁操作记录--区域管理员
    public Response getCtlog(int pageNum, int pageSize,String uname) {
        Map<String,Object> map=new HashMap<>();
        PageInfo pageInfo=new PageInfo();
        map.put("sumLog",0);
        //map.put("goodLogNum",0);
        map.put("errorLogNum",0);
        map.put("allLogs",pageInfo);
        UserInf uinf=uinfMapper.getUinfByUname(uname);
        //查看所有区域
        List areaList=getAllAreaUser(uinf.getUid(),uinf.getUrole());
        //查看区域下所有的锁
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.in("area_id",areaList);
        List<LockInf> linfs=linfMapper.selectList(linfWrapper);
        if(linfs!=null&&linfs.size()>0){
            List<Integer> lockIds=linfs.stream().map(LockInf::getLockId) // 提取用户名
                    .collect(Collectors.toList()); // 转换为列表*/
            //获取锁的日志
            List<LockCtlLog> logList=ctlLogService.getAllErrorLog(lockIds);
            if(logList!=null&&logList.size()>0){
                map.put("sumLog",logList.size());
                Map<Integer, List<LockCtlLog>> logmap = logList.stream().collect(Collectors.groupingBy(LockCtlLog::getCtlResult));
                for (Integer result : logmap.keySet()) {
                    if(result==0){
                        map.put("errorLogNum", logmap.get(0).size());//失败
                    }
                }
                pageInfo=PageInfoUtils.list2PageInfo(logList,pageNum,pageSize);
                map.put("allLogs",pageInfo);
            }
   /* //获取获取id下所有的区域用户名
    private void getAllUinfId(Integer id,List uinfList) {
        }
        return new Response().setII(1,true,map,"区域管理员点击查看开锁操作记录--区域管理员");
    }
    //区域管理员查看区域下的锁的状态--区域管理员
    public Response getAreaLockById(int id) {
        Map<String,Object> map=new HashMap<>();
        map.put("sumLinf",0);
        map.put("onlineNum",0);
        map.put("offLineNum",0);
        map.put("openNum",0);
        map.put("closeNum",0);
        map.put("unLoadNum",0);
        List<LockInf> linfs=new ArrayList<>();
        map.put("allLinfs",linfs);
        List areaList=new ArrayList();
        areaList.add(id);
        getAllAreaId(id,areaList);
        //查看区域下所有的锁
        linfs=linfMapper.selectAllLockById(areaList);
        if(linfs!=null&&linfs.size()>0){
            map.put("sumLinf",linfs.size());
            Map<Integer, List<LockInf>> onlinemap = linfs.stream().collect(Collectors.groupingBy(LockInf::getLockOnline));
            for (Integer state : onlinemap.keySet()) {
                if(state==0){
                    map.put("offLineNum", onlinemap.get(0).size());//离线
                }
                if(state==1){
                    map.put("onlineNum", onlinemap.get(1).size());//在线
                }
            }
            Map<Integer, List<LockInf>> openmap = linfs.stream().collect(Collectors.groupingBy(LockInf::getLockState));
            for (Integer open : openmap.keySet()) {
                if(open==0){
                    map.put("closeNum", openmap.get(0).size());//闭锁
                }
                if(open==1){
                    map.put("openNum", openmap.get(1).size());//开锁
                }
                if(open==-1){
                    map.put("unLoadNum", openmap.get(-1).size());//未安装
                }
            }
            map.put("allLinfs",linfs);
        }
        return new Response().setII(1,true,map,"区域管理员查看区域下的锁的状态--区域管理员");
    }
    //区域管理员查看指定区域下的锁具告警(失败的)--区域管理员
    public Response getErrLogByUid(int pageNum, int pageSize,String uname) {
        UserInf uinf=uinfMapper.getUinfByUname(uname);
        //查看所有区域
        List areaList=getAllAreaUser(uinf.getUid(),uinf.getUrole());
        //查看区域下所有的锁
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.in("area_id",areaList);
        List<LockInf> linfs=linfMapper.selectList(linfWrapper);
        if(linfs!=null&&linfs.size()>0){
            List<Integer> lockIds=linfs.stream().map(LockInf::getLockId) // 提取用户名
                    .collect(Collectors.toList()); // 转换为列表*/
            //获取锁的日志
            PageHelper.startPage(pageNum,pageSize);
            List<LockCtlLog> logList=ctlLogService.getAllErrorLog(lockIds);
            PageInfo pageInfo=new PageInfo(logList);
            return new Response().setII(1,true,pageInfo,"区域管理员点击查看开锁操作记录--区域管理员");
        }else{
            return new Response().set(1,false,"区域管理员点击查看开锁操作记录--区域管理员");
        }
    }
    //区域管理员查看指定区域下的锁具告警(全部的的)--区域管理员
    public Response getAllLogByUid(int pageNum, int pageSize,String uname) {
        UserInf uinf=uinfMapper.getUinfByUname(uname);
        //查看所有区域
        List areaList=getAllAreaUser(uinf.getUid(),uinf.getUrole());
        //查看区域下所有的锁
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.in("area_id",areaList);
        List<LockInf> linfs=linfMapper.selectList(linfWrapper);
        if(linfs!=null&&linfs.size()>0){
            List<Integer> lockIds=linfs.stream().map(LockInf::getLockId) // 提取用户名
                    .collect(Collectors.toList()); // 转换为列表*/
            //获取锁的日志
            PageHelper.startPage(pageNum,pageSize);
            List<LockCtlLog> logList=ctlLogService.getAllLog(lockIds);
            PageInfo pageInfo=new PageInfo(logList);
            return new Response().setII(1,true,pageInfo,"区域管理员点击查看开锁操作记录--区域管理员");
        }else{
            return new Response().set(1,false,"区域管理员点击查看开锁操作记录--区域管理员");
        }
    }
    //区域管理员记录手机蓝牙开锁日志--区域管理员
    public Response setLogByUid(String mac, int result,String uname) {
        //根据mac获取锁的id
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.eq("lock_mac",mac);
        linfWrapper.last("limit 1");
        LockInf linf=linfMapper.selectOne(linfWrapper);
        UserInf uinf=uinfMapper.getUinfByUname(uname);
        //添加操作记录
        ctlLogService.setLogByUid(linf.getLockId(),result,uinf.getUname());
        return new Response().set(1,true);
    }
    //查询所有区域下所有锁信息
    public Response getLinfById(Integer id) {
        //获取获取id下所有的区域id
        List areaList=new ArrayList();
        areaList.add(id);
        getAllAreaId(id,areaList);
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("parent_id",id);
        List<AreaInf> list=mapper.selectList(wrapper);
        if(list!=null){
            for (AreaInf painf:list) {
                uinfList.add(painf.getAreaUname());
                getAllUinfId(painf.getId(),uinfList);
        wrapper.in("area_id",areaList);
        List<LockInf> list=linfMapper.selectList(wrapper);
        return new Response().setII(1,list!=null,list,"查询所有区域下所有锁信息");
    }
    //查询所在区域下所有用户信息
    public Response getUinfById(Integer id) {
        List areaList=new ArrayList();
        areaList.add(id);
        getAllAreaId(id,areaList);
        List<String> unameList=areaUserService.getUserNameByAreaIds(areaList);
        return new Response().setII(1,unameList!=null,unameList,"查询所在区域下所有用户信息");
    }
    //查询开锁日志
    public Response getLockLog(LockCtlLog log, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        QueryWrapper wrapper=new QueryWrapper();
        if(log.getAreaId()!=null){
            List<Integer> areaList=new ArrayList();
            areaList.add(log.getAreaId());
            getAllAreaId(log.getAreaId(),areaList);
            //查询区域下所有的锁
            QueryWrapper wrapper1=new QueryWrapper();
            wrapper1.in("area_id",areaList);
            List<LockInf> linfs=linfMapper.selectList(wrapper1);
            if(linfs!=null&&linfs.size()>0){
                List lockIds=linfs.stream().map(LockInf::getLockId)
                        .collect(Collectors.toList());
                wrapper.in("lock_id",lockIds);
            }else{
                wrapper.eq("lock_id",0);//当区域下没有锁的时候
            }
        }
    }*/
   //查询所有区域下所有钥匙信息
   /* public Response getKinfById(Integer id, int pageNum, int pageSize) {
        //获取获取id下所有的区域id
        List areaList=new ArrayList();
        areaList.add(id);
        getAllAreaId(id,areaList);
        if(log.getLockId()!=null){
            wrapper.eq("lock_id",log.getLockId());
        }
        if(log.getCtlResult()!=null){
            wrapper.eq("ctl_result",log.getCtlResult());
        }
        if(log.getCtlType()!=null){
            wrapper.eq("ctl_type",log.getCtlType());
        }
        if(log.getCtlUname()!=null){
            wrapper.eq("ctl_uname",log.getCtlUname());
        }
        if(log.getStartTime()!=null){
            wrapper.gt("ctl_time",log.getStartTime());
        }
        if(log.getEndTime()!=null){
            wrapper.lt("ctl_time",log.getEndTime());
        }
        wrapper.orderByDesc("ctl_time");
        List<LockCtlLog> list=ctlLogMapper.selectList(wrapper);
        for (LockCtlLog l:list) {
            QueryWrapper wrapper1=new QueryWrapper();
            wrapper1.eq("lock_id",l.getLockId());
            wrapper1.last("limit 1");
            LockInf linf=linfMapper.selectOne(wrapper1);
            l.setLockName(linf.getLockName());
        }
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"查询最近的开锁日志");
    }
    //首页分组统计前10开锁次数
    public Response getGroupCtlCount(int uid,int urole) {
        List areaList=getAllAreaUser(uid,urole);
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.in("area_id",areaList);
        List<KeyInf> list=kinfMapper.selectList(wrapper);
        PageInfo pageInfo=PageInfoUtils.list2PageInfo(list,pageNum,pageSize);
        return new Response().setII(1,list!=null,pageInfo,"查询所有区域下所有钥匙信息");
    }*/
   /* //查询所在区域下所有开锁日志
    public Response getLogById(Integer id, int pageNum, int pageSize) {
        //获取获取id下所有的区域id
        List areaList=new ArrayList();
        areaList.add(id);
        getAllAreaId(id,areaList);
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.in("area_id",areaList);
        List<LockInf> lockList=linfMapper.selectList(wrapper);
        List<Integer> lockIdList=lockList.stream().map(LockInf::getLockId).collect(Collectors.toList());
        QueryWrapper logwrapper=new QueryWrapper();
        wrapper.in("lock_id",lockIdList);
        List<KeyInf> list=ctlLogMapper.selectList(logwrapper);
        PageInfo pageInfo=PageInfoUtils.list2PageInfo(list,pageNum,pageSize);
        return new Response().setII(1,list!=null,pageInfo,"查询所在区域下所有开锁日志");
    }*/
        wrapper.orderByAsc("num");
        List<LockInf> list=linfMapper.selectList(wrapper);
        //根据用户id查询管理的锁的id
        List<HomeCtlGroupDto> listGroup=ctlLogMapper.getGroupCtlCount(uid);
        return new Response().setII(1,listGroup!=null,listGroup,"首页分组统计前10开锁次数");
    }
    //首页统计屏柜类型
    public Response getScreenBoxType(int uid,int urole) {
        try {
            List areaList=getAllAreaUser(uid,urole);
            QueryWrapper wrapper=new QueryWrapper();
            wrapper.in("area_id",areaList);
            wrapper.eq("screen_flag",1);//只取屏柜
            wrapper.orderByAsc("num");
            List<LockInf> list=linfMapper.selectList(wrapper);
            Map<String, List<LockInf>>  boxType = list.stream().collect(Collectors.groupingBy(LockInf::getScreenBoxType));
            Map<String, Object> map = new HashMap<>();
            Map<String, Object> typeMap = new HashMap<>();
            for (String type : boxType.keySet()) {
                typeMap.put(type, boxType.get(type).size());
            }
            map.put("type",typeMap);
            Map<String, List<LockInf>>  productType = list.stream().collect(Collectors.groupingBy(LockInf::getScreenBoxProduct));
            Map<String, Object> productMap = new HashMap<>();
            for (String product : productType.keySet()) {
                productMap.put(product, productType.get(product).size());
            }
            map.put("product",productMap);
            return new Response().setII(1,true,map,"首页统计屏柜类型");
        } catch (Exception e) {
            return new Response().set(1,false,"首页统计屏柜类型");
        }
    }
    //锁的工作状态
    public Response getLockState(int uid, int urole) {
        try {
            List areaList = getAllAreaUser(uid, urole);
            QueryWrapper wrapper = new QueryWrapper();
            wrapper.in("area_id", areaList);
            wrapper.orderByAsc("num");
            List<LockInf> list = linfMapper.selectList(wrapper);
            Map<String, Object> map = new HashMap<>();
            map.put("sumLinf", 0);
            map.put("onlineNum", 0);
            map.put("offLineNum", 0);
            map.put("openNum", 0);
            map.put("closeNum", 0);
            map.put("unLoadNum", 0);
            //查看区域下所有的锁
            map.put("sumLinf", list.size());
            Map<Integer, List<LockInf>> onlinemap = list.stream().collect(Collectors.groupingBy(LockInf::getLockOnline));
            for (Integer state : onlinemap.keySet()) {
                if (state == 0) {
                    map.put("offLineNum", onlinemap.get(0).size());//离线
                }
                if (state == 1) {
                    map.put("onlineNum", onlinemap.get(1).size());//在线
                }
            }
            Map<Integer, List<LockInf>> openmap = list.stream().collect(Collectors.groupingBy(LockInf::getLockState));
            for (Integer open : openmap.keySet()) {
                if (open == 0) {
                    map.put("closeNum", openmap.get(0).size());//闭锁
                }
                if (open == 1) {
                    map.put("openNum", openmap.get(1).size());//开锁
                }
                if (open == -1) {
                    map.put("unLoadNum", openmap.get(-1).size());//未安装
                }
                map.put("allLinfs", list);
            }
                return new Response().setII(1, true, map, "锁的工作状态");
            } catch(Exception e){
                return new Response().set(1, false, "锁的工作状态");
        }
    }
    //实时开锁信息(全部)
    public Response getAllCtlLog(int userId, int urole) {
        //查看所有区域
        List areaList=getAllAreaUser(userId,urole);
        //查看区域下所有的锁
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.in("area_id",areaList);
        List<LockInf> linfs=linfMapper.selectList(linfWrapper);
        if(linfs!=null&&linfs.size()>0){
            List<Integer> lockIds=linfs.stream().map(LockInf::getLockId) // 提取用户名
                    .collect(Collectors.toList()); // 转换为列表*/
            //获取锁的日志
            List<LockCtlLog> logList=ctlLogService.getAllLog(lockIds);
            return new Response().setII(1,true,logList,"实时开锁信息(全部)");
        }
        return new Response().set(1,false,"实时开锁信息(全部)");
    }
    //实时开锁信息(失败)
    public Response getErrorCtlog(int userId, int urole) {
        //查看所有区域
        List areaList=getAllAreaUser(userId,urole);
        //查看区域下所有的锁
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.in("area_id",areaList);
        List<LockInf> linfs=linfMapper.selectList(linfWrapper);
        if(linfs!=null&&linfs.size()>0){
            List<Integer> lockIds=linfs.stream().map(LockInf::getLockId) // 提取用户名
                    .collect(Collectors.toList()); // 转换为列表*/
            //获取锁的日志
            List<LockCtlLog> logList=ctlLogService.getAllErrorLog(lockIds);
            return new Response().setII(1,true,logList,"实时开锁信息(失败)");
        }
        return new Response().set(1,false,"实时开锁信息(失败)");
    }
    //lock的使用频次
    public Response getReport(int userId, int urole) {
        //查看所有区域
        List areaList=getAllAreaUser(userId,urole);
        //查看区域下所有的锁
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.in("area_id",areaList);
        List<LockInf> linfs=linfMapper.selectList(linfWrapper);
        if(linfs!=null&&linfs.size()>0){
            List<Integer> lockIds=linfs.stream().map(LockInf::getLockId) // 提取用户名
                    .collect(Collectors.toList()); // 转换为列表*/
            //获取锁的频次
            List<LockReport> reportList=reportService.getReport(lockIds);
            return new Response().setII(1,true,reportList,"lock的使用频次");
        }
        return new Response().set(1,false,"lock的使用频次");
    }
    //地图顶部的管理的区域包含子区域
    public Response getHomeAllAinf(int userId, int urole) {
        List<Integer> list=getAllAreaUser(userId,urole);
        if (list!=null){
            List<Integer> disList=list.stream().distinct()
                    .collect(Collectors.toList());
            return new Response().setII(1,true,disList.size(),"地图顶部的管理的区域包含子区域");
        }else{
            return new Response().setII(1,false,0,"地图顶部的管理的区域包含子区域");
        }
    }
}