From ff25fec207602b5e44679e413822d64b45fc4b21 Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期三, 28 五月 2025 14:31:36 +0800
Subject: [PATCH] 蓄电池核容信息统计

---
 src/main/java/com/whyc/service/BatttestdataInfService.java |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/whyc/service/BatttestdataInfService.java b/src/main/java/com/whyc/service/BatttestdataInfService.java
index 6ece9a4..a553c31 100644
--- a/src/main/java/com/whyc/service/BatttestdataInfService.java
+++ b/src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -9,6 +9,7 @@
 import com.whyc.mapper.BattInfMapper;
 import com.whyc.mapper.BatttestdataInfMapper;
 import com.whyc.pojo.db_batt_testdata.BatttestdataInf;
+import com.whyc.pojo.db_ram_db.BattRtstate;
 import com.whyc.pojo.db_station.BattInf;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -19,6 +20,12 @@
 public class BatttestdataInfService {
     @Autowired(required = false)
     private BatttestdataInfMapper mapper;
+
+    @Autowired(required = false)
+    private BattRtstateService rtstateService;
+
+    @Autowired(required = false)
+    private BattInfService battInfService;
 
 
     //鑾峰彇鏈�鍚庝竴娆℃祴璇曟暟鎹苟璁$畻鍓╀綑瀹归噺
@@ -41,6 +48,28 @@
     public Response getBattTinfStatistic(BattTinfStic stic) {
         PageHelper.startPage(stic.getPageNum(), stic.getPageSize());
         List<BatttestdataInf> list=mapper.getBattTinfStatistic(stic);
+        if(list!=null&&list.size()>0){
+            for (BatttestdataInf tinf:list) {
+                //鍓╀綑瀹归噺鍜屽墿浣欐椂闂磋绠�
+                int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr());
+                Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest);
+                tinf.setRestCap(restCap);
+                tinf.setRestTime(0f);
+                //鑾峰彇鐢垫睜缁勫疄鏃舵暟鎹�
+                BattRtstate battRtstate=rtstateService.getBattRealInfo(tinf.getBattgroupId());
+                //鑾峰彇鐢垫睜缁勪俊鎭�
+                BattInf binf=battInfService.getBinfByBattgroupId(tinf.getBattgroupId());
+                //瀹炴椂缁勭鐢垫祦锛屽墿浣欏閲忥紝鏍囩О瀹归噺
+                if(battRtstate!=null){
+                    Float restTime= BattCapFactory.getTheoryTime(battRtstate.getGroupCurr(), restCap, binf.getMoncapstd());
+                    tinf.setRestTime(restTime);
+                }
+                //淇濈暀2浣嶅皬鏁�
+                String precentCap = String.format("%.2f",(restCap/binf.getMoncapstd()*100));
+                tinf.setPrecentCap(precentCap);
+            }
+        }
+
         PageInfo pageInfo=new PageInfo(list);
         return new Response().setII(1,list.size()>0,pageInfo,"钃勭數姹犳牳瀹逛俊鎭粺璁�");
     }

--
Gitblit v1.9.1