lxw
2023-11-24 a21f9150961e555475455e2d80ea3c5dd14e59d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.whyc.service;
 
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.AlarmDaoFactory;
import com.whyc.dto.Response;
import com.whyc.dto.UpsAlarmDTO;
import com.whyc.mapper.UpspwrdevAlarmMapper;
import com.whyc.pojo.PwrdevAlarm;
import com.whyc.pojo.UpspwrdevAlarm;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service
public class UpspwrdevAlarmService {
    @Autowired(required = false)
    private UpspwrdevAlarmMapper mapper;
    //ups告警推送实时数据
    public Response getAlmReal(UpsAlarmDTO upsAlarmDTO) {
        PageHelper.startPage(upsAlarmDTO.getPageNum(),upsAlarmDTO.getPageSize());
        upsAlarmDTO.setUsrId(ActionUtil.getUser().getUId().intValue());
        List<UpspwrdevAlarm> list=mapper.getAlmReal(upsAlarmDTO);
        for (UpspwrdevAlarm u:list) {
            u.setAlmTypeName(AlarmDaoFactory.getUpsAlarmName(u.getAlmType()));
        }
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"ups告警推送实时数据");
    }
}