| | |
| | | |
| | | |
| | | //获取最后一次测试数据并计算剩余容量 |
| | | public Float getLastTestDataRestCap(Integer battgroupId) { |
| | | public Float getLastTestDataRestCap(Float moncapstd,Integer battgroupId) { |
| | | //获取放电记录 |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | |
| | | BatttestdataInf tinf=mapper.selectOne(wrapper); |
| | | if(tinf!=null){ |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float restcap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | Float restcap = (float) BattCapFactory.GetMonomerCap(moncapstd, hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | return restcap; |
| | | }else{ |
| | | return 0f; |
| | |
| | | List<BatttestdataInf> list=mapper.getBattTinfStatistic(stic); |
| | | if(list!=null&&list.size()>0){ |
| | | for (BatttestdataInf tinf:list) { |
| | | //获取电池组信息 |
| | | BattInf binf=battInfService.getBinfByBattgroupId(tinf.getBattgroupId()); |
| | | //剩余容量和剩余时间计算 |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | Float realCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | Float restCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | Float realCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | tinf.setRestCap(restCap); |
| | | tinf.setRealCap(realCap); |
| | | tinf.setRestTime(0f); |
| | | //获取电池组实时数据 |
| | | BattRtstate battRtstate=rtstateService.getBattRealInfo(tinf.getBattgroupId()); |
| | | //获取电池组信息 |
| | | BattInf binf=battInfService.getBinfByBattgroupId(tinf.getBattgroupId()); |
| | | |
| | | //实时组端电流,剩余容量,标称容量 |
| | | if(battRtstate!=null){ |
| | | Float restTime= BattCapFactory.getTheoryTime(battRtstate.getLoadCurr(), restCap, binf.getMoncapstd()); |
| | |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | for (BatttestdataId data:idDataList) {//求单体的 实际容量,最小值就是单体的单体电压 |
| | | realCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(),data.getMonVol() , tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | realCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(),data.getMonVol() , tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | SticMonRes res=new SticMonRes(); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | res.setBattgroupName(binf.getBattgroupName()); |
| | |
| | | map.put("standCapDiff",0f); |
| | | Float sumCap=0f; |
| | | Float maxCap=0f; |
| | | Float minCap=0f; |
| | | Float standCapDiff=0f; |
| | | List<ComPareChart> capList=new ArrayList<>(); |
| | | List<ComPareChart> resList=new ArrayList<>(); |
| | |
| | | }else{ |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | //Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | //Float restCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | res.setRealCap(grouprealCap); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_1.getStateId())); |
| | |
| | | String precentCap = String.format("%.5f",(grouprealCap/binf.getMoncapstd()*100)); |
| | | res.setPrecentCap(precentCap); |
| | | sumCap+=grouprealCap; |
| | | standCapDiff=grouprealCap-maxCap; |
| | | if(grouprealCap>=maxCap){ |
| | | maxCap=grouprealCap; |
| | | } |
| | | if(grouprealCap<=minCap){ |
| | | minCap=grouprealCap; |
| | | } |
| | | } |
| | | } |
| | |
| | | resList.add(resChart); |
| | | } |
| | | map.put("avgCap",sumCap/binfList.size()); |
| | | map.put("standCapDiff",standCapDiff); |
| | | map.put("standCapDiff",maxCap-minCap); |
| | | |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(comparelist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setIII(1,comparelist.size()>0,pageInfo,map,"蓄电池组对比分析界面(同一品牌同一时间)"); |
| | |
| | | res.setStopReason(StopReasonEnum.getValue(tinf.getTestStoptype())); |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | //Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | //Float restCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest); |
| | | res.setRealCap(grouprealCap); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_1.getStateId())); |
| | |
| | | res.setPowerId(binf.getPowerId()); |
| | | res.setDevId(binf.getDevId()); |
| | | res.setBattgroupId(binf.getBattgroupId()); |
| | | Float monrealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), data.getMonVol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | Float monrealCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), data.getMonVol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | res.setMonrealCap(monrealCap); |
| | | //保留5位小数 |
| | | String monprecentCap = String.format("%.5f",(monrealCap/binf.getMoncapstd()*100)); |
| | |
| | | dto.setRecordNum(tinf.getRecordNum()); |
| | | dto.setTestCap(tinf.getTestCap()); |
| | | dto.setTestTimeLong(tinf.getTestTimelong()); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float realCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | dto.setRealCap(realCap); |
| | | //实时获取电池组信息 |
| | | BattRtstate battRtstate = rtstateService.getBattRealInfo(tinf.getBattgroupId()); |
| | | //获取电池组信息 |
| | | BattInf binf = battInfService.getBinfByBattgroupId(tinf.getBattgroupId()); |
| | | dto.setMoncapstd(binf.getMoncapstd()); |
| | | dto.setMonCount(binf.getMoncount()); |
| | | dto.setMonvolstd(binf.getMonvolstd()); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float realCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | dto.setRealCap(realCap); |
| | | //实时获取电池组信息 |
| | | BattRtstate battRtstate = rtstateService.getBattRealInfo(tinf.getBattgroupId()); |
| | | dto.setFloatchartVol(tinf.getFloatGroupVol()); |
| | | if(battRtstate!=null){ |
| | | Float restTime= BattCapFactory.getTheoryTime(battRtstate.getLoadCurr(), realCap, binf.getMoncapstd()); |
| | |
| | | res.setTestRecordCount(tinf.getTestRecordCount()); |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | res.setRealCap(grouprealCap); |
| | | //res.setDisChargeType(1); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | |
| | | }else{ |
| | | Float moncapStd=binf.getMoncapstd(); |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | Float grouprealCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | res.setRealCap(grouprealCap); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_1.getStateId())); |
| | |
| | | wrapper.last(" limit 1"); |
| | | return mapper.selectOne(wrapper); |
| | | } |
| | | //点击右侧折线图画出电池组所有完整周期的实际容量变化图(1.2.15/16/17) |
| | | public Response getRealCapChangeByBattgroupId(Integer battgroupId) { |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("battgroup_id", battgroupId); |
| | | wrapper.eq("test_type", 3); |
| | | wrapper.eq("test_starttype", 3); |
| | | wrapper.eq("data_available", 1);//一次有效的记录 |
| | | wrapper.last(" ORDER BY test_starttime DESC "); |
| | | List<BatttestdataInf> list = mapper.selectList(wrapper); |
| | | //获取电池组的标称容量 |
| | | BattInf binf=battInfService.getBattgroupIdInf(battgroupId); |
| | | List<ComPareChangeCurve> curvelist=new ArrayList<>(); |
| | | for (BatttestdataInf tinf:list) { |
| | | int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr()); |
| | | Float realCap = (float) BattCapFactory.GetMonomerCap(binf.getMoncapstd(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | ComPareChangeCurve curve=new ComPareChangeCurve(); |
| | | curve.setBattgroupId(battgroupId); |
| | | curve.setStartTime(tinf.getTestStarttime()); |
| | | curve.setCurveValue(realCap); |
| | | curvelist.add(curve); |
| | | } |
| | | return new Response().setII(1,list.size()>0,curvelist,"点击右侧折线图画出电池组所有完整周期的实际容量变化图(1.2.15/16/17)"); |
| | | } |
| | | //点击右侧折线图画出电池组所有完整周期的浮充电压变化图(1.2.15/16/17) |
| | | public Response getFloatGroupVolChangeByBattgroupId(Integer battgroupId) { |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("battgroup_id", battgroupId); |
| | | wrapper.eq("test_type", 3); |
| | | wrapper.eq("test_starttype", 3); |
| | | wrapper.eq("data_available", 1);//一次有效的记录 |
| | | wrapper.last(" ORDER BY test_starttime asc "); |
| | | List<BatttestdataInf> list = mapper.selectList(wrapper); |
| | | List<ComPareChangeCurve> curvelist=new ArrayList<>(); |
| | | for (BatttestdataInf tinf:list) { |
| | | ComPareChangeCurve curve=new ComPareChangeCurve(); |
| | | curve.setBattgroupId(battgroupId); |
| | | curve.setStartTime(tinf.getTestStarttime()); |
| | | curve.setCurveValue(tinf.getFloatGroupVol()); |
| | | curvelist.add(curve); |
| | | } |
| | | return new Response().setII(1,list.size()>0,curvelist,"点击右侧折线图画出电池组所有完整周期的浮充电压变化图(1.2.15/16/17)"); |
| | | } |
| | | } |