src/main/java/com/whyc/mapper/DevAlarmDataMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/DevAlarmDataService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/webSocket/DevAlarmSocket.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/webSocket/DevAlmPopUp.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/DevAlarmDataMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/mapper/DevAlarmDataMapper.java
@@ -8,7 +8,7 @@ public interface DevAlarmDataMapper extends CustomMapper<DevAlarmData>{ //获取设备告警信息 List<DevAlarmData> getDAlmInf(@Param("dto") DalmDto dto); List<DevAlarmData> getDevAlmInf(@Param("dto") DalmDto dto); //弹窗告警 List<DevAlarmData> getDAlmPopUp(@Param("uid") int uid); List<DevAlarmData> getDevAlmPopUp(@Param("uid") int uid); } src/main/java/com/whyc/service/DevAlarmDataService.java
@@ -33,10 +33,10 @@ private UserInfService uinfService; //获取设备告警信息 public Response getDAlmInf(int uid, DalmDto dto) { public Response getDevAlmInf(int uid, DalmDto dto) { PageHelper.startPage(dto.getPageNum(),dto.getPageSize()); dto.setUid(uid); List<DevAlarmData> list=mapper.getDAlmInf(dto); List<DevAlarmData> list=mapper.getDevAlmInf(dto); for (DevAlarmData data:list) { UserInf uinf=uinfService.getUinfByUId(data.getConfirmedUid()); data.setConfirmedUname(uinf!=null?uinf.getUname():""); @@ -47,7 +47,7 @@ return new Response().setII(1,list!=null,pageInfo,"获取设备告警信息"); } //获取历史告警 public Response getDAlmHis(DalmDto dto) throws ParseException { public Response getDevAlmHis(DalmDto dto) throws ParseException { UserInf uinf= ActionUtil.getUser(); dto.setUid(uinf.getUid()); if(dto.getStartTime()==null){ @@ -61,7 +61,7 @@ return new Response().setII(1,pageInfo!=null,pageInfo,"获取设备告警信息"); } //确认实时告警 public Response confiirmAlm(int num) { public Response confirmAlm(int num) { UserInf uinf= ActionUtil.getUser(); UpdateWrapper wrapper=new UpdateWrapper(); wrapper.set("alm_is_confirmed",1); @@ -77,8 +77,8 @@ return new Response().setII(1,true,map,"获取所有的告警类型"); } //弹窗告警 public Response getDAlmPopUp(Integer uid) { List<DevAlarmData> list=mapper.getDAlmPopUp(uid); public Response getDevAlmPopUp(Integer uid) { List<DevAlarmData> list=mapper.getDevAlmPopUp(uid); for (DevAlarmData data:list) { int almId=data.getAlmId(); data.setAlmName(DevAlmEnum.getValue(almId)); src/main/java/com/whyc/webSocket/DevAlarmSocket.java
@@ -59,7 +59,7 @@ Thread thread = currentThread(); threadFlagMap.put(thread.getId(), true); try { Response res=dalmService.getDAlmInf(userId, dto); Response res=dalmService.getDevAlmInf(userId, dto); if (session.isOpen()) { //推送信息 synchronized (session) { src/main/java/com/whyc/webSocket/DevAlmPopUp.java
@@ -42,7 +42,7 @@ public void run() { try { while (!currentThread().isInterrupted()) { Response res = almService.getDAlmPopUp(userId); Response res = almService.getDevAlmPopUp(userId); session.getBasicRemote().sendObject(res); sleep(4000); } src/main/resources/mapper/DevAlarmDataMapper.xml
@@ -20,7 +20,7 @@ </association> </resultMap> <select id="getDAlmInf" resultMap="almDev"> <select id="getDevAlmInf" resultMap="almDev"> select * from db_alarm.tb_devalarm_data <where> <if test="dto.devId!=null"> @@ -53,7 +53,7 @@ <select id="selectDinf" resultType="devInf" parameterType="int" > select * from db_lithium_ram_db.tb_dev_inf where dev_id = #{dev_id} </select> <select id="getDAlmPopUp" resultMap="almDev"> <select id="getDevAlmPopUp" resultMap="almDev"> select * from db_alarm.tb_devalarm_data <where> alm_is_confirmed=0