Merge remote-tracking branch 'origin/main'

main
王家东 4 months ago
commit 177ce5ec82
  1. 50
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java
  2. 8
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java
  3. 4
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java
  4. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java
  5. 395
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java
  6. 5
      jeecgboot-vue3-master/src/api/common/api.ts
  7. 12
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue
  8. 16
      jeecgboot-vue3-master/src/views/comprehensiveEvaluation/comprehensiveReport.vue

@ -131,16 +131,25 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
Comp comp = new Comp(); Comp comp = new Comp();
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap());
queryWrappercomp.eq("comp_admin",user.getUsername()); queryWrappercomp.eq("comp_admin",user.getUsername());
if(awardPersion.getComType()!=null){
queryWrappercomp.eq("comp_type_id",awardPersion.getComType());
}
List<Comp> list = compService.list(queryWrappercomp); List<Comp> list = compService.list(queryWrappercomp);
if(list.size()==0){ if(list.size()==0){
return Result.error("未绑定比赛"); return Result.OK(null);
/* if(awardPersion.getComType()==null){
return Result.error("未绑定比赛");
}else {
return Result.error("未绑定该比赛类型的比赛");
}*/
} }
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList()); List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>(); QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in("compid",ids); queryWrapperAnnual.in("compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual); List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
if(listAnnual.size()==0){ if(listAnnual.size()==0){
return Result.error("未创建年度比赛"); /*return Result.error("未创建年度比赛");*/
return Result.OK(null);
} }
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
@ -150,9 +159,17 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap());
queryWrapperacp.in("annual_comp_id",annualIds); queryWrapperacp.in("annual_comp_id",annualIds);
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
if(awardPersion.getObjLevel()!=null){
queryWrapperacp.eq("obj_level",awardPersion.getObjLevel());
}
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp); List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
if(listacp.size()==0){ if(listacp.size()==0){
return Result.error("未创建年度比赛项目"); /*if(awardPersion.getObjLevel()==null){
return Result.error("未创建年度比赛项目");
}else {
return Result.error("未创建该项目层次的年度比赛项目");
}*/
return Result.OK(null);
} }
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in("annual_comp_p",acpIds); queryWrapper.in("annual_comp_p",acpIds);
@ -171,6 +188,33 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
//学校和超级管理员(全部都可以)(查全部数据) //学校和超级管理员(全部都可以)(查全部数据)
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize); Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
if(awardPersion.getComType()!=null){
QueryWrapper<Comp> queryWrappercomp = new QueryWrapper<>();
queryWrappercomp.eq("comp_type_id",awardPersion.getComType());
List<Comp> list = compService.list(queryWrappercomp);
if(list.size()==0){
return Result.OK(null);
}
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in("compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
if(listAnnual.size()==0){
return Result.OK(null);
}
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
queryWrapper.in("annal_comp",annualIds);
}
if(awardPersion.getObjLevel()!=null){
QueryWrapper<AnnualCompPoint> queryWrapperacp = new QueryWrapper<>();
queryWrapperacp.eq("obj_level",awardPersion.getObjLevel());
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
if(listacp.size()==0){
return Result.OK(null);
}
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in("annual_comp_p",acpIds);
}
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper); IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }

@ -123,4 +123,12 @@ public class AwardPersion implements Serializable {
@ApiModelProperty(value = "推荐") @ApiModelProperty(value = "推荐")
private String tj; private String tj;
@TableField(exist = false)
@ApiModelProperty(value = "比赛类型")
private String comType;
@TableField(exist = false)
@ApiModelProperty(value = "项目层次")
private String objLevel;
} }

@ -48,8 +48,8 @@ public class UserHomePageController {
@AutoLog(value = "学校管理员-分析报告") @AutoLog(value = "学校管理员-分析报告")
@ApiOperation(value = "河南机电-学校综合报告", notes = "河南机电-学校综合报告") @ApiOperation(value = "河南机电-学校综合报告", notes = "河南机电-学校综合报告")
@GetMapping(value = "/report4School") @GetMapping(value = "/report4School")
public Result report4School(HttpServletRequest req) { public Result report4School(boolean recreateFlag) {
Map<String, Object> result = homePageService.report4School(); Object result = homePageService.report4School(recreateFlag);
return Result.ok(result); return Result.ok(result);
} }

@ -9,6 +9,7 @@ public interface UserHomePageService {
Map<String, Object> homePage4School(); Map<String, Object> homePage4School();
Map<String, Object> report4School(); Object report4School(boolean recreateFlag);
Map<String, Object> report4Depart(String orgCode); Map<String, Object> report4Depart(String orgCode);
} }

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.exception.JeecgBootException; 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.common.util.RedisUtil;
import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation; import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation;
import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluationCollect; import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluationCollect;
import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService; import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService;
@ -108,6 +109,9 @@ public class UserHomePageServiceImpl implements UserHomePageService {
final String BASE_PARENT_ID = "1693446350597038081"; final String BASE_PARENT_ID = "1693446350597038081";
@Autowired
private RedisUtil redisUtil;
@Override @Override
public Map<String, Object> homePage4Depart(String orgCode) { public Map<String, Object> homePage4Depart(String orgCode) {
@ -358,189 +362,192 @@ public class UserHomePageServiceImpl implements UserHomePageService {
} }
@Override @Override
public Map<String, Object> report4School() { public Object report4School(boolean recreateFlag) {
Map<String, Object> resultMap = new LinkedHashMap<>();
int currentYear = DateUtils.getCurrentYear();
//当前年度
Annual annual = iAnnualService.getOne(new LambdaQueryWrapper<Annual>().eq(Annual::getAnnualName, currentYear + ""));
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>()
.eq(AnnualComp::getAnnualid, annual.getId()));
Set<String> compIds = Optional.ofNullable(annualCompList).orElse(new LinkedList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet()); final String REPORT4SCHOOL = "report4School";
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(!ObjectUtils.isEmpty(compIds), AnnualCompPoint::getAnnualCompId, compIds));
//当前年,所有项目id
Set<String> annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet());
//未评奖的项目为进行中 Map<String, Object> resultMap = new LinkedHashMap<>();
List<AnnualCompPoint> pj0PointList = Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream().filter(bo -> "0".equals(bo.getIsPj())).collect(Collectors.toList()); if (recreateFlag) {
Map<String, Object> countMap = this.convertProjectLevel(annualCompPointList); int currentYear = DateUtils.getCurrentYear();
countMap.put("本年度已开展比赛项目数", annualCompPointList.size()); //当前年度
countMap.put("本年度参加比赛队伍数", 0); Annual annual = iAnnualService.getOne(new LambdaQueryWrapper<Annual>().eq(Annual::getAnnualName, currentYear + ""));
countMap.put("正在进行的比赛数", pj0PointList.size());
int donePointCount = annualCompPointList.size() - pj0PointList.size(); List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>()
countMap.put("已完成的比赛", donePointCount); .eq(AnnualComp::getAnnualid, annual.getId()));
countMap.put("未完成的比赛", pj0PointList.size());
if (donePointCount > 0) { Set<String> compIds = Optional.ofNullable(annualCompList).orElse(new LinkedList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet());
DecimalFormat decimalFormat = new DecimalFormat(); List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(!ObjectUtils.isEmpty(compIds), AnnualCompPoint::getAnnualCompId, compIds));
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数 //当前年,所有项目id
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制 Set<String> annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet());
double val = ComputeUtils.div2(donePointCount, annualCompPointList.size());
countMap.put("已完成比赛比率", val); //未评奖的项目为进行中
} else { List<AnnualCompPoint> pj0PointList = Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream().filter(bo -> "0".equals(bo.getIsPj())).collect(Collectors.toList());
countMap.put("已完成比赛比率", 0); Map<String, Object> countMap = this.convertProjectLevel(annualCompPointList);
} countMap.put("本年度已开展比赛项目数", annualCompPointList.size());
resultMap.putAll(countMap); 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);
}
resultMap.putAll(countMap);
List<PersonalAbilityEvaluationCollect> evaluationCollects = iPersonalAbilityEvaluationCollectService List<PersonalAbilityEvaluationCollect> evaluationCollects = iPersonalAbilityEvaluationCollectService
.list(new LambdaQueryWrapper<PersonalAbilityEvaluationCollect>()); .list(new LambdaQueryWrapper<PersonalAbilityEvaluationCollect>());
// resultMap.put("前60名学生能力值", evaluationCollects); // resultMap.put("前60名学生能力值", evaluationCollects);
List<PersonalAbilityEvaluationCollect> vos = new LinkedList<>(); List<PersonalAbilityEvaluationCollect> vos = new LinkedList<>();
Map<String, List<PersonalAbilityEvaluationCollect>> capacityIdListMap = Optional.ofNullable(evaluationCollects).orElse(new LinkedList<>()).stream() Map<String, List<PersonalAbilityEvaluationCollect>> capacityIdListMap = Optional.ofNullable(evaluationCollects).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(PersonalAbilityEvaluationCollect::getCapacityId)); .collect(Collectors.groupingBy(PersonalAbilityEvaluationCollect::getCapacityId));
//遍历分组后的结果
Optional.ofNullable(capacityIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
List<PersonalAbilityEvaluationCollect> 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("学生能力平均值", vos);
List<Map<String, Object>> abilityList = new LinkedList<>();
List<Integer> years = DateUtils.getLastxYear(2);
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName));
Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(bo -> {
Map<String, Object> abilityResultMap = new LinkedHashMap<>();
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(new LambdaQueryWrapper<DepartAbilityEvaluation>()
.eq(DepartAbilityEvaluation::getAnnualId, bo.getId()));
List<DepartAbilityEvaluation> voList = new LinkedList<>();
Map<String, List<DepartAbilityEvaluation>> capacityIdListMap2 = Optional.ofNullable(departAbilityEvaluations).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(DepartAbilityEvaluation::getCapacityId));
//遍历分组后的结果 //遍历分组后的结果
Optional.ofNullable(capacityIdListMap2).orElse(new LinkedHashMap<>()).forEach((key, value) -> { Optional.ofNullable(capacityIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
List<DepartAbilityEvaluation> departAbilityEvaluationList = value; List<PersonalAbilityEvaluationCollect> departAbilityEvaluationList = value;
double sum = departAbilityEvaluationList.stream().mapToDouble(obj -> obj.getValue()).sum(); double sum = departAbilityEvaluationList.stream().mapToDouble(obj -> obj.getValue()).sum();
DecimalFormat decimalFormat = new DecimalFormat(); DecimalFormat decimalFormat = new DecimalFormat();
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数 decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制 decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
double val = ComputeUtils.div2(sum, departAbilityEvaluationList.size()); double val = ComputeUtils.div2(sum, departAbilityEvaluationList.size());
DepartAbilityEvaluation vo = new DepartAbilityEvaluation(); PersonalAbilityEvaluationCollect vo = new PersonalAbilityEvaluationCollect();
vo.setAnnualId(bo.getId());
vo.setValue(val); vo.setValue(val);
vo.setCapacityId(key); vo.setCapacityId(key);
vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName()); vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName());
voList.add(vo); vos.add(vo);
}); });
abilityResultMap.put(bo.getAnnualName(), voList); resultMap.put("学生能力平均值", vos);
abilityList.add(abilityResultMap);
}); List<Map<String, Object>> abilityList = new LinkedList<>();
resultMap.put("近2年能力分析", abilityList); List<Integer> years = DateUtils.getLastxYear(2);
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName));
resultMap.put("比赛类型占比", convertCompType(iCompService.list())); Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(bo -> {
Map<String, Object> abilityResultMap = new LinkedHashMap<>();
List<AnnualCompPoint> pointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>() List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(new LambdaQueryWrapper<DepartAbilityEvaluation>()
.eq(AnnualCompPoint::getRequireApply, "Y")); .eq(DepartAbilityEvaluation::getAnnualId, bo.getId()));
List<ReportCompVo> compVoList = new LinkedList<>(); List<DepartAbilityEvaluation> voList = new LinkedList<>();
Optional.ofNullable(pointList).orElse(new LinkedList<>()).stream().forEach(p -> { Map<String, List<DepartAbilityEvaluation>> capacityIdListMap2 = Optional.ofNullable(departAbilityEvaluations).orElse(new LinkedList<>()).stream()
ReportCompVo compVo = new ReportCompVo(); .collect(Collectors.groupingBy(DepartAbilityEvaluation::getCapacityId));
BeanUtils.copyProperties(p, compVo); //遍历分组后的结果
compVo.setPointName(p.getObjName()); Optional.ofNullable(capacityIdListMap2).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
List<DepartAbilityEvaluation> departAbilityEvaluationList = value;
AnnualComp annualComp = iAnnualCompService.getById(p.getAnnualCompId()); double sum = departAbilityEvaluationList.stream().mapToDouble(obj -> obj.getValue()).sum();
if (!ObjectUtils.isEmpty(annualComp)) { DecimalFormat decimalFormat = new DecimalFormat();
Comp comp = iCompService.getById(annualComp.getCompid()); decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
compVo.setCompName(comp.getCompName()); decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
CompType compType = iCompTypeService.getById(comp.getCompTypeId()); double val = ComputeUtils.div2(sum, departAbilityEvaluationList.size());
compVo.setTypeName(compType.getTypeName()); DepartAbilityEvaluation vo = new DepartAbilityEvaluation();
Projectlevel projectlevel = iProjectlevelService.getById(p.getObjLevel()); vo.setAnnualId(bo.getId());
compVo.setProjectLevel(projectlevel.getName()); vo.setValue(val);
} vo.setCapacityId(key);
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName());
.eq(AnnualCompetitionProjectRegistration::getAnnualCompid, p.getId())); voList.add(vo);
if (!ObjectUtils.isEmpty(list)) { });
Set<String> entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); abilityResultMap.put(bo.getAnnualName(), voList);
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, entryFormats)); abilityList.add(abilityResultMap);
compVo.setNumber(count.intValue()); });
} resultMap.put("近2年能力分析", abilityList);
compVoList.add(compVo);
}); resultMap.put("比赛类型占比", convertCompType(iCompService.list()));
resultMap.put("学生参赛情况", compVoList);
List<AnnualCompPoint> pointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>()
List<AwardPersion> awardPersionList = iAwardPersionService.list(); .eq(AnnualCompPoint::getRequireApply, "Y"));
Map<String, List<AwardPersion>> awardIdListMap = Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream() List<ReportCompVo> compVoList = new LinkedList<>();
.collect(Collectors.groupingBy(AwardPersion::getAwardname)); Optional.ofNullable(pointList).orElse(new LinkedList<>()).stream().forEach(p -> {
Map<String, Object> awardTypeMap = new LinkedHashMap<>(); ReportCompVo compVo = new ReportCompVo();
BeanUtils.copyProperties(p, compVo);
//遍历分组后的结果 compVo.setPointName(p.getObjName());
Optional.ofNullable(awardIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
Map<String, Object> awardIdMap = new LinkedHashMap<>(); AnnualComp annualComp = iAnnualCompService.getById(p.getAnnualCompId());
awardIdMap.put(key, value.size()); if (!ObjectUtils.isEmpty(annualComp)) {
awardTypeMap.putAll(awardIdMap); Comp comp = iCompService.getById(annualComp.getCompid());
}); compVo.setCompName(comp.getCompName());
resultMap.put("比赛获奖占比", awardTypeMap); CompType compType = iCompTypeService.getById(comp.getCompTypeId());
compVo.setTypeName(compType.getTypeName());
Projectlevel projectlevel = iProjectlevelService.getById(p.getObjLevel());
List<ReportCompVo> awareVos = new ArrayList<>(); compVo.setProjectLevel(projectlevel.getName());
Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream().forEach(p -> { }
ReportCompVo compVo = new ReportCompVo(); List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
compVo.setStuName(p.getStudentname()); .eq(AnnualCompetitionProjectRegistration::getAnnualCompid, p.getId()));
compVo.setAwardName(p.getAwardname()); if (!ObjectUtils.isEmpty(list)) {
AnnualCompPoint point = iAnnualCompPointService.getById(p.getAnnualCompP()); Set<String> entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet());
if (!ObjectUtils.isEmpty(point)) { Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, entryFormats));
compVo.setPointName(point.getObjName()); compVo.setNumber(count.intValue());
Projectlevel projectlevel = iProjectlevelService.getById(point.getObjLevel()); }
compVo.setProjectLevel(projectlevel.getName()); compVoList.add(compVo);
} });
AnnualComp annualComp = iAnnualCompService.getById(p.getAnnalComp()); resultMap.put("学生参赛情况", compVoList);
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<AwardPersion> awardPersionList = iAwardPersionService.list();
Map<String, List<AwardPersion>> awardIdListMap = Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(AwardPersion::getAwardname));
Map<String, Object> awardTypeMap = new LinkedHashMap<>();
List<Map<String, Object>> canSaiList = new LinkedList<>(); //遍历分组后的结果
List<Map<String, Object>> huoJiangList = new LinkedList<>(); Optional.ofNullable(awardIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
//二级部门 Map<String, Object> awardIdMap = new LinkedHashMap<>();
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID)); awardIdMap.put(key, value.size());
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> { awardTypeMap.putAll(awardIdMap);
List<AnnualCompPoint> pointList4Depart = convertPoint4Depart(depart); });
Set<String> pointIds4Depart = Optional.ofNullable(pointList4Depart).orElse(new ArrayList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet()); resultMap.put("比赛获奖占比", awardTypeMap);
Map<String, Object> departMap = new LinkedHashMap<>();
departMap.put("部门名称", depart.getDepartName());
//报名列表 List<ReportCompVo> awareVos = new ArrayList<>();
if (!ObjectUtils.isEmpty(pointIds4Depart)) { Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream().forEach(p -> {
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() ReportCompVo compVo = new ReportCompVo();
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, pointIds4Depart)); compVo.setStuName(p.getStudentname());
if (!ObjectUtils.isEmpty(registrationList)) { compVo.setAwardName(p.getAwardname());
//报名编号 AnnualCompPoint point = iAnnualCompPointService.getById(p.getAnnualCompP());
Set<String> enrollCodes = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); if (!ObjectUtils.isEmpty(point)) {
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, enrollCodes)); compVo.setPointName(point.getObjName());
departMap.put("比赛总人数", count); Projectlevel projectlevel = iProjectlevelService.getById(point.getObjLevel());
//个人赛报名数 compVo.setProjectLevel(projectlevel.getName());
List<AnnualCompetitionProjectRegistration> registrationList4Stu = registrationList.stream().filter(b -> b.getEntryFormat().equals("0")).collect(Collectors.toList());
Set<String> enrollCodes4Stu = Optional.ofNullable(registrationList4Stu).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet());
Long count4Stu = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(!ObjectUtils.isEmpty(enrollCodes4Stu), TeamManagement::getEnrollCode, enrollCodes4Stu));
//学生人数
departMap.put("个人赛人数", count4Stu);
departMap.put("团队赛人数", count - count4Stu);
} }
} AnnualComp annualComp = iAnnualCompService.getById(p.getAnnalComp());
canSaiList.add(departMap); 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<Map<String, Object>> canSaiList = new LinkedList<>();
List<Map<String, Object>> huoJiangList = new LinkedList<>();
//二级部门
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID));
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> {
List<AnnualCompPoint> pointList4Depart = convertPoint4Depart(depart);
Set<String> pointIds4Depart = Optional.ofNullable(pointList4Depart).orElse(new ArrayList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet());
Map<String, Object> departMap = new LinkedHashMap<>();
departMap.put("部门名称", depart.getDepartName());
//报名列表
if (!ObjectUtils.isEmpty(pointIds4Depart)) {
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, pointIds4Depart));
if (!ObjectUtils.isEmpty(registrationList)) {
//报名编号
Set<String> enrollCodes = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet());
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, enrollCodes));
departMap.put("比赛总人数", count);
//个人赛报名数
List<AnnualCompetitionProjectRegistration> registrationList4Stu = registrationList.stream().filter(b -> b.getEntryFormat().equals("0")).collect(Collectors.toList());
Set<String> enrollCodes4Stu = Optional.ofNullable(registrationList4Stu).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet());
Long count4Stu = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(!ObjectUtils.isEmpty(enrollCodes4Stu), TeamManagement::getEnrollCode, enrollCodes4Stu));
//学生人数
departMap.put("个人赛人数", count4Stu);
departMap.put("团队赛人数", count - count4Stu);
}
}
canSaiList.add(departMap);
/*List<AwardPersion> awardPersionList4Depart = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getAnnualCompP, pointIds4Depart)); /*List<AwardPersion> awardPersionList4Depart = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getAnnualCompP, pointIds4Depart));
Map<String, Object> departHuoJiangMap = new LinkedHashMap<>(); Map<String, Object> departHuoJiangMap = new LinkedHashMap<>();
@ -553,34 +560,42 @@ public class UserHomePageServiceImpl implements UserHomePageService {
departHuoJiangMap.put(depart.getDepartName() + "-" + key, value.size()); departHuoJiangMap.put(depart.getDepartName() + "-" + key, value.size());
}); });
huoJiangList.add(departHuoJiangMap);*/ huoJiangList.add(departHuoJiangMap);*/
}); });
resultMap.put("部门参赛情况列表", canSaiList); resultMap.put("部门参赛情况列表", canSaiList);
// resultMap.put("部门获奖情况列表", huoJiangList); // resultMap.put("部门获奖情况列表", huoJiangList);
List<HomePageCompVo> scoreList4Point = new LinkedList<>(); List<HomePageCompVo> scoreList4Point = new LinkedList<>();
List<PersonalCompScore> personalCompScores = iPersonalCompScoreService.list(new LambdaQueryWrapper<PersonalCompScore>().eq(PersonalCompScore::getAnnualCompP, annualCompPointIds)); List<PersonalCompScore> personalCompScores = iPersonalCompScoreService.list(new LambdaQueryWrapper<PersonalCompScore>().eq(PersonalCompScore::getAnnualCompP, annualCompPointIds));
Map<String, List<PersonalCompScore>> AnnualCompPointIdsMap = Optional.ofNullable(personalCompScores).orElse(new LinkedList<>()).stream() Map<String, List<PersonalCompScore>> AnnualCompPointIdsMap = Optional.ofNullable(personalCompScores).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(PersonalCompScore::getAnnualCompP)); .collect(Collectors.groupingBy(PersonalCompScore::getAnnualCompP));
Optional.ofNullable(AnnualCompPointIdsMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { Optional.ofNullable(AnnualCompPointIdsMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
double sum = value.stream().mapToDouble(obj -> obj.getScore()).sum(); double sum = value.stream().mapToDouble(obj -> obj.getScore()).sum();
HomePageCompVo vo = new HomePageCompVo(); HomePageCompVo vo = new HomePageCompVo();
AnnualCompPoint point = iAnnualCompPointService.getById(key); AnnualCompPoint point = iAnnualCompPointService.getById(key);
vo.setAnnualCompPointName(point.getObjName()); vo.setAnnualCompPointName(point.getObjName());
vo.setAnnualCompPointId(key); vo.setAnnualCompPointId(key);
AnnualComp annualComp = iAnnualCompService.getById(point.getAnnualCompId()); AnnualComp annualComp = iAnnualCompService.getById(point.getAnnualCompId());
if (!ObjectUtils.isEmpty(annualComp)) { if (!ObjectUtils.isEmpty(annualComp)) {
Comp comp = iCompService.getById(annualComp.getCompid()); Comp comp = iCompService.getById(annualComp.getCompid());
if (!ObjectUtils.isEmpty(comp)) { if (!ObjectUtils.isEmpty(comp)) {
vo.setCompName(comp.getCompName()); vo.setCompName(comp.getCompName());
}
} }
vo.setTotalScore(sum);
scoreList4Point.add(vo);
});
scoreList4Point.stream().sorted(Comparator.comparing(HomePageCompVo::getTotalScore)).collect(Collectors.toList());
resultMap.put("比赛学生积分况分析", scoreList4Point);
redisUtil.set(REPORT4SCHOOL, resultMap.toString());
return resultMap;
} else {
boolean hasKey = redisUtil.hasKey(REPORT4SCHOOL);
if (hasKey) {
return redisUtil.get(REPORT4SCHOOL);
} else {
return this.report4School(true);
} }
vo.setTotalScore(sum); }
scoreList4Point.add(vo);
});
scoreList4Point.stream().sorted(Comparator.comparing(HomePageCompVo::getTotalScore)).collect(Collectors.toList());
resultMap.put("比赛学生积分况分析", scoreList4Point);
return resultMap;
} }
private List<AnnualCompPoint> convertPoint4Depart(SysDepart depart) { private List<AnnualCompPoint> convertPoint4Depart(SysDepart depart) {
@ -616,7 +631,7 @@ public class UserHomePageServiceImpl implements UserHomePageService {
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>() List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>()
.eq(AnnualComp::getAnnualid, annual.getId()) .eq(AnnualComp::getAnnualid, annual.getId())
.in(!ObjectUtils.isEmpty(compIds),AnnualComp::getCompid, compIds)); .in(!ObjectUtils.isEmpty(compIds), AnnualComp::getCompid, compIds));
Set<String> annualCompIds = Optional.ofNullable(annualCompList).orElse(new LinkedList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet()); Set<String> annualCompIds = Optional.ofNullable(annualCompList).orElse(new LinkedList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet());
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(AnnualCompPoint::getAnnualCompId, annualCompIds)); List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(AnnualCompPoint::getAnnualCompId, annualCompIds));

@ -191,9 +191,10 @@ export const getOrganizingCommitteeReport = () => {
} }
// /user/login/homepage/report4School // /user/login/homepage/report4School
// 学校综合报告 // 学校综合报告
export const getComprehensiveReport = () => { export const getComprehensiveReport = (params={}) => {
return defHttp.get({ return defHttp.get({
url:'/user/login/homepage/report4School' url:'/user/login/homepage/report4School',
params
}) })
} }
// 部门 // 部门

@ -39,6 +39,18 @@
dictCode="sys_depart,depart_name,id" /> dictCode="sys_depart,depart_name,id" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="8">
<a-form-item label="比赛类型" name="comType">
<j-dict-select-tag placeholder="请选择比赛类型" v-model:value="queryParam.comType"
dictCode="comp_type,type_name,id" />
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="项目层次" name="objLevel">
<j-dict-select-tag placeholder="请选择项目层次" v-model:value="queryParam.objLevel"
dictCode="projectlevel,name,id" />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons"> <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6"> <a-col :lg="6">

@ -1,6 +1,7 @@
<template> <template>
<div class="container" v-if="isLoading"> <div class="container" v-if="isLoading">
<div class="title">河南机电学院比赛综合报告<div style="margin-left: 10px;cursor: pointer;"><SvgIcon name="log" @click="log"/></div></div> <div class="title">河南机电学院比赛综合报告<div style="margin-left: 10px;cursor: pointer;"><SvgIcon name="log" @click="log"/></div></div>
<div class="rebuild" ><div @click="Rebuild">重新生成报告</div></div>
<p class="description" <p class="description"
>我是比赛综述:全面落实立德树人根本任务依据CDI0工程教育理念培养德劳全面发展掌握软件工程专业所需的数学与自然科学基础知识专业基础理论知识;在企业级软件开发和工业智能软件开发方向能承担软件分析设计开发项目管理等任务具备解决复杂工程问题的能力;具有终身学习和创新创业意识国际交流能力团队合作精神等良好案养能适应产业与社会变革的国际化应用型人才<br />本专业毕业生经过五年左右的实际工作能够达到以下目标:</p >我是比赛综述:全面落实立德树人根本任务依据CDI0工程教育理念培养德劳全面发展掌握软件工程专业所需的数学与自然科学基础知识专业基础理论知识;在企业级软件开发和工业智能软件开发方向能承担软件分析设计开发项目管理等任务具备解决复杂工程问题的能力;具有终身学习和创新创业意识国际交流能力团队合作精神等良好案养能适应产业与社会变革的国际化应用型人才<br />本专业毕业生经过五年左右的实际工作能够达到以下目标:</p
> >
@ -173,6 +174,14 @@
} }
getComprehensiveReportEvent() getComprehensiveReportEvent()
const Rebuild = async () => {
isLoading.value = false
const res = await getComprehensiveReport({recreateFlag:true})
data.value = res
console.log(res);
data12.value = JSON.stringify(res.学生能力平均值)
isLoading.value = true
}
const activeKey = ref('1'); const activeKey = ref('1');
var indicator = [ var indicator = [
{ {
@ -307,6 +316,13 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.rebuild{
display: flex;
justify-content: center;
div{
cursor: pointer;
}
}
.description { .description {
text-indent: 2em; text-indent: 2em;
margin: 30px 0; margin: 30px 0;

Loading…
Cancel
Save