whyclxw
2025-06-10 35764901d6a63ee5427ab2f07b76ca3827be3f43
电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10)
4个文件已修改
1个文件已添加
113 ■■■■■ 已修改文件
src/main/java/com/whyc/dto/Statistic/PerformanceRes.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattInfMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattInfService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BatttestdataInfService.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattInfMapper.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/Statistic/PerformanceRes.java
New file
@@ -0,0 +1,19 @@
package com.whyc.dto.Statistic;
import lombok.Data;
@Data
public class PerformanceRes {
    private String provice;
    private String city;
    private String country;
    private String stationName;
    private String battgroupName;
    private Float monvolstd;
    private Float moncapstd;
    private Float moncount;
    private String product;
    private Integer inuseYear;
    private Float realCap;          //实际容量
    private String capperformance; //性能
}
src/main/java/com/whyc/mapper/BattInfMapper.java
@@ -2,10 +2,7 @@
import com.whyc.dto.BattDto;
import com.whyc.dto.InfoDto;
import com.whyc.dto.Statistic.BattCompareStic;
import com.whyc.dto.Statistic.DisChargeStic;
import com.whyc.dto.Statistic.MonStic;
import com.whyc.dto.Statistic.StationStic;
import com.whyc.dto.Statistic.*;
import com.whyc.pojo.db_station.BattInf;
import org.apache.ibatis.annotations.Param;
@@ -52,4 +49,6 @@
    List<BattInf> getDischr5Statistic(@Param("stic") DisChargeStic stic);
    //本年度已放电数量统计(1.2.6)
    List<BattInf> getDischr6Statistic(@Param("stic") DisChargeStic stic);
    //电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10)
    List<BattInf> getPerformanceStatistic(@Param("stic") PerformanceStic stic);
}
src/main/java/com/whyc/service/BattInfService.java
@@ -10,10 +10,7 @@
import com.whyc.dto.InfoDto;
import com.whyc.dto.Real.QuarterDto;
import com.whyc.dto.Response;
import com.whyc.dto.Statistic.BattCompareStic;
import com.whyc.dto.Statistic.DisChargeStic;
import com.whyc.dto.Statistic.MonStic;
import com.whyc.dto.Statistic.StationStic;
import com.whyc.dto.Statistic.*;
import com.whyc.factory.InfoFactory;
import com.whyc.mapper.BattInfMapper;
import com.whyc.mapper.PowerInfMapper;
@@ -468,4 +465,8 @@
    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);
    }
}
src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -18,6 +18,7 @@
import com.whyc.pojo.db_ram_db.BattRtstate;
import com.whyc.pojo.db_station.BattInf;
import com.whyc.pojo.db_user.Baojigroup;
import com.whyc.util.ActionUtil;
import com.whyc.util.PageInfoUtils;
import com.whyc.util.ThreadLocalUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -793,7 +794,7 @@
    }
    //电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10)
    public Response getPerformanceStatistic(PerformanceStic stic) {
        /*//获取核容优劣,损坏参数
        //获取核容优劣,损坏参数
        List<AppParam> paramList=appParamService.getHrParam();
        Float badValue=0f;
        Float damageValue=0f;
@@ -809,31 +810,34 @@
            }
        }
        //1查询符合条件的电池组
        List<BattInf> binfList=battInfService.getBattCompare15Statistic(stic);
        List<BattInf> binfList=battInfService.getPerformanceStatistic(stic);
        if(binfList==null||binfList.size()==0){
            return new Response().set(1,false,"当前用户未管理满足条件的电池组");
        }
        List<SticCompare15Res> reslist=new ArrayList<>();
        List<PerformanceRes> reslist=new ArrayList<>();
        for (BattInf binf:binfList) {
            SticCompare15Res res=new SticCompare15Res();
            PerformanceRes res=new PerformanceRes();
            res.setProvice(binf.getProvice());
            res.setCity(binf.getCity());
            res.setCountry(binf.getCountry());
            res.setStationName(binf.getStationName());
            res.setBattgroupName(binf.getBattgroupName());
            res.setDevName(binf.getDevName());
            res.setProduct(binf.getProduct());
            res.setInuseTime(binf.getInuseTime());
            res.setInuseYear(ActionUtil.getDateYear(new Date())-ActionUtil.getDateYear(binf.getInuseTime()));
            res.setMonvolstd(binf.getMonvolstd());
            res.setStationId(binf.getStationId());
            res.setPowerId(binf.getPowerId());
            res.setDevId(binf.getDevId());
            res.setBattgroupId(binf.getBattgroupId());
            res.setMoncapstd(binf.getMoncapstd());
            res.setMoncount(binf.getMoncount());
            //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电)
            BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime());
            if(stic.getPerformance()==null){
                reslist.add(res);
            }else{
                if(res.getCapperformance().equals(Capperformance.getValue(stic.getPerformance()))){
                    reslist.add(res);
                }
            }
            if(tinf==null){
                res.setRealCap(0f);
                res.setPrecentCap("0");
                res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId()));
                continue;
            }
@@ -841,14 +845,12 @@
            List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum());
            if(idDataList==null||idDataList.size()==0){
                res.setRealCap(0f);
                res.setPrecentCap("0");
                res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_4.getStateId()));
                continue;
            }
            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);
            //Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest);
            res.setRealCap(grouprealCap);
            if(grouprealCap>=moncapStd*badValue){
                res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_1.getStateId()));
@@ -859,28 +861,8 @@
            if((grouprealCap>moncapStd*damageValue)&&(grouprealCap<moncapStd*badValue)){
                res.setCapperformance(Capperformance.getValue(Capperformance.BATTSTATE_2.getStateId()));
            }
            //保留5位小数
            String precentCap = String.format("%.5f",(grouprealCap/binf.getMoncapstd()*100));
            res.setPrecentCap(precentCap);
            List<Integer> monNums=new ArrayList<>();
            for (BatttestdataId data:idDataList) {//求单体的 实际容量,最小值就是单体的单体电压
                Float monrealCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), data.getMonVol(), tinf.getGroupVol(), BattCapFactory.CapType_Real);
                if (monrealCap <= moncapStd * damageValue) {//损坏的
                    monNums.add(data.getMonNum());
                }
            }
            res.setMonNums(monNums);
            if(stic.getPerformance()==null){
                reslist.add(res);
            }else{
                if(res.getCapperformance().equals(Capperformance.getValue(stic.getPerformance()))){
                    reslist.add(res);
                }
            }
        }
        PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize());
        return new Response().setII(1,reslist.size()>0,pageInfo,"蓄电池组对比分析界面(同一品牌同一时间)");*/
        return null;
        return new Response().setII(1,reslist.size()>0,pageInfo,"电池组电池性能统计(未放电,优秀,劣化,损坏)统计(1.2.8/9/10)");
    }
}
src/main/resources/mapper/BattInfMapper.xml
@@ -374,4 +374,32 @@
            order by tb_batt_inf.dev_id asc,battgroup_id asc
        </where>
    </select>
    <select id="getPerformanceStatistic" resultType="com.whyc.pojo.db_station.BattInf">
        select distinct tb_batt_inf.*
        ,tb_station_inf.station_type,tb_station_inf.station_name,tb_station_inf.provice,tb_station_inf.city,tb_station_inf.country,tb_station_inf.full_name
        from db_station.tb_batt_inf,db_station.tb_station_inf
        <where>
            tb_batt_inf.station_id=tb_station_inf.station_id
            <if test="stic.provice!=null">
                and tb_station_inf.provice=#{stic.provice}
            </if>
            <if test="stic.city!=null">
                and tb_station_inf.city=#{stic.city}
            </if>
            <if test="stic.country!=null">
                and tb_station_inf.country=#{stic.country}
            </if>
            <if test="stic.stationName!=null">
                and tb_station_inf.station_name=#{stic.stationName}
            </if>
            <if test="stic.uid>100">
                and tb_batt_inf.station_id in(
                select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
                where   tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id
                and tb_baojigroup_usr.uid=#{stic.uid}
                )
            </if>
            order by tb_batt_inf.dev_id asc,battgroup_id asc
        </where>
    </select>
</mapper>