| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.PowerAlarmMapper; |
| | | import com.whyc.pojo.db_alarm.BattAlarm; |
| | | import com.whyc.pojo.db_param.BattAlarmCfg; |
| | | import com.whyc.pojo.db_power_alarm.PowerAlarm; |
| | | import com.whyc.pojo.db_power_alarm.PowerAlarmCfg; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired(required = false) |
| | | private PowerAlarmMapper mapper; |
| | | |
| | | @Autowired(required = false) |
| | | private PowerAlarmCfgService cfgService; |
| | | |
| | | /* |
| | | 在用电源实时推送告警信息 |
| | | **/ |
| | |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<PowerAlarm> list=mapper.getList(almLevel, ThreadLocalUtil.parse(startTime,1),ThreadLocalUtil.parse(endTime,1)); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | List<PowerAlarmCfg> cfgList = cfgService.getList(); |
| | | list.stream().forEach(item->{ |
| | | Integer almId = item.getAlmId(); |
| | | for (int i = 0; i < cfgList.size(); i++) { |
| | | if(almId.intValue() == cfgList.get(i).getAlmId()){ |
| | | item.setAlmName(cfgList.get(i).getAlmName()); |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询-分页"); |
| | | } |
| | | //确认告警 |