From a6609b79468c5abd342e72382647cafb91ea5454 Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期二, 10 六月 2025 15:06:47 +0800 Subject: [PATCH] 本年度未放电数量统计(1.2.6) --- src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java | 4 +++- src/main/java/com/whyc/service/BatttestdataInfService.java | 14 +++++++++++++- src/main/resources/mapper/BatttestdataInfMapper.xml | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java b/src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java index 8184297..2de1c2a 100644 --- a/src/main/java/com/whyc/dto/Statistic/SticDischarge6Res.java +++ b/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; } \ 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 7dbf755..2e30590 100644 --- a/src/main/java/com/whyc/service/BatttestdataInfService.java +++ b/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<>()); diff --git a/src/main/resources/mapper/BatttestdataInfMapper.xml b/src/main/resources/mapper/BatttestdataInfMapper.xml index 2ca8ffb..a6b1e32 100644 --- a/src/main/resources/mapper/BatttestdataInfMapper.xml +++ b/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 <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<=#{stic.testEndTime} </if> <if test="typeList!=null"> -- Gitblit v1.9.1