whyclxw
1 天以前 add5c816a5281cf6b1df4a0988e8b3a0c2b59bee
src/main/java/com/whyc/service/BattInfService.java
@@ -10,6 +10,7 @@
import com.whyc.dto.Param.ParamAlmDto;
import com.whyc.dto.Real.QuarterDto;
import com.whyc.dto.Response;
import com.whyc.dto.SocreHehaviorDto;
import com.whyc.dto.Statistic.*;
import com.whyc.factory.InfoFactory;
import com.whyc.mapper.BattInfMapper;
@@ -43,6 +44,7 @@
    @Autowired(required = false)
    private InfoChangeService changeService;
    /*新建电池组(新的设备新的电池组)
     * @param binf
     * 1.在电源下新建设备,记录设备编号,devNum,设备名称为设备类型+devNum
@@ -231,6 +233,15 @@
        if(pinf.getModelCfg()!=null){
            wrapper2.set("model_cfg",pinf.getModelCfg());
        }
        if(pinf.getAcvolHighLimit()!=null){
            wrapper2.set("acvol_high_limit",pinf.getAcvolHighLimit());
        }
        if(pinf.getAcvolLowLimit()!=null){
            wrapper2.set("acvol_low_limit",pinf.getAcvolLowLimit());
        }
        if(pinf.getDcoutvolLowLimit()!=null){
            wrapper2.set("dcoutvol_low_limit",pinf.getDcoutvolLowLimit());
        }
        /*if(pinf.getPowerName()!=null){
            //检测该机房下要修改的电源名是否存在
            QueryWrapper queryWrapper1=new QueryWrapper();
@@ -304,6 +315,30 @@
            if (binf.getInuseTime() != null) {
                wrapper4.set("inuse_time", binf.getInuseTime());
            }
            if (binf.getFloatVolLevel() != null) {
                wrapper4.set("float_vol_level", binf.getFloatVolLevel());
            }
            if (binf.getOfflinelineVolLevel() != null) {
                wrapper4.set("offlineline_vol_level", binf.getOfflinelineVolLevel());
            }
            if (binf.getFloatCurrLevel() != null) {
                wrapper4.set("float_curr_level", binf.getFloatCurrLevel());
            }
            if (binf.getMaxDisCurr() != null) {
                wrapper4.set("max_dis_curr", binf.getMaxDisCurr());
            }
            if (binf.getSignType()!= null) {
                wrapper4.set("sign_type", binf.getSignType());
            }
            if (binf.getCommPort()!= null) {
                wrapper4.set("comm_port", binf.getCommPort());
            }
            if (binf.getLoadCurr()!= null) {
                wrapper4.set("load_curr", binf.getLoadCurr());
            }
            if (binf.getVideoUrl()!= null) {
                wrapper4.set("video_url", binf.getVideoUrl());
            }
            wrapper4.eq("battgroup_id", binf.getBattgroupId());
            mapper.update((BattInf) ActionUtil.objeNull,wrapper3);
            mapper.update((BattInf) ActionUtil.objeNull,wrapper4);
@@ -368,15 +403,6 @@
        dto.setUid(user.getId());
        PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
        List<InfoDto> list=mapper.getInfo(dto);
        for (InfoDto infoDto:list) {
            //获取机房,电源,电池组变更记录
            List<StationInfChange> sinfChangeList=changeService.getSinfChange(infoDto.getStationId());
            infoDto.setSinfChangeList(sinfChangeList);
            List<PowerInfChange> pinfChangeList=changeService.getPinfChange(infoDto.getPowerId());
            infoDto.setPinfChangeList(pinfChangeList);
            List<BattInfChange> binfChangeList=changeService.getBinfChange(infoDto.getBattgroupId());
            infoDto.setBinfChangeList(binfChangeList);
        }
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"查询电池");
    }
@@ -415,6 +441,8 @@
        wrapper.eq("battgroup_id",battgroupId);
        wrapper.last("limit 1");
        BattInf binf=mapper.selectOne(wrapper);
        List<BattInfChange> binfChangeList=changeService.getBinfChange(battgroupId);
        binf.setBinfChangeList(binfChangeList);
        return binf;
    }
   //当没有内助测试时初始内阻值为标称内阻
@@ -509,11 +537,15 @@
        return mapper.getBattgroupIdInf(battgroupId);
    }
    //查询电源下所有的电池组id
    public List<Integer> getBattgroupIdListByPowerId(Integer powerId) {
    public List<BattInf> getBattgroupIdListByPowerId(Integer powerId) {
        return mapper.getBattgroupIdListByPowerId(powerId);
    }
    //查询设备下所有的电池组id
    public List<Integer> getBattgroupIdListByDevId(Integer devId) {
    public List<BattInf> getBattgroupIdListByDevId(Integer devId) {
        return mapper.getBattgroupIdListByDevId(devId);
    }
    //询符合条件的电池组权重表格评分
    public List<BattInf> getScoreByHehavior(SocreHehaviorDto dto) {
        return mapper.getScoreByHehavior(dto);
    }
}