学生分析报告

main
Gitea 4 months ago
parent ee86ae6a32
commit 25c0358724
  1. 262
      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<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("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<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(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<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<AnnualCompetitionProjectRegistration> queryWrapperlist = new QueryWrapper<>();
queryWrapperlist.eq("enroll_code",listAll.get(n).getEnrollCode());
List<AnnualCompetitionProjectRegistration> listdw = annualCompetitionProjectRegistrationService.list(queryWrapperlist);
if(listdw.size()>0){
mapall2.put("dwname",listdw.get(0).getTeamName());
}else {
mapall2.put("dwname","暂无数据");
}
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);
}
public List<AnnualComp> getZXAnnualComp(HttpServletRequest req) {

Loading…
Cancel
Save