| | |
| | | @Autowired(required = false) |
| | | private PwrdevHistorydataIdService pwrHisdataIdService; |
| | | |
| | | @Autowired(required = false) |
| | | private BattresdataInfService battResdataInfService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | /*蓄电池组对比分析界面(同一品牌同一时间) |
| | | *1.查询出符合条件的电池组信息 |
| | | * 2.计算电池组的预估剩余容量 |
| | | *1.查询出符合条件的电池组信息(同一品牌同一投运时间) |
| | | * 2.计算电池组的最近一次标准核容放电的预估容量 |
| | | *3.判断性能和百分比 |
| | | * 4.分页 |
| | | */ |
| | |
| | | if(param.getParamNamePsx().equals("batt_mon_damage_val")){ |
| | | damageValue=param.getParamValue(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | Map<String,Object> map=new HashMap<>();//右侧图表 |
| | | map.put("avgCap",0f); |
| | | map.put("standCapDiff",0f); |
| | | Float sumCap=0f; |
| | | Float maxCap=0f; |
| | | Float standCapDiff=0f; |
| | | List<ComPareChart> capList=new ArrayList<>(); |
| | | List<ComPareChart> resList=new ArrayList<>(); |
| | | List<ComPareChart> flotVolList=new ArrayList<>(); |
| | | map.put("capList",capList); |
| | | map.put("resList",resList); |
| | | map.put("flotVolList",flotVolList); |
| | | //1查询符合条件的电池组 |
| | | List<BattInf> binfList=battInfService.getBattCompare15Statistic(stic); |
| | | if(binfList==null||binfList.size()==0){ |
| | | return new Response().set(1,false,"当前用户未管理满足条件的电池组"); |
| | | } |
| | | List<SticCompare15Res> reslist=new ArrayList<>(); |
| | | List<SticCompare15Res> comparelist=new ArrayList<>(); |
| | | for (BattInf binf:binfList) { |
| | | SticCompare15Res res=new SticCompare15Res(); |
| | | res.setProvice(binf.getProvice()); |
| | |
| | | BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); |
| | | if(tinf==null){ |
| | | res.setRealCap(0f); |
| | | res.setPrecentCap("0"); |
| | | res.setPrecentCap("0.00000"); |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_4.getStateId())); |
| | | continue; |
| | | } |
| | | //找这次放电的最后一笔数据 |
| | | List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum()); |
| | | if(idDataList==null||idDataList.size()==0){ |
| | | res.setRealCap(0f); |
| | | res.setPrecentCap("0"); |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_4.getStateId())); |
| | | continue; |
| | | } |
| | | 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); |
| | | res.setRealCap(grouprealCap); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_1.getStateId())); |
| | | } |
| | | if(grouprealCap<=moncapStd*damageValue){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_3.getStateId())); |
| | | } |
| | | if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_2.getStateId())); |
| | | } |
| | | //保留5位小数 |
| | | String precentCap = String.format("%.5f",(grouprealCap/binf.getMoncapstd()*100)); |
| | | res.setPrecentCap(precentCap); |
| | | List<Integer> monNums=new ArrayList<>(); |
| | | for (BatttestdataId data:idDataList) {//求单体的 实际容量,最小值就是单体的单体电压 |
| | | Float monrealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), data.getMonVol(), tinf.getGroupVol(), BattCapFactory.CapType_Real); |
| | | if (monrealCap <= moncapStd * damageValue) {//损坏的 |
| | | monNums.add(data.getMonNum()); |
| | | res.setStopReason("--"); |
| | | res.setFloatGroupVol(0f); |
| | | }else{ |
| | | res.setStopReason(StopReasonEnum.getValue(tinf.getTestStoptype())); |
| | | res.setFloatGroupVol(tinf.getFloatGroupVol()); |
| | | //找这次放电的最后一笔数据 |
| | | List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum()); |
| | | if(idDataList==null||idDataList.size()==0){ |
| | | res.setRealCap(0f); |
| | | res.setPrecentCap("0.00000"); |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_4.getStateId())); |
| | | res.setFloatGroupVol(0f); |
| | | }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); |
| | | res.setRealCap(grouprealCap); |
| | | if(grouprealCap>=moncapStd*badValue){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_1.getStateId())); |
| | | } |
| | | if(grouprealCap<=moncapStd*damageValue){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_3.getStateId())); |
| | | } |
| | | if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ |
| | | res.setCapperformance(BattCapperformanceEnum.getValue(BattCapperformanceEnum.BATTSTATE_2.getStateId())); |
| | | } |
| | | //保留5位小数 |
| | | String precentCap = String.format("%.5f",(grouprealCap/binf.getMoncapstd()*100)); |
| | | res.setPrecentCap(precentCap); |
| | | sumCap+=grouprealCap; |
| | | standCapDiff=grouprealCap-maxCap; |
| | | if(grouprealCap>=maxCap){ |
| | | maxCap=grouprealCap; |
| | | } |
| | | } |
| | | } |
| | | res.setMonNums(monNums); |
| | | if(stic.getPerformance()==null){ |
| | | reslist.add(res); |
| | | comparelist.add(res); |
| | | }else{ |
| | | if(res.getCapperformance().equals(BattCapperformanceEnum.getValue(stic.getPerformance()))){ |
| | | reslist.add(res); |
| | | comparelist.add(res); |
| | | } |
| | | } |
| | | |
| | | ComPareChart capChart=new ComPareChart(); |
| | | capChart.setBattgroupId(binf.getBattgroupId()); |
| | | capChart.setBattgroupName(binf.getBattgroupName()); |
| | | capChart.setValue(res.getRealCap()); |
| | | capList.add(capChart); |
| | | ComPareChart floatVolChart=new ComPareChart(); |
| | | floatVolChart.setBattgroupId(binf.getBattgroupId()); |
| | | floatVolChart.setBattgroupName(binf.getBattgroupName()); |
| | | floatVolChart.setValue(res.getFloatGroupVol()); |
| | | flotVolList.add(floatVolChart); |
| | | //统计内阻测试 |
| | | ComPareChart resChart=battResdataInfService.getMaxResData(binf); |
| | | resList.add(resChart); |
| | | } |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setII(1,reslist.size()>0,pageInfo,"蓄电池组对比分析界面(同一品牌同一时间)"); |
| | | map.put("avgCap",sumCap/binfList.size()); |
| | | map.put("standCapDiff",standCapDiff); |
| | | |
| | | PageInfo pageInfo=PageInfoUtils.list2PageInfo(comparelist, stic.getPageNum(), stic.getPageSize()); |
| | | return new Response().setIII(1,comparelist.size()>0,pageInfo,map,"蓄电池组对比分析界面(同一品牌同一时间)"); |
| | | } |
| | | |
| | | //蓄电池组对比分析界面(不同品牌同一时间)(1.2.16) |
| | |
| | | public int getHrDisCount(Integer userId, Date startTime, Date endTime) { |
| | | return mapper.getHrDisCount(userId, startTime, endTime); |
| | | } |
| | | //获取这一次的放电信息 |
| | | public BatttestdataInf getTinfByTestRecordCount(Integer battgroupId, Integer testRecordCount) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.eq("test_record_count",testRecordCount); |
| | | wrapper.last(" limit 1"); |
| | | return mapper.selectOne(wrapper); |
| | | } |
| | | //历史测试数据导出 |
| | | public BatttestdataInf exportTinfDataByTestRecordCount(Integer battgroupId, Integer testRecordCount) { |
| | | QueryWrapper wrapper =new QueryWrapper(); |
| | | wrapper.eq("battgroup_id",battgroupId); |
| | | wrapper.eq("test_record_count",testRecordCount); |
| | | wrapper.last(" limit 1"); |
| | | return mapper.selectOne(wrapper); |
| | | } |
| | | } |