diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java index 75de9765..34860de7 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java @@ -513,6 +513,9 @@ public class AnnualCompPointController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap()); queryWrapper.eq("annucompid",id); List list = annualCompAwardService.list(queryWrapper); + if(list.size()==0){ + return Result.error("未设置年度比赛奖项!"); + } QueryWrapper queryWrappersp = new QueryWrapper<>(); queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); @@ -538,7 +541,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getUsername()); + awardPersion.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion); } } @@ -561,7 +564,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getUsername()); + awardPersion.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion); } } @@ -585,7 +588,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getUsername()); + awardPersion.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion); } } @@ -610,7 +613,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getUsername()); + awardPersion.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion); } } @@ -636,7 +639,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion.setStudentname(sysUser.getRealname()); - awardPersion.setStudentcode(sysUser.getUsername()); + awardPersion.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion); } } @@ -656,6 +659,13 @@ public class AnnualCompPointController extends JeecgController cxhq(@RequestBody AwardPersion awardPersion,HttpServletRequest req) { + AnnualCompAward annualCompAward = new AnnualCompAward(); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap()); + queryWrapper.eq("annucompid",awardPersion.getAnnualCompP()); + List list = annualCompAwardService.list(queryWrapper); + if(list.size()==0){ + return Result.error("未设置年度比赛奖项!"); + } AwardPersion awardPersionqw = new AwardPersion(); QueryWrapper queryWrapperap = QueryGenerator.initQueryWrapper(awardPersionqw, req.getParameterMap()); queryWrapperap.eq("annualid",awardPersion.getAnnualid()); @@ -668,10 +678,6 @@ public class AnnualCompPointController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(annualCompAward, req.getParameterMap()); - queryWrapper.eq("annucompid",awardPersion.getAnnualCompP()); - List list = annualCompAwardService.list(queryWrapper); QueryWrapper queryWrappersp = new QueryWrapper<>(); queryWrappersp.eq("annualid",annualCompService.getById(annualCompPoint.getAnnualCompId()).getAnnualid()); queryWrappersp.eq("annual_compid",annualCompPoint.getAnnualCompId()); @@ -698,7 +704,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getUsername()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion1); } @@ -724,7 +730,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getUsername()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion1); } } @@ -750,7 +756,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getUsername()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion1); } } @@ -777,7 +783,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getUsername()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion1); } } @@ -805,7 +811,7 @@ public class AnnualCompPointController extends JeecgController listtm = teamManagementService.list(queryWrappertm); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); awardPersion1.setStudentname(sysUser.getRealname()); - awardPersion1.setStudentcode(sysUser.getUsername()); + awardPersion1.setStudentcode(sysUser.getWorkNo()); awardPersionService.save(awardPersion1); } } 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 05725349..05841c76 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 @@ -1196,7 +1196,7 @@ public class AnnualCompetitionProjectRegistrationController { SysDepart depart = sysDepartService.query().eq("id", userDeparts.get(0).getDepId()).one(); Map map4 = new HashMap<>(); map4.put("name", sysUser.getRealname()); - map4.put("xh", sysUser.getUsername()); + map4.put("xh", sysUser.getWorkNo()); map4.put("szyx", depart.getDepartName()); bmxsxxListMap.add(map4); } @@ -1208,7 +1208,7 @@ public class AnnualCompetitionProjectRegistrationController { SysDepart depart = sysDepartService.query().eq("id", userDeparts.get(0).getDepId()).one(); Map map5 = new HashMap<>(); map5.put("name", sysUser.getRealname()); - map5.put("xh", sysUser.getUsername()); + map5.put("xh", sysUser.getWorkNo()); map5.put("szyx", depart.getDepartName()); bmxsxxListMap.add(map5); } @@ -1234,6 +1234,7 @@ public class AnnualCompetitionProjectRegistrationController { public Result xssybsjs( HttpServletRequest req) { //获取当前登录用户 LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String wonk = sysUserService.getById(user.getId()).getWorkNo(); TeamManagement teamManagement = new TeamManagement(); QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); queryWrappertm.eq("user_id",user.getId()); @@ -1382,8 +1383,9 @@ public class AnnualCompetitionProjectRegistrationController { map.put("xj",0); } //获奖数 + QueryWrapper queryWrapperaphj = new QueryWrapper<>(); - queryWrapperaphj.eq("studentcode",user.getUsername()); + queryWrapperaphj.eq("studentcode",wonk); queryWrapperaphj.in(bmbhs.size()!=0,"enroll_code",bmbhs); List listhj = awardPersionService.list(queryWrapperaphj); map.put("hjNumber",listhj.size()); @@ -1391,7 +1393,7 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion1 = new AwardPersion(); QueryWrapper queryWrapperap1 = QueryGenerator.initQueryWrapper(awardPersion1, req.getParameterMap()); queryWrapperap1.eq("awardsort",1); - queryWrapperap1.eq("studentcode",user.getUsername()); + queryWrapperap1.eq("studentcode",wonk); queryWrapperap1.in(bmbhs.size()!=0,"enroll_code",bmbhs); List list1 = awardPersionService.list(queryWrapperap1); map.put("ydjNumber",list1.size()); @@ -1399,7 +1401,7 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion2 = new AwardPersion(); QueryWrapper queryWrapperap2 = QueryGenerator.initQueryWrapper(awardPersion2, req.getParameterMap()); queryWrapperap2.eq("awardsort",2); - queryWrapperap2.eq("studentcode",user.getUsername()); + queryWrapperap2.eq("studentcode",wonk); queryWrapperap2.in(bmbhs.size()!=0,"enroll_code",bmbhs); List list2 = awardPersionService.list(queryWrapperap2); map.put("edjNumber",list2.size()); @@ -1407,7 +1409,7 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion3 = new AwardPersion(); QueryWrapper queryWrapperap3 = QueryGenerator.initQueryWrapper(awardPersion3, req.getParameterMap()); queryWrapperap3.eq("awardsort",3); - queryWrapperap3.eq("studentcode",user.getUsername()); + queryWrapperap3.eq("studentcode",wonk); queryWrapperap3.in(bmbhs.size()!=0,"enroll_code",bmbhs); List list3 = awardPersionService.list(queryWrapperap3); map.put("sdjNumber",list3.size()); @@ -1415,7 +1417,7 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion4 = new AwardPersion(); QueryWrapper queryWrapperap4 = QueryGenerator.initQueryWrapper(awardPersion4, req.getParameterMap()); queryWrapperap4.eq("awardsort",4); - queryWrapperap4.eq("studentcode",user.getUsername()); + queryWrapperap4.eq("studentcode",wonk); queryWrapperap4.in(bmbhs.size()!=0,"enroll_code",bmbhs); List list4 = awardPersionService.list(queryWrapperap4); map.put("sidjNumber",list4.size()); @@ -1423,14 +1425,14 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion5 = new AwardPersion(); QueryWrapper queryWrapperap5 = QueryGenerator.initQueryWrapper(awardPersion5, req.getParameterMap()); queryWrapperap5.eq("awardsort",5); - queryWrapperap5.eq("studentcode",user.getUsername()); + queryWrapperap5.eq("studentcode",wonk); 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.eq("studentcode",wonk); queryWrapperapAll.in(bmbhs.size()!=0,"enroll_code",bmbhs); List listAll = awardPersionService.list(queryWrapperapAll); List> allApListMap = new ArrayList<>(); @@ -1443,7 +1445,7 @@ public class AnnualCompetitionProjectRegistrationController { 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()); + queryWrapperpcs.eq("work_on",wonk); List listpcs = personalCompScoreService.list(queryWrapperpcs); if(listpcs.size()==0){ mapall1.put("jf",0); @@ -1462,7 +1464,7 @@ public class AnnualCompetitionProjectRegistrationController { 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()); + queryWrapperpcs.eq("work_on",wonk); List listpcs = personalCompScoreService.list(queryWrapperpcs); if(listpcs.size()==0){ mapall2.put("jf",0); @@ -1490,6 +1492,7 @@ public class AnnualCompetitionProjectRegistrationController { public Result xsfxbg( HttpServletRequest req) { //获取当前登录用户 LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String wonk = sysUserService.getById(user.getId()).getWorkNo(); TeamManagement teamManagement = new TeamManagement(); QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); queryWrappertm.eq("user_id",user.getId()); @@ -1643,7 +1646,7 @@ public class AnnualCompetitionProjectRegistrationController { } //获奖数 QueryWrapper queryWrapperaphj = new QueryWrapper<>(); - queryWrapperaphj.eq("studentcode",user.getUsername()); + queryWrapperaphj.eq("studentcode",wonk); queryWrapperaphj.in(bmbhs.size()!=0,"enroll_code",bmbhs); List listhj = awardPersionService.list(queryWrapperaphj); map.put("hjNumber",listhj.size()); @@ -1651,7 +1654,7 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion1 = new AwardPersion(); QueryWrapper queryWrapperap1 = QueryGenerator.initQueryWrapper(awardPersion1, req.getParameterMap()); queryWrapperap1.eq("awardsort",1); - queryWrapperap1.eq("studentcode",user.getUsername()); + queryWrapperap1.eq("studentcode",wonk); queryWrapperap1.in(bmbhs.size()!=0,"enroll_code",bmbhs); List list1 = awardPersionService.list(queryWrapperap1); map.put("ydjNumber",list1.size()); @@ -1659,7 +1662,7 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion2 = new AwardPersion(); QueryWrapper queryWrapperap2 = QueryGenerator.initQueryWrapper(awardPersion2, req.getParameterMap()); queryWrapperap2.eq("awardsort",2); - queryWrapperap2.eq("studentcode",user.getUsername()); + queryWrapperap2.eq("studentcode",wonk); queryWrapperap2.in(bmbhs.size()!=0,"enroll_code",bmbhs); List list2 = awardPersionService.list(queryWrapperap2); map.put("edjNumber",list2.size()); @@ -1667,7 +1670,7 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion3 = new AwardPersion(); QueryWrapper queryWrapperap3 = QueryGenerator.initQueryWrapper(awardPersion3, req.getParameterMap()); queryWrapperap3.eq("awardsort",3); - queryWrapperap3.eq("studentcode",user.getUsername()); + queryWrapperap3.eq("studentcode",wonk); queryWrapperap3.in(bmbhs.size()!=0,"enroll_code",bmbhs); List list3 = awardPersionService.list(queryWrapperap3); map.put("sdjNumber",list3.size()); @@ -1675,7 +1678,7 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion4 = new AwardPersion(); QueryWrapper queryWrapperap4 = QueryGenerator.initQueryWrapper(awardPersion4, req.getParameterMap()); queryWrapperap4.eq("awardsort",4); - queryWrapperap4.eq("studentcode",user.getUsername()); + queryWrapperap4.eq("studentcode",wonk); queryWrapperap4.in(bmbhs.size()!=0,"enroll_code",bmbhs); List list4 = awardPersionService.list(queryWrapperap4); map.put("sidjNumber",list4.size()); @@ -1683,14 +1686,14 @@ public class AnnualCompetitionProjectRegistrationController { AwardPersion awardPersion5 = new AwardPersion(); QueryWrapper queryWrapperap5 = QueryGenerator.initQueryWrapper(awardPersion5, req.getParameterMap()); queryWrapperap5.eq("awardsort",5); - queryWrapperap5.eq("studentcode",user.getUsername()); + queryWrapperap5.eq("studentcode",wonk); 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.eq("studentcode",wonk); queryWrapperapAll.in(bmbhs.size()!=0,"enroll_code",bmbhs); List listAll = awardPersionService.list(queryWrapperapAll); List> allApListMap = new ArrayList<>(); @@ -1702,6 +1705,7 @@ public class AnnualCompetitionProjectRegistrationController { mapall1.put("ndbsxm",annualCompPointService.getById(listAll.get(y).getAnnualCompP()).getObjName()); QueryWrapper queryWrapperlist = new QueryWrapper<>(); queryWrapperlist.eq("enroll_code",listAll.get(y).getEnrollCode()); + queryWrapperlist.eq("enroll_static", "2"); List listdw = annualCompetitionProjectRegistrationService.list(queryWrapperlist); if(listdw.size()>0){ mapall1.put("dwname",listdw.get(0).getTeamName()); @@ -1711,7 +1715,7 @@ public class AnnualCompetitionProjectRegistrationController { 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()); + queryWrapperpcs.eq("work_on",wonk); List listpcs = personalCompScoreService.list(queryWrapperpcs); if(listpcs.size()==0){ mapall1.put("jf",0); @@ -1729,6 +1733,7 @@ public class AnnualCompetitionProjectRegistrationController { mapall2.put("ndbsxm",annualCompPointService.getById(listAll.get(n).getAnnualCompP()).getObjName()); QueryWrapper queryWrapperlist = new QueryWrapper<>(); queryWrapperlist.eq("enroll_code",listAll.get(n).getEnrollCode()); + queryWrapperlist.eq("enroll_static", "2"); List listdw = annualCompetitionProjectRegistrationService.list(queryWrapperlist); if(listdw.size()>0){ mapall2.put("dwname",listdw.get(0).getTeamName()); @@ -1738,7 +1743,7 @@ public class AnnualCompetitionProjectRegistrationController { 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()); + queryWrapperpcs.eq("work_on",wonk); List listpcs = personalCompScoreService.list(queryWrapperpcs); if(listpcs.size()==0){ mapall2.put("jf",0); @@ -1756,6 +1761,369 @@ public class AnnualCompetitionProjectRegistrationController { } + /** + * 组委会角色分析报告比赛数据接口 + * + * @param req + * @return + */ + @ApiOperation(value="组委会角色分析报告比赛数据接口", notes="组委会角色分析报告比赛数据接口") + @GetMapping(value = "/zwhfxbg") + public Result zwhfxbg( HttpServletRequest req) { + //获取当前登录用户 最新的年度比赛记录 + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + Comp comp = new Comp(); + QueryWrapper queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); + queryWrappercomp.like("comp_admin", user.getUsername()); + List list = compService.list(queryWrappercomp); + Map map = new HashMap<>(); + if (list.size() > 0) { + List ids = list.stream().map(Comp::getId).collect(Collectors.toList()); + QueryWrapper queryWrapperAnnual = new QueryWrapper<>(); + queryWrapperAnnual.in(ids.size() != 0, "compid", ids); + queryWrapperAnnual.orderByDesc("create_time"); + List annualCompList = annualCompService.list(queryWrapperAnnual); + if (annualCompList.size() > 0) { + //年度比赛名称 + map.put("annualCompName", annualCompList.get(0).getName()); + //共多少届以及当前第几届 + map.put("sum", annualCompList.size()); + + AnnualCompPoint annualCompPoint = new AnnualCompPoint(); + QueryWrapper queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); + queryWrapperacp.eq("annual_comp_id", annualCompList.get(0).getId()); + queryWrapperacp.eq("annual_comp_switch", "Y"); // 比赛必须是开启的 + //queryWrapperacp.orderByDesc("create_time"); + List listacp = annualCompPointService.list(queryWrapperacp); + //比赛项目数 + map.put("bsxmSum", listacp.size()); + //前五条项目名称数据以及对应的报名数 +/* List> xmListMap = new ArrayList<>(); + if (listacp.size() > 5) { + for (int i = 0; i < 5; i++) { + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); + QueryWrapper queryWrapperbm = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + queryWrapperbm.eq("annual_compid", listacp.get(i).getId()); + queryWrapperbm.eq("enroll_static", "2"); + List listbm = annualCompetitionProjectRegistrationService.list(queryWrapperbm); + Map map1 = new HashMap<>(); + map1.put("xmname", listacp.get(i).getObjName()); + map1.put("xmbmrs", listbm.size()); + xmListMap.add(map1); + } + } else { + for (int m = 0; m < listacp.size(); m++) { + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); + QueryWrapper queryWrapperbm = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + queryWrapperbm.eq("annual_compid", listacp.get(m).getId()); + queryWrapperbm.eq("enroll_static", "2"); + List listbm = annualCompetitionProjectRegistrationService.list(queryWrapperbm); + Map map1 = new HashMap<>(); + map1.put("xmname", listacp.get(m).getObjName()); + map1.put("xmbmrs", listbm.size()); + xmListMap.add(map1); + } + } + + + map.put("qwtxmList", xmListMap);*/ + //参加比赛队伍数(报名数) + if(listacp.size()>0){ + List acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); + QueryWrapper queryWrapperbm = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); + queryWrapperbm.in(acpIds.size() != 0, "annual_compid", acpIds); + queryWrapperbm.eq("enroll_static", "2"); + List listbm = annualCompetitionProjectRegistrationService.list(queryWrapperbm); + map.put("bmNumber", listbm.size()); + //参数人数 + if (listbm.size() == 0) { + map.put("csNumber", 0); + map.put("ydjNumber", 0); + map.put("edjNumber", 0); + map.put("sdjNumber", 0); + map.put("sidjNumber", 0); + map.put("wdjNumber", 0); + } else { + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + List bmbhs = listbm.stream().map(AnnualCompetitionProjectRegistration::getEnrollCode).collect(Collectors.toList()); + queryWrappertm.in(bmbhs.size() != 0, "enroll_code", bmbhs); + List listtm = teamManagementService.list(queryWrappertm); + map.put("csNumber", listtm.size()); + /* //一等奖人数 + AwardPersion awardPersion1 = new AwardPersion(); + QueryWrapper queryWrapperap1 = QueryGenerator.initQueryWrapper(awardPersion1, req.getParameterMap()); + queryWrapperap1.eq("awardsort", 1); + 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.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.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.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.in(bmbhs.size() != 0, "enroll_code", bmbhs); + List list5 = awardPersionService.list(queryWrapperap5); + map.put("wdjNumber", list5.size());*/ + } + //参赛院系用到的list + List listcs = new ArrayList<>(); + //个人赛人数 + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration1 = new AnnualCompetitionProjectRegistration(); + QueryWrapper queryWrapperbm1 = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration1, req.getParameterMap()); + queryWrapperbm1.in(acpIds.size() != 0, "annual_compid", acpIds); + queryWrapperbm1.eq("enroll_static", "2"); + queryWrapperbm1.eq("entry_format", "0"); + List listbm1 = annualCompetitionProjectRegistrationService.list(queryWrapperbm1); + if (listbm1.size() == 0) { + map.put("grsNumber", 0); + } else { + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + List bmbhs = listbm1.stream().map(AnnualCompetitionProjectRegistration::getEnrollCode).collect(Collectors.toList()); + queryWrappertm.in(bmbhs.size() != 0, "enroll_code", bmbhs); + List listtm = teamManagementService.list(queryWrappertm); + map.put("grsNumber", listtm.size()); + listcs.addAll(listtm); + } + //团队赛人数 + AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration2 = new AnnualCompetitionProjectRegistration(); + QueryWrapper queryWrapperbm2 = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration2, req.getParameterMap()); + queryWrapperbm2.in(acpIds.size() != 0, "annual_compid", acpIds); + queryWrapperbm2.eq("enroll_static", "2"); + queryWrapperbm2.eq("entry_format", "1"); + List listbm2 = annualCompetitionProjectRegistrationService.list(queryWrapperbm2); + if (listbm2.size() == 0) { + map.put("tdsNumber", 0); + } else { + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + List bmbhs = listbm2.stream().map(AnnualCompetitionProjectRegistration::getEnrollCode).collect(Collectors.toList()); + queryWrappertm.in(bmbhs.size() != 0, "enroll_code", bmbhs); + List listtm = teamManagementService.list(queryWrappertm); + map.put("tdsNumber", listtm.size()); + //查只是队长的用户id + queryWrappertm.eq("captain", "1"); + List listdz = teamManagementService.list(queryWrappertm); + listcs.addAll(listdz); + } + //参赛院系人数排名(只取前六条) + if (listcs.size() == 0) { + map.put("csyxbmpm", new ArrayList<>()); + map.put("bmxsxxList", new ArrayList<>()); + } else { + //拿到所有的userid + List userIds = listcs.stream().map(TeamManagement::getUserId).collect(Collectors.toList()); + QueryWrapper queryWrappersud = new QueryWrapper<>(); + queryWrappersud.select("dep_id,COUNT(*) as user_id"); + queryWrappersud.in("user_id", userIds); + queryWrappersud.groupBy("dep_id"); + queryWrappersud.orderByDesc("COUNT(*)"); + List listsud = sysUserDepartService.list(queryWrappersud); + List> csyxpmListMap = new ArrayList<>(); + if (listsud.size() > 6) { + for (int o = 0; o < 6; o++) { + Map map2 = new HashMap<>(); + map2.put("pm", o + 1); + map2.put("csyxid", listsud.get(o).getDepId()); + SysDepart depart = sysDepartService.query().eq("id", listsud.get(o).getDepId()).one(); + map2.put("csyxname", depart.getDepartName()); + map2.put("bms", listsud.get(o).getUserId()); + csyxpmListMap.add(map2); + } + map.put("csyxbmpm", csyxpmListMap); + } else { + for (int u = 0; u < listsud.size(); u++) { + Map map3 = new HashMap<>(); + map3.put("pm", u + 1); + map3.put("csyxid", listsud.get(u).getDepId()); + SysDepart depart = sysDepartService.query().eq("id", listsud.get(u).getDepId()).one(); + map3.put("csyxname", depart.getDepartName()); + map3.put("bms", listsud.get(u).getUserId()); + csyxpmListMap.add(map3); + } + map.put("csyxbmpm", csyxpmListMap); + } + //报名学生列表(只取前六条) + //根据userIds查询出六个学生信息 +/* List> bmxsxxListMap = new ArrayList<>(); + if (userIds.size() > 6) { + for (int p = 0; p < 6; p++) { + List userDeparts = sysUserDepartService.query().eq("user_id", userIds.get(p)).list(); + SysUser sysUser = sysUserService.query().eq("id", userIds.get(p)).one(); + SysDepart depart = sysDepartService.query().eq("id", userDeparts.get(0).getDepId()).one(); + Map map4 = new HashMap<>(); + map4.put("name", sysUser.getRealname()); + map4.put("xh", sysUser.getUsername()); + map4.put("szyx", depart.getDepartName()); + bmxsxxListMap.add(map4); + } + map.put("bmxsxxList", bmxsxxListMap); + } else { + for (int a = 0; a < userIds.size(); a++) { + List userDeparts = sysUserDepartService.query().eq("user_id", userIds.get(a)).list(); + SysUser sysUser = sysUserService.query().eq("id", userIds.get(a)).one(); + SysDepart depart = sysDepartService.query().eq("id", userDeparts.get(0).getDepId()).one(); + Map map5 = new HashMap<>(); + map5.put("name", sysUser.getRealname()); + map5.put("xh", sysUser.getUsername()); + map5.put("szyx", depart.getDepartName()); + bmxsxxListMap.add(map5); + } + map.put("bmxsxxList", bmxsxxListMap); + }*/ + } + + AwardPersion awardPersionAll = new AwardPersion(); + QueryWrapper queryWrapperapAll = QueryGenerator.initQueryWrapper(awardPersionAll, req.getParameterMap()); + queryWrapperapAll.in(acpIds.size()!=0,"annual_comp_p",acpIds); + List listAll = awardPersionService.list(queryWrapperapAll); + List> allApListMap = new ArrayList<>(); + if(listAll.size()>7){ + for (int y = 0 ; y < 7; 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 queryWrapperlist = new QueryWrapper<>(); + queryWrapperlist.eq("enroll_code",listAll.get(y).getEnrollCode()); + queryWrapperlist.eq("enroll_static", "2"); + List listdw = annualCompetitionProjectRegistrationService.list(queryWrapperlist); + if(listdw.size()>0){ + mapall1.put("dwname",listdw.get(0).getTeamName()); + if(listdw.get(0).getEntryFormat().equals("0")){ + //个人 + QueryWrapper queryWrappertm1 = new QueryWrapper<>(); + queryWrappertm1.eq( "enroll_code", listAll.get(y).getEnrollCode()); + List listtm1 = teamManagementService.list(queryWrappertm1); + if(listtm1.size()>0){ + String wn = sysUserService.getById(listtm1.get(0).getUserId()).getWorkNo(); + 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",wn); + List listpcs = personalCompScoreService.list(queryWrapperpcs); + if(listpcs.size()==0){ + mapall1.put("jf",0); + }else { + mapall1.put("jf",listpcs.get(0).getScore()); + } + } + }else { + //团队 积分这块只统计队长的积分 + QueryWrapper queryWrappertm2 = new QueryWrapper<>(); + queryWrappertm2.eq( "enroll_code", listAll.get(y).getEnrollCode()); + queryWrappertm2.eq("captain", "1"); + List listtm2 = teamManagementService.list(queryWrappertm2); + if(listtm2.size()>0){ + String wn2 = sysUserService.getById(listtm2.get(0).getUserId()).getWorkNo(); + 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",wn2); + List listpcs = personalCompScoreService.list(queryWrapperpcs); + if(listpcs.size()==0){ + mapall1.put("jf",0); + }else { + mapall1.put("jf",listpcs.get(0).getScore()); + } + } + } + }else { + mapall1.put("jf",0); + mapall1.put("dwname","暂无数据"); + } + + 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()); + queryWrapperlist.eq("enroll_static", "2"); + List listdw = annualCompetitionProjectRegistrationService.list(queryWrapperlist); + if(listdw.size()>0){ + mapall2.put("dwname",listdw.get(0).getTeamName()); + if(listdw.get(0).getEntryFormat().equals("0")){ + //个人 + QueryWrapper queryWrappertm1 = new QueryWrapper<>(); + queryWrappertm1.eq( "enroll_code", listAll.get(n).getEnrollCode()); + List listtm1 = teamManagementService.list(queryWrappertm1); + if(listtm1.size()>0){ + String wn = sysUserService.getById(listtm1.get(0).getUserId()).getWorkNo(); + 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",wn); + List listpcs = personalCompScoreService.list(queryWrapperpcs); + if(listpcs.size()==0){ + mapall2.put("jf",0); + }else { + mapall2.put("jf",listpcs.get(0).getScore()); + } + } + }else { + //团队 积分这块只统计队长的积分 + QueryWrapper queryWrappertm2 = new QueryWrapper<>(); + queryWrappertm2.eq( "enroll_code", listAll.get(n).getEnrollCode()); + queryWrappertm2.eq("captain", "1"); + List listtm2 = teamManagementService.list(queryWrappertm2); + if(listtm2.size()>0){ + String wn2 = sysUserService.getById(listtm2.get(0).getUserId()).getWorkNo(); + 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",wn2); + List listpcs = personalCompScoreService.list(queryWrapperpcs); + if(listpcs.size()==0){ + mapall2.put("jf",0); + }else { + mapall2.put("jf",listpcs.get(0).getScore()); + } + } + } + }else { + mapall2.put("jf",0); + mapall2.put("dwname","暂无数据"); + } + allApListMap.add(mapall2); + } + } + map.put("allApList",allApListMap); + } + } + } + + return Result.OK(map); + } + + public List getZXAnnualComp(HttpServletRequest req) { LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java index 50f5bf2c..6ea35bca 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java @@ -340,13 +340,12 @@ public class ExpertController extends JeecgController { expert.setExpYjfx(expYjfx);//研究方向 expert.setExpCsgz(expCsgz);//从事工作 expertService.save(expert); - /* CompExp compExp = new CompExp(); compExp.setCompid(compid); compExp.setCompName(compName); compExp.setExpid(expert.getId()); compExp.setStat(stat); - compExpService.save(compExp);*/ + compExpService.save(compExp); result.success("添加成功!"); } catch (Exception e) { log.error(e.getMessage(), e); @@ -408,7 +407,7 @@ public class ExpertController extends JeecgController { expert.setExpCsgz(expCsgz);//从事工作 expertService.updateById(expert); - /* CompExp compExp = new CompExp(); + CompExp compExp = new CompExp(); QueryWrapper queryWrapper1 = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap()); queryWrapper1.eq("expid",expert.getId()); List listce = compExpService.list(queryWrapper1); @@ -417,7 +416,7 @@ public class ExpertController extends JeecgController { compExp.setCompName(compName); compExp.setExpid(expert.getId()); compExp.setStat(stat); - compExpService.updateById(compExp);*/ + compExpService.updateById(compExp); result.success("修改成功!"); } } catch (Exception e) { diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java index 27e9b535..b2c57051 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/topic/controller/TopicController.java @@ -336,9 +336,12 @@ public class TopicController extends JeecgController { QueryWrapper queryWrapper= new QueryWrapper<>(); queryWrapper.eq("annual_compid",topic.getAnnualCompid()).eq("number",topic.getNumber()); Topic one = topicService.getOne(queryWrapper); - if (!Objects.equals(one.getId(), topic.getId())){ - return Result.error("编码重复"); - } + if(one!=null){ + if (!Objects.equals(one.getId(), topic.getId())){ + return Result.error("编码重复"); + } + } + topicService.updateById(topic); return Result.OK("编辑成功!"); } diff --git a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java index 87d2159e..1af4c42d 100644 --- a/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java +++ b/jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java @@ -247,6 +247,13 @@ public class SysUserController { // 保存用户走一个service 保证事务 //获取租户ids String relTenantIds = jsonObject.getString("relTenantIds"); + SysUser sysUser = sysUserService.getUserByPhone(user.getPhone()); + if (sysUser != null) { + result.setMessage("该手机号已注册"); + result.setSuccess(false); + return result; + } + sysUserService.saveUser(user, selectedRoles, selectedDeparts, relTenantIds); baseCommonService.addLog("添加用户,username: " +user.getUsername() ,CommonConstant.LOG_TYPE_2, 2); result.success("添加成功!"); diff --git a/jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.data.ts b/jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.data.ts index cb41ba10..bf2523d5 100644 --- a/jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.data.ts +++ b/jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualComp.data.ts @@ -149,9 +149,12 @@ export const formSchema: FormSchema[] = [ }, { - label: '驳回信息', + label: '反馈信息', field: 'backinfo', component: 'InputTextArea', + dynamicDisabled: ({ values }) => { + return !!values.id; + }, }, // TODO 主键隐藏字段,目前写死为ID { diff --git a/jeecgboot-vue3-master/src/views/comp/Comp.data.ts b/jeecgboot-vue3-master/src/views/comp/Comp.data.ts index 4d4ed48e..ae747eb7 100644 --- a/jeecgboot-vue3-master/src/views/comp/Comp.data.ts +++ b/jeecgboot-vue3-master/src/views/comp/Comp.data.ts @@ -30,12 +30,12 @@ export const columns: BasicColumn[] = [ dataIndex: 'compImg', customRender: render.renderImage, }, - { +/* { title: '比赛详情', align: 'center', dataIndex: 'compDetail', slots: { customRender: 'htmlSlot' }, - }, + },*/ { title: '比赛介绍文件', align: 'center', diff --git a/jeecgboot-vue3-master/src/views/scorepersion/ScorePersionList.vue b/jeecgboot-vue3-master/src/views/scorepersion/ScorePersionList.vue index efafe706..9e3584ee 100644 --- a/jeecgboot-vue3-master/src/views/scorepersion/ScorePersionList.vue +++ b/jeecgboot-vue3-master/src/views/scorepersion/ScorePersionList.vue @@ -105,7 +105,7 @@ canResize:false, useSearchForm: false, actionColumn: { - width: 120, + width: 160, fixed: 'right', }, beforeFetch: (params) => { diff --git a/jeecgboot-vue3-master/src/views/scorestapoint/ScoreStaPointList.vue b/jeecgboot-vue3-master/src/views/scorestapoint/ScoreStaPointList.vue index c45df8f8..9e4427e0 100644 --- a/jeecgboot-vue3-master/src/views/scorestapoint/ScoreStaPointList.vue +++ b/jeecgboot-vue3-master/src/views/scorestapoint/ScoreStaPointList.vue @@ -73,7 +73,7 @@ canResize:false, useSearchForm: false, actionColumn: { - width: 120, + width: 160, fixed: 'right', }, beforeFetch: (params) => { diff --git a/jeecgboot-vue3-master/src/views/scorestapointd/ScoreStaPointDList.vue b/jeecgboot-vue3-master/src/views/scorestapointd/ScoreStaPointDList.vue index 7839e487..e82904da 100644 --- a/jeecgboot-vue3-master/src/views/scorestapointd/ScoreStaPointDList.vue +++ b/jeecgboot-vue3-master/src/views/scorestapointd/ScoreStaPointDList.vue @@ -78,7 +78,7 @@ canResize:false, useSearchForm: false, actionColumn: { - width: 120, + width: 160, fixed: 'right', }, beforeFetch: (params) => { diff --git a/jeecgboot-vue3-master/src/views/topic/Topic.data.ts b/jeecgboot-vue3-master/src/views/topic/Topic.data.ts index 32ffc75c..4584789c 100644 --- a/jeecgboot-vue3-master/src/views/topic/Topic.data.ts +++ b/jeecgboot-vue3-master/src/views/topic/Topic.data.ts @@ -70,11 +70,11 @@ export const formSchema: FormSchema[] = [ multi:true } }, - dynamicRules: ({model,schema}) => { +/* dynamicRules: ({model,schema}) => { return [ - { required: true, message: '请输入年度比赛项目id!'}, + { required: true, message: '请选择年度比赛项目!'}, ]; - }, + },*/ }, { label: '题目编号',