JayChou 4 months ago
commit f6d331c2b9
  1. 14
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java
  2. 4
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java
  3. 13
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java

@ -267,7 +267,19 @@ public class AnnualCompetitionProjectRegistrationController {
queryWrapper.in("enroll_code", eCodes); queryWrapper.in("enroll_code", eCodes);
return; return;
} else if (role.equals("committee")) { } 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<>(); List<String> aIds = new ArrayList<>();
aIds.add(""); aIds.add("");
for (AnnualCompPoint annualCompPoint : annualCompPointList) for (AnnualCompPoint annualCompPoint : annualCompPointList)

@ -37,8 +37,8 @@ public class UserHomePageController {
@ApiOperation(value = "河南机电-部门首页", notes = "河南机电-部门首页") @ApiOperation(value = "河南机电-部门首页", notes = "河南机电-部门首页")
@GetMapping(value = "/depart") @GetMapping(value = "/depart")
public Result depart(String departId) { public Result depart(String orgCode) {
Map<String, Object> result = homePageService.homePage4Depart(departId); Map<String, Object> result = homePageService.homePage4Depart(orgCode);
return Result.ok(result); return Result.ok(result);
} }
} }

@ -2,12 +2,11 @@ package org.jeecg.modules.demo.homepage.service;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.ComputeUtils;
import org.jeecg.common.util.DateUtils; import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation; import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation;
import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService; 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.entity.Annual;
import org.jeecg.modules.demo.annual.service.IAnnualService; import org.jeecg.modules.demo.annual.service.IAnnualService;
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; 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.annualcomp.service.IAnnualCompService;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; 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.entity.Comp;
import org.jeecg.modules.demo.comp.service.ICompService; import org.jeecg.modules.demo.comp.service.ICompService;
import org.jeecg.modules.demo.homepage.vo.HomePageCompVo; import org.jeecg.modules.demo.homepage.vo.HomePageCompVo;
@ -101,9 +99,14 @@ public class UserHomePageServiceImpl implements UserHomePageService {
@Override @Override
public Map<String, Object> homePage4Depart(String departId) { public Map<String, Object> homePage4Depart(String orgCode) {
Assert.notNull(departId, "部门id不能为空"); Assert.notNull(orgCode, "部门编号不能为空");
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode, orgCode));
if (ObjectUtil.isNull(sysDepart)) {
throw new JeecgBootException("部门不存在");
}
String departId = sysDepart.getId();
Map<String, Object> resultMap = new LinkedHashMap<>(); Map<String, Object> resultMap = new LinkedHashMap<>();
int currentYear = DateUtils.getCurrentYear(); int currentYear = DateUtils.getCurrentYear();
//当前年度 //当前年度

Loading…
Cancel
Save