河南机电职业学院-大屏数据统计

dev
zhc077 5 months ago
parent ee939c8bd2
commit edab57cf9d
  1. 1
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java
  2. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcomp/entity/AnnualComp.java
  3. 96
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/entity/AnnualCompetitionProjectRegistration.java
  4. 11
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java
  5. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java
  6. 194
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java
  7. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java

@ -178,6 +178,7 @@ public class AnnualCompPoint implements Serializable {
*/ */
@Excel(name = "年度比赛状态", width = 15) @Excel(name = "年度比赛状态", width = 15)
@ApiModelProperty(value = "年度比赛状态") @ApiModelProperty(value = "年度比赛状态")
//状态:0待提交、1已提交(待审核)、2已审核(已通过)、3待驳回、4已驳回、5-已报名、6-已选题、7-已上传作品、8-已评分、9-已评奖,10-积分已汇总
private String annualCompState; private String annualCompState;
/** /**
* 开关 * 开关

@ -140,9 +140,12 @@ public class AnnualComp implements Serializable {
@Excel(name = "协办方", width = 15) @Excel(name = "协办方", width = 15)
@ApiModelProperty(value = "协办方") @ApiModelProperty(value = "协办方")
private String coorganizer; private String coorganizer;
/** /**
* 年度比赛状态 * 年度比赛状态
*/ */
//状态:0待提交、1已提交(待审核)、2已审核(已通过)、3待驳回、4已驳回、5-已报名、6-已选题、7-已上传作品、8-已评分、9-已评奖,10-积分已汇总
@Excel(name = "年度比赛状态", width = 15) @Excel(name = "年度比赛状态", width = 15)
@ApiModelProperty(value = "年度比赛状态") @ApiModelProperty(value = "年度比赛状态")
private String state; private String state;

@ -1,77 +1,103 @@
package org.jeecg.modules.demo.annualcompetitionprojectregistration.entity; package org.jeecg.modules.demo.annualcompetitionprojectregistration.entity;
import java.io.Serializable; import com.baomidou.mybatisplus.annotation.IdType;
import java.io.UnsupportedEncodingException; import com.baomidou.mybatisplus.annotation.TableField;
import java.util.Date; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/** /**
* @Description: 年度比赛项目报名 * @Description: 年度比赛项目报名
* @Author: jeecg-boot * @Author: jeecg-boot
* @Date: 2023-08-17 * @Date: 2023-08-17
* @Version: V1.0 * @Version: V1.0
*/ */
@ApiModel(value="annual_competition_project_registration对象", description="年度比赛项目报名") @ApiModel(value = "annual_competition_project_registration对象", description = "年度比赛项目报名")
@Data @Data
@TableName("annual_competition_project_registration") @TableName("annual_competition_project_registration")
public class AnnualCompetitionProjectRegistration implements Serializable { public class AnnualCompetitionProjectRegistration implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键*/ /**
@TableId(type = IdType.ASSIGN_ID) * 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
private java.lang.String id; private java.lang.String id;
/**创建人*/ /**
* 创建人
*/
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人")
private java.lang.String createBy; private java.lang.String createBy;
/**创建日期*/ /**
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") * 创建日期
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期") @ApiModelProperty(value = "创建日期")
private java.util.Date createTime; private java.util.Date createTime;
/**更新人*/ /**
* 更新人
*/
@ApiModelProperty(value = "更新人") @ApiModelProperty(value = "更新人")
private java.lang.String updateBy; private java.lang.String updateBy;
/**更新日期*/ /**
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") * 更新日期
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") */
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期") @ApiModelProperty(value = "更新日期")
private java.util.Date updateTime; private java.util.Date updateTime;
/**所属部门*/ /**
* 所属部门
*/
@ApiModelProperty(value = "所属部门") @ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
/**年度比赛项目*/ /**
@Excel(name = "年度比赛项目", width = 15) * 年度比赛项目
*/
@Excel(name = "年度比赛项目", width = 15)
@ApiModelProperty(value = "年度比赛项目") @ApiModelProperty(value = "年度比赛项目")
@Dict(dicText = "obj_name", dictTable = "annual_comp_point",dicCode = "id") @Dict(dicText = "obj_name", dictTable = "annual_comp_point", dicCode = "id")
private java.lang.String annualCompid; private java.lang.String annualCompid;
/**报名编号*/ /**
@Excel(name = "报名编号", width = 15) * 报名编号
*/
@Excel(name = "报名编号", width = 15)
@ApiModelProperty(value = "报名编号") @ApiModelProperty(value = "报名编号")
private java.lang.String enrollCode; private java.lang.String enrollCode;
/**报名状态*/ /**
@Excel(name = "报名状态", width = 15) * 报名状态
*/
@Excel(name = "报名状态", width = 15)
@ApiModelProperty(value = "报名状态") @ApiModelProperty(value = "报名状态")
@Dict(dicCode = "enroll_static") @Dict(dicCode = "enroll_static")
private java.lang.String enrollStatic; private java.lang.String enrollStatic;
/**驳回原因*/ /**
@Excel(name = "驳回原因", width = 15) * 驳回原因
*/
@Excel(name = "驳回原因", width = 15)
@ApiModelProperty(value = "驳回原因") @ApiModelProperty(value = "驳回原因")
private java.lang.String backinfo; private java.lang.String backinfo;
/**参赛形式*/ /**
@Excel(name = "参赛形式", width = 15) * 参赛形式
*/
@Excel(name = "参赛形式", width = 15)
@ApiModelProperty(value = "参赛形式") @ApiModelProperty(value = "参赛形式")
//个人0、团队1
private java.lang.String entryFormat; private java.lang.String entryFormat;
/**队伍名称*/ /**
@Excel(name = "队伍名称", width = 15) * 队伍名称
*/
@Excel(name = "队伍名称", width = 15)
@ApiModelProperty(value = "队伍名称") @ApiModelProperty(value = "队伍名称")
private java.lang.String teamName; private java.lang.String teamName;

@ -45,10 +45,17 @@ public class CompSystemBigScreenController /*extends JeecgController*/ {
return Result.ok(result); return Result.ok(result);
} }
@ApiOperation(value = "河南机电-单个比赛数据展示", notes = "河南机电-单个比赛数据展示")
@GetMapping(value = "/singleComp")
public Result singleComp(String compId) {
Map<String, Object> result = compSystemBigScreenService.singleComp(compId);
return Result.ok(result);
}
@ApiOperation(value = "学生个人能力大屏", notes = "学生个人能力大屏") @ApiOperation(value = "学生个人能力大屏", notes = "学生个人能力大屏")
@GetMapping(value = "/student") @GetMapping(value = "/student")
public Result bigScreen4Student(PersonalAbilityEvaluation personalAbilityEvaluation) { public Result bigScreen4Student(String workNo) {
Map<String, Object> result = compSystemBigScreenService.bigScreen4Student(personalAbilityEvaluation); Map<String, Object> result = compSystemBigScreenService.bigScreen4Student(workNo);
return Result.ok(result); return Result.ok(result);
} }

@ -7,8 +7,9 @@ import java.util.Map;
public interface CompSystemBigScreenService { public interface CompSystemBigScreenService {
Map<String, Object> bigScreen4Depart(String departId); Map<String, Object> bigScreen4Depart(String departId);
Map<String, Object> bigScreen4Student(PersonalAbilityEvaluation personalAbilityEvaluation); Map<String, Object> bigScreen4Student(String workNo);
Map<String, Object> composite(); Map<String, Object> composite();
Map<String, Object> singleComp(String compId);
} }

@ -1,11 +1,9 @@
package org.jeecg.modules.demo.bigScreen.service; package org.jeecg.modules.demo.bigScreen.service;
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.entity.PersonalAbilityEvaluation;
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;
import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationCollectService; import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationCollectService;
@ -93,6 +91,143 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
@Autowired @Autowired
private IAnnualService iAnnualService; private IAnnualService iAnnualService;
/**
* @description: 单项比赛数据展示
* 使用大数据页面的形式全面展示某项比赛的各种综合数据包括年度比赛列表比赛项目数参赛人数统计多维度能力评价分析数据近五年比赛人数对比比赛获奖列表参赛人员积分列表需要提供功能截图
* @param: [compId]
* @return: java.util.Map<java.lang.String, java.lang.Object>
* @author: z.h.c
* @date: 24/7/6 11:51
*/
@Override
public Map<String, Object> singleComp(String compId) {
Assert.notNull(compId, "比赛id不能为空");
Map<String, Object> resultMap = new LinkedHashMap<>();
Comp comp = iCompService.getById(compId);
if (ObjectUtils.isEmpty(comp)) {
return resultMap;
}
//比赛列表
List<CompVo> annualCompList = this.getAnnualCompList(comp);
//年度比赛列表
resultMap.put("annualCompList", annualCompList);
// List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().eq(AnnualComp::getCompid, compId));
//年度比赛ids
Set<String> annualCompIds = Optional.ofNullable(annualCompList).orElse(new ArrayList<>()).stream().map(annualComp -> annualComp.getCompId()).collect(Collectors.toSet());
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>()
.in(AwardPersion::getAnnalComp, annualCompIds)
.orderByAsc(AwardPersion::getAwardname)
.last("limit 30"));
Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(award -> {
// 根据报名编号查询参赛者信息,都是个人赛场景
TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper<TeamManagement>()
.eq(TeamManagement::getEnrollCode, award.getEnrollCode()).last("limit 1"));
if (ObjectUtils.isEmpty(management)) return;
SysUser sysUser = iSysUserService.getById(management.getUserId());
award.setStudentname(sysUser.getRealname());
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(award.getAnnualCompP());
award.setAnnualCompPname(annualCompPoint.getObjName());
});
//获奖列表
resultMap.put("awardList", awardPersionList);
List<PersonalCompTotalScore> personalCompScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper<PersonalCompTotalScore>()
// .eq(PersonalCompTotalScore::getDepet, departId)
.orderByDesc(PersonalCompTotalScore::getScore)
.last("limit 50"));
//学生积分排名
resultMap.put("studentScore", personalCompScoreList);
Map<String, Object> compCounts = new LinkedHashMap<>();
long pointCount = iAnnualCompPointService.count(new LambdaQueryWrapper<AnnualCompPoint>().in(AnnualCompPoint::getAnnualCompId, annualCompIds));
//比赛数
// compCounts.put("compCount", annualCompIds.size());
//年度项目比赛数
compCounts.put("pointCount", pointCount);
//总报名数
long count = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompIds)
);
//总报名数
compCounts.put("count", count);
Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0")
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompIds));
//学生人数
compCounts.put("personCompCount", personCount);
Long teamCount = count - personCount;
//队伍数
compCounts.put("teamCompCount", teamCount);
//比赛统计
resultMap.put("compCounts", compCounts);
// List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(new LambdaQueryWrapper<DepartAbilityEvaluation>()
// .eq(DepartAbilityEvaluation::getDepetId, departId));
// List<DepartAbilityEvaluation> vos = new LinkedList<>();
// Map<String, List<DepartAbilityEvaluation>> capacityIdListMap = Optional.ofNullable(departAbilityEvaluations).orElse(new LinkedList<>()).stream()
// .collect(Collectors.groupingBy(DepartAbilityEvaluation::getCapacityId));
// //遍历分组后的结果
// Optional.ofNullable(capacityIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
// List<DepartAbilityEvaluation> 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.setDepetId(departId);
// vo.setValue(val);
// vo.setCapacityId(key);
// vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName());
// vos.add(vo);
// });
// //能力评估
// resultMap.put("departAbilityEvaluation", vos);
List<Integer> years = DateUtils.getLastxYear(5);
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>()
.in(Annual::getAnnualName, years));
List<Last5YearDataVo> last5YearDataVos = new LinkedList<>();
Set<String> annualIds = Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet());
//该项目5年的比赛
List<AnnualComp> annualCompList5Year = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>()
.eq(AnnualComp::getCompid, compId)
.in(AnnualComp::getAnnualid, annualIds));
Optional.ofNullable(annualCompList5Year).orElse(new LinkedList<>()).stream().forEach(ac -> {
Last5YearDataVo last5YearDataVo = new Last5YearDataVo();
annualList.stream().forEach(a -> {
if (a.getId().equals(ac.getAnnualid())) {
last5YearDataVo.setYear(a.getAnnualName());
}
});
AtomicReference<BigDecimal> personCount4Comp = new AtomicReference<>(BigDecimal.ZERO);
//比赛数
last5YearDataVo.setCompCount(1);
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getOne(new LambdaQueryWrapper<AnnualCompPoint>().eq(AnnualCompPoint::getAnnualCompId, ac.getId()));
if (!ObjectUtils.isEmpty(annualCompPoint)) {
long personCount4CompTemp = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>().
eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId()));
personCount4Comp.getAndUpdate(val -> val.add(new BigDecimal(personCount4CompTemp)));
last5YearDataVo.setPersonCount(personCount4Comp.get().intValue());
}
last5YearDataVos.add(last5YearDataVo);
});
resultMap.put("last5YearData", last5YearDataVos);
return resultMap;
}
/** /**
* @description: 部门比赛数据展示 * @description: 部门比赛数据展示
* 使用大数据页面的形式全面展示各部门参加比赛的数据可以用多幅大数据页面分别展示展示内容包括多维度能力评价数据获奖情况得分情况参赛情况需要提供功能截图 * 使用大数据页面的形式全面展示各部门参加比赛的数据可以用多幅大数据页面分别展示展示内容包括多维度能力评价数据获奖情况得分情况参赛情况需要提供功能截图
@ -106,10 +241,10 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
Assert.notNull(departId, "部门id不能为空"); Assert.notNull(departId, "部门id不能为空");
SysDepart sysDepart = iSysDepartService.getById(departId); SysDepart sysDepart = iSysDepartService.getById(departId);
Map<String, Object> resultMap = new LinkedHashMap<>();
if (ObjectUtils.isEmpty(sysDepart)) { if (ObjectUtils.isEmpty(sysDepart)) {
throw new JeecgBootException("部门不存在"); return resultMap;
} }
Map<String, Object> resultMap = new LinkedHashMap<>();
//比赛列表 //比赛列表
List<CompVo> compVoList = this.getCompList4Depart(sysDepart); List<CompVo> compVoList = this.getCompList4Depart(sysDepart);
@ -220,24 +355,24 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
} }
@Override @Override
public Map<String, Object> bigScreen4Student(PersonalAbilityEvaluation person) { public Map<String, Object> bigScreen4Student(String workNo) {
Assert.notNull(person.getWorkOn(), "学号不能为空"); Assert.notNull(workNo, "学号不能为空");
Map<String, Object> resultMap = new LinkedHashMap<>(); Map<String, Object> resultMap = new LinkedHashMap<>();
List<PersonalAbilityEvaluationCollect> personalAbilityEvaluationList = iPersonalAbilityEvaluationCollectService.list(new LambdaQueryWrapper<PersonalAbilityEvaluationCollect>() List<PersonalAbilityEvaluationCollect> personalAbilityEvaluationList = iPersonalAbilityEvaluationCollectService.list(new LambdaQueryWrapper<PersonalAbilityEvaluationCollect>()
.eq(PersonalAbilityEvaluationCollect::getWorkOn, person.getWorkOn())); .eq(PersonalAbilityEvaluationCollect::getWorkOn, workNo));
resultMap.put("studentAbilityEvaluation", personalAbilityEvaluationList); resultMap.put("studentAbilityEvaluation", personalAbilityEvaluationList);
Map<String, Object> studentInfoMap = new LinkedHashMap<>(); Map<String, Object> studentInfoMap = new LinkedHashMap<>();
PersonalCompTotalScore compTotalScore = iPersonalCompTotalScoreService.getOne(new LambdaQueryWrapper<PersonalCompTotalScore>() PersonalCompTotalScore compTotalScore = iPersonalCompTotalScoreService.getOne(new LambdaQueryWrapper<PersonalCompTotalScore>()
.eq(PersonalCompTotalScore::getWorkOn, person.getWorkOn())); .eq(PersonalCompTotalScore::getWorkOn, workNo));
studentInfoMap.put("score", compTotalScore); studentInfoMap.put("score", compTotalScore);
SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getWorkNo, person.getWorkOn())); SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getWorkNo, workNo));
List<AwardPersion> awardPersions = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>() List<AwardPersion> awardPersions = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>()
.eq(AwardPersion::getStudentcode, person.getWorkOn())); .eq(AwardPersion::getStudentcode, workNo));
Optional.ofNullable(awardPersions).orElse(new LinkedList<>()).forEach(award -> { Optional.ofNullable(awardPersions).orElse(new LinkedList<>()).forEach(award -> {
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(award.getAnnualCompP()); AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(award.getAnnualCompP());
award.setAnnualCompPname(annualCompPoint.getObjName()); award.setAnnualCompPname(annualCompPoint.getObjName());
@ -252,7 +387,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
Map<String, Object> yearData = new LinkedHashMap<>(); Map<String, Object> yearData = new LinkedHashMap<>();
yearData.put("year", annual.getAnnualName()); yearData.put("year", annual.getAnnualName());
List<PersonalCompScore> compScoreList = iPersonalCompScoreService.list(new LambdaQueryWrapper<PersonalCompScore>() List<PersonalCompScore> compScoreList = iPersonalCompScoreService.list(new LambdaQueryWrapper<PersonalCompScore>()
.eq(PersonalCompScore::getWorkOn, person.getWorkOn()) .eq(PersonalCompScore::getWorkOn, workNo)
.eq(PersonalCompScore::getAnnualId, annual.getId())); .eq(PersonalCompScore::getAnnualId, annual.getId()));
if (!ObjectUtils.isEmpty(compScoreList)) { if (!ObjectUtils.isEmpty(compScoreList)) {
double sum = compScoreList.stream().mapToDouble(PersonalCompScore::getScore).sum(); double sum = compScoreList.stream().mapToDouble(PersonalCompScore::getScore).sum();
@ -262,7 +397,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
last4YearData.add(yearData); last4YearData.add(yearData);
}); });
studentInfoMap.put("last4YearData", last4YearData); studentInfoMap.put("last4YearData", last4YearData);
studentInfoMap.put("workNo", person.getWorkOn()); studentInfoMap.put("workNo", workNo);
studentInfoMap.put("name", sysUser.getRealname()); studentInfoMap.put("name", sysUser.getRealname());
studentInfoMap.put("major", "软件工程"); studentInfoMap.put("major", "软件工程");
studentInfoMap.put("grade", "202*级"); studentInfoMap.put("grade", "202*级");
@ -407,6 +542,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
return resultMap; return resultMap;
} }
List<CompVo> getCompList() { List<CompVo> getCompList() {
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>() List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>()
.eq(AnnualCompPoint::getRequireApply, "Y")); .eq(AnnualCompPoint::getRequireApply, "Y"));
@ -468,4 +604,38 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
}); });
return compVoList; return compVoList;
} }
private List<CompVo> getAnnualCompList(Comp comp) {
List<CompVo> compVoList = new LinkedList<>();
//年度比赛表
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().eq(AnnualComp::getCompid, comp.getId()));
Optional.ofNullable(annualCompList).orElse(new LinkedList<>()).stream().forEach(ac -> {
CompVo compVo = new CompVo();
//年度比赛id
compVo.setCompId(ac.getId());
//年度比赛名称
compVo.setCompName(ac.getName());
// compVo.setCompOrganId(sysDepart.getId());
// compVo.setCompOrganName(sysDepart.getDepartName());
compVo.setNumber(0);
// compVo.setAnnualCompPointNumber(0);
compVo.setStatus(ac.getState());
//年度比赛表
// List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().in(AnnualComp::getCompid, c.getId()));
// Set<String> annualCompIds = Optional.ofNullable(ac).orElse(new ArrayList<>()).stream().map(annualComp -> annualComp.getId()).collect(Collectors.toSet());
//年度比赛项目表
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>()
.in(AnnualCompPoint::getAnnualCompId, ac.getId()));
// compVo.setAnnualCompPointNumber(annualCompPointList.size());
Set<String> annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet());
if (!ObjectUtils.isEmpty(annualCompPointIds)) {
//报名表
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds));
compVo.setNumber(list.size());
}
compVoList.add(compVo);
});
return compVoList;
}
} }

@ -40,4 +40,7 @@ public class CompVo implements Serializable {
@ApiModelProperty(value = "年度比赛项目数") @ApiModelProperty(value = "年度比赛项目数")
private Integer annualCompPointNumber; private Integer annualCompPointNumber;
@ApiModelProperty(value = "年度比赛状态")
private String status;
} }

Loading…
Cancel
Save