From 25c03587246e6dd682376e0ad6c28099c2ee989c Mon Sep 17 00:00:00 2001 From: Gitea Date: Sun, 28 Jul 2024 16:55:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=88=86=E6=9E=90=E6=8A=A5?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...petitionProjectRegistrationController.java | 262 ++++++++++++++++++ 1 file changed, 262 insertions(+) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java index dbc4d0f7..5561ceea 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java @@ -1474,6 +1474,268 @@ public class AnnualCompetitionProjectRegistrationController { return Result.OK(map); } + /** + * 学生角色分析报告数据接口 + * + * @param req + * @return + */ + @ApiOperation(value="学生角色分析报告数据接口", notes="学生角色分析报告数据接口") + @GetMapping(value = "/xsfxbg") + public Result xsfxbg( HttpServletRequest req) { + //获取当前登录用户 + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("user_id",user.getId()); + List listtm = teamManagementService.list(queryWrappertm); + Map map = new HashMap<>(); + if(listtm.size()!=0){ + //学生参加比赛的所有报名编号 + List bmbhs = listtm.stream().map(TeamManagement::getEnrollCode).collect(Collectors.toList()); + //查询报名表报名编号对应的所有年度比赛项目id + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); + QueryWrapper queryWrapperbm = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + queryWrapperbm.in("enroll_code",bmbhs); + queryWrapperbm.eq("enroll_static", "2"); + List listbm = annualCompetitionProjectRegistrationService.list(queryWrapperbm); + //参加比赛项目数量 + map.put("cjbsxmsl",listbm.size()); + + if(listbm.size()!=0){ + //年度比赛项目ids + List ndbsxmids = listbm.stream().map(AnnualCompetitionProjectRegistration::getAnnualCompid).collect(Collectors.toList()); + AnnualCompPoint annualCompPoint = new AnnualCompPoint(); + QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); + queryWrapperacp.in("id",ndbsxmids); + List listacp = annualCompPointService.list(queryWrapperacp); + //报名比赛项目 + List> xmListMap = new ArrayList<>(); + + if(listacp.size()>6){ + for (int k = 0 ; k < 6 ; k++){ + Map map2 = new HashMap<>(); + //年度比赛 + map2.put("ndbsname",annualCompService.getById(listacp.get(k).getAnnualCompId()).getName()); + //项目名称 + map2.put("xmname",listacp.get(k).getObjName()); + //参与形式 + map2.put("cyxs",listacp.get(k).getEntryForm().equals("N") ? "个人":"团队"); + //项目id + map2.put("xmid",listacp.get(k).getId()); + //状态 + Date date = new Date(); + if(listacp.get(k).getApplyStartTime()!=null&&listacp.get(k).getApplyEndTime()!=null){ + if(date.getTime()>=listacp.get(k).getApplyStartTime().getTime()&&date.getTime()<=listacp.get(k).getApplyEndTime().getTime()){ + map2.put("zt","报名"); + } + } + + if(listacp.get(k).getTopicStartTime()!=null&&listacp.get(k).getTopicEndTime()!=null){ + if(date.getTime()>=listacp.get(k).getTopicStartTime().getTime()&&date.getTime()<=listacp.get(k).getTopicEndTime().getTime()){ + map2.put("zt","选题"); + } + } + + if(listacp.get(k).getUploadStartTime()!=null&&listacp.get(k).getUploadEndTime()!=null){ + if(date.getTime()>=listacp.get(k).getUploadStartTime().getTime()&&date.getTime()<=listacp.get(k).getUploadEndTime().getTime()){ + map2.put("zt","上传作品"); + } + } + + if(listacp.get(k).getScoreStartTime()!=null&&listacp.get(k).getScoreEndTime()!=null){ + if(date.getTime()>=listacp.get(k).getScoreStartTime().getTime()&&date.getTime()<=listacp.get(k).getScoreEndTime().getTime()){ + map2.put("zt","评分"); + } + } + + if(listacp.get(k).getScoreEndTime()!=null){ + if(date.getTime()>listacp.get(k).getScoreEndTime().getTime()){ + map2.put("zt","已结束"); + } + } + + xmListMap.add(map2); + } + }else { + for (int o = 0 ; o < listacp.size() ; o++){ + Map map3 = new HashMap<>(); + //项目名称 + map3.put("xmname",listacp.get(o).getObjName()); + //参与形式 + map3.put("cyxs",listacp.get(o).getEntryForm().equals("N") ? "个人":"团队"); + //项目id + map3.put("xmid",listacp.get(o).getId()); + //状态 + Date date = new Date(); + if(listacp.get(o).getApplyStartTime()!=null&&listacp.get(o).getApplyEndTime()!=null){ + if(date.getTime()>=listacp.get(o).getApplyStartTime().getTime()&&date.getTime()<=listacp.get(o).getApplyEndTime().getTime()){ + map3.put("zt","报名"); + } + } + + if(listacp.get(o).getTopicStartTime()!=null&&listacp.get(o).getTopicEndTime()!=null){ + if(date.getTime()>=listacp.get(o).getTopicStartTime().getTime()&&date.getTime()<=listacp.get(o).getTopicEndTime().getTime()){ + map3.put("zt","选题"); + } + } + + if(listacp.get(o).getUploadStartTime()!=null&&listacp.get(o).getUploadEndTime()!=null){ + if(date.getTime()>=listacp.get(o).getUploadStartTime().getTime()&&date.getTime()<=listacp.get(o).getUploadEndTime().getTime()){ + map3.put("zt","上传作品"); + } + } + + if(listacp.get(o).getScoreStartTime()!=null&&listacp.get(o).getScoreEndTime()!=null){ + if(date.getTime()>=listacp.get(o).getScoreStartTime().getTime()&&date.getTime()<=listacp.get(o).getScoreEndTime().getTime()){ + map3.put("zt","评分"); + } + } + + if(listacp.get(o).getScoreEndTime()!=null){ + if(date.getTime()>listacp.get(o).getScoreEndTime().getTime()){ + map3.put("zt","已结束"); + } + } + xmListMap.add(map3); + } + } + map.put("bmbsxm",xmListMap); + int gjj = 0; + int shengj = 0; + int shij = 0; + int xj = 0; + for (int i = 0 ; i < listacp.size() ; i++){ + if(listacp.get(i).getObjLevel().equals("1809121223401168898")){ + //国家 + gjj = gjj+1; + } + if(listacp.get(i).getObjLevel().equals("1809121301201313793")){ + //省 + shengj = shengj+1; + } + if(listacp.get(i).getObjLevel().equals("1809121356582903809")){ + //市 + shij = shij+1; + } + if(listacp.get(i).getObjLevel().equals("1809121454654119937")){ + //校 + xj = xj+1; + } + } + map.put("gjj",gjj); + map.put("shengj",shengj); + map.put("shij",shij); + map.put("xj",xj); + + }else{ + map.put("gjj",0); + map.put("shengj",0); + map.put("shij",0); + map.put("xj",0); + } + //获奖数 + //一等奖数 + AwardPersion awardPersion1 = new AwardPersion(); + QueryWrapper queryWrapperap1 = QueryGenerator.initQueryWrapper(awardPersion1, req.getParameterMap()); + queryWrapperap1.eq("awardsort",1); + queryWrapperap1.eq("studentcode",user.getUsername()); + queryWrapperap1.in(bmbhs.size()!=0,"enroll_code",bmbhs); + List list1 = awardPersionService.list(queryWrapperap1); + map.put("ydjNumber",list1.size()); + //二等奖数 + AwardPersion awardPersion2 = new AwardPersion(); + QueryWrapper queryWrapperap2 = QueryGenerator.initQueryWrapper(awardPersion2, req.getParameterMap()); + queryWrapperap2.eq("awardsort",2); + queryWrapperap2.eq("studentcode",user.getUsername()); + queryWrapperap2.in(bmbhs.size()!=0,"enroll_code",bmbhs); + List list2 = awardPersionService.list(queryWrapperap2); + map.put("edjNumber",list2.size()); + //三等奖数 + AwardPersion awardPersion3 = new AwardPersion(); + QueryWrapper queryWrapperap3 = QueryGenerator.initQueryWrapper(awardPersion3, req.getParameterMap()); + queryWrapperap3.eq("awardsort",3); + queryWrapperap3.eq("studentcode",user.getUsername()); + queryWrapperap3.in(bmbhs.size()!=0,"enroll_code",bmbhs); + List list3 = awardPersionService.list(queryWrapperap3); + map.put("sdjNumber",list3.size()); + //四等奖数 + AwardPersion awardPersion4 = new AwardPersion(); + QueryWrapper queryWrapperap4 = QueryGenerator.initQueryWrapper(awardPersion4, req.getParameterMap()); + queryWrapperap4.eq("awardsort",4); + queryWrapperap4.eq("studentcode",user.getUsername()); + queryWrapperap4.in(bmbhs.size()!=0,"enroll_code",bmbhs); + List list4 = awardPersionService.list(queryWrapperap4); + map.put("sidjNumber",list4.size()); + //五等奖数 + AwardPersion awardPersion5 = new AwardPersion(); + QueryWrapper queryWrapperap5 = QueryGenerator.initQueryWrapper(awardPersion5, req.getParameterMap()); + queryWrapperap5.eq("awardsort",5); + queryWrapperap5.eq("studentcode",user.getUsername()); + queryWrapperap5.in(bmbhs.size()!=0,"enroll_code",bmbhs); + List list5 = awardPersionService.list(queryWrapperap5); + map.put("wdjNumber",list5.size()); + //所有奖项(前六条) + AwardPersion awardPersionAll = new AwardPersion(); + QueryWrapper queryWrapperapAll = QueryGenerator.initQueryWrapper(awardPersionAll, req.getParameterMap()); + queryWrapperapAll.eq("studentcode",user.getUsername()); + queryWrapperapAll.in(bmbhs.size()!=0,"enroll_code",bmbhs); + List listAll = awardPersionService.list(queryWrapperapAll); + List> allApListMap = new ArrayList<>(); + if(listAll.size()>6){ + for (int y = 0 ; y < 6; y++){ + Map mapall1 = new HashMap<>(); + mapall1.put("jxname",listAll.get(y).getAwardname()); + mapall1.put("ndbs",annualCompService.getById(listAll.get(y).getAnnalComp()).getName()); + mapall1.put("ndbsxm",annualCompPointService.getById(listAll.get(y).getAnnualCompP()).getObjName()); + QueryWrapper queryWrapperpcs = new QueryWrapper<>(); + queryWrapperpcs.eq("annual_comp_id",listAll.get(y).getAnnalComp()); + queryWrapperpcs.eq("annual_comp_p",listAll.get(y).getAnnualCompP()); + queryWrapperpcs.eq("work_on",user.getUsername()); + List listpcs = personalCompScoreService.list(queryWrapperpcs); + if(listpcs.size()==0){ + mapall1.put("jf",0); + }else { + mapall1.put("jf",listpcs.get(0).getScore()); + } + allApListMap.add(mapall1); + + } + }else{ + for (int n = 0 ; n < listAll.size(); n++){ + Map mapall2 = new HashMap<>(); + mapall2.put("jxname",listAll.get(n).getAwardname()); + mapall2.put("ndbs",annualCompService.getById(listAll.get(n).getAnnalComp()).getName()); + mapall2.put("ndbsxm",annualCompPointService.getById(listAll.get(n).getAnnualCompP()).getObjName()); + + QueryWrapper queryWrapperlist = new QueryWrapper<>(); + queryWrapperlist.eq("enroll_code",listAll.get(n).getEnrollCode()); + List listdw = annualCompetitionProjectRegistrationService.list(queryWrapperlist); + if(listdw.size()>0){ + mapall2.put("dwname",listdw.get(0).getTeamName()); + }else { + mapall2.put("dwname","暂无数据"); + } + QueryWrapper queryWrapperpcs = new QueryWrapper<>(); + queryWrapperpcs.eq("annual_comp_id",listAll.get(n).getAnnalComp()); + queryWrapperpcs.eq("annual_comp_p",listAll.get(n).getAnnualCompP()); + queryWrapperpcs.eq("work_on",user.getUsername()); + List listpcs = personalCompScoreService.list(queryWrapperpcs); + if(listpcs.size()==0){ + mapall2.put("jf",0); + }else { + mapall2.put("jf",listpcs.get(0).getScore()); + } + allApListMap.add(mapall2); + } + } + map.put("allApList",allApListMap); + } + + + return Result.OK(map); + } + public List getZXAnnualComp(HttpServletRequest req) {