whyclxw
5 天以前 8c635598000e40edfb3edf5934124ad48d60f62d
src/main/java/com/whyc/service/DevalarmDataService.java
@@ -9,10 +9,13 @@
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.db_station.BattInf;
import com.whyc.pojo.web_site.AlarmInspection;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +31,9 @@
public class DevalarmDataService {
    @Autowired(required = false)
    private DevalarmDataMapper mapper;
    @Autowired
    private BattInfService battInfService;
    //获取设备实时告警信息
    public Response getDevAlmReal(AlmDto almDto) {
        PageHelper.startPage(almDto.getPageNum(),almDto.getPageSize());
@@ -84,4 +90,18 @@
    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<BattInf> binfList = battInfService.getBattgroupIdListByDevId(data.getDevId());
            data.setBinfList(binfList);
        });
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"获取设备实时告警信息");
    }
}