diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java index 5b2b5c14..f69fa4ec 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java @@ -50,6 +50,7 @@ import org.jeecg.modules.demo.expert.entity.Expert; import org.jeecg.modules.demo.expert.service.IExpertService; import org.jeecg.modules.demo.expscore.entity.ExpScore; import org.jeecg.modules.demo.expscore.service.IExpScoreService; +import org.jeecg.modules.demo.projectlevel.service.IProjectlevelService; import org.jeecg.modules.demo.score_management.entity.ScoreManagement; import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; import org.jeecg.modules.demo.scorepersion.service.IScorePersionService; @@ -139,6 +140,9 @@ public class AnnualCompPointController extends JeecgController xsfxbg( HttpServletRequest req,@RequestParam(name = "recreateFlag") boolean recreateFlag) { + public Result xsfxbg( HttpServletRequest req,@RequestParam(name = "recreateFlag") boolean recreateFlag,@RequestParam(name = "annualid") String annualid) { final String XSFXBG = "xsfxbg"; Map map = new HashMap<>(); @@ -1762,6 +1762,22 @@ public class AnnualCompetitionProjectRegistrationController { QueryWrapper queryWrapperbm = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); queryWrapperbm.in("enroll_code",bmbhs); queryWrapperbm.eq("enroll_static", "2"); + //年度id传过来后需要根据年度id查询有哪些年度比赛,根据年度比赛查询年度比赛项目,然后把得到的年度比赛项目id加到条件中 + if(!annualid.equals("")){ + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.eq("annualid",annualid); + List listac = annualCompService.list(queryWrapperAnnual); + if(listac.size()>0){ + List tjndbsids = listac.stream().map(AnnualComp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperacpt = new QueryWrapper<>(); + queryWrapperacpt.in("annual_comp_id",tjndbsids); + List listacpt = annualCompPointService.list(queryWrapperacpt); + if(listacpt.size()>0){ + List tjndbsxmids = listacpt.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + queryWrapperbm.in("annual_compid",tjndbsxmids); + } + } + } List listbm = annualCompetitionProjectRegistrationService.list(queryWrapperbm); //参加比赛项目数量 map.put("cjbsxmsl",listbm.size()); @@ -2019,7 +2035,7 @@ public class AnnualCompetitionProjectRegistrationController { if (hasKey) { return Result.OK(redisUtil.get(XSFXBG)); } else { - return this.xsfxbg(req,true); + return this.xsfxbg(req,true,annualid); } } } @@ -2033,7 +2049,7 @@ public class AnnualCompetitionProjectRegistrationController { */ @ApiOperation(value="组委会角色分析报告比赛数据接口", notes="组委会角色分析报告比赛数据接口") @GetMapping(value = "/zwhfxbg") - public Result zwhfxbg( HttpServletRequest req,@RequestParam(name = "recreateFlag") boolean recreateFlag) { + public Result zwhfxbg( HttpServletRequest req,@RequestParam(name = "recreateFlag") boolean recreateFlag,@RequestParam(name = "annualid") String annualid) { final String ZWHFXBG = "zwhfxbg"; Map map = new HashMap<>(); if (recreateFlag) { @@ -2048,6 +2064,10 @@ public class AnnualCompetitionProjectRegistrationController { List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); queryWrapperAnnual.in(ids.size() != 0, "compid", ids); + //加上判断如果年度id传过来就加上条件 + if(!annualid.equals("")){ + queryWrapperAnnual.eq("annualid",annualid); + } queryWrapperAnnual.orderByDesc("create_time"); List annualCompList = annualCompService.list(queryWrapperAnnual); if (annualCompList.size() > 0) { @@ -2395,7 +2415,7 @@ public class AnnualCompetitionProjectRegistrationController { if (hasKey) { return Result.OK(redisUtil.get(ZWHFXBG)); } else { - return this.zwhfxbg(req,true); + return this.zwhfxbg(req,true,annualid); } } }