From 2a0d63149431539aae2abf67b1302c9041220796 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期二, 10 六月 2025 14:53:38 +0800 Subject: [PATCH] 实时推送修改 --- src/main/java/com/whyc/service/BatttestdataInfService.java | 50 +++++++++++++++----------------------------------- 1 files changed, 15 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/whyc/service/BatttestdataInfService.java b/src/main/java/com/whyc/service/BatttestdataInfService.java index b8f010d..7dbf755 100644 --- a/src/main/java/com/whyc/service/BatttestdataInfService.java +++ b/src/main/java/com/whyc/service/BatttestdataInfService.java @@ -722,7 +722,7 @@ return new Response().set(1,false,"褰撳墠鐢ㄦ埛鏈鐞嗘弧瓒虫潯浠剁殑鐢垫睜缁�"); } List<SticDischarge6Res> reslist=new ArrayList<>(); - /*for (BattInf binf:binfList) { + for (BattInf binf:binfList) { //鏌ヨ鐢垫睜缁勬墍鍦ㄧ殑鐝粍 String groupName=bjService.getGroupName(binf.getPowerId()); SticDischarge6Res res=new SticDischarge6Res(); @@ -731,16 +731,11 @@ res.setCountry(binf.getCountry()); res.setStationName(binf.getStationName()); res.setBattgroupName(binf.getBattgroupName()); - //2.鑾峰彇鐢垫睜缁勬湭鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) + //鑾峰彇鐢垫睜缁勬湭鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) + getNoDischargeData(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime(),stic.getTypeList(),res); + //2.鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime()); if(tinf==null){ - 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); if(!groupName.equals("none")){ BanZu bz= (BanZu) map.get(groupName); int nochargeNum=bz.getNochargeNum(); @@ -755,33 +750,18 @@ bz.setDischargeNum(dischargeNum+1); map.put(groupName,bz); } - res.setTestStartTime(tinf.getTestStarttime()); - res.setTestTimelong(tinf.getTestTimelong()); - res.setTestCap(tinf.getTestCap()); - 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); - res.setRealCap(grouprealCap); - res.setDisChargeType(1); - if(grouprealCap>=moncapStd*badValue){ - res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId())); - } - if(grouprealCap<=moncapStd*damageValue){ - res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_3.getStateId())); - } - if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){ - res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId())); - } - if(stic.getDisChargeType()==null){ - reslist.add(res); - }else{ - if(res.getDisChargeType()==stic.getDisChargeType()){ - reslist.add(res); - } - } - }*/ + } PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize()); return new Response().setII(1,reslist.size()>0,pageInfo,"鏈勾搴︽湭鏀剧數鏁伴噺缁熻"); } + //2.鑾峰彇鐢垫睜缁勬湭鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數) + private void getNoDischargeData(Integer battgroupId, Date testStartTime, Date testEndTime, List<Integer> typeList, SticDischarge6Res res) { + List<BatttestdataInf> tinfList=mapper.getNoDischargeData(battgroupId,testStartTime,testEndTime,typeList); + if(tinfList!=null&&tinfList.size()>0){ + res.setErrorNum(tinfList.size()); + }else { + res.setErrorNum(0); + res.setStopList(new ArrayList<>()); + } + } } \ No newline at end of file -- Gitblit v1.9.1