whyclxw
2025-05-15 476ccf8a7dcd23806dd49944659ec34575047c40
src/main/java/com/whyc/service/BaojigroupService.java
@@ -164,11 +164,11 @@
    public Map<String, List<PowerInf>> getStationList(int id) {
        Map<String,List<PowerInf>> resultMap = new LinkedHashMap<>();
        //查询已添加的机房站点列表
        List<PowerInf> lockList = bjPowermapper.getPowerList(id);
        List<PowerInf> allLockList = powerInfMapper.getPowerList();
        List<PowerInf> notRelatedLockList = allLockList.stream().filter(PowerInf -> !lockList.contains(PowerInf)).collect(Collectors.toList());
        List<PowerInf> powerList = bjPowermapper.getPowerList(id);
        List<PowerInf> allPowerList = powerInfMapper.getPowerList();
        List<PowerInf> notRelatedLockList = allPowerList.stream().filter(PowerInf -> !powerList.contains(PowerInf)).collect(Collectors.toList());
        resultMap.put("stationsAdded",lockList);
        resultMap.put("stationsAdded",powerList);
        resultMap.put("stationsNotAdded",notRelatedLockList);
        return resultMap;
@@ -194,4 +194,11 @@
        Integer flag =  bjUsrmapper.getGroupFlag(userId);
        return flag != null && flag == 1;
    }
    //先校验当前用户是否存在包机组
    public int checkUserBaojiGroup(Integer id) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("uid",id);
        List<BaojigroupUsr> list=bjUsrmapper.selectList(wrapper);
        return list == null?0:1 ;
    }
}