src/main/java/com/whyc/controller/DevAlarmDataVerifyController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/controller/PwrAlarmVerifyController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/mapper/DevAlarmDataVerifyMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/mapper/PwrDevAlarmVerifyMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/DevAlarmDataVerifyService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/PwrDevAlarmVerifyService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/webSocket/PowerAlarmRealTimeSocket.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/DevAlarmDataVerifyMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/PwrAlarmVerifyMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/DevAlarmDataVerifyController.java
@@ -1,15 +1,14 @@ package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.dto.paramter.AlarmPar; import com.whyc.dto.paramter.DevAlarmPar; import com.whyc.pojo.DevAlarmDataVerify; import com.whyc.service.DevAlarmDataVerifyService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("devAlarmDataVerify") @@ -19,10 +18,10 @@ @Autowired private DevAlarmDataVerifyService service; @GetMapping("page") @PostMapping("page") @ApiOperation("查询分页") public Response<Object> getPage(@RequestParam int pageNum, @RequestParam int pageSize){ return service.getPage(pageNum,pageSize); public Response<Object> getPage(@RequestBody DevAlarmPar param){ return service.getPage(param); } } src/main/java/com/whyc/controller/PwrAlarmVerifyController.java
@@ -1,14 +1,12 @@ package com.whyc.controller; import com.whyc.dto.Response; import com.whyc.pojo.PwrdevAlarm; import com.whyc.service.PwrDevAlarmVerifyService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("pwrAlarmVerify") @@ -18,10 +16,10 @@ @Autowired private PwrDevAlarmVerifyService service; @GetMapping("page") @PostMapping("page") @ApiOperation("查询分页") public Response<Object> getPage(@RequestParam int pageNum,@RequestParam int pageSize){ return service.getPage(pageNum,pageSize); public Response<Object> getPage(@RequestBody PwrdevAlarm param){ return service.getPage(param); } } src/main/java/com/whyc/mapper/DevAlarmDataVerifyMapper.java
@@ -1,10 +1,11 @@ package com.whyc.mapper; import com.whyc.dto.paramter.DevAlarmPar; import com.whyc.pojo.DevAlarmDataVerify; import java.util.List; public interface DevAlarmDataVerifyMapper extends CustomMapper<DevAlarmDataVerify> { List<DevAlarmDataVerify> getList(int userId); List<DevAlarmDataVerify> getList(DevAlarmPar param); } src/main/java/com/whyc/mapper/PwrDevAlarmVerifyMapper.java
@@ -1,10 +1,11 @@ package com.whyc.mapper; import com.whyc.pojo.PwrDevAlarmVerify; import com.whyc.pojo.PwrdevAlarm; import java.util.List; public interface PwrDevAlarmVerifyMapper extends CustomMapper<PwrDevAlarmVerify>{ List<PwrDevAlarmVerify> getList(int userId); List<PwrDevAlarmVerify> getList(PwrdevAlarm param); } src/main/java/com/whyc/service/DevAlarmDataVerifyService.java
@@ -6,6 +6,7 @@ import com.github.pagehelper.PageInfo; import com.whyc.dto.AlarmDaoFactory; import com.whyc.dto.Response; import com.whyc.dto.paramter.AlarmPar; import com.whyc.dto.paramter.DevAlarmPar; import com.whyc.mapper.DevAlarmDataVerifyMapper; import com.whyc.pojo.BattAlarmDataVerify; @@ -22,10 +23,10 @@ @Resource private DevAlarmDataVerifyMapper mapper; public Response<Object> getPage(int pageNum, int pageSize) { int userId = ActionUtil.getUser().getUId().intValue(); PageHelper.startPage(pageNum,pageSize); List<DevAlarmDataVerify> list = mapper.getList(userId); public Response<Object> getPage(DevAlarmPar param) { //int userId = ActionUtil.getUser().getUId().intValue(); PageHelper.startPage(param.getPage().getPageCurr(),param.getPage().getPageSize()); List<DevAlarmDataVerify> list = mapper.getList(param); list.stream().forEach(data -> { data.setAlarmName(AlarmDaoFactory.getAllAlarmName(data.getAlmType())); }); @@ -41,11 +42,11 @@ mapper.deleteById(num); } public Response getPageOfWebSocket(DevAlarmPar alarmPar) { public Response getPageOfWebSocket(DevAlarmPar param) { try { int userId = alarmPar.getUId(); PageHelper.startPage(alarmPar.getPage().getPageCurr(), alarmPar.getPage().getPageSize()); List<DevAlarmDataVerify> list = mapper.getList(userId); //int userId = alarmPar.getUId(); PageHelper.startPage(param.getPage().getPageCurr(), param.getPage().getPageSize()); List<DevAlarmDataVerify> list = mapper.getList(param); list.stream().forEach(data -> { data.setAlarmName(AlarmDaoFactory.getAllAlarmName(data.getAlmType())); }); src/main/java/com/whyc/service/PwrDevAlarmVerifyService.java
@@ -19,9 +19,9 @@ @Resource private PwrDevAlarmVerifyMapper mapper; public Response<Object> getPage(int pageNum, int pageSize) { int userId = ActionUtil.getUser().getUId().intValue(); List<PwrDevAlarmVerify> list = mapper.getList(userId); public Response<Object> getPage(PwrdevAlarm param) { //int userId = ActionUtil.getUser().getUId().intValue(); List<PwrDevAlarmVerify> list = mapper.getList(param); list.stream().forEach(data -> { data.setAlarmName(AlarmDaoFactory.getAllAlarmName(data.getAlmType())); }); @@ -37,10 +37,10 @@ mapper.deleteById(num); } public Response getPageOfWebSocket(Integer userId, PwrdevAlarm pwrdevAlarm) { public Response getPageOfWebSocket(PwrdevAlarm param) { try { PageHelper.startPage(pwrdevAlarm.getPage().getPageCurr(), pwrdevAlarm.getPage().getPageSize()); List<PwrDevAlarmVerify> list = mapper.getList(userId); PageHelper.startPage(param.getPage().getPageCurr(), param.getPage().getPageSize()); List<PwrDevAlarmVerify> list = mapper.getList(param); list.stream().forEach(data -> { data.setAlarmName(AlarmDaoFactory.getAllAlarmName(data.getAlmType())); }); src/main/java/com/whyc/webSocket/PowerAlarmRealTimeSocket.java
@@ -66,7 +66,7 @@ Response levelRes = service.serchByLevel(pwrdevAlarm.getUsrId(), pwrdevAlarm.getAlmTypes()); res.put("levelRes", levelRes); //告警手动确认 Response verifyListRes = verifyService.getPageOfWebSocket(pwrdevAlarm.getUsrId(),pwrdevAlarm); Response verifyListRes = verifyService.getPageOfWebSocket(pwrdevAlarm); res.put("verifyListRes",verifyListRes); //推送信息 synchronized (session) { src/main/resources/mapper/DevAlarmDataVerifyMapper.xml
@@ -4,8 +4,21 @@ <select id="getList" resultType="com.whyc.pojo.DevAlarmDataVerify"> select * from db_alarm.tb_devalarm_data_verify v,db_battinf.tb_battinf b where select *,b.FBSDeviceName as devName from db_alarm.tb_devalarm_data_verify v,db_battinf.tb_battinf b where v.dev_id = b.FBSDeviceId <if test="stationName1!=''"> and stationname1=#{stationName1} </if> <if test="stationName!=''"> and stationname=#{stationName} </if> <if test="almLevel!=0 and almLevel!=null"> and alm_level=#{almLevel} </if> <if test="almType!=0 and almType!=null"> and alm_type=#{almType} </if> and b.StationId in (select distinct stationId from db_user.tb_user_battgroup_baojigroup_battgroup , db_user.tb_user_battgroup_baojigroup_usr @@ -13,7 +26,7 @@ where 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}) and db_user.tb_user_inf.uid = #{uId}) order by v.num desc </select> </mapper> src/main/resources/mapper/PwrAlarmVerifyMapper.xml
@@ -6,6 +6,31 @@ <select id="getList" resultType="com.whyc.pojo.PwrDevAlarmVerify"> select * from db_pwrdev_alarm.tb_pwrdev_alarm_verify v,db_pwrdev_inf.tb_pwrdev_inf b where v.PowerDeviceId = b.powerDeviceId <if test="stationName1!=null "> and stationName1 like '%${stationName1}%' </if> <if test="stationName2!=null "> and stationName2 like '%${stationName2}%' </if> <if test="stationName5!=null "> and stationName5 like '%${stationName5}%' </if> <if test="stationName3!=null "> and stationName3 like '%${stationName3}%' </if> <if test="almSource!=0"> and alm_source=#{almSource} </if> <if test="almTypes!=null and almTypes.size>0"> <foreach collection="almTypes" item="almType" open="and alm_type in (" close=")" separator=","> #{almType} </foreach> </if> <if test="almLevels!=null and almLevels.size>0"> <foreach collection="almLevels" item="almLevel" open="and alm_level in (" close=")" separator=","> #{almLevel} </foreach> </if> and b.StationId in (select distinct stationId from db_user.tb_user_battgroup_baojigroup_battgroup , db_user.tb_user_battgroup_baojigroup_usr @@ -13,7 +38,7 @@ where 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}) and db_user.tb_user_inf.uid = #{uId}) order by v.num desc </select> </mapper>