whyclxw
5 天以前 ea0e6aeaad04e8762bb33ddad64fec1eb1d0e3b7
src/main/java/com/whyc/service/BattInfService.java
@@ -15,9 +15,7 @@
import com.whyc.mapper.BattInfMapper;
import com.whyc.mapper.PowerInfMapper;
import com.whyc.mapper.StationInfMapper;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.pojo.db_station.PowerInf;
import com.whyc.pojo.db_station.StationInf;
import com.whyc.pojo.db_station.*;
import com.whyc.pojo.db_user.User;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +41,8 @@
    @Autowired(required = false)
    private BaojigroupService bjService;
    @Autowired(required = false)
    private InfoChangeService changeService;
    /*新建电池组(新的设备新的电池组)
     * @param binf
     * 1.在电源下新建设备,记录设备编号,devNum,设备名称为设备类型+devNum
@@ -310,6 +310,11 @@
        }
        sinfMapper.update((StationInf) ActionUtil.objeNull,wrapper1);
        pinfMapper.update((PowerInf) ActionUtil.objeNull,wrapper2);
        //存入变更信息记录
        pinf.setStationId(sinf.getStationId());
        binf.setStationId(sinf.getStationId());
        binf.setPowerId(pinf.getPowerId());
        changeService.addInfoChange(sinf,pinf,binf,info.getUpdateReason());
        return new Response().set(1,true,"修改信息成功");
    }
    /*//修改电池组
@@ -363,6 +368,15 @@
        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,"查询电池");
    }
@@ -495,7 +509,11 @@
        return mapper.getBattgroupIdInf(battgroupId);
    }
    //查询电源下所有的电池组id
    public List<Integer> getBattgroupIdList(Integer powerId) {
        return mapper.getBattgroupIdList(powerId);
    public List<Integer> getBattgroupIdListByPowerId(Integer powerId) {
        return mapper.getBattgroupIdListByPowerId(powerId);
    }
    //查询设备下所有的电池组id
    public List<Integer> getBattgroupIdListByDevId(Integer devId) {
        return mapper.getBattgroupIdListByDevId(devId);
    }
}