whyclxw
2025-05-07 45ef9e340f9bb4b98fd88a758343470dfe125cb3
src/main/java/com/whyc/service/BattInfService.java
@@ -59,6 +59,9 @@
    @Autowired(required = false)
    private BaoJiGroupBattGroupMapper bjBattMapper;
    @Autowired(required = false)
    private DevalarmDataMapper devAlmMapper;
    public int searchMaxBattgroupId_zj() {
        Integer id = battInfMapper.getMaxBattGroupId_zj();
        if (id == null) {
@@ -989,7 +992,7 @@
        int devNum=0;
        int battNum=0;
        try {
            //查询battinf表中所有机房信息
            //查询battinf表中所有电池组信息
            List<Battinf> list=battInfMapper.getAllInfInSz2(userId);
            Map<String, List<Battinf>> ListMap = list.stream().collect(Collectors.groupingBy(Battinf::getStationName9));
            for (String stationName9 : ListMap.keySet()) {
@@ -1019,4 +1022,29 @@
        }
    }
    //4.中间地图
    public Response getAllStationInSz2(Integer userId) {
        Map<String,Object> map=new HashMap<>();
        try {
            //查询battinf表中所有机房信息
            List<Battinf> list=battInfMapper.getAllStationInSz2(userId);
            Map<String, List<Battinf>> ListMap = list.stream().collect(Collectors.groupingBy(Battinf::getStationName9));
            for (String stationName9 : ListMap.keySet())  {
                List<Battinf> name9List=ListMap.get(stationName9);
                for (Battinf binf:name9List) {
                    //判断机房下的设备告警是否都存在通讯告警 119020
                    int flag=devAlmMapper.judgeCommErr(binf.getStationId(),119020);
                    if(flag>0){
                        binf.setNote("0");
                    }else{
                        binf.setNote("1");
                    }
                }
                map.put(stationName9,name9List);
            }
            return new Response<>().setII(1,true,map,"");
        } catch (Exception e) {
            return new Response<>().set(1,false,"");
        }
    }
}