whyclxw
2025-05-30 494a59976459b88ac0f0a13c5893b906e10bdfa0
src/main/java/com/whyc/service/BatttestdataInfService.java
@@ -5,10 +5,12 @@
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.dto.Statistic.BattTinfStic;
import com.whyc.dto.Statistic.MonStic;
import com.whyc.dto.Statistic.StationStic;
import com.whyc.factory.BattCapFactory;
import com.whyc.mapper.BattInfMapper;
import com.whyc.mapper.BatttestdataInfMapper;
import com.whyc.pojo.db_batt_testdata.BatttestdataId;
import com.whyc.pojo.db_batt_testdata.BatttestdataInf;
import com.whyc.pojo.db_ram_db.BattRtstate;
import com.whyc.pojo.db_station.BattInf;
@@ -27,6 +29,10 @@
    @Autowired(required = false)
    private BattInfService battInfService;
    @Autowired(required = false)
    private BatttestdataIdService battTestdataIdService;
    //获取最后一次测试数据并计算剩余容量
@@ -56,6 +62,7 @@
                Float restCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Rest);
                Float realCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real);
                tinf.setRestCap(restCap);
                tinf.setRealCap(realCap);
                tinf.setRestTime(0f);
                //获取电池组实时数据
                BattRtstate battRtstate=rtstateService.getBattRealInfo(tinf.getBattgroupId());
@@ -87,4 +94,27 @@
        BatttestdataInf tinf = mapper.selectOne(wrapper);
        return tinf;
    }
    /*单节数量统计
      1筛选满足条件的电池组,找最近一次标准核容放电记录的最后一笔数据
      2再按照公式计算单体实际容量,
      3然后找到判断优秀,劣化,损坏的参数,得到结果。
      4浮充电压图,需要显示单体+实时数据的单体电压,单体内阻
    */
    public Response getMonStatistic(MonStic stic) {
        List<BattInf> binfList=battInfService.getMonStatistic(stic);
        if(binfList!=null&&binfList.size()>0){
            for (BattInf binf:binfList) {
                BatttestdataInf tinf =getLastStandardTestData(binf.getBattgroupId());
                if(tinf!=null){
                    //找这次放电的最后一笔数据
                    List<BatttestdataId> idDataList=battTestdataIdService.getLastDataByBattgroupId(tinf.getBattgroupId(),tinf.getTestRecordCount(),tinf.getRecordNum());
                    for (BatttestdataId data:idDataList) {
                        int hourRate = BattCapFactory.GetHourRate(tinf.getTestCap(), tinf.getTestCurr());
                        Float realCap = (float) BattCapFactory.GetMonomerCap(tinf.getTestCap(), hourRate, tinf.getTestCap(), tinf.getMaxMonvol(), tinf.getMinMonvol(), tinf.getGroupVol(), BattCapFactory.CapType_Real);
                    }
                }
            }
        }
        return new Response().set(1,false,"");
    }
}