From ac4f36a716198037fc9d3af8c51b4be9ca159b96 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期四, 12 六月 2025 15:40:38 +0800 Subject: [PATCH] 蓄电池组1.2.5,1.2.6 --- src/main/java/com/whyc/service/BatttestdataInfService.java | 81 +++++++++++++++++++++++++++++++++------- 1 files changed, 66 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/whyc/service/BatttestdataInfService.java b/src/main/java/com/whyc/service/BatttestdataInfService.java index b5fccd7..1700aec 100644 --- a/src/main/java/com/whyc/service/BatttestdataInfService.java +++ b/src/main/java/com/whyc/service/BatttestdataInfService.java @@ -612,8 +612,18 @@ } return new Response().setII(1,true,map,"鍘嗗彶娴嬭瘯璁板綍"); } - //鏈勾搴﹀凡鏀剧數鏁伴噺缁熻(1.2.5) + //鏈勾搴﹀凡鏀剧數鏁伴噺缁熻(1.2.5)<鍙煡鐪嬪凡鏀剧數鏁版嵁> public Response getDischr5Statistic(DisChargeStic stic) { + //鐝粍 + Map<String, Object> bzmap=new HashMap<>(); + //鎬ц兘 + Map<String, Integer> xnmap=new HashMap<>(); + xnmap.put("浼樼",0); + xnmap.put("鍔e寲",0); + xnmap.put("鎹熷潖",0); + xnmap.put("鏈斁鐢�",0); + //鏌ヨ鍑烘墍鏈夌殑鐝粍骞惰祴浜堝垵濮嬪�� + setBanZuDefault(bzmap); //鑾峰彇鏍稿浼樺姡锛屾崯鍧忓弬鏁� List<AppParam> paramList=appParamService.getHrParam(); Float badValue=0f; @@ -647,16 +657,21 @@ //2.鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); if(tinf==null){ - res.setRealCap(0f); + /* res.setRealCap(0f); res.setTestStartTime(ThreadLocalUtil.parse("1972-01-01 00:00:00",1)); res.setTestTimelong(0); res.setTestCap(0f); res.setStopReason(""); res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId())); - res.setDisChargeType(2); + res.setDisChargeType(2);*/ continue; } - + if(!groupName.equals("none")){ + BanZu bz= (BanZu) bzmap.get(groupName); + int dischargeNum=bz.getDischargeNum(); + bz.setDischargeNum(dischargeNum+1); + bzmap.put(groupName,bz); + } res.setTestStartTime(tinf.getTestStarttime()); res.setTestTimelong(tinf.getTestTimelong()); res.setTestCap(tinf.getTestCap()); @@ -665,27 +680,27 @@ 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); res.setRealCap(grouprealCap); - res.setDisChargeType(1); + //res.setDisChargeType(1); if(grouprealCap>=moncapStd*badValue){ res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); + int value=xnmap.get(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); + xnmap.put(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId()),value+1); } if(grouprealCap<=moncapStd*damageValue){ res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); + int value=xnmap.get(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); + xnmap.put(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId()),value+1); } if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); + int value=xnmap.get(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); + xnmap.put(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId()),value+1); } - if(stic.getDisChargeType()==null){ - reslist.add(res); - }else{ - if(res.getDisChargeType()==stic.getDisChargeType()){ - reslist.add(res); - } - } + reslist.add(res); } PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); - return new Response().setII(1,reslist.size()>0,pageInfo,"鏈勾搴﹀凡鏀剧數鏁伴噺缁熻"); - }//鏈勾搴﹀凡鏀剧數鏁伴噺缁熻鍙充晶鍥捐〃(1.2.5) + return new Response().setIIII(1,reslist.size()>0,pageInfo,bzmap,xnmap,"鏈勾搴﹀凡鏀剧數鏁伴噺缁熻"); + }//鏈勾搴﹀凡鏀剧數鏁伴噺缁熻鍙充晶鍥捐〃(1.2.5/6) public Response getDischr5Chart(Integer uid) { //鐝粍 Map<String, Object> bzmap=new HashMap<>(); @@ -774,6 +789,10 @@ //鏈勾搴︽湭鏀剧數鏁伴噺缁熻(1.2.6) public Response getDischr6Statistic(DisChargeStic stic) { + //鐝粍 + Map<String, Object> bzmap=new HashMap<>(); + //鏌ヨ鍑烘墍鏈夌殑鐝粍骞惰祴浜堝垵濮嬪�� + setBanZuDefault(bzmap); //1鏌ヨ绗﹀悎鏉′欢鐨勭數姹犵粍 List<BattInf> binfList=battInfService.getDischr6Statistic(stic); if(binfList==null||binfList.size()==0){ @@ -805,9 +824,19 @@ reslist.add(res); } } + if(tinf==null){ + if(!groupName.equals("none")){ + BanZu bz= (BanZu) bzmap.get(groupName); + int nochargeNum=bz.getNochargeNum(); + bz.setNochargeNum(nochargeNum+1); + bzmap.put(groupName,bz); + } + continue; + } + } PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); - return new Response().setII(1,reslist.size()>0,pageInfo,"鏈勾搴︽湭鏀剧數鏁伴噺缁熻"); + return new Response().setIII(1,reslist.size()>0,pageInfo,bzmap,"鏈勾搴︽湭鏀剧數鏁伴噺缁熻"); } //2.鑾峰彇鐢垫睜缁勬湭鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) private void getNoDischargeData(Integer battgroupId, Date testStartTime, Date testEndTime, List<Integer> typeList, SticDischarge6Res res) { @@ -905,5 +934,27 @@ PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); return new Response().setII(1,reslist.size()>0,pageInfo,"鐢垫睜缁勭數姹犳�ц兘缁熻锛堟湭鏀剧數锛屼紭绉�锛屽姡鍖栵紝鎹熷潖锛夌粺璁�(1.2.8/9/10)"); } + //浼樿壇鐢垫簮鏁伴噺缁熻(1.2.7) + public Response getPwr7Statistic(Pwr7Stic stic) { + //鑾峰彇鏍稿浼樺姡锛屾崯鍧忓弬鏁� + List<AppParam> paramList=appParamService.getHrParam(); + Float badValue=0f; + Float damageValue=0f; + if(paramList!=null){ + for (AppParam param:paramList) { + if(param.getParamNamePsx().equals("batt_mon_deteriorate_val")){ + badValue=param.getParamValue(); + } + if(param.getParamNamePsx().equals("batt_mon_damage_val")){ + damageValue=param.getParamValue(); + } + } + } + //1鏌ヨ绗﹀悎鏉′欢鐨勭數姹犵粍 + List<BattInf> binfList=battInfService.getPwr7Statistic(stic); + List<PerformanceRes> reslist=new ArrayList<>(); + PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); + return new Response().setII(1,reslist.size()>0,pageInfo,"浼樿壇鐢垫簮鏁伴噺缁熻(1.2.7)"); + } } \ No newline at end of file -- Gitblit v1.9.1