| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.BattAlarmIdEnum; |
| | | import com.whyc.constant.BattSingalIdEnum; |
| | | import com.whyc.constant.DevAlarmEnum; |
| | | import com.whyc.dto.AlarmDto; |
| | | import com.whyc.dto.Param.AlmAnalyseDto; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattalarmDataMapper; |
| | |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电池组实时告警信息"); |
| | | } |
| | | |
| | | //确认电池告警 |
| | | public Response updateBattConfrim(Integer num) { |
| | | UpdateWrapper wrapper = new UpdateWrapper<>(); |
| | |
| | | return listGreatThan; |
| | | } |
| | | |
| | | public List<AlarmDto> getListByUserId(Integer userId, Integer almLevel) { |
| | | return mapper.getListByUserId(userId,almLevel); |
| | | } |
| | | |
| | | public List<Long> getNumListInDB(List<Long> battAlarmNumList) { |
| | | QueryWrapper<BattalarmData> query = Wrappers.query(); |
| | | query.select("num"); |
| | | query.in("num",battAlarmNumList); |
| | | return mapper.selectList(query).stream().map(BattalarmData::getNum).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public List<BattalarmData> getMonAlarm(Integer userId) { |
| | | return mapper.getMonAlarm(userId); |
| | | } |
| | | //预警分析管理 |
| | | public Response getBattAlmAnalyse(AlmAnalyseDto dto) { |
| | | PageHelper .startPage(dto.getPageNum(),dto.getPageSize()); |
| | | List<BattalarmData> list=mapper.getBattAlmAnalyse(dto); |
| | | list.forEach(data->{ |
| | | data.setAlmName(BattSingalIdEnum.getValue(data.getAlmSignalId())); |
| | | }); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"电池告警分析"); |
| | | } |
| | | |
| | | } |