whyclxw
5 天以前 4b3cef746d0752487beffb72ff340e220b0388cd
src/main/java/com/whyc/service/BattInfService.java
@@ -4,8 +4,7 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.constant.Capperformance;
import com.whyc.constant.PowerAlarmEnum;
import com.whyc.constant.BattCapperformanceEnum;
import com.whyc.dto.BattDto;
import com.whyc.dto.InfoDto;
import com.whyc.dto.Param.ParamAlmDto;
@@ -16,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 +40,9 @@
    @Autowired(required = false)
    private BaojigroupService bjService;
    @Autowired(required = false)
    private InfoChangeService changeService;
    /*新建电池组(新的设备新的电池组)
     * @param binf
@@ -204,6 +204,9 @@
        if(sinf.getLatitude()!=null){
            wrapper1.set("latitude",sinf.getLatitude());
        }
        if(sinf.getNodeStation()!=null){
            wrapper1.set("node_station",sinf.getNodeStation());
        }
        wrapper1.eq("station_id",sinf.getStationId());
        //再修改电源信息
@@ -308,6 +311,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,"修改信息成功");
    }
    /*//修改电池组
@@ -399,6 +407,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;
    }
   //当没有内助测试时初始内阻值为标称内阻
@@ -447,7 +457,7 @@
    }
    //获取容量性能(下拉)
    public Response getCapperformance() {
        Map<Integer,String> map= Capperformance.getOpInfo();
        Map<Integer,String> map= BattCapperformanceEnum.getOpInfo();
        return new Response().setII(1,true,map,"获取容量性能(下拉)");
    }
    //蓄电池组对比分析界面16
@@ -479,13 +489,25 @@
        return mapper.getListByUserId(userId);
    }
    public List<BattInf> getListByCondition(Integer userId, BattInf battInf) {
        return mapper.getListByCondition(userId, battInf);
    }
    //获取站点下的电池组(下拉)
    public Response getBattByUid(Integer uid, String provice, String city, String country, String stationName) {
        List<BattInf> list=mapper.getBattByUid(uid,provice,city,country,stationName);
        return new Response().setII(1,list.size()>0,list,"获取站点下的电池组(下拉)");
    }
    //根据查询条件获取电池组集合
    public List<Integer> getBattgroupIdList(ParamAlmDto dto) {
        return mapper.getBattgroupIdList(dto);
    //根据查询条件获取电池组
    public  BattInf getBattgroupIdInf(Integer battgroupId) {
        return mapper.getBattgroupIdInf(battgroupId);
    }
    //查询电源下所有的电池组id
    public List<BattInf> getBattgroupIdListByPowerId(Integer powerId) {
        return mapper.getBattgroupIdListByPowerId(powerId);
    }
    //查询设备下所有的电池组id
    public List<BattInf> getBattgroupIdListByDevId(Integer devId) {
        return mapper.getBattgroupIdListByDevId(devId);
    }
}