| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.DevAlarmEnum; |
| | | import com.whyc.constant.PowerAlarmEnum; |
| | | import com.whyc.dto.Real.AlmDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.PwrdevAlarmMapper; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PwrdevAlarmService { |
| | |
| | | public Response getPwrAlmReal(AlmDto almDto) { |
| | | PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize()); |
| | | List<PwrdevAlarm> list=mapper.getPwrAlmReal(almDto); |
| | | list.forEach(data->{ |
| | | data.setAlmName(PowerAlarmEnum.getValue(data.getAlmId())); |
| | | }); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"获取电源实时告警信息"); |
| | | } |
| | |
| | | List<DevalarmData> list=mapper.selectList(wrapper); |
| | | return list!=null?list.size():0; |
| | | } |
| | | //获取电源告警类型(下拉) |
| | | public Response getPwrAlmIdType() { |
| | | Map<Integer,String> map= PowerAlarmEnum.getOpInfo(); |
| | | return new Response().setII(1,true,map,"获取设备告警类型(下拉)"); |
| | | } |
| | | } |