From dc09ea375b07cf0b30359ac25589a6ce75784d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Thu, 18 Jul 2024 15:09:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E6=AF=94=E8=B5=9B?= =?UTF-8?q?=E4=B8=AD=E8=8E=B7=E5=8F=96=E5=B9=B4=E5=BA=A6=E6=AF=94=E8=B5=9B?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=8D=E5=90=88=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...alCompetitionProjectRegistrationController.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 6e4255c0..7e09e6f3 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) From e0b0e4c586c2ad32087e77f507e90b489e7eb4d6 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Thu, 18 Jul 2024 15:40:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B2=B3=E5=8D=97=E6=9C=BA=E7=94=B5?= =?UTF-8?q?=E8=81=8C=E4=B8=9A=E5=AD=A6=E9=99=A2-=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homepage/controller/UserHomePageController.java | 4 ++-- .../homepage/service/UserHomePageServiceImpl.java | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) 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(); //当前年度