From a0dc821ac3c77d5be4a8b1d59e36312a5ee7f915 Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期四, 12 六月 2025 16:19:09 +0800
Subject: [PATCH] 去除蓄电池组1.2.5,1.2.6右侧图表

---
 src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java |    3 +
 src/main/java/com/whyc/service/BatttestdataInfService.java  |   61 ++++++++++++++++++------------
 src/main/resources/mapper/BatttestdataInfMapper.xml         |    1 
 src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java |    2 +
 4 files changed, 41 insertions(+), 26 deletions(-)

diff --git a/src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java b/src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java
index 5321168..424a744 100644
--- a/src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java
+++ b/src/main/java/com/whyc/dto/Statistic/SticDischarge5Res.java
@@ -20,4 +20,6 @@
     private String stopReason;      //鍋滄鍘熷洜
     private String capperformance;     //鐢垫睜鎬ц兘
     private Integer disChargeType;     //1.宸叉斁鐢� 2.鏈斁鐢� 涓嶄紶鍏ㄩ儴
+    private Integer testRecordCount;
+    private String dischargeName;
 }
\ No newline at end of file
diff --git a/src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java b/src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java
index 686b037..7dccd87 100644
--- a/src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java
+++ b/src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java
@@ -20,6 +20,7 @@
     private String product;
     private Integer errorNum;
     private List<String> stopList;
-    private BatttestdataInf tinf;
+    private Integer testRecordCount;
+    private String dischargeName;
     private Integer stopReasonType;   //0鍏ㄩ儴锛�1绗﹀悎绛涢�夋潯浠剁殑鏀剧數璁板綍
 }
\ No newline at end of file
diff --git a/src/main/java/com/whyc/service/BatttestdataInfService.java b/src/main/java/com/whyc/service/BatttestdataInfService.java
index c6dbf82..1cf2ea5 100644
--- a/src/main/java/com/whyc/service/BatttestdataInfService.java
+++ b/src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -547,11 +547,11 @@
         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);   //鍋滅數鏀剧數
+        map.put("鏍稿鏀剧數",List1);   //鏍稿鏀剧數
+        map.put("鏍稿鍏呯數",List2);   //鏍稿鍏呯數
+        map.put("鐩戞祴鏀剧數",List3);   //鐩戞祴鏀剧數
+        map.put("鐩戞祴鍏呯數",List4);   //鐩戞祴鍏呯數
+        map.put("鍋滅數鏀剧數",List5);   //鍋滅數鏀剧數
         QueryWrapper wrapper=new QueryWrapper();
         wrapper.eq("battgroup_id",battgroupId);
         wrapper.orderByDesc("test_starttime");
@@ -657,13 +657,6 @@
             //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);*/
                 continue;
             }
             if(!groupName.equals("none")){
@@ -676,6 +669,17 @@
             res.setTestTimelong(tinf.getTestTimelong());
             res.setTestCap(tinf.getTestCap());
             res.setStopReason(StopReasonEnum.getValue(tinf.getTestStoptype()));
+            if (tinf.getTestType() == 3) {
+                // 娴嬭瘯绫诲瀷涓烘斁鐢�
+                if (tinf.getTestStarttype() == 3) {
+                    res.setDischargeName("鏍稿鏀剧數");
+                } else if(tinf.getTestStarttype() == 4){
+                    res.setDischargeName("鍋滅數鏀剧數");
+                }else {
+                    res.setDischargeName("鐩戞祴鏀剧數");
+                }
+            }
+            res.setTestRecordCount(tinf.getTestRecordCount());
             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);
@@ -742,9 +746,6 @@
             res.setProduct(binf.getProduct());
             //鑾峰彇鐢垫睜缁勬湭鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數)
             getNoDischargeData(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime(),stic.getTypeList(),res);
-            //2.鑾峰彇鐢垫睜缁勫湪缁欏畾鏃堕棿娈电殑鏀剧數璁板綍(鎸囧畾鏃堕棿娈电殑鏍囧噯鏍稿鏀剧數)
-            BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime());
-            res.setTinf(tinf);
             if(stic.getStopReasonType()==0){
                 reslist.add(res);
             }else {
@@ -752,16 +753,12 @@
                     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;
+            if(!groupName.equals("none")){
+                BanZu bz= (BanZu) bzmap.get(groupName);
+                int nochargeNum=bz.getNochargeNum();
+                bz.setNochargeNum(nochargeNum+1);
+                bzmap.put(groupName,bz);
             }
-
         }
         PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize());
         return new Response().setIII(1,reslist.size()>0,pageInfo,bzmap,"鏈勾搴︽湭鏀剧數鏁伴噺缁熻");
@@ -773,7 +770,21 @@
         if(tinfList!=null&&tinfList.size()>0){
             res.setErrorNum(tinfList.size());
             res.setStopReasonType(1);
-            for (BatttestdataInf tinf:tinfList) {
+            for (int i=0;i<tinfList.size();i++) {
+                BatttestdataInf tinf=tinfList.get(i);
+                if(i==0){
+                   res.setTestRecordCount(tinf.getTestRecordCount());
+                   if (tinf.getTestType() == 3) {
+                        // 娴嬭瘯绫诲瀷涓烘斁鐢�
+                        if (tinf.getTestStarttype() == 3) {
+                            res.setDischargeName("鏍稿鏀剧數");
+                        } else if(tinf.getTestStarttype() == 4){
+                            res.setDischargeName("鍋滅數鏀剧數");
+                        }else {
+                            res.setDischargeName("鐩戞祴鏀剧數");
+                        }
+                   }
+                }
                 String stopReason=StopReasonEnum.getValue(tinf.getTestStoptype());
                 stopList.add(stopReason);
             }
diff --git a/src/main/resources/mapper/BatttestdataInfMapper.xml b/src/main/resources/mapper/BatttestdataInfMapper.xml
index a6b1e32..762b55d 100644
--- a/src/main/resources/mapper/BatttestdataInfMapper.xml
+++ b/src/main/resources/mapper/BatttestdataInfMapper.xml
@@ -59,5 +59,6 @@
                 </foreach>
             </if>
         </where>
+        order by test_starttime desc
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1