|
|
|
@ -18,6 +18,8 @@ import org.jeecg.common.util.oConvertUtils; |
|
|
|
|
import org.jeecg.modules.demo.annual.service.IAnnualService; |
|
|
|
|
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; |
|
|
|
|
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; |
|
|
|
|
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore; |
|
|
|
|
import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService; |
|
|
|
|
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; |
|
|
|
|
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; |
|
|
|
|
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; |
|
|
|
@ -92,6 +94,8 @@ public class AnnualCompetitionProjectRegistrationController { |
|
|
|
|
private ICompService compService; |
|
|
|
|
@Autowired |
|
|
|
|
private IAwardPersionService awardPersionService; |
|
|
|
|
@Autowired |
|
|
|
|
private IPersonalCompScoreService personalCompScoreService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -985,13 +989,14 @@ public class AnnualCompetitionProjectRegistrationController { |
|
|
|
|
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); |
|
|
|
|
queryWrappercomp.like("comp_admin", user.getUsername()); |
|
|
|
|
List<Comp> list = compService.list(queryWrappercomp); |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
if (list.size() > 0) { |
|
|
|
|
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList()); |
|
|
|
|
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>(); |
|
|
|
|
queryWrapperAnnual.in(ids.size() != 0, "compid", ids); |
|
|
|
|
queryWrapperAnnual.orderByDesc("create_time"); |
|
|
|
|
List<AnnualComp> annualCompList = annualCompService.list(queryWrapperAnnual); |
|
|
|
|
//List<AnnualComp> annualCompList = getZXAnnualComp(req);
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
if (annualCompList.size() > 0) { |
|
|
|
|
//年度比赛名称
|
|
|
|
|
map.put("annualCompName", annualCompList.get(0).getName()); |
|
|
|
|
//共多少届以及当前第几届
|
|
|
|
@ -1036,6 +1041,7 @@ public class AnnualCompetitionProjectRegistrationController { |
|
|
|
|
|
|
|
|
|
map.put("qwtxmList", xmListMap); |
|
|
|
|
//参加比赛队伍数(报名数)
|
|
|
|
|
if(listacp.size()>0){ |
|
|
|
|
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); |
|
|
|
|
AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); |
|
|
|
|
QueryWrapper<AnnualCompetitionProjectRegistration> queryWrapperbm = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); |
|
|
|
@ -1046,6 +1052,11 @@ public class AnnualCompetitionProjectRegistrationController { |
|
|
|
|
//参数人数
|
|
|
|
|
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<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); |
|
|
|
@ -1195,11 +1206,234 @@ public class AnnualCompetitionProjectRegistrationController { |
|
|
|
|
} |
|
|
|
|
map.put("bmxsxxList", bmxsxxListMap); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return Result.OK(map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 学生角色首页比赛数据接口 |
|
|
|
|
* |
|
|
|
|
* @param req |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value="学生角色首页比赛数据接口", notes="学生角色首页比赛数据接口") |
|
|
|
|
@GetMapping(value = "/xssybsjs") |
|
|
|
|
public Result<?> xssybsjs( HttpServletRequest req) { |
|
|
|
|
//获取当前登录用户
|
|
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
TeamManagement teamManagement = new TeamManagement(); |
|
|
|
|
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); |
|
|
|
|
queryWrappertm.eq("user_id",user.getId()); |
|
|
|
|
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm); |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
if(listtm.size()!=0){ |
|
|
|
|
//学生参加比赛的所有报名编号
|
|
|
|
|
List<String> bmbhs = listtm.stream().map(TeamManagement::getEnrollCode).collect(Collectors.toList()); |
|
|
|
|
//查询报名表报名编号对应的所有年度比赛项目id
|
|
|
|
|
AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration = new AnnualCompetitionProjectRegistration(); |
|
|
|
|
QueryWrapper<AnnualCompetitionProjectRegistration> queryWrapperbm = QueryGenerator.initQueryWrapper(annualCompetitionProjectRegistration, req.getParameterMap()); |
|
|
|
|
queryWrapperbm.in("enroll_code",bmbhs); |
|
|
|
|
queryWrapperbm.eq("enroll_static", "2"); |
|
|
|
|
List<AnnualCompetitionProjectRegistration> listbm = annualCompetitionProjectRegistrationService.list(queryWrapperbm); |
|
|
|
|
//参加比赛项目数量
|
|
|
|
|
map.put("cjbsxmsl",listbm.size()); |
|
|
|
|
|
|
|
|
|
if(listbm.size()!=0){ |
|
|
|
|
//年度比赛项目ids
|
|
|
|
|
List<String> ndbsxmids = listbm.stream().map(AnnualCompetitionProjectRegistration::getAnnualCompid).collect(Collectors.toList()); |
|
|
|
|
AnnualCompPoint annualCompPoint = new AnnualCompPoint(); |
|
|
|
|
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); |
|
|
|
|
queryWrapperacp.in("id",ndbsxmids); |
|
|
|
|
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp); |
|
|
|
|
//报名比赛项目
|
|
|
|
|
List<Map<String,Object>> xmListMap = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
if(listacp.size()>6){ |
|
|
|
|
for (int k = 0 ; k < 6 ; k++){ |
|
|
|
|
Map<String, Object> map2 = new HashMap<>(); |
|
|
|
|
//项目名称
|
|
|
|
|
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(date.getTime()>=listacp.get(k).getApplyStartTime().getTime()&&date.getTime()<=listacp.get(k).getApplyEndTime().getTime()){ |
|
|
|
|
map2.put("zt","报名"); |
|
|
|
|
} |
|
|
|
|
if(date.getTime()>=listacp.get(k).getTopicStartTime().getTime()&&date.getTime()<=listacp.get(k).getTopicEndTime().getTime()){ |
|
|
|
|
map2.put("zt","选题"); |
|
|
|
|
} |
|
|
|
|
if(date.getTime()>=listacp.get(k).getUploadStartTime().getTime()&&date.getTime()<=listacp.get(k).getUploadEndTime().getTime()){ |
|
|
|
|
map2.put("zt","上传作品"); |
|
|
|
|
} |
|
|
|
|
if(date.getTime()>=listacp.get(k).getScoreStartTime().getTime()&&date.getTime()<=listacp.get(k).getScoreEndTime().getTime()){ |
|
|
|
|
map2.put("zt","评分"); |
|
|
|
|
} |
|
|
|
|
if(date.getTime()>listacp.get(k).getScoreEndTime().getTime()){ |
|
|
|
|
map2.put("zt","已结束"); |
|
|
|
|
} |
|
|
|
|
xmListMap.add(map2); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
for (int o = 0 ; o < listacp.size() ; o++){ |
|
|
|
|
Map<String, Object> 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(date.getTime()>=listacp.get(o).getApplyStartTime().getTime()&&date.getTime()<=listacp.get(o).getApplyEndTime().getTime()){ |
|
|
|
|
map3.put("zt","报名"); |
|
|
|
|
} |
|
|
|
|
if(date.getTime()>=listacp.get(o).getTopicStartTime().getTime()&&date.getTime()<=listacp.get(o).getTopicEndTime().getTime()){ |
|
|
|
|
map3.put("zt","选题"); |
|
|
|
|
} |
|
|
|
|
if(date.getTime()>=listacp.get(o).getUploadStartTime().getTime()&&date.getTime()<=listacp.get(o).getUploadEndTime().getTime()){ |
|
|
|
|
map3.put("zt","上传作品"); |
|
|
|
|
} |
|
|
|
|
if(date.getTime()>=listacp.get(o).getScoreStartTime().getTime()&&date.getTime()<=listacp.get(o).getScoreEndTime().getTime()){ |
|
|
|
|
map3.put("zt","评分"); |
|
|
|
|
} |
|
|
|
|
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(map.isEmpty()){ |
|
|
|
|
return Result.error("无可用的比赛项目"); |
|
|
|
|
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<AwardPersion> queryWrapperap1 = QueryGenerator.initQueryWrapper(awardPersion1, req.getParameterMap()); |
|
|
|
|
queryWrapperap1.eq("awardsort",1); |
|
|
|
|
queryWrapperap1.eq("studentcode",user.getUsername()); |
|
|
|
|
queryWrapperap1.in(bmbhs.size()!=0,"enroll_code",bmbhs); |
|
|
|
|
List<AwardPersion> list1 = awardPersionService.list(queryWrapperap1); |
|
|
|
|
map.put("ydjNumber",list1.size()); |
|
|
|
|
//二等奖数
|
|
|
|
|
AwardPersion awardPersion2 = new AwardPersion(); |
|
|
|
|
QueryWrapper<AwardPersion> queryWrapperap2 = QueryGenerator.initQueryWrapper(awardPersion2, req.getParameterMap()); |
|
|
|
|
queryWrapperap2.eq("awardsort",2); |
|
|
|
|
queryWrapperap2.eq("studentcode",user.getUsername()); |
|
|
|
|
queryWrapperap2.in(bmbhs.size()!=0,"enroll_code",bmbhs); |
|
|
|
|
List<AwardPersion> list2 = awardPersionService.list(queryWrapperap2); |
|
|
|
|
map.put("edjNumber",list2.size()); |
|
|
|
|
//三等奖数
|
|
|
|
|
AwardPersion awardPersion3 = new AwardPersion(); |
|
|
|
|
QueryWrapper<AwardPersion> queryWrapperap3 = QueryGenerator.initQueryWrapper(awardPersion3, req.getParameterMap()); |
|
|
|
|
queryWrapperap3.eq("awardsort",3); |
|
|
|
|
queryWrapperap3.eq("studentcode",user.getUsername()); |
|
|
|
|
queryWrapperap3.in(bmbhs.size()!=0,"enroll_code",bmbhs); |
|
|
|
|
List<AwardPersion> list3 = awardPersionService.list(queryWrapperap3); |
|
|
|
|
map.put("sdjNumber",list3.size()); |
|
|
|
|
//四等奖数
|
|
|
|
|
AwardPersion awardPersion4 = new AwardPersion(); |
|
|
|
|
QueryWrapper<AwardPersion> queryWrapperap4 = QueryGenerator.initQueryWrapper(awardPersion4, req.getParameterMap()); |
|
|
|
|
queryWrapperap4.eq("awardsort",4); |
|
|
|
|
queryWrapperap4.eq("studentcode",user.getUsername()); |
|
|
|
|
queryWrapperap4.in(bmbhs.size()!=0,"enroll_code",bmbhs); |
|
|
|
|
List<AwardPersion> list4 = awardPersionService.list(queryWrapperap4); |
|
|
|
|
map.put("sidjNumber",list4.size()); |
|
|
|
|
//五等奖数
|
|
|
|
|
AwardPersion awardPersion5 = new AwardPersion(); |
|
|
|
|
QueryWrapper<AwardPersion> queryWrapperap5 = QueryGenerator.initQueryWrapper(awardPersion5, req.getParameterMap()); |
|
|
|
|
queryWrapperap5.eq("awardsort",5); |
|
|
|
|
queryWrapperap5.eq("studentcode",user.getUsername()); |
|
|
|
|
queryWrapperap5.in(bmbhs.size()!=0,"enroll_code",bmbhs); |
|
|
|
|
List<AwardPersion> list5 = awardPersionService.list(queryWrapperap5); |
|
|
|
|
map.put("wdjNumber",list5.size()); |
|
|
|
|
//所有奖项(前六条)
|
|
|
|
|
AwardPersion awardPersionAll = new AwardPersion(); |
|
|
|
|
QueryWrapper<AwardPersion> queryWrapperapAll = QueryGenerator.initQueryWrapper(awardPersionAll, req.getParameterMap()); |
|
|
|
|
queryWrapperapAll.eq("studentcode",user.getUsername()); |
|
|
|
|
queryWrapperapAll.in(bmbhs.size()!=0,"enroll_code",bmbhs); |
|
|
|
|
List<AwardPersion> listAll = awardPersionService.list(queryWrapperapAll); |
|
|
|
|
List<Map<String,Object>> allApListMap = new ArrayList<>(); |
|
|
|
|
if(listAll.size()>6){ |
|
|
|
|
for (int y = 0 ; y < 6; y++){ |
|
|
|
|
Map<String, Object> 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<PersonalCompScore> 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<PersonalCompScore> 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<String, Object> 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<PersonalCompScore> 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<PersonalCompScore> 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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|