From 2bb5386f806cd9418b18da9ad0c4137d0212695b Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期五, 01 十一月 2024 12:02:39 +0800 Subject: [PATCH] 导出actm和a200测试数据,同时修改统计actm添加均衡统计 --- src/main/java/com/whyc/service/BatttestdataInfService.java | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/BatttestdataInfService.java b/src/main/java/com/whyc/service/BatttestdataInfService.java index 3df5116..1223754 100644 --- a/src/main/java/com/whyc/service/BatttestdataInfService.java +++ b/src/main/java/com/whyc/service/BatttestdataInfService.java @@ -1,5 +1,6 @@ package com.whyc.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.whyc.dto.Response; import com.whyc.mapper.BatttestdataIdMapper; import com.whyc.mapper.BatttestdataInfMapper; @@ -39,6 +40,7 @@ Map<Integer,Integer> actmYearMap=new HashMap<>(); actmYearMap.put(2,0); actmYearMap.put(3,0); + actmYearMap.put(4,0); //鏈勾 Map<Integer, List<BatttestdataInf>> typeMapY = listYear.stream().collect(Collectors.groupingBy(BatttestdataInf::getDevType)); @@ -65,6 +67,7 @@ Map<Integer,Integer> actmMonthMap=new HashMap<>(); actmMonthMap.put(2,0); actmMonthMap.put(3,0); + actmMonthMap.put(4,0); List<BatttestdataInf> listMonth=mapper.getDevTinfByMonth(userId); Map<Integer, List<BatttestdataInf>> typeMapM = listMonth.stream().collect(Collectors.groupingBy(BatttestdataInf::getDevType)); for (Integer type : typeMapM.keySet()) { @@ -101,6 +104,7 @@ Map<Integer,Integer> actmweekDataMap=new HashMap<>(); actmweekDataMap.put(2,0); actmweekDataMap.put(3,0); + actmweekDataMap.put(4,0); // 褰撳墠鏃ユ湡 LocalDate today = LocalDate.now(); @@ -134,6 +138,7 @@ Map<Integer,Integer> actmweekMap=new HashMap<>(); actmweekMap.put(2,0); actmweekMap.put(3,0); + actmweekMap.put(4,0); for (Integer test : testMapM2.keySet()) { actmweekMap.put(test, testMapM2.get(test).size()); } @@ -149,13 +154,25 @@ //鑾峰彇鍏呮斁鐢垫暟鎹� List<BatttestdataInf> listDis=mapper.getTinfById(3,devId); List<BatttestdataInf> listChr=mapper.getTinfById(2,devId); + List<BatttestdataInf> listJun=mapper.getTinfById(4,devId); map.put("dis",listDis); map.put("chr",listChr); + map.put("jun",listJun); return new Response().setII(1,true,map,"鑾峰彇璁惧鐨勫厖鏀剧數璁板綍"); } //鑾峰彇璁惧鏌愭璁板綍璇︾粏鐨勫崟浣撴斁鐢佃繃绋� public Response getTdataById(Integer devId, Integer testRecordCount) { List<BatttestdataId> list=subService.getTdataById(devId,testRecordCount); + return new Response().setII(1,list!=null,list,"鑾峰彇璁惧鏌愭璁板綍璇︾粏鐨勫崟浣撴斁鐢佃繃绋�"); } + //鑾峰彇鏀剧數inf + public BatttestdataInf getTinfExport(Integer devId, Integer testRecordCount) { + QueryWrapper wrapper=new QueryWrapper(); + wrapper.eq("dev_id",devId); + wrapper.eq("test_record_count",testRecordCount); + wrapper.last("limit 1"); + BatttestdataInf tinf=mapper.selectOne(wrapper); + return tinf; + } } \ No newline at end of file -- Gitblit v1.9.1