whyclxw
2025-06-10 a6609b79468c5abd342e72382647cafb91ea5454
本年度未放电数量统计(1.2.6)
3个文件已修改
22 ■■■■ 已修改文件
src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BatttestdataInfService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BatttestdataInfMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java
@@ -1,6 +1,7 @@
package com.whyc.dto.Statistic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.whyc.pojo.db_batt_testdata.BatttestdataInf;
import lombok.Data;
import java.util.Date;
@@ -15,8 +16,9 @@
    private String battgroupName;
    private Float monvolstd;
    private Float moncapstd;
    private Float monCount;
    private Float moncount;
    private String product;
    private Integer errorNum;
    private List<String> stopList;
    private BatttestdataInf tinf;
}
src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -731,10 +731,16 @@
            res.setCountry(binf.getCountry());
            res.setStationName(binf.getStationName());
            res.setBattgroupName(binf.getBattgroupName());
            res.setMoncapstd(binf.getMoncapstd());
            res.setMonvolstd(binf.getMonvolstd());
            res.setMoncount(binf.getMoncount());
            res.setProduct(binf.getProduct());
            //获取电池组未放电记录(指定时间段的标准核容放电)
            getNoDischargeData(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime(),stic.getTypeList(),res);
            reslist.add(res);
            //2.获取电池组在给定时间段的放电记录(指定时间段的标准核容放电)
            BatttestdataInf tinf =getLastStandardTestDataByTime(binf.getBattgroupId(),stic.getTestStartTime(),stic.getTestEndTime());
            res.setTinf(tinf);
            if(tinf==null){
                if(!groupName.equals("none")){
                    BanZu bz= (BanZu) map.get(groupName);
@@ -752,13 +758,19 @@
            }
        }
        PageInfo pageInfo=PageInfoUtils.list2PageInfo(reslist, stic.getPageNum(), stic.getPageSize());
        return new Response().setII(1,reslist.size()>0,pageInfo,"本年度未放电数量统计");
        return new Response().setIII(1,reslist.size()>0,pageInfo,map,"本年度未放电数量统计");
    }
    //2.获取电池组未放电记录(指定时间段的标准核容放电)
    private void getNoDischargeData(Integer battgroupId, Date testStartTime, Date testEndTime, List<Integer> typeList, SticDischarge6Res res) {
        List<BatttestdataInf> tinfList=mapper.getNoDischargeData(battgroupId,testStartTime,testEndTime,typeList);
        List<String> stopList=new ArrayList<>();
        if(tinfList!=null&&tinfList.size()>0){
            res.setErrorNum(tinfList.size());
            for (BatttestdataInf tinf:tinfList) {
                String stopReason=StopReasonEnum.getValue(tinf.getTestStoptype());
                stopList.add(stopReason);
            }
            res.setStopList(stopList);
        }else {
            res.setErrorNum(0);
            res.setStopList(new ArrayList<>());
src/main/resources/mapper/BatttestdataInfMapper.xml
@@ -46,10 +46,10 @@
        <where>
            battgroup_id=#{battgroupId} and test_type=3
            and (test_starttype!=3 or test_timelong &lt;7200)
            <if test="stic.testStartTime!=null">
            <if test="testStartTime!=null">
                and tb_batttestdata_inf.test_starttime>=#{stic.testStartTime}
            </if>
            <if test="stic.testEndTime!=null">
            <if test="testEndTime!=null">
                and tb_batttestdata_inf.test_starttime&lt;=#{stic.testEndTime}
            </if>
            <if test="typeList!=null">