diff --git a/jeecg-boot-master/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot-master/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index 33a44cf2..2f9f06ab 100644 --- a/jeecg-boot-master/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot-master/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -104,8 +104,7 @@ public class ShiroConfig { filterChainDefinitionMap.put("/cms/front/**", "anon"); //cms不拦截 //filterChainDefinitionMap.put("/annualcompetitionprojectregistration/annualCompetitionProjectRegistration/zwhsybsjs", "anon"); //组委会首页接口不拦截 - //CMS门户 - filterChainDefinitionMap.put("/cms/front/**","anon"); + filterChainDefinitionMap.put("/user/login/homepage/**","anon"); filterChainDefinitionMap.put("/", "anon"); filterChainDefinitionMap.put("/doc.html", "anon"); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java index c8a49d42..28b0bcfc 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java @@ -429,8 +429,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic compCounts.put("pointCount", pointCount); //总报名数 long count = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper() - .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompIds) - ); + .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompIds)); //总报名数 compCounts.put("count", count); Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper() @@ -812,10 +811,11 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic last5YearDataVo.setCompCount(annualCompList.size()); if (!ObjectUtils.isEmpty(annualCompList)) { annualCompList.stream().forEach(ac -> { - AnnualCompPoint annualCompPoint = iAnnualCompPointService.getOne(new LambdaQueryWrapper().eq(AnnualCompPoint::getAnnualCompId, ac.getId())); - if (!ObjectUtils.isEmpty(annualCompPoint)) { + List annualCompPoints = iAnnualCompPointService.list(new LambdaQueryWrapper().eq(AnnualCompPoint::getAnnualCompId, ac.getId())); + if (!ObjectUtils.isEmpty(annualCompPoints)) { + Set pids = annualCompPoints.stream().map(e -> e.getId()).collect(Collectors.toSet()); List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() - .eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId())); + .in(AnnualCompetitionProjectRegistration::getAnnualCompid, pids)); if (!ObjectUtils.isEmpty(list)) { Set entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); long personCount4CompTemp = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, entryFormats)); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java index 50f5bf2c..6ea35bca 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java @@ -340,13 +340,12 @@ public class ExpertController extends JeecgController { expert.setExpYjfx(expYjfx);//研究方向 expert.setExpCsgz(expCsgz);//从事工作 expertService.save(expert); - /* CompExp compExp = new CompExp(); compExp.setCompid(compid); compExp.setCompName(compName); compExp.setExpid(expert.getId()); compExp.setStat(stat); - compExpService.save(compExp);*/ + compExpService.save(compExp); result.success("添加成功!"); } catch (Exception e) { log.error(e.getMessage(), e); @@ -408,7 +407,7 @@ public class ExpertController extends JeecgController { expert.setExpCsgz(expCsgz);//从事工作 expertService.updateById(expert); - /* CompExp compExp = new CompExp(); + CompExp compExp = new CompExp(); QueryWrapper queryWrapper1 = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap()); queryWrapper1.eq("expid",expert.getId()); List listce = compExpService.list(queryWrapper1); @@ -417,7 +416,7 @@ public class ExpertController extends JeecgController { compExp.setCompName(compName); compExp.setExpid(expert.getId()); compExp.setStat(stat); - compExpService.updateById(compExp);*/ + compExpService.updateById(compExp); result.success("修改成功!"); } } catch (Exception e) { 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 969cb735..8941f315 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 @@ -41,4 +41,11 @@ public class UserHomePageController { Map result = homePageService.homePage4Depart(orgCode); return Result.ok(result); } + + @ApiOperation(value = "河南机电-学校综合报告", notes = "河南机电-学校综合报告") + @GetMapping(value = "/report4School") + public Result report4School(HttpServletRequest req) { + Map result = homePageService.report4School(); + return Result.ok(result); + } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java index b587f754..63dbe981 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java @@ -9,4 +9,6 @@ public interface UserHomePageService { Map homePage4School(); + Map report4School(); + Map report4Depart(); } 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 ace99a83..58b474c8 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 @@ -6,7 +6,9 @@ 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.entity.PersonalAbilityEvaluationCollect; import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService; +import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationCollectService; import org.jeecg.modules.demo.annual.entity.Annual; import org.jeecg.modules.demo.annual.service.IAnnualService; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; @@ -19,14 +21,23 @@ import org.jeecg.modules.demo.annualScore.service.IPersonalCompTotalScoreService 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.entity.TeamManagement; import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; +import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService; +import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; +import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; +import org.jeecg.modules.demo.bigScreen.vo.CompVo; import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.service.ICompService; +import org.jeecg.modules.demo.comptype.entity.CompType; +import org.jeecg.modules.demo.comptype.service.ICompTypeService; import org.jeecg.modules.demo.homepage.vo.HomePageCompVo; +import org.jeecg.modules.demo.homepage.vo.ReportCompVo; import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; import org.jeecg.modules.demo.projectlevel.service.IProjectlevelService; import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.service.ISysDepartService; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.Assert; @@ -55,9 +66,8 @@ public class UserHomePageServiceImpl implements UserHomePageService { @Autowired private ICompService iCompService; - // @Autowired -// private ICompTypeService iCompTypeService; -// + @Autowired + private ICompTypeService iCompTypeService; @Autowired private ISysDepartService iSysDepartService; @@ -67,11 +77,11 @@ public class UserHomePageServiceImpl implements UserHomePageService { @Autowired private IAnnualCompetitionProjectRegistrationService iAnnualCompetitionProjectRegistrationService; -// @Autowired -// private ITeamManagementService iTeamManagementService; + @Autowired + private ITeamManagementService iTeamManagementService; -// @Autowired -// private IAwardPersionService iAwardPersionService; + @Autowired + private IAwardPersionService iAwardPersionService; // // @Autowired // private ISysUserService iSysUserService; @@ -85,11 +95,11 @@ public class UserHomePageServiceImpl implements UserHomePageService { @Autowired private IDepartAbilityEvaluationService iDepartAbilityEvaluationService; -// @Autowired + // @Autowired // private IPersonalAbilityEvaluationService iPersonalAbilityEvaluationService; -// -// @Autowired -// private IPersonalAbilityEvaluationCollectService iPersonalAbilityEvaluationCollectService; + + @Autowired + private IPersonalAbilityEvaluationCollectService iPersonalAbilityEvaluationCollectService; @Autowired private IAnnualService iAnnualService; @@ -346,6 +356,247 @@ public class UserHomePageServiceImpl implements UserHomePageService { return resultMap; } + @Override + public Map report4School() { + + Map resultMap = new LinkedHashMap<>(); + int currentYear = DateUtils.getCurrentYear(); + //当前年度 + Annual annual = iAnnualService.getOne(new LambdaQueryWrapper().eq(Annual::getAnnualName, currentYear + "")); + + List annualCompList = iAnnualCompService.list(new LambdaQueryWrapper() + .eq(AnnualComp::getAnnualid, annual.getId())); + + Set compIds = Optional.ofNullable(annualCompList).orElse(new LinkedList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet()); + List annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper().in(!ObjectUtils.isEmpty(compIds), AnnualCompPoint::getAnnualCompId, compIds)); + //当前年,所有项目id + Set annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet()); + + //未评奖的项目为进行中 + List pj0PointList = Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream().filter(bo -> "0".equals(bo.getIsPj())).collect(Collectors.toList()); + Map countMap = this.convertProjectLevel(annualCompPointList); + countMap.put("本年度已开展比赛项目数", annualCompPointList.size()); + countMap.put("本年度参加比赛队伍数", 0); + countMap.put("正在进行的比赛数", pj0PointList.size()); + int donePointCount = annualCompPointList.size() - pj0PointList.size(); + countMap.put("已完成的比赛", donePointCount); + countMap.put("未完成的比赛", pj0PointList.size()); + if (donePointCount > 0) { + DecimalFormat decimalFormat = new DecimalFormat(); + decimalFormat.setMaximumFractionDigits(2); // 保留两位小数 + decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制 + double val = ComputeUtils.div2(donePointCount, annualCompPointList.size()); + countMap.put("已完成比赛比率", val); + } else { + countMap.put("已完成比赛比率", 0); + } + + List evaluationCollects = iPersonalAbilityEvaluationCollectService + .list(new LambdaQueryWrapper() + .orderByDesc(PersonalAbilityEvaluationCollect::getCreateTime) + .last(" limit 60")); + resultMap.put("前60名学生能力值", evaluationCollects); + + List vos = new LinkedList<>(); + Map> capacityIdListMap = Optional.ofNullable(evaluationCollects).orElse(new LinkedList<>()).stream() + .collect(Collectors.groupingBy(PersonalAbilityEvaluationCollect::getCapacityId)); + //遍历分组后的结果 + Optional.ofNullable(capacityIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { + List departAbilityEvaluationList = value; + double sum = departAbilityEvaluationList.stream().mapToDouble(obj -> obj.getValue()).sum(); + DecimalFormat decimalFormat = new DecimalFormat(); + decimalFormat.setMaximumFractionDigits(2); // 保留两位小数 + decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制 + double val = ComputeUtils.div2(sum, departAbilityEvaluationList.size()); + PersonalAbilityEvaluationCollect vo = new PersonalAbilityEvaluationCollect(); + vo.setValue(val); + vo.setCapacityId(key); + vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName()); + vos.add(vo); + }); + resultMap.put("前60名学生能力平均值", vos); + + List> abilityList = new LinkedList<>(); + List years = DateUtils.getLastxYear(2); + List annualList = iAnnualService.list(new LambdaQueryWrapper().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName)); + Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(bo -> { + Map abilityResultMap = new LinkedHashMap<>(); + List departAbilityEvaluations = iDepartAbilityEvaluationService.list(new LambdaQueryWrapper() + .eq(DepartAbilityEvaluation::getAnnualId, bo.getId())); + List voList = new LinkedList<>(); + Map> capacityIdListMap2 = Optional.ofNullable(departAbilityEvaluations).orElse(new LinkedList<>()).stream() + .collect(Collectors.groupingBy(DepartAbilityEvaluation::getCapacityId)); + //遍历分组后的结果 + Optional.ofNullable(capacityIdListMap2).orElse(new LinkedHashMap<>()).forEach((key, value) -> { + List departAbilityEvaluationList = value; + double sum = departAbilityEvaluationList.stream().mapToDouble(obj -> obj.getValue()).sum(); + DecimalFormat decimalFormat = new DecimalFormat(); + decimalFormat.setMaximumFractionDigits(2); // 保留两位小数 + decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制 + double val = ComputeUtils.div2(sum, departAbilityEvaluationList.size()); + DepartAbilityEvaluation vo = new DepartAbilityEvaluation(); + vo.setAnnualId(bo.getId()); + vo.setValue(val); + vo.setCapacityId(key); + vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName()); + voList.add(vo); + }); + abilityResultMap.put(bo.getAnnualName(), voList); + abilityList.add(abilityResultMap); + }); + resultMap.put("近2年能力分析", abilityList); + + resultMap.put("比赛类型占比", convertCompType(iCompService.list())); + + List pointList = iAnnualCompPointService.list(new LambdaQueryWrapper() + .eq(AnnualCompPoint::getRequireApply, "Y")); + List compVoList = new LinkedList<>(); + Optional.ofNullable(pointList).orElse(new LinkedList<>()).stream().forEach(p -> { + ReportCompVo compVo = new ReportCompVo(); + BeanUtils.copyProperties(p, compVo); + compVo.setPointName(p.getObjName()); + + AnnualComp annualComp = iAnnualCompService.getById(p.getAnnualCompId()); + if (!ObjectUtils.isEmpty(annualComp)) { + Comp comp = iCompService.getById(annualComp.getCompid()); + compVo.setCompName(comp.getCompName()); + CompType compType = iCompTypeService.getById(comp.getCompTypeId()); + compVo.setTypeName(compType.getTypeName()); + Projectlevel projectlevel = iProjectlevelService.getById(p.getObjLevel()); + compVo.setProjectLevel(projectlevel.getName()); + } + List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() + .eq(AnnualCompetitionProjectRegistration::getAnnualCompid, p.getId())); + if (!ObjectUtils.isEmpty(list)) { + Set entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); + Long count = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, entryFormats)); + compVo.setNumber(count.intValue()); + } + compVoList.add(compVo); + }); + resultMap.put("学生参赛情况", compVoList); + + List awardPersionList = iAwardPersionService.list(); + Map> awardIdListMap = Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream() + .collect(Collectors.groupingBy(AwardPersion::getAwardname)); + Map awardTypeMap = new LinkedHashMap<>(); + + //遍历分组后的结果 + Optional.ofNullable(awardIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { + Map awardIdMap = new LinkedHashMap<>(); + awardIdMap.put(key, value.size()); + awardTypeMap.putAll(awardIdMap); + }); + resultMap.put("比赛获奖占比", awardTypeMap); + + + List awareVos = new ArrayList<>(); + Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream().forEach(p -> { + ReportCompVo compVo = new ReportCompVo(); + compVo.setStuName(p.getStudentname()); +// BeanUtils.copyProperties(p, compVo); + AnnualCompPoint point = iAnnualCompPointService.getById(p.getAnnualCompP()); + if (!ObjectUtils.isEmpty(point)) { + compVo.setPointName(point.getObjName()); + Projectlevel projectlevel = iProjectlevelService.getById(point.getObjLevel()); + compVo.setProjectLevel(projectlevel.getName()); + } + AnnualComp annualComp = iAnnualCompService.getById(p.getAnnalComp()); + if (!ObjectUtils.isEmpty(annualComp)) { + Comp comp = iCompService.getById(annualComp.getCompid()); + compVo.setCompName(comp.getCompName()); + CompType compType = iCompTypeService.getById(comp.getCompTypeId()); + compVo.setTypeName(compType.getTypeName()); + } + awareVos.add(compVo); + }); + resultMap.put("比赛获奖情况列表", awareVos); + + + List> canSaiList = new LinkedList<>(); + List> huoJiangList = new LinkedList<>(); + //二级部门 + final String BASE_PARENT_ID = "1693446350597038081"; + List departList = iSysDepartService.list(new LambdaQueryWrapper().eq(SysDepart::getParentId, BASE_PARENT_ID)); + Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> { + List pointList4Depart = convertPoint4Depart(depart); + Set pointIds4Depart = Optional.ofNullable(pointList4Depart).orElse(new ArrayList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet()); + Map departMap = new LinkedHashMap<>(); + departMap.put("部门名称", depart.getDepartName()); + //报名列表 + List registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() + .in(AnnualCompetitionProjectRegistration::getAnnualCompid, pointIds4Depart)); + if (!ObjectUtils.isEmpty(registrationList)) { + //报名编号 + Set enrollCodes = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); + Long count = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, enrollCodes)); + departMap.put("参加比赛数", count); + //个人赛报名数 + List registrationList4Stu = registrationList.stream().filter(b -> b.getEntryFormat().equals("0")).collect(Collectors.toList()); + Set enrollCodes4Stu = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); + Long count4Stu = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, enrollCodes4Stu)); + //学生人数 + departMap.put("参加学生数", count4Stu); + departMap.put("队伍数", registrationList.size() - registrationList4Stu.size()); + } + canSaiList.add(departMap); + + List awardPersionList4Depart = iAwardPersionService.list(new LambdaQueryWrapper().eq(AwardPersion::getAnnualCompP, pointIds4Depart)); + Map departHuoJiangMap = new LinkedHashMap<>(); + departHuoJiangMap.put("部门名称", depart.getDepartName()); + departHuoJiangMap.put("获取人数", awardPersionList4Depart.size()); + Map> awardNameMap = Optional.ofNullable(awardPersionList4Depart).orElse(new LinkedList<>()).stream() + .collect(Collectors.groupingBy(AwardPersion::getAwardname)); + //遍历分组后的结果 + Optional.ofNullable(awardNameMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { + Map awardTypeMap2 = new HashMap<>(); + awardTypeMap2.put(key, value.size()); + departHuoJiangMap.putAll(awardTypeMap2); + }); + huoJiangList.add(departHuoJiangMap); + }); + resultMap.put("部门参赛情况列表", canSaiList); + resultMap.put("部门获奖情况列表", huoJiangList); + + List scoreList4Point = new LinkedList<>(); + List personalCompScores = iPersonalCompScoreService.list(new LambdaQueryWrapper().eq(PersonalCompScore::getAnnualCompP, annualCompPointIds)); + Map> AnnualCompPointIdsMap = Optional.ofNullable(personalCompScores).orElse(new LinkedList<>()).stream() + .collect(Collectors.groupingBy(PersonalCompScore::getAnnualCompP)); + Optional.ofNullable(AnnualCompPointIdsMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { + double sum = value.stream().mapToDouble(obj -> obj.getScore()).sum(); + HomePageCompVo vo = new HomePageCompVo(); + AnnualCompPoint point = iAnnualCompPointService.getById(key); + vo.setAnnualCompPointName(point.getObjName()); + vo.setAnnualCompPointId(key); + AnnualComp annualComp = iAnnualCompService.getById(point.getAnnualCompId()); + if (!ObjectUtils.isEmpty(annualComp)) { + Comp comp = iCompService.getById(annualComp.getCompid()); + if (!ObjectUtils.isEmpty(comp)) { + vo.setCompName(comp.getCompName()); + } + } + vo.setTotalScore(sum); + scoreList4Point.add(vo); + }); + scoreList4Point.stream().sorted(Comparator.comparing(HomePageCompVo::getTotalScore)).collect(Collectors.toList()); + resultMap.put("比赛学生积分况分析", scoreList4Point); + + return resultMap; + } + + private List convertPoint4Depart(SysDepart depart) { + List compList = iCompService.list(new LambdaQueryWrapper().eq(Comp::getCompOrgan, depart.getId())); + Set compIds = Optional.ofNullable(compList).orElse(new ArrayList<>()).stream().map(comp -> comp.getId()).collect(Collectors.toSet()); + List annualCompList = iAnnualCompService.list(new LambdaQueryWrapper().in(!ObjectUtils.isEmpty(compIds),AnnualComp::getCompid, compIds)); + Set annualCompIds = Optional.ofNullable(annualCompList).orElse(new ArrayList<>()).stream().map(annualComp -> annualComp.getId()).collect(Collectors.toSet()); + return iAnnualCompPointService.list(new LambdaQueryWrapper().in(!ObjectUtils.isEmpty(annualCompIds),AnnualCompPoint::getAnnualCompId, annualCompIds)); + } + + @Override + public Map report4Depart() { + return null; + } + Map convertProjectLevel(List annualCompPointList) { Map map = new LinkedHashMap<>(); Map> objLevelIdsMap = Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream() @@ -359,4 +610,35 @@ public class UserHomePageServiceImpl implements UserHomePageService { return map; } + Map convertCompType(List compList) { + Map map = new LinkedHashMap<>(); + Map> typeIdsMap = Optional.ofNullable(compList).orElse(new LinkedList<>()).stream() + .collect(Collectors.groupingBy(Comp::getCompTypeId)); + Optional.ofNullable(typeIdsMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { + Map levelMap = new LinkedHashMap<>(); + CompType compType = iCompTypeService.getById(key); + levelMap.put(compType.getTypeName(), value.size()); + map.putAll(levelMap); + }); + return map; + } + + List getCompList() { + List annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper() + .eq(AnnualCompPoint::getRequireApply, "Y")); + List compVoList = new LinkedList<>(); + Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream().forEach(p -> { + CompVo compVo = new CompVo(); + BeanUtils.copyProperties(p, compVo); + List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() + .eq(AnnualCompetitionProjectRegistration::getAnnualCompid, p.getId())); + if (!ObjectUtils.isEmpty(list)) { + Set entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); + Long count = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, entryFormats)); + compVo.setNumber(count.intValue()); + } + }); + return compVoList; + } + } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/vo/ReportCompVo.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/vo/ReportCompVo.java new file mode 100644 index 00000000..fee85c8b --- /dev/null +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/vo/ReportCompVo.java @@ -0,0 +1,60 @@ +package org.jeecg.modules.demo.homepage.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Description: TODO + * @Author: Z.H.C + * @CreateTime: 2024-07-28 17:10 + * @Version: 1.0 + */ +@Data +public class ReportCompVo { + + @ApiModelProperty(value = "比赛id") + private String compId; + + @ApiModelProperty(value = "年度比赛项目名称") + private String pointName; + + @ApiModelProperty(value = "比赛类型") + private String typeName; + + @ApiModelProperty(value = "比赛层次") + private String projectLevel; + + @ApiModelProperty(value = "学生名称") + private String stuName; + + /** + * 比赛名称 + */ + @ApiModelProperty(value = "比赛名称") + private String compName; + + @ApiModelProperty(value = "部门id") + private String compOrganId; + + @ApiModelProperty(value = "部门名称") + private String compOrganName; + + @ApiModelProperty(value = "奖项名称") + private java.lang.String awardName; + + @ApiModelProperty(value = "参数人数") + private Integer number; + + @ApiModelProperty(value = "年度比赛项目数") + private Integer annualCompPointNumber; + + @ApiModelProperty(value = "获取人数") + private Integer awardNumber; + + @ApiModelProperty(value = "获取比率") + private String awardRatio; + + @ApiModelProperty(value = "年度比赛状态") + private String status; + +} diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java index e2e7136c..b2c57051 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java @@ -77,9 +77,10 @@ public class TopicController extends JeecgController { public Result> queryPageList(Topic topic, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { + HttpServletRequest req,@RequestParam(name="annualCompid",required=true) String annualCompid) { LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); String orgCode = user.getOrgCode(); + System.out.println(annualCompid); topic.setSysOrgCode(orgCode); QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(topic, req.getParameterMap()); Page page = new Page(pageNo, pageSize); @@ -335,9 +336,12 @@ public class TopicController extends JeecgController { QueryWrapper queryWrapper= new QueryWrapper<>(); queryWrapper.eq("annual_compid",topic.getAnnualCompid()).eq("number",topic.getNumber()); Topic one = topicService.getOne(queryWrapper); - if (!Objects.equals(one.getId(), topic.getId())){ - return Result.error("编码重复"); - } + if(one!=null){ + if (!Objects.equals(one.getId(), topic.getId())){ + return Result.error("编码重复"); + } + } + topicService.updateById(topic); return Result.OK("编辑成功!"); } diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java index 87d2159e..1af4c42d 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java @@ -247,6 +247,13 @@ public class SysUserController { // 保存用户走一个service 保证事务 //获取租户ids String relTenantIds = jsonObject.getString("relTenantIds"); + SysUser sysUser = sysUserService.getUserByPhone(user.getPhone()); + if (sysUser != null) { + result.setMessage("该手机号已注册"); + result.setSuccess(false); + return result; + } + sysUserService.saveUser(user, selectedRoles, selectedDeparts, relTenantIds); baseCommonService.addLog("添加用户,username: " +user.getUsername() ,CommonConstant.LOG_TYPE_2, 2); result.success("添加成功!"); diff --git a/jeecgboot-vue3-master/src/views/annualCompPoint/committee/AnnualCompPointList.vue b/jeecgboot-vue3-master/src/views/annualCompPoint/committee/AnnualCompPointList.vue index 25c9d294..fff73315 100644 --- a/jeecgboot-vue3-master/src/views/annualCompPoint/committee/AnnualCompPointList.vue +++ b/jeecgboot-vue3-master/src/views/annualCompPoint/committee/AnnualCompPointList.vue @@ -191,7 +191,7 @@ function handleEdittopic(record: Recordable) { router.push({ path: '/compp/topic', - query: {id: record.id} + query: {annualCompid: record.id} }); } diff --git a/jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.data.ts b/jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.data.ts index cb41ba10..bf2523d5 100644 --- a/jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.data.ts +++ b/jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.data.ts @@ -149,9 +149,12 @@ export const formSchema: FormSchema[] = [ }, { - label: '驳回信息', + label: '反馈信息', field: 'backinfo', component: 'InputTextArea', + dynamicDisabled: ({ values }) => { + return !!values.id; + }, }, // TODO 主键隐藏字段,目前写死为ID { diff --git a/jeecgboot-vue3-master/src/views/comp/Comp.data.ts b/jeecgboot-vue3-master/src/views/comp/Comp.data.ts index 4d4ed48e..ae747eb7 100644 --- a/jeecgboot-vue3-master/src/views/comp/Comp.data.ts +++ b/jeecgboot-vue3-master/src/views/comp/Comp.data.ts @@ -30,12 +30,12 @@ export const columns: BasicColumn[] = [ dataIndex: 'compImg', customRender: render.renderImage, }, - { +/* { title: '比赛详情', align: 'center', dataIndex: 'compDetail', slots: { customRender: 'htmlSlot' }, - }, + },*/ { title: '比赛介绍文件', align: 'center', diff --git a/jeecgboot-vue3-master/src/views/scorepersion/ScorePersionList.vue b/jeecgboot-vue3-master/src/views/scorepersion/ScorePersionList.vue index efafe706..9e3584ee 100644 --- a/jeecgboot-vue3-master/src/views/scorepersion/ScorePersionList.vue +++ b/jeecgboot-vue3-master/src/views/scorepersion/ScorePersionList.vue @@ -105,7 +105,7 @@ canResize:false, useSearchForm: false, actionColumn: { - width: 120, + width: 160, fixed: 'right', }, beforeFetch: (params) => { diff --git a/jeecgboot-vue3-master/src/views/scorestapoint/ScoreStaPointList.vue b/jeecgboot-vue3-master/src/views/scorestapoint/ScoreStaPointList.vue index c45df8f8..9e4427e0 100644 --- a/jeecgboot-vue3-master/src/views/scorestapoint/ScoreStaPointList.vue +++ b/jeecgboot-vue3-master/src/views/scorestapoint/ScoreStaPointList.vue @@ -73,7 +73,7 @@ canResize:false, useSearchForm: false, actionColumn: { - width: 120, + width: 160, fixed: 'right', }, beforeFetch: (params) => { diff --git a/jeecgboot-vue3-master/src/views/scorestapointd/ScoreStaPointDList.vue b/jeecgboot-vue3-master/src/views/scorestapointd/ScoreStaPointDList.vue index 7839e487..e82904da 100644 --- a/jeecgboot-vue3-master/src/views/scorestapointd/ScoreStaPointDList.vue +++ b/jeecgboot-vue3-master/src/views/scorestapointd/ScoreStaPointDList.vue @@ -78,7 +78,7 @@ canResize:false, useSearchForm: false, actionColumn: { - width: 120, + width: 160, fixed: 'right', }, beforeFetch: (params) => { diff --git a/jeecgboot-vue3-master/src/views/topic/Topic.data.ts b/jeecgboot-vue3-master/src/views/topic/Topic.data.ts index 32ffc75c..4584789c 100644 --- a/jeecgboot-vue3-master/src/views/topic/Topic.data.ts +++ b/jeecgboot-vue3-master/src/views/topic/Topic.data.ts @@ -70,11 +70,11 @@ export const formSchema: FormSchema[] = [ multi:true } }, - dynamicRules: ({model,schema}) => { +/* dynamicRules: ({model,schema}) => { return [ - { required: true, message: '请输入年度比赛项目id!'}, + { required: true, message: '请选择年度比赛项目!'}, ]; - }, + },*/ }, { label: '题目编号', diff --git a/jeecgboot-vue3-master/src/views/topic/TopicList.vue b/jeecgboot-vue3-master/src/views/topic/TopicList.vue index b24efe38..d2798413 100644 --- a/jeecgboot-vue3-master/src/views/topic/TopicList.vue +++ b/jeecgboot-vue3-master/src/views/topic/TopicList.vue @@ -119,6 +119,8 @@ import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue'; import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; import JInput from "/@/components/Form/src/jeecg/components/JInput.vue"; import TopicModal1 from "/@/views/topic/components/TopicModal1.vue"; +import {useRoute} from "vue-router"; +const route = useRoute(); const formRef = ref(); const queryParam = reactive({}); @@ -138,7 +140,7 @@ const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({ fixed: 'right', }, beforeFetch: (params) => { - return Object.assign(params, queryParam); + return Object.assign(params, {annualCompid:route.query.annualCompid}); }, }, exportConfig: {