diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java index 8445b7da..58ec2db4 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java @@ -127,7 +127,7 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl queryWrapperup = new QueryWrapper<>(); + queryWrapperup.eq("apply_code",list.get(b).getBmcode()); + List listup = upfilePersionService.list(queryWrapperup); + if(listup.size()>0){ + up = listup.get(0); + up.setStatus(1); + upfilePersionService.updateById(up); + } + } return Result.OK("成功!"); } /** @@ -484,6 +501,18 @@ public class AnnualCompPointController extends JeecgController queryWrapperup = new QueryWrapper<>(); + queryWrapperup.eq("apply_code",list.get(b).getBmcode()); + List listup = upfilePersionService.list(queryWrapperup); + if(listup.size()>0){ + up = listup.get(0); + up.setStatus(1); + upfilePersionService.updateById(up); + } + } return Result.OK("成功!"); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java index 6bed29f0..d98e7fae 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java @@ -149,14 +149,15 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl score = new AtomicReference<>((double) 0); if (StringUtils.equals("Y", entryForm)) { //团队赛 Optional.ofNullable(managementList).orElse(new ArrayList<>()).forEach(e -> { diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java index 2aa65af5..0d82f476 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java @@ -143,8 +143,40 @@ public class AnnualCompetitionProjectRegistrationController { //处理查询信息 QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); Page page = new Page(pageNo, pageSize); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //根据登录信息查询负责比赛 + List compList =compService.query().eq("comp_admin",loginUser.getUsername()).list(); + //判空 + if (compList.isEmpty()){ + return Result.error("未绑定比赛"); + } + //将比赛的id放进一个list里面 + List compIds = compList.stream() + .map(Comp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据比赛的id查询年度比赛id,这里没有去卡年度 + List annualCompList = annualCompService.query().in("compid",compIds).list(); + //判空 + if (annualCompList.isEmpty()){ + return Result.error("未创建年度比赛"); + } + //将年度比赛id存放到一个list里面 + List anncompIds = annualCompList.stream() + .map(AnnualComp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + List annualCompPointList = annualCompPointService.query().in("annual_comp_id", anncompIds).list(); + //判空 + if (annualCompPointList.isEmpty()){ + return Result.error("未创建年度比赛项目"); + } + //将年度比赛项目id存放到一个list里面 + List anncomppointIds = annualCompPointList.stream() + .map(AnnualCompPoint::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.in("annual_compid",anncomppointIds); + /* queryWrapperAddRoleInfo(queryWrapper);*/ //查询 IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); //处理返回信息 @@ -163,8 +195,40 @@ public class AnnualCompetitionProjectRegistrationController { //处理查询信息 QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); Page page = new Page(pageNo, pageSize); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //根据登录信息查询负责比赛 + List compList =compService.query().eq("comp_admin",loginUser.getUsername()).list(); + //判空 + if (compList.isEmpty()){ + return Result.error("未绑定比赛"); + } + //将比赛的id放进一个list里面 + List compIds = compList.stream() + .map(Comp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据比赛的id查询年度比赛id,这里没有去卡年度 + List annualCompList = annualCompService.query().in("compid",compIds).list(); + //判空 + if (annualCompList.isEmpty()){ + return Result.error("未创建年度比赛"); + } + //将年度比赛id存放到一个list里面 + List anncompIds = annualCompList.stream() + .map(AnnualComp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + List annualCompPointList = annualCompPointService.query().in("annual_comp_id", anncompIds).list(); + //判空 + if (annualCompPointList.isEmpty()){ + return Result.error("未创建年度比赛项目"); + } + //将年度比赛项目id存放到一个list里面 + List anncomppointIds = annualCompPointList.stream() + .map(AnnualCompPoint::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.in("annual_compid",anncomppointIds); + /* queryWrapperAddRoleInfo(queryWrapper);*/ queryWrapper.eq("enroll_static", "2"); //查询 IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); @@ -184,8 +248,40 @@ public class AnnualCompetitionProjectRegistrationController { //处理查询信息 QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); Page page = new Page(pageNo, pageSize); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //根据登录信息查询负责比赛 + List compList =compService.query().eq("comp_admin",loginUser.getUsername()).list(); + //判空 + if (compList.isEmpty()){ + return Result.error("未绑定比赛"); + } + //将比赛的id放进一个list里面 + List compIds = compList.stream() + .map(Comp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据比赛的id查询年度比赛id,这里没有去卡年度 + List annualCompList = annualCompService.query().in("compid",compIds).list(); + //判空 + if (annualCompList.isEmpty()){ + return Result.error("未创建年度比赛"); + } + //将年度比赛id存放到一个list里面 + List anncompIds = annualCompList.stream() + .map(AnnualComp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + List annualCompPointList = annualCompPointService.query().in("annual_comp_id", anncompIds).list(); + //判空 + if (annualCompPointList.isEmpty()){ + return Result.error("未创建年度比赛项目"); + } + //将年度比赛项目id存放到一个list里面 + List anncomppointIds = annualCompPointList.stream() + .map(AnnualCompPoint::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.in("annual_compid",anncomppointIds); + /* queryWrapperAddRoleInfo(queryWrapper);*/ queryWrapper.eq("enroll_static", "4"); //查询 IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); @@ -206,8 +302,40 @@ public class AnnualCompetitionProjectRegistrationController { //处理查询信息 QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); Page page = new Page(pageNo, pageSize); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //根据登录信息查询负责比赛 + List compList =compService.query().eq("comp_admin",loginUser.getUsername()).list(); + //判空 + if (compList.isEmpty()){ + return Result.error("未绑定比赛"); + } + //将比赛的id放进一个list里面 + List compIds = compList.stream() + .map(Comp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据比赛的id查询年度比赛id,这里没有去卡年度 + List annualCompList = annualCompService.query().in("compid",compIds).list(); + //判空 + if (annualCompList.isEmpty()){ + return Result.error("未创建年度比赛"); + } + //将年度比赛id存放到一个list里面 + List anncompIds = annualCompList.stream() + .map(AnnualComp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + List annualCompPointList = annualCompPointService.query().in("annual_comp_id", anncompIds).list(); + //判空 + if (annualCompPointList.isEmpty()){ + return Result.error("未创建年度比赛项目"); + } + //将年度比赛项目id存放到一个list里面 + List anncomppointIds = annualCompPointList.stream() + .map(AnnualCompPoint::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.in("annual_compid",anncomppointIds); + /* queryWrapperAddRoleInfo(queryWrapper);*/ queryWrapper.eq("enroll_static", "1"); //查询 IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); @@ -227,8 +355,40 @@ public class AnnualCompetitionProjectRegistrationController { //处理查询信息 QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); Page page = new Page(pageNo, pageSize); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //根据登录信息查询负责比赛 + List compList =compService.query().eq("comp_admin",loginUser.getUsername()).list(); + //判空 + if (compList.isEmpty()){ + return Result.error("未绑定比赛"); + } + //将比赛的id放进一个list里面 + List compIds = compList.stream() + .map(Comp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据比赛的id查询年度比赛id,这里没有去卡年度 + List annualCompList = annualCompService.query().in("compid",compIds).list(); + //判空 + if (annualCompList.isEmpty()){ + return Result.error("未创建年度比赛"); + } + //将年度比赛id存放到一个list里面 + List anncompIds = annualCompList.stream() + .map(AnnualComp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + List annualCompPointList = annualCompPointService.query().in("annual_comp_id", anncompIds).list(); + //判空 + if (annualCompPointList.isEmpty()){ + return Result.error("未创建年度比赛项目"); + } + //将年度比赛项目id存放到一个list里面 + List anncomppointIds = annualCompPointList.stream() + .map(AnnualCompPoint::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.in("annual_compid",anncomppointIds); + /* queryWrapperAddRoleInfo(queryWrapper);*/ queryWrapper.eq("enroll_static", "0"); //查询 IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); @@ -248,8 +408,40 @@ public class AnnualCompetitionProjectRegistrationController { //处理查询信息 QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); Page page = new Page(pageNo, pageSize); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //根据登录信息查询负责比赛 + List compList =compService.query().eq("comp_admin",loginUser.getUsername()).list(); + //判空 + if (compList.isEmpty()){ + return Result.error("未绑定比赛"); + } + //将比赛的id放进一个list里面 + List compIds = compList.stream() + .map(Comp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据比赛的id查询年度比赛id,这里没有去卡年度 + List annualCompList = annualCompService.query().in("compid",compIds).list(); + //判空 + if (annualCompList.isEmpty()){ + return Result.error("未创建年度比赛"); + } + //将年度比赛id存放到一个list里面 + List anncompIds = annualCompList.stream() + .map(AnnualComp::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + List annualCompPointList = annualCompPointService.query().in("annual_comp_id", anncompIds).list(); + //判空 + if (annualCompPointList.isEmpty()){ + return Result.error("未创建年度比赛项目"); + } + //将年度比赛项目id存放到一个list里面 + List anncomppointIds = annualCompPointList.stream() + .map(AnnualCompPoint::getId) // 使用方法引用获取每个Comp对象的id + .collect(Collectors.toList()); // 收集到List中 + //根据用户角色决定查询信息 - queryWrapperAddRoleInfo(queryWrapper); + queryWrapper.in("annual_compid",anncomppointIds); + /* queryWrapperAddRoleInfo(queryWrapper);*/ queryWrapper.eq("enroll_static", "3"); //查询 IPage pageList = annualCompetitionProjectRegistrationService.page(page, queryWrapper); @@ -273,6 +465,9 @@ public class AnnualCompetitionProjectRegistrationController { } else if (role.equals("committee")) { //首先获取负责的比赛 List compList = compService.query().eq("comp_admin",loginUser.getUsername()).list(); + if(compList.isEmpty()){ + return ; + } //将比赛的id放进一个list里面 List compIds = compList.stream() .map(Comp::getId) // 使用方法引用获取每个Comp对象的id @@ -995,7 +1190,7 @@ public class AnnualCompetitionProjectRegistrationController { LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); Comp comp = new Comp(); QueryWrapper queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrappercomp.like("comp_admin", user.getUsername()); + queryWrappercomp.eq("comp_admin", user.getUsername()); List list = compService.list(queryWrappercomp); Map map = new HashMap<>(); if (list.size() > 0) { @@ -1774,7 +1969,7 @@ public class AnnualCompetitionProjectRegistrationController { LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); Comp comp = new Comp(); QueryWrapper queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrappercomp.like("comp_admin", user.getUsername()); + queryWrappercomp.eq("comp_admin", user.getUsername()); List list = compService.list(queryWrappercomp); Map map = new HashMap<>(); if (list.size() > 0) { @@ -2129,7 +2324,7 @@ public class AnnualCompetitionProjectRegistrationController { LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); Comp comp = new Comp(); QueryWrapper queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrappercomp.like("comp_admin",user.getUsername()); + queryWrappercomp.eq("comp_admin",user.getUsername()); List list = compService.list(queryWrappercomp); List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java index 8172749f..32f5160f 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java @@ -95,21 +95,30 @@ public class AnnualCompGroupController extends JeecgController queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrappercomp.like("comp_admin",user.getUsername()); + queryWrappercomp.eq("comp_admin",user.getUsername()); List list = compService.list(queryWrappercomp); + if(list.size()==0){ + return Result.error("未绑定比赛"); + } List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); - queryWrapperAnnual.in(ids.size()!=0,"compid",ids); + queryWrapperAnnual.in("compid",ids); List listAnnual = annualCompService.list(queryWrapperAnnual); + if(listAnnual.size()==0){ + return Result.error("未创建年度比赛"); + } List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompGroup, req.getParameterMap()); queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds); AnnualCompPoint annualCompPoint = new AnnualCompPoint(); QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds); + queryWrapperacp.in("annual_comp_id",annualIds); queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 List listacp = annualCompPointService.list(queryWrapperacp); + if(listacp.size()==0){ + return Result.error("未创建年度比赛项目"); + } List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); queryWrapper.in(acpIds.size()!=0,"ann_comp_p",acpIds); @@ -190,7 +199,7 @@ public class AnnualCompGroupController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrapper.like("comp_admin",user.getUsername()); + queryWrapper.eq("comp_admin",user.getUsername()); List list = compService.list(queryWrapper); String str = ""; for(int i = 0 ; i < list.size() ; i++){ diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java index 5b2bbbc8..b4b14f9d 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java @@ -127,23 +127,32 @@ public class AwardPersionController extends JeecgController queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrappercomp.like("comp_admin",user.getUsername()); + queryWrappercomp.eq("comp_admin",user.getUsername()); List list = compService.list(queryWrappercomp); + if(list.size()==0){ + return Result.error("未绑定比赛"); + } List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); - queryWrapperAnnual.in(ids.size()!=0,"compid",ids); + queryWrapperAnnual.in("compid",ids); List listAnnual = annualCompService.list(queryWrapperAnnual); + if(listAnnual.size()==0){ + return Result.error("未创建年度比赛"); + } List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); - queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds); + queryWrapper.in("annal_comp",annualIds); AnnualCompPoint annualCompPoint = new AnnualCompPoint(); QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds); + queryWrapperacp.in("annual_comp_id",annualIds); queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 List listacp = annualCompPointService.list(queryWrapperacp); + if(listacp.size()==0){ + return Result.error("未创建年度比赛项目"); + } List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); - queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds); + queryWrapper.in("annual_comp_p",acpIds); Page page = new Page(pageNo, pageSize); IPage pageList = awardPersionService.page(page, queryWrapper); 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 8b1fe80e..21a6f8a2 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 @@ -105,21 +105,30 @@ public class ScorePersionController extends JeecgController queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrappercomp.like("comp_admin",user.getUsername()); + queryWrappercomp.eq("comp_admin",user.getUsername()); List list = compService.list(queryWrappercomp); + if(list.size()==0){ + return Result.error("未绑定比赛"); + } 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 Result.error("未创建年度比赛"); + } List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap()); - queryWrapper.in(annualIds.size()!=0,"annual_compid",annualIds); + queryWrapper.in("annual_compid",annualIds); AnnualCompPoint annualCompPoint = new AnnualCompPoint(); QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); - queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds); + queryWrapperacp.in("annual_comp_id",annualIds); queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 List listacp = annualCompPointService.list(queryWrapperacp); + if(listacp.size()==0){ + return Result.error("未创建年度比赛项目"); + } List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java index b276a960..9615ed40 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scoresta/controller/ScoreStaController.java @@ -87,23 +87,32 @@ public class ScoreStaController extends JeecgController queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); - queryWrappercomp.like("comp_admin",user.getUsername()); + queryWrappercomp.eq("comp_admin",user.getUsername()); List list = compService.list(queryWrappercomp); + if(list.size()==0){ + return Result.error("未绑定比赛"); + } List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); - queryWrapperAnnual.in(ids.size()!=0,"compid",ids); + queryWrapperAnnual.in("compid",ids); List listAnnual = annualCompService.list(queryWrapperAnnual); + if(listAnnual.size()==0){ + return Result.error("未创建年度比赛"); + } List annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(scoreSta, req.getParameterMap()); - queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds); + queryWrapper.in("annal_comp",annualIds); AnnualCompPoint annualCompPoint = new AnnualCompPoint(); QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds); queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 List listacp = annualCompPointService.list(queryWrapperacp); + if(listacp.size()==0){ + return Result.error("未创建年度比赛项目"); + } List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); - queryWrapper.in(acpIds.size()!=0,"annual_compid",acpIds); + queryWrapper.in("annual_compid",acpIds); Page page = new Page(pageNo, pageSize);