From 12ca59651cb819c49c8412f73b149631739ee85d Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 11 Sep 2024 15:00:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E7=BB=A9=E7=AE=A1=E7=90=86=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ScorePersionController.java | 52 ++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java index 21a6f8a2..aecdd468 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java @@ -286,7 +286,57 @@ public class ScorePersionController extends JeecgController queryWrappercomp = QueryGenerator.initQueryWrapper(comp, request.getParameterMap()); + queryWrappercomp.eq("comp_admin",user.getUsername()); + List list = compService.list(queryWrappercomp); + if(list.size()==0){ + return null; + } + List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.in(ids.size()!=0,"compid",ids); + List listAnnual = annualCompService.list(queryWrapperAnnual); + if(listAnnual.size()==0){ + return null; + } + List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(scorePersion, request.getParameterMap()); + queryWrapper.in("annual_compid",annualIds); + + AnnualCompPoint annualCompPoint = new AnnualCompPoint(); + QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, request.getParameterMap()); + queryWrapperacp.in("annual_comp_id",annualIds); + queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 + List listacp = annualCompPointService.list(queryWrapperacp); + if(listacp.size()==0){ + return null; + } + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds); + // 过滤选中数据 + String selections = request.getParameter("selections"); + if (oConvertUtils.isNotEmpty(selections)) { + List selectionList = Arrays.asList(selections.split(",")); + queryWrapper.in("id",selectionList); + } + // Step.2 获取导出数据 + List exportList = scorePersionService.list(queryWrapper); + + // Step.3 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + //此处设置的filename无效 ,前端会重更新设置一下 + mv.addObject(NormalExcelConstants.FILE_NAME, "成绩管理"); + mv.addObject(NormalExcelConstants.CLASS, ScorePersion.class); + //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置-------------------- + ExportParams exportParams=new ExportParams("成绩管理" + "报表", "导出人:" + user.getRealname(), "成绩管理"); + exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload()); + //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置---------------------- + mv.addObject(NormalExcelConstants.PARAMS,exportParams); + mv.addObject(NormalExcelConstants.DATA_LIST, exportList); + return mv; } /**