年度比赛中获取年度比赛方法不合理

main
王家东 4 months ago
parent a526a8ee18
commit dc09ea375b
  1. 14
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java

@ -267,7 +267,19 @@ public class AnnualCompetitionProjectRegistrationController {
queryWrapper.in("enroll_code", eCodes);
return;
} else if (role.equals("committee")) {
List<AnnualCompPoint> annualCompPointList = annualCompPointService.query().eq("create_by", loginUser.getUsername()).list();
//首先获取负责的比赛
List<Comp> compList = compService.query().eq("comp_admin",loginUser.getUsername()).list();
//将比赛的id放进一个list里面
List<String> compIds = compList.stream()
.map(Comp::getId) // 使用方法引用获取每个Comp对象的id
.collect(Collectors.toList()); // 收集到List中
//根据比赛的id查询年度比赛id,这里没有去卡年度
List<AnnualComp> annualCompList = annualCompService.query().in("compid",compIds).list();
//将年度比赛id存放到一个list里面
List<String> anncompIds = annualCompList.stream()
.map(AnnualComp::getId) // 使用方法引用获取每个Comp对象的id
.collect(Collectors.toList()); // 收集到List中
List<AnnualCompPoint> annualCompPointList = annualCompPointService.query().in("annual_comp_id", anncompIds).list();
List<String> aIds = new ArrayList<>();
aIds.add("");
for (AnnualCompPoint annualCompPoint : annualCompPointList)

Loading…
Cancel
Save