From c34c224406217a2523d68fdcecaf2bb4fb732389 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期五, 06 六月 2025 16:31:22 +0800 Subject: [PATCH] 历史测试数据 --- src/main/java/com/whyc/service/BatttestdataInfService.java | 73 ++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/BatttestdataInfService.java b/src/main/java/com/whyc/service/BatttestdataInfService.java index 52b4c8c..80dfc26 100644 --- a/src/main/java/com/whyc/service/BatttestdataInfService.java +++ b/src/main/java/com/whyc/service/BatttestdataInfService.java @@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; import com.whyc.constant.Capperformance; import com.whyc.constant.StopReasonEnum; +import com.whyc.dto.Real.TestDataDto; import com.whyc.dto.Response; import com.whyc.dto.Statistic.*; import com.whyc.factory.BattCapFactory; @@ -40,6 +41,7 @@ @Autowired(required = false) private AppParamService appParamService; + @@ -529,4 +531,75 @@ } } } + //鍘嗗彶娴嬭瘯璁板綍 + public Response getBattTinf(Integer battgroupId) { + Map<String, Object> map=new HashMap<>(); + List<TestDataDto> List1=new ArrayList<>(); + List<TestDataDto> List2=new ArrayList<>(); + List<TestDataDto> List3=new ArrayList<>(); + List<TestDataDto> List4=new ArrayList<>(); + List<TestDataDto> List5=new ArrayList<>(); + map.put("1",List1); //鏍稿鏀剧數 + map.put("2",List2); //鏍稿鍏呯數 + map.put("3",List3); //鐩戞祴鏀剧數 + map.put("4",List4); //鐩戞祴鍏呯數 + map.put("5",List5); //鍋滅數鏀剧數 + QueryWrapper wrapper=new QueryWrapper(); + wrapper.eq("battgroup_id",battgroupId); + wrapper.orderByDesc("test_starttime"); + List<BatttestdataInf> list=mapper.selectList(wrapper); + for (BatttestdataInf tinf:list) { + TestDataDto dto=new TestDataDto(); + dto.setTestStarttime(tinf.getTestStarttime()); + dto.setBattgroupId(tinf.getBattgroupId()); + dto.setTestRecordCount(tinf.getTestRecordCount()); + 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()); + if(battRtstate!=null){ + Float restTime= BattCapFactory.getTheoryTime(battRtstate.getGroupCurr(), realCap, binf.getMoncapstd()); + dto.setRestTime(restTime); + dto.setFloatchartVol(battRtstate.getGroupVol()); + }else{ + dto.setRestTime(0f); + dto.setFloatchartVol(0f); + } + //鎵捐繖娆℃斁鐢电殑鎸囧畾涓�绗旀暟鎹� + List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),1); + if(idDataList!=null&&idDataList.size()>=0){ + BatttestdataId idData=idDataList.get(0); + dto.setOnlineVol(idData.getOnlineVol()); + dto.setGroupCurr(idData.getTestCurr()); + }else { + dto.setOnlineVol(0f); + dto.setGroupCurr(0f); + } + if (tinf.getTestType() == 3) { + // 娴嬭瘯绫诲瀷涓烘斁鐢� + if (tinf.getTestStarttype() == 3) { + List1.add(dto); + } else { + List3.add(dto); + } + } else if (tinf.getTestType() == 2) { + // 娴嬭瘯绫诲瀷涓哄厖鐢� + if (tinf.getTestStarttype() == 3) { + List2.add(dto); + } else { + List4.add(dto); + } + } + } + return new Response().setII(1,true,map,"鍘嗗彶娴嬭瘯璁板綍"); + } } \ No newline at end of file -- Gitblit v1.9.1