whyclxw
6 天以前 2753ad7aee272a5a5a8a0124b1feea5a1e4cc83e
src/main/java/com/whyc/service/BattAlmparamService.java
@@ -10,11 +10,13 @@
import com.whyc.dto.Response;
import com.whyc.mapper.BattAlmparamMapper;
import com.whyc.pojo.db_param.BattAlmparam;
import com.whyc.pojo.db_station.BattInf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class BattAlmparamService {
@@ -25,20 +27,24 @@
    private BattInfService binfService;
    //获取电池告警参数
    public Response getBattAlmParam(ParamAlmDto dto) {
        //根据查询条件获取电池组集合
        List<Integer> idList=binfService.getBattgroupIdList(dto);
        //根据查询条件获取电池组
        BattInf binf=binfService.getBattgroupIdInf(dto.getBattgroupId());
        QueryWrapper wrapper=new QueryWrapper();
        if(idList!=null){
            wrapper.in("battgroup_id",idList);
        }
        wrapper.eq("battgroup_id",dto.getBattgroupId());
        if(dto.getAlmIdList()!=null){
            wrapper.in("alm_id",dto.getAlmIdList());
        }
        wrapper.orderByAsc("alm_id");
        PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
        //PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
        List<BattAlmparam> list = mapper.selectList(wrapper);
        PageInfo<BattAlmparam> pageInfo=new PageInfo<>(list);
        return new Response().setII(1,list!=null,pageInfo,"获取电池告警参数");
        //PageInfo<BattAlmparam> pageInfo=new PageInfo<>(list);
        return new Response().setIII(1,list!=null,list,binf,"获取电池告警参数");
    }
    //获取电池告警参数(无参用于导出)
    public Response getBattAlmParamToExport(Integer uid) {
        //获取所有的电池组id
        List<BattAlmparam> list = mapper.getBattAlmParamToExport(uid);
        return new Response().setII(1,list!=null,list,"获取电池告警参数");
    }
    //修改电池告警参数
    public Response setBattAlmParam(List<BattAlmparam> almparamList) {