| | |
| | | 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; |
| | | 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; |
| | |
| | | |
| | | @Autowired(required = false) |
| | | private BaojigroupService bjService; |
| | | |
| | | @Autowired(required = false) |
| | | private InfoChangeService changeService; |
| | | |
| | | /*新建电池组(新的设备新的电池组) |
| | | * @param binf |
| | |
| | | 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(); |
| | |
| | | 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); |
| | | } |
| | | 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,"修改信息成功"); |
| | | } |
| | | /*//修改电池组 |
| | |
| | | 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; |
| | | } |
| | | //当没有内助测试时初始内阻值为标称内阻 |
| | |
| | | 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); |
| | | } |
| | | //询符合条件的电池组权重表格评分 |
| | | public List<BattInf> getScoreByHehavior(SocreHehaviorDto dto) { |
| | | return mapper.getScoreByHehavior(dto); |
| | | } |
| | | } |