whyclxw
2025-06-13 37b198e2ed9a87ae52987e0069d7c7d7e01cc7fb
src/main/java/com/whyc/service/PwrdevAlarmParamService.java
@@ -7,6 +7,7 @@
import com.github.pagehelper.PageInfo;
import com.whyc.constant.PowerAlarmEnum;
import com.whyc.dto.AlarmParam;
import com.whyc.dto.Param.ParamAlmDto;
import com.whyc.dto.Real.AlmDto;
import com.whyc.dto.Response;
import com.whyc.mapper.PwrdevAlarmParamMapper;
@@ -29,24 +30,35 @@
    @Autowired(required = false)
    private PwrdevAlarmParamMapper mapper;
    @Autowired(required = false)
    private PowerInfService pinfService;
    //获取电源告警参数
    public Response getPwrAlmParam(Integer powerId) {
        Map<String, List<PwrdevAlarmParam>> map=new HashMap<>();
    public Response getPwrAlmParam(ParamAlmDto dto) {
        //根据查询条件获取电源集合
        List<Integer> idList=pinfService.getPowerIdList(dto);
        /*Map<String, List<PwrdevAlarmParam>> map=new HashMap<>();
        List<PwrdevAlarmParam> almmap30=new ArrayList<>();
        List<PwrdevAlarmParam> almmap31=new ArrayList<>();
        List<PwrdevAlarmParam> almmap32=new ArrayList<>();
        List<PwrdevAlarmParam> almmap33=new ArrayList<>();
        List<PwrdevAlarmParam> almmap34=new ArrayList<>();
        List<PwrdevAlarmParam> almmap35=new ArrayList<>();
        List<PwrdevAlarmParam> almmap36=new ArrayList<>();
        List<PwrdevAlarmParam> almmap36=new ArrayList<>();*/
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("power_id",powerId);
        if(idList!=null){
            wrapper.in("power_id",idList);
        }
        if(dto.getAlmIdList()!=null){
            wrapper.in("alm_id",dto.getAlmIdList());
        }
        wrapper.orderByAsc("alm_id");
        PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
        List<PwrdevAlarmParam> list = mapper.selectList(wrapper);
        if(list!=null && list.size()>0){
            for (PwrdevAlarmParam alm:list) {
                alm.setAlarmName(PowerAlarmEnum.getValue(alm.getAlmId()));
                if(alm.getAlmId()/100000==30){
               /* if(alm.getAlmId()/100000==30){
                    almmap30.add(alm);
                    map.put("故障告警",almmap30);
                }
@@ -73,10 +85,11 @@
                if(alm.getAlmId()/100000==36){
                    almmap36.add(alm);
                    map.put("直流告警",almmap36);
                }
                }*/
            }
        }
        return new Response().setII(1,list!=null,map,"获取电源告警参数");
        PageInfo<PwrdevAlarmParam> pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"获取电源告警参数");
    }
    //修改电源告警参数
    public Response setPwrAlmParam(List<PwrdevAlarmParam> almparamList) {