diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/entity/AnnComGroTopP.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/entity/AnnComGroTopP.java index f1c4408a..11edc91e 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/entity/AnnComGroTopP.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/anncomgrotopp/entity/AnnComGroTopP.java @@ -72,4 +72,22 @@ public class AnnComGroTopP implements Serializable { @Excel(name = "已评专家数", width = 15) @ApiModelProperty(value = "已评专家数") private java.lang.Integer ypzj; + /**年度*/ + @Excel(name = "年度", width = 15, dictTable = "annual", dicText = "annual_name", dicCode = "id") + @Dict(dictTable = "annual", dicText = "annual_name", dicCode = "id") + @ApiModelProperty(value = "年度") + private java.lang.String annid; + /**年度比赛项目*/ + @Excel(name = "年度比赛项目", width = 15, dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") + @Dict(dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id") + @ApiModelProperty(value = "年度比赛项目") + private java.lang.String annComP; + /**专家组*/ + @Excel(name = "专家组", width = 15, dictTable = "annual_comp_group", dicText = "name", dicCode = "id") + @Dict(dictTable = "annual_comp_group", dicText = "name", dicCode = "id") + @ApiModelProperty(value = "专家组") + private java.lang.String annComPG; + /**作品名称*/ + @ApiModelProperty(value = "作品名称") + private java.lang.String topicName; } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java index 9fd49b13..a21c0c42 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java @@ -16,13 +16,13 @@ import java.util.List; import java.util.Map; /** - * @Description: 比赛综合管理系统大屏 + * @Description: 河南机电比赛大屏 * @Author: Z.H.C * @CreateTime: 2023-11-28 16:45 * @Version: 1.0 */ -@Api(tags = "比赛系统大屏") +@Api(tags = "河南机电比赛系统大屏") @RestController @RequestMapping("/comp/bigScreen") @Slf4j @@ -31,10 +31,17 @@ public class CompSystemBigScreenController /*extends JeecgController*/ { @Autowired private CompSystemBigScreenService compSystemBigScreenService; - @ApiOperation(value = "院系综合大屏", notes = "院系综合大屏") + @ApiOperation(value = "河南机电-比赛数据综合展示", notes = "河南机电-比赛数据综合展示") + @GetMapping(value = "/composite") + public Result composite(HttpServletRequest req) { + Map result = compSystemBigScreenService.composite(); + return Result.ok(result); + } + + @ApiOperation(value = "河南机电-部门比赛数据展示", notes = "河南机电-部门比赛数据展示") @GetMapping(value = "/depart") - public Result bigScreen4Depart(HttpServletRequest req) { - Map result = compSystemBigScreenService.bigScreen4Depart(); + public Result bigScreen4Depart(String departId) { + Map result = compSystemBigScreenService.bigScreen4Depart(departId); return Result.ok(result); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java index e930981b..c520de01 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java @@ -5,7 +5,10 @@ import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation import java.util.Map; public interface CompSystemBigScreenService { - Map bigScreen4Depart(); + Map bigScreen4Depart(String departId); Map bigScreen4Student(PersonalAbilityEvaluation personalAbilityEvaluation); + + Map composite(); + } 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 02c129c3..4fdcf79e 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 @@ -1,6 +1,8 @@ package org.jeecg.modules.demo.bigScreen.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.jeecg.common.exception.JeecgBootException; +import org.jeecg.common.util.ComputeUtils; import org.jeecg.common.util.DateUtils; import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation; import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation; @@ -38,12 +40,14 @@ import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** - * @Description: TODO + * @Description: 河南机电-大屏 * @Author: Z.H.C * @CreateTime: 2023-11-28 17:00 * @Version: 1.0 @@ -89,14 +93,30 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic @Autowired private IAnnualService iAnnualService; + /** + * @description: 部门比赛数据展示 + * 使用大数据页面的形式全面展示各部门参加比赛的数据,可以用多幅大数据页面分别展示,展示内容包括:多维度能力评价数据、获奖情况、得分情况、参赛情况。需要提供功能截图。 + * @param: [] + * @return: java.util.Map + * @author: z.h.c + * @date: 24/7/3 17:27 + */ @Override - public Map bigScreen4Depart() { + public Map bigScreen4Depart(String departId) { + Assert.notNull(departId, "部门id不能为空"); + SysDepart sysDepart = iSysDepartService.getById(departId); + if (ObjectUtils.isEmpty(sysDepart)) { + throw new JeecgBootException("部门不存在"); + } Map resultMap = new LinkedHashMap<>(); - resultMap.put("compList", this.getCompList()); + //比赛列表 + List compVoList = this.getCompList4Depart(sysDepart); + resultMap.put("compList", compVoList); - List awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper().last("limit 30")); + + List awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper().eq(AwardPersion::getSysOrgCode, sysDepart.getOrgCode()).last("limit 30")); Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(award -> { // 根据报名编号查询参赛者信息,都是个人赛场景 TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper() @@ -107,36 +127,71 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(award.getAnnualCompP()); award.setAnnualCompPname(annualCompPoint.getObjName()); }); + //获奖列表 resultMap.put("awardList", awardPersionList); + List personalCompScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper() + .eq(PersonalCompTotalScore::getDepet, departId) .orderByDesc(PersonalCompTotalScore::getScore) .last("limit 50")); + //学生积分排名 resultMap.put("studentScore", personalCompScoreList); + Map compCounts = new LinkedHashMap<>(); - Long compCount = iCompService.count(); - Long pointCount = iAnnualCompPointService.count(); +// Long pointCount = iAnnualCompPointService.count(); + Long compCount = iCompService.count(new LambdaQueryWrapper().eq(Comp::getCompOrgan, departId)); //比赛数 compCounts.put("compCount", compCount); //年度项目比赛数 - compCounts.put("pointCount", pointCount); - //总报名数数 - Long count = iAnnualCompetitionProjectRegistrationService.count(); +// long pointCount = Optional.ofNullable(compVoList).orElse(new LinkedList<>()).stream().mapToInt(vo -> vo.getAnnualCompPointNumber()).sum(); +// compCounts.put("pointCount", pointCount); + //总报名数 + long count = Optional.ofNullable(compVoList).orElse(new LinkedList<>()).stream().mapToInt(vo -> vo.getNumber()).sum(); + //总报名数 + compCounts.put("count", count); Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper() - .eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0")); + .eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0") + .eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode())); //学生人数 compCounts.put("personCompCount", personCount); Long teamCount = count - personCount; //队伍数 compCounts.put("teamCompCount", teamCount); + //比赛统计 resultMap.put("compCounts", compCounts); - List departAbilityEvaluations = iDepartAbilityEvaluationService.list(); - resultMap.put("departAbilityEvaluation", departAbilityEvaluations); + + List departAbilityEvaluations = iDepartAbilityEvaluationService.list(new LambdaQueryWrapper() + .eq(DepartAbilityEvaluation::getDepetId, departId)); + List vos = new LinkedList<>(); + Map> capacityIdListMap = Optional.ofNullable(departAbilityEvaluations).orElse(new LinkedList<>()).stream() + .collect(Collectors.groupingBy(DepartAbilityEvaluation::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()); + 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 years = DateUtils.getLastxYear(5); - List annualList = iAnnualService.list(new LambdaQueryWrapper().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName)); + List annualList = iAnnualService.list(new LambdaQueryWrapper() + .in(Annual::getAnnualName, years) + .eq(Annual::getSysOrgCode, sysDepart.getOrgCode()) + .orderByAsc(Annual::getAnnualName)); List last5YearDataVos = new LinkedList<>(); Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(annual -> { Last5YearDataVo last5YearDataVo = new Last5YearDataVo(); @@ -250,6 +305,108 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic return resultMap; } + /** + * @description: 比赛数据综合展示 + * 使用大数据页面的形式全面展示系统管理的各种综合数据, + * 包括比赛列表、比赛总数统计、参赛人数统计、多维度能力评价分析数据、近五年比赛数和总人数对比,比赛获奖列表,参赛人员积分列表。需要提供功能截图。 + * @param: [] + * @return: java.util.Map + * @author: z.h.c + * @date: 24/7/3 16:25 + */ + @Override + public Map composite() { + + Map resultMap = new LinkedHashMap<>(); + //比赛列表 + resultMap.put("compList", this.getCompList()); + List awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper().last("limit 30")); + Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(award -> { + // 根据报名编号查询参赛者信息,都是个人赛场景 + TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper() + .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 personalCompScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper() + .orderByDesc(PersonalCompTotalScore::getScore) + .last("limit 50")); + //学生积分排行前50名 + resultMap.put("studentScore", personalCompScoreList); + + Map compCounts = new LinkedHashMap<>(); + Long compCount = iCompService.count(); +// Long pointCount = iAnnualCompPointService.count(); + //比赛数 + compCounts.put("compCount", compCount); + Long count = iAnnualCompetitionProjectRegistrationService.count(); + //总人数 + compCounts.put("pointCount", count); + //人个报名人数 + Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper() + .eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0")); + //学生人数 + compCounts.put("personCompCount", personCount); + Long teamCount = count - personCount; + //队伍数 + compCounts.put("teamCompCount", teamCount); + resultMap.put("compCounts", compCounts); + + List departAbilityEvaluations = iDepartAbilityEvaluationService.list(); + List vos = new LinkedList<>(); + Map> capacityIdListMap = Optional.ofNullable(departAbilityEvaluations).orElse(new LinkedList<>()).stream() + .collect(Collectors.groupingBy(DepartAbilityEvaluation::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()); + DepartAbilityEvaluation vo = new DepartAbilityEvaluation(); + vo.setValue(val); + vo.setCapacityId(key); + vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName()); + vos.add(vo); + }); + resultMap.put("abilityEvaluation", vos); + + List years = DateUtils.getLastxYear(5); + List annualList = iAnnualService.list(new LambdaQueryWrapper().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName)); + List last5YearDataVos = new LinkedList<>(); + Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(annual -> { + Last5YearDataVo last5YearDataVo = new Last5YearDataVo(); + last5YearDataVo.setYear(annual.getAnnualName()); + AtomicReference personCount4Comp = new AtomicReference<>(BigDecimal.ZERO); + + List annualCompList = iAnnualCompService.list(new LambdaQueryWrapper().eq(AnnualComp::getAnnualid, annual.getId())); + //比赛数 + 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)) { + long personCount4CompTemp = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper(). + 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; + } + List getCompList() { List annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper() .eq(AnnualCompPoint::getRequireApply, "Y")); @@ -264,7 +421,9 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic if (!ObjectUtils.isEmpty(annualComp)) { Comp comp = iCompService.getById(annualComp.getCompid()); if (!ObjectUtils.isEmpty(comp)) { + compVo.setCompId(comp.getId()); compVo.setCompName(comp.getCompName()); + compVo.setCompOrganId(comp.getCompOrgan()); SysDepart sysDepart = iSysDepartService.getById(comp.getCompOrgan()); compVo.setCompOrganName(sysDepart.getDepartName()); } @@ -273,4 +432,40 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic }); return compVoList; } + + List getCompList4Depart(SysDepart sysDepart) { + + //比赛表 + List compList = iCompService.list(new LambdaQueryWrapper().eq(Comp::getCompOrgan, sysDepart.getId())); + List compVoList = new LinkedList<>(); + Optional.ofNullable(compList).orElse(new LinkedList<>()).stream().forEach(c -> { + CompVo compVo = new CompVo(); + compVo.setCompId(c.getId()); + compVo.setCompName(c.getCompName()); + compVo.setCompOrganId(sysDepart.getId()); + compVo.setCompOrganName(sysDepart.getDepartName()); + compVo.setNumber(0); + compVo.setAnnualCompPointNumber(0); + //年度比赛表 + List annualCompList = iAnnualCompService.list(new LambdaQueryWrapper().in(AnnualComp::getCompid, c.getId())); + Set annualCompIds = Optional.ofNullable(annualCompList).orElse(new ArrayList<>()).stream().map(annualComp -> annualComp.getId()).collect(Collectors.toSet()); + //年度比赛项目表 + if (!ObjectUtils.isEmpty(annualCompIds)) { + List annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper() + .in(AnnualCompPoint::getAnnualCompId, annualCompIds)); + compVo.setAnnualCompPointNumber(annualCompPointList.size()); + Set annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet()); + if (!ObjectUtils.isEmpty(annualCompPointIds)) { + //报名表 + List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() + .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds) + .eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode()) + ); + compVo.setNumber(list.size()); + } + } + compVoList.add(compVo); + }); + return compVoList; + } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java index 73a0f2a6..267b977d 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java @@ -14,8 +14,11 @@ import java.io.Serializable; @Data public class CompVo implements Serializable { - @ApiModelProperty(value = "主键") - private String id; + @ApiModelProperty(value = "比赛id") + private String compId; + +// @ApiModelProperty(value = "年度比赛项目id") +// private String annualCompPointId; /** * 比赛名称 @@ -23,11 +26,18 @@ public class CompVo implements Serializable { @ApiModelProperty(value = "比赛名称") private String compName; - @ApiModelProperty(value = "负责部门") + @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; } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java index 3e1802be..78759840 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/chooseTopicPersion/controller/ChaoseTopicPersionController.java @@ -34,6 +34,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.demo.topic.service.ITopicService; +import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion; +import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -76,6 +78,8 @@ public class ChaoseTopicPersionController extends JeecgController> bmbhlist(ChaoseTopicPersion chaoseTopicPersion, + public Result> bmbhlist(UpfilePersion upfilePersion, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req,@RequestParam(name="xmtmid",required=true) String xmtmid) { AnnComGroTop annComGroTop = annComGroTopService.getById(xmtmid); - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(chaoseTopicPersion, req.getParameterMap()); - queryWrapper.eq("timul",annComGroTop.getTopid()); - queryWrapper.eq("status","2"); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(upfilePersion, req.getParameterMap()); + queryWrapper.eq("annual_id",annComGroTop.getAnnid()); + queryWrapper.eq("annual_comp_point_id",annComGroTop.getAnnComP()); + queryWrapper.eq("status","0"); AnnComGroTopP annComGroTopP = new AnnComGroTopP(); QueryWrapper queryWrapperagt = QueryGenerator.initQueryWrapper(annComGroTopP, req.getParameterMap()); //queryWrapperagt.eq("ann_com_gro_topid",xmtmid); - queryWrapperagt.eq("topid",annComGroTop.getTopid()); + queryWrapperagt.eq("annid",annComGroTop.getAnnid()); + queryWrapperagt.eq("ann_com_p",annComGroTop.getAnnComP()); List listact = annComGroTopPService.list(queryWrapperagt); String str = ""; for(int i = 0 ; i page = new Page<>(pageNo, pageSize); - IPage pageList = chaoseTopicPersionService.page(page, queryWrapper); + Page page = new Page<>(pageNo, pageSize); + IPage pageList = upfilePersionService.page(page, queryWrapper); return Result.OK(pageList); } @@ -182,12 +187,16 @@ public class ChaoseTopicPersionController extends JeecgController bmbhadd(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="xmtmid",required=true) String xmtmid) { String strs[] = ids.split(","); + AnnComGroTop annComGroTop = annComGroTopService.getById(xmtmid); for (int i = 0 ; i < strs.length ; i++){ - ChaoseTopicPersion chaoseTopicPersion = chaoseTopicPersionService.getById(strs[i]); + UpfilePersion upfilePersion = upfilePersionService.getById(strs[i]); AnnComGroTopP annComGroTopP = new AnnComGroTopP(); annComGroTopP.setAnnComGroTopid(xmtmid); - annComGroTopP.setTopid(chaoseTopicPersion.getTimul()); - annComGroTopP.setBmcode(chaoseTopicPersion.getBmcode()); + annComGroTopP.setBmcode(upfilePersion.getApplyCode()); + annComGroTopP.setAnnid(annComGroTop.getAnnid()); + annComGroTopP.setAnnComP(annComGroTop.getAnnComP()); + annComGroTopP.setAnnComPG(annComGroTop.getAnnComPG()); + annComGroTopP.setTopicName(upfilePersion.getTopicName()); annComGroTopPService.save(annComGroTopP); } return Result.OK("绑定成功!"); 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 73501bbd..c0a66441 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 @@ -124,16 +124,15 @@ public class TopicController extends JeecgController { /** * 添加 * - * @param ids * @return */ @AutoLog(value = "设置题目添加") @ApiOperation(value="设置题目添加", notes="设置题目添加") //@RequiresPermissions("expert:expert:add") @GetMapping(value = "/szadd") - public Result szadd(@RequestParam(name="ids",required=true) String ids,@RequestParam(name="ndbsxzid",required=true) String ndbsxzid) { + public Result szadd(@RequestParam(name="ndbsxzid",required=true) String ndbsxzid,HttpServletRequest req) { AnnualCompGroup annualCompGroup = annualCompGroupService.getById(ndbsxzid); - String str[] =ids.split(","); +/* String str[] =ids.split(","); for (int i = 0 ; i < str.length;i++){ AnnComGroTop annComGroTop = new AnnComGroTop(); annComGroTop.setAnnid(annualCompGroup.getAnnal()); @@ -141,8 +140,23 @@ public class TopicController extends JeecgController { annComGroTop.setAnnComPG(ndbsxzid); annComGroTop.setTopid(str[i]); annComGroTopService.save(annComGroTop); + }*/ + AnnComGroTop annComGroTopnew = new AnnComGroTop(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annComGroTopnew, req.getParameterMap()); + queryWrapper.eq("annid",annualCompGroup.getAnnal()); + queryWrapper.eq("ann_com_p",annualCompGroup.getAnnCompP()); + queryWrapper.eq("ann_com_p_g",ndbsxzid); + List list = annComGroTopService.list(queryWrapper); + if(list.size()==0){ + AnnComGroTop annComGroTop = new AnnComGroTop(); + annComGroTop.setAnnid(annualCompGroup.getAnnal()); + annComGroTop.setAnnComP(annualCompGroup.getAnnCompP()); + annComGroTop.setAnnComPG(ndbsxzid); + annComGroTopService.save(annComGroTop); + return Result.OK(annComGroTop.getId()); + }else{ + return Result.OK(list.get(0).getId()); } - return Result.OK("设置成功!"); } // @ApiOperation(value = "题目管理-教务处待审核", notes = "题目管理-分页列表查询") diff --git a/jeecgboot-vue3-master/src/views/anncomgrotopp/AnnComGroTopP.data.ts b/jeecgboot-vue3-master/src/views/anncomgrotopp/AnnComGroTopP.data.ts index 65c20717..8bd63f38 100644 --- a/jeecgboot-vue3-master/src/views/anncomgrotopp/AnnComGroTopP.data.ts +++ b/jeecgboot-vue3-master/src/views/anncomgrotopp/AnnComGroTopP.data.ts @@ -5,9 +5,9 @@ import { render } from '/@/utils/common/renderUtils'; //列表数据 export const columns: BasicColumn[] = [ { - title: '题目', + title: '作品名称', align: "center", - dataIndex: 'topid_dictText' + dataIndex: 'topicName' }, { title: '报名编号', diff --git a/jeecgboot-vue3-master/src/views/anncomgrotopp/components/AnnComGroTopPModal.vue b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/AnnComGroTopPModal.vue index ae5d3c3c..2f6a0950 100644 --- a/jeecgboot-vue3-master/src/views/anncomgrotopp/components/AnnComGroTopPModal.vue +++ b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/AnnComGroTopPModal.vue @@ -19,7 +19,7 @@ * 新增 */ function add() { - title.value = '绑定报名编号'; + title.value = '绑定作品'; visible.value = true; /* nextTick(() => { registerForm.value.add(); diff --git a/jeecgboot-vue3-master/src/views/anncomgrotopp/components/ChaoseTopicPersion.data.ts b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/ChaoseTopicPersion.data.ts index 95aff3c7..68f54697 100644 --- a/jeecgboot-vue3-master/src/views/anncomgrotopp/components/ChaoseTopicPersion.data.ts +++ b/jeecgboot-vue3-master/src/views/anncomgrotopp/components/ChaoseTopicPersion.data.ts @@ -3,20 +3,20 @@ import {FormSchema} from '/@/components/Table'; //列表数据 export const columns: BasicColumn[] = [ { - title: '报名编号', + title: '作品名称', align: "center", - dataIndex: 'bmcode' + dataIndex: 'topicName' }, { - title: '题目', + title: '报名编号', align: "center", - dataIndex: 'timul_dictText' - }, - { + dataIndex: 'applyCode' + } +/* { title: '状态', align: "center", - dataIndex: 'status_dictText' - } + dataIndex: "待评分" + }*/ ]; //查询数据 export const searchFormSchema: FormSchema[] = [ diff --git a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts index 9137c820..677c1406 100644 --- a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts +++ b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts @@ -12,6 +12,7 @@ enum Api { importExcel = '/annualcompgroup/annualCompGroup/importExcel', exportXls = '/annualcompgroup/annualCompGroup/exportXls', queryCompId = '/annualcompgroup/annualCompGroup/queryCompId', + saveTop = '/topic/topic/szadd', } /** @@ -73,3 +74,13 @@ export const saveOrUpdate = (params, isUpdate) => { let url = isUpdate ? Api.edit : Api.save; return defHttp.post({ url: url, params }, { isTransformResponse: false }); } + +/** + * 保存或者更新 + * @param params + * @param isUpdate + */ +export const saveOrUpdateTop = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.saveTop; + return defHttp.get({ url: url, params }, { isTransformResponse: false }); +} diff --git a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList.vue b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList.vue index f5963ec0..895f29ce 100644 --- a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList.vue +++ b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList.vue @@ -201,11 +201,11 @@ onClick: bdcy.bind(null, record), //this.$Router.push }, - { +/* { label: '设置题目', onClick: sztm.bind(null, record), //this.$Router.push - }, + },*/ ] } diff --git a/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList1.vue b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList1.vue new file mode 100644 index 00000000..76289887 --- /dev/null +++ b/jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList1.vue @@ -0,0 +1,282 @@ + + + + +