From 494a59976459b88ac0f0a13c5893b906e10bdfa0 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期五, 30 五月 2025 16:17:56 +0800 Subject: [PATCH] 单体统计修改 --- src/main/java/com/whyc/service/BatttestdataInfService.java | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/BatttestdataInfService.java b/src/main/java/com/whyc/service/BatttestdataInfService.java index 84e0ab1..88735ab 100644 --- a/src/main/java/com/whyc/service/BatttestdataInfService.java +++ b/src/main/java/com/whyc/service/BatttestdataInfService.java @@ -5,10 +5,12 @@ import com.github.pagehelper.PageInfo; import com.whyc.dto.Response; import com.whyc.dto.Statistic.BattTinfStic; +import com.whyc.dto.Statistic.MonStic; import com.whyc.dto.Statistic.StationStic; import com.whyc.factory.BattCapFactory; import com.whyc.mapper.BattInfMapper; import com.whyc.mapper.BatttestdataInfMapper; +import com.whyc.pojo.db_batt_testdata.BatttestdataId; import com.whyc.pojo.db_batt_testdata.BatttestdataInf; import com.whyc.pojo.db_ram_db.BattRtstate; import com.whyc.pojo.db_station.BattInf; @@ -27,6 +29,10 @@ @Autowired(required = false) private BattInfService battInfService; + + @Autowired(required = false) + private BatttestdataIdService battTestdataIdService; + //鑾峰彇鏈�鍚庝竴娆℃祴璇曟暟鎹苟璁$畻鍓╀綑瀹归噺 @@ -56,6 +62,7 @@ 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); tinf.setRestCap(restCap); + tinf.setRealCap(realCap); tinf.setRestTime(0f); //鑾峰彇鐢垫睜缁勫疄鏃舵暟鎹� BattRtstate battRtstate=rtstateService.getBattRealInfo(tinf.getBattgroupId()); @@ -87,4 +94,27 @@ BatttestdataInf tinf = mapper.selectOne(wrapper); return tinf; } + /*鍗曡妭鏁伴噺缁熻 + 1绛涢�夋弧瓒虫潯浠剁殑鐢垫睜缁勶紝鎵炬渶杩戜竴娆℃爣鍑嗘牳瀹规斁鐢佃褰曠殑鏈�鍚庝竴绗旀暟鎹� + 2鍐嶆寜鐓у叕寮忚绠楀崟浣撳疄闄呭閲忥紝 + 3鐒跺悗鎵惧埌鍒ゆ柇浼樼锛屽姡鍖栵紝鎹熷潖鐨勫弬鏁帮紝寰楀埌缁撴灉銆� + 4娴厖鐢靛帇鍥撅紝闇�瑕佹樉绀哄崟浣�+瀹炴椂鏁版嵁鐨勫崟浣撶數鍘嬶紝鍗曚綋鍐呴樆 + */ + public Response getMonStatistic(MonStic stic) { + List<BattInf> binfList=battInfService.getMonStatistic(stic); + if(binfList!=null&&binfList.size()>0){ + for (BattInf binf:binfList) { + BatttestdataInf tinf =getLastStandardTestData(binf.getBattgroupId()); + if(tinf!=null){ + //鎵捐繖娆℃斁鐢电殑鏈�鍚庝竴绗旀暟鎹� + List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum()); + for (BatttestdataId data:idDataList) { + 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); + } + } + } + } + return new Response().set(1,false,""); + } } \ No newline at end of file -- Gitblit v1.9.1