whyclxw
2025-05-07 45ef9e340f9bb4b98fd88a758343470dfe125cb3
苏州地铁推送修改
6个文件已修改
61 ■■■■■ 已修改文件
src/main/java/com/whyc/mapper/BattInfMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/DevalarmDataMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattInfService.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/ScreenForSZ2Socket.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattInfMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/DevalarmDataMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattInfMapper.java
@@ -137,4 +137,6 @@
    List<Battinf> getInfInStation(String stationId);
    //1统计机房个数,设备个数,电池组个数(苏州地铁)
    List<Battinf> getAllInfInSz2(Integer userId);
    //查询battinf表中所有机房信息
    List<Battinf> getAllStationInSz2(Integer userId);
}
src/main/java/com/whyc/mapper/DevalarmDataMapper.java
@@ -45,4 +45,6 @@
    List<DevalarmData> getListByStationIds(List<String> stationIdList);
    List<DevalarmData> getLevelListByUserId(int userId);
    //判断机房下的设备告警是否都存在通讯告警 119020
    int judgeCommErr(@Param("stationId") String stationId,@Param("almType") int almType);
}
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,"");
        }
    }
}
src/main/java/com/whyc/webSocket/ScreenForSZ2Socket.java
@@ -89,7 +89,7 @@
    public Map<String, Object> getStatic(Integer userId) throws InterruptedException {
        Map<String, Object> res = new HashMap<>();
        ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor();
        CountDownLatch latch = new CountDownLatch(3);
        CountDownLatch latch = new CountDownLatch(4);
        poolExecutor.execute(()->{
            //1统计机房个数,设备个数,电池组个数
            Response<Map> res_inf = battInfService.getAllInfInSz2(userId);
@@ -108,6 +108,12 @@
            res.put("res_battState", res_battState);
            latch.countDown();
        });
        poolExecutor.execute(()->{
            //4.中间地图
            Response<Map> res_station = battInfService.getAllStationInSz2(userId);
            res.put("res_station", res_station);
            latch.countDown();
        });
        latch.await(10, TimeUnit.MINUTES);
        return res;
src/main/resources/mapper/BattInfMapper.xml
@@ -774,4 +774,18 @@
                             and db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid
                             and db_user.tb_user_inf.uid = #{userId})
    </select>
    <select id="getAllStationInSz2" resultType="com.whyc.pojo.Battinf">
        select  distinct stationId, stationName1,stationName2,stationName3,stationName5,stationName9 from db_battinf.tb_battinf
        where StationId in  (select distinct db_battinf.tb_battinf.StationId
                             from db_battinf.tb_battinf,
                                  db_user.tb_user_battgroup_baojigroup_battgroup,
                                  db_user.tb_user_battgroup_baojigroup_usr,
                                  db_user.tb_user_inf
                             where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId =
                                   db_battinf.tb_battinf.BattGroupId
                               and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id =
                                   db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id
                               and db_user.tb_user_inf.uid = db_user.tb_user_battgroup_baojigroup_usr.uid
                               and db_user.tb_user_inf.uid = #{userId})
    </select>
</mapper>
src/main/resources/mapper/DevalarmDataMapper.xml
@@ -392,4 +392,9 @@
        and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid
        and db_user.tb_user_inf.uid=#{userId} )
    </select>
    <select id="judgeCommErr" resultType="java.lang.Integer">
        select count(*)  from db_alarm.tb_devalarm_data ,db_battinf.tb_battinf
        WHERE tb_devalarm_data.dev_id=tb_battinf.FBSDeviceId
        and  alm_type=#{almType} and tb_battinf.stationid=#{stationId}
    </select>
</mapper>