From 02ccfc21d5d4f767bbd92ecda89cdfcc3283728c Mon Sep 17 00:00:00 2001
From: whycxzp <glperry@163.com>
Date: 星期三, 11 六月 2025 08:38:26 +0800
Subject: [PATCH] Merge branch 'master' of http://118.89.139.230:10101/r/powerIntelligenceSystem into master

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

diff --git a/src/main/java/com/whyc/service/BattInfService.java b/src/main/java/com/whyc/service/BattInfService.java
index 10056b1..c027615 100644
--- a/src/main/java/com/whyc/service/BattInfService.java
+++ b/src/main/java/com/whyc/service/BattInfService.java
@@ -4,9 +4,13 @@
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.whyc.constant.Capperformance;
+import com.whyc.constant.PowerAlarmEnum;
 import com.whyc.dto.BattDto;
 import com.whyc.dto.InfoDto;
+import com.whyc.dto.Real.QuarterDto;
 import com.whyc.dto.Response;
+import com.whyc.dto.Statistic.*;
 import com.whyc.factory.InfoFactory;
 import com.whyc.mapper.BattInfMapper;
 import com.whyc.mapper.PowerInfMapper;
@@ -23,6 +27,7 @@
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 @Service
 public class BattInfService {
@@ -217,6 +222,12 @@
         if(pinf.getPowerType()!=null){
             wrapper2.set("power_type",pinf.getPowerType());
         }
+        if(pinf.getPowerInuseTime()!=null){
+            wrapper2.set("power_inuse_time",pinf.getPowerInuseTime());
+        }
+        if(pinf.getModelCfg()!=null){
+            wrapper2.set("model_cfg",pinf.getModelCfg());
+        }
         /*if(pinf.getPowerName()!=null){
             //妫�娴嬭鏈烘埧涓嬭淇敼鐨勭數婧愬悕鏄惁瀛樺湪
             QueryWrapper queryWrapper1=new QueryWrapper();
@@ -286,6 +297,9 @@
             }
             if (binf.getBattModel() != null) {
                 wrapper4.set("batt_model", binf.getBattModel());
+            }
+            if (binf.getInuseTime() != null) {
+                wrapper4.set("inuse_time", binf.getInuseTime());
             }
             wrapper4.eq("battgroup_id", binf.getBattgroupId());
             mapper.update((BattInf) ActionUtil.objeNull,wrapper3);
@@ -378,4 +392,81 @@
         return new Response().setII(1,list.size()>0,list,"鑾峰彇璁惧鍨嬪彿(涓嬫媺)");
     }
 
+    //鏍规嵁鐢垫睜缁刬d鑾峰彇鐢垫睜缁勪俊鎭�
+    public BattInf getBinfByBattgroupId(Integer battgroupId) {
+        QueryWrapper wrapper=new QueryWrapper();
+        wrapper.eq("battgroup_id",battgroupId);
+        wrapper.last("limit 1");
+        BattInf binf=mapper.selectOne(wrapper);
+        return binf;
+    }
+   //褰撴病鏈夊唴鍔╂祴璇曟椂鍒濆鍐呴樆鍊间负鏍囩О鍐呴樆
+    public List<QuarterDto> getBinfResStd(Integer battgroupId) {
+        QueryWrapper wrapper=new QueryWrapper();
+        wrapper.eq("battgroup_id",battgroupId);
+        wrapper.last("limit 1");
+        BattInf binf=mapper.selectOne(wrapper);
+        Float monresstd=binf.getMonresstd();
+        List<QuarterDto> list=new ArrayList<>();
+        for(int i=0;i<binf.getMoncount();i++){
+            QuarterDto dto=new QuarterDto();
+            dto.setRecordTime(binf.getCreateTime());
+            dto.setMonNum(i+1);
+            dto.setNumValue(monresstd);
+        }
+        return list;
+    }
+
+    //璁惧淇℃伅缁熻
+    public Response getDevStatistic(StationStic stic) {
+        PageHelper.startPage(stic.getPageNum(),stic.getPageSize());
+        List<BattInf> list=mapper.getDevStatistic(stic);
+        for (BattInf binf:list) {
+            //鑾峰彇璁惧涓嬬數姹犵粍涓暟
+            int battCount=mapper.getBattCountBydevId(binf.getDevId());
+            binf.setBattCount(battCount);
+        }
+        PageInfo<BattInf> pageInfo=new PageInfo<>(list);
+        return new Response().setII(1,list.size()>0,pageInfo,"璁惧淇℃伅缁熻");
+    }
+    //钃勭數姹犵粍淇℃伅缁熻
+    public Response getBattStatistic(StationStic stic) {
+        PageHelper.startPage(stic.getPageNum(),stic.getPageSize());
+        List<BattInf> list=mapper.getBattStatistic(stic);
+        PageInfo<BattInf> pageInfo=new PageInfo<>(list);
+        return new Response().setII(1,list.size()>0,pageInfo,"钃勭數姹犵粍淇℃伅缁熻");
+    }
+    //鍗曚綋缁熻鏌ヨ绗﹀悎鏉′欢鐨勭數姹犵粍
+    public List<BattInf> getMonStatistic(MonStic stic) {
+        return mapper.getMonStatistic(stic);
+    }
+    //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰15
+    public List<BattInf> getBattCompare15Statistic(BattCompareStic stic) {
+        return mapper.getBattCompare15Statistic(stic);
+    }
+    //鑾峰彇瀹归噺鎬ц兘(涓嬫媺)
+    public Response getCapperformance() {
+        Map<Integer,String> map= Capperformance.getOpInfo();
+        return new Response().setII(1,true,map,"鑾峰彇瀹归噺鎬ц兘(涓嬫媺)");
+    }
+    //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰16
+    public List<BattInf> getBattCompare16Statistic(BattCompareStic stic) {
+        return mapper.getBattCompare16Statistic(stic);
+    }
+    //钃勭數姹犵粍瀵规瘮鍒嗘瀽鐣岄潰17
+    public List<BattInf> getBattCompare17Statistic(BattCompareStic stic) {
+        return mapper.getBattCompare17Statistic(stic);
+    }
+    //鏈勾搴﹀凡鏀剧數鏁伴噺缁熻(1.2.5)
+    public List<BattInf> getDischr5Statistic(DisChargeStic stic) {
+        return mapper.getDischr5Statistic(stic);
+    }
+    //鏈勾搴﹀凡鏀剧數鏁伴噺缁熻(1.2.6)
+    public List<BattInf> getDischr6Statistic(DisChargeStic stic) {
+        return mapper.getDischr6Statistic(stic);
+    }
+    //鐢垫睜缁勭數姹犳�ц兘缁熻锛堟湭鏀剧數锛屼紭绉�锛屽姡鍖栵紝鎹熷潖锛夌粺璁�(1.2.8/9/10)
+    public List<BattInf> getPerformanceStatistic(PerformanceStic stic) {
+        return mapper.getPerformanceStatistic(stic);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1