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 25d085b3..23a46017 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 @@ -267,7 +267,19 @@ public class AnnualCompetitionProjectRegistrationController { queryWrapper.in("enroll_code", eCodes); return; } else if (role.equals("committee")) { - List annualCompPointList = annualCompPointService.query().eq("create_by", loginUser.getUsername()).list(); + //首先获取负责的比赛 + List compList = compService.query().eq("comp_admin",loginUser.getUsername()).list(); + //将比赛的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(); + //将年度比赛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(); List aIds = new ArrayList<>(); aIds.add(""); for (AnnualCompPoint annualCompPoint : annualCompPointList) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java index 0c2537e5..969cb735 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java @@ -37,8 +37,8 @@ public class UserHomePageController { @ApiOperation(value = "河南机电-部门首页", notes = "河南机电-部门首页") @GetMapping(value = "/depart") - public Result depart(String departId) { - Map result = homePageService.homePage4Depart(departId); + public Result depart(String orgCode) { + Map result = homePageService.homePage4Depart(orgCode); return Result.ok(result); } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java index 3ab8c288..f0f8c163 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java @@ -2,12 +2,11 @@ package org.jeecg.modules.demo.homepage.service; import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.ComputeUtils; import org.jeecg.common.util.DateUtils; import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation; import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService; -import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationCollectService; -import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationService; import org.jeecg.modules.demo.annual.entity.Annual; import org.jeecg.modules.demo.annual.service.IAnnualService; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; @@ -21,7 +20,6 @@ import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; -import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService; import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.service.ICompService; import org.jeecg.modules.demo.homepage.vo.HomePageCompVo; @@ -101,9 +99,14 @@ public class UserHomePageServiceImpl implements UserHomePageService { @Override - public Map homePage4Depart(String departId) { + public Map homePage4Depart(String orgCode) { - Assert.notNull(departId, "部门id不能为空"); + Assert.notNull(orgCode, "部门编号不能为空"); + SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper().eq(SysDepart::getOrgCode, orgCode)); + if (ObjectUtil.isNull(sysDepart)) { + throw new JeecgBootException("部门不存在"); + } + String departId = sysDepart.getId(); Map resultMap = new LinkedHashMap<>(); int currentYear = DateUtils.getCurrentYear(); //当前年度