| | |
| | | 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.DevalarmDataMapper; |
| | | import com.whyc.pojo.db_alarm.BattalarmData; |
| | | import com.whyc.pojo.db_alarm.DevalarmData; |
| | | import com.whyc.pojo.web_site.AlarmInspection; |
| | | import com.whyc.util.ActionUtil; |
| | |
| | | public class DevalarmDataService { |
| | | @Autowired(required = false) |
| | | private DevalarmDataMapper mapper; |
| | | |
| | | @Autowired |
| | | private BattInfService battInfService; |
| | | //获取设备实时告警信息 |
| | | public Response getDevAlmReal(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | |
| | | query.in("num",devAlarmNumList); |
| | | return mapper.selectList(query).stream().map(DevalarmData::getNum).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public List<AlarmDto> getListByUserId(Integer userId,Integer almLevel) { |
| | | return mapper.getListByUserId(userId,almLevel); |
| | | } |
| | | //预警分析管理-设备告警 |
| | | public Response getDevAlmAnalyse(AlmAnalyseDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<DevalarmData> list=mapper.getDevAlmAnalyse(almDto); |
| | | list.forEach(data->{ |
| | | data.setAlmName(DevAlarmEnum.getValue(data.getAlmId())); |
| | | //查询设备下所有的电池组id |
| | | List<Integer> battgroupIdList = battInfService.getBattgroupIdListByDevId(data.getDevId()); |
| | | data.setBattgroupIdList(battgroupIdList); |
| | | }); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取设备实时告警信息"); |
| | | } |
| | | |
| | | } |