获奖增加学生学号和姓名

main
Gitea 12 months ago
parent e30ef9cf95
commit 4c461b5552
  1. 70
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java
  2. 49
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java
  3. 4
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java

@ -405,6 +405,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion.setAwardname(name1); awardPersion.setAwardname(name1);
awardPersion.setAwardsort(1); awardPersion.setAwardsort(1);
awardPersion.setAwardid(list.get(i).getId()); awardPersion.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion); awardPersionService.save(awardPersion);
} }
} }
@ -421,6 +428,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion.setAwardname(name2); awardPersion.setAwardname(name2);
awardPersion.setAwardsort(2); awardPersion.setAwardsort(2);
awardPersion.setAwardid(list.get(i).getId()); awardPersion.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion); awardPersionService.save(awardPersion);
} }
} }
@ -438,6 +452,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion.setAwardname(name3); awardPersion.setAwardname(name3);
awardPersion.setAwardsort(3); awardPersion.setAwardsort(3);
awardPersion.setAwardid(list.get(i).getId()); awardPersion.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion); awardPersionService.save(awardPersion);
} }
} }
@ -456,6 +477,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion.setAwardname(name4); awardPersion.setAwardname(name4);
awardPersion.setAwardsort(4); awardPersion.setAwardsort(4);
awardPersion.setAwardid(list.get(i).getId()); awardPersion.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion); awardPersionService.save(awardPersion);
} }
} }
@ -475,6 +503,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion.setAwardname(name5); awardPersion.setAwardname(name5);
awardPersion.setAwardsort(5); awardPersion.setAwardsort(5);
awardPersion.setAwardid(list.get(i).getId()); awardPersion.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion); awardPersionService.save(awardPersion);
} }
} }
@ -530,6 +565,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion1.setAwardname(name1); awardPersion1.setAwardname(name1);
awardPersion1.setAwardsort(1); awardPersion1.setAwardsort(1);
awardPersion1.setAwardid(list.get(i).getId()); awardPersion1.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion1); awardPersionService.save(awardPersion1);
} }
} }
@ -546,6 +588,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion1.setAwardname(name2); awardPersion1.setAwardname(name2);
awardPersion1.setAwardsort(2); awardPersion1.setAwardsort(2);
awardPersion1.setAwardid(list.get(i).getId()); awardPersion1.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion1); awardPersionService.save(awardPersion1);
} }
} }
@ -563,6 +612,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion1.setAwardname(name3); awardPersion1.setAwardname(name3);
awardPersion1.setAwardsort(3); awardPersion1.setAwardsort(3);
awardPersion1.setAwardid(list.get(i).getId()); awardPersion1.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion1); awardPersionService.save(awardPersion1);
} }
} }
@ -581,6 +637,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion1.setAwardname(name4); awardPersion1.setAwardname(name4);
awardPersion1.setAwardsort(4); awardPersion1.setAwardsort(4);
awardPersion1.setAwardid(list.get(i).getId()); awardPersion1.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion1); awardPersionService.save(awardPersion1);
} }
} }
@ -600,6 +663,13 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
awardPersion1.setAwardname(name5); awardPersion1.setAwardname(name5);
awardPersion1.setAwardsort(5); awardPersion1.setAwardsort(5);
awardPersion1.setAwardid(list.get(i).getId()); awardPersion1.setAwardid(list.get(i).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",listsp.get(j).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion1); awardPersionService.save(awardPersion1);
} }
} }

@ -128,15 +128,6 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize); Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper); IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
for(int i = 0 ; i < pageList.getRecords().size();i++){
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",pageList.getRecords().get(i).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
pageList.getRecords().get(i).setStudentcode(sysUser.getUsername());
pageList.getRecords().get(i).setStudentname(sysUser.getRealname());
}
return Result.OK(pageList); return Result.OK(pageList);
} }
@ -144,7 +135,7 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
/** /**
* 分页列表查询学生端 * 分页列表查询学生端
* *
* @param awardPersion * @param
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param req * @param req
@ -163,15 +154,6 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
queryWrapper.in("enroll_code",str); queryWrapper.in("enroll_code",str);
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize); Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper); IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
for(int i = 0 ; i < pageList.getRecords().size();i++){
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",pageList.getRecords().get(i).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
pageList.getRecords().get(i).setStudentcode(sysUser.getUsername());
pageList.getRecords().get(i).setStudentname(sysUser.getRealname());
}
return Result.OK(pageList); return Result.OK(pageList);
} }
@ -201,6 +183,13 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
queryWrapper.eq("annucompid",awardPersion.getAnnualCompP()); queryWrapper.eq("annucompid",awardPersion.getAnnualCompP());
List<AnnualCompAward> list = annualCompAwardService.list(queryWrapper); List<AnnualCompAward> list = annualCompAwardService.list(queryWrapper);
awardPersion.setAwardid(list.get(0).getId()); awardPersion.setAwardid(list.get(0).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",awardPersion.getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion); awardPersionService.save(awardPersion);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP()); AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP());
annualCompPoint.setIsPj(1); annualCompPoint.setIsPj(1);
@ -235,6 +224,13 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
queryWrapper.eq("annucompid",awardPersion.getAnnualCompP()); queryWrapper.eq("annucompid",awardPersion.getAnnualCompP());
List<AnnualCompAward> list = annualCompAwardService.list(queryWrapper); List<AnnualCompAward> list = annualCompAwardService.list(queryWrapper);
awardPersion.setAwardid(list.get(0).getId()); awardPersion.setAwardid(list.get(0).getId());
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",awardPersion.getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.updateById(awardPersion); awardPersionService.updateById(awardPersion);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
@ -420,21 +416,36 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
QueryWrapper<AnnualCompAward> queryWrapperaca = QueryGenerator.initQueryWrapper(annualCompAward, request.getParameterMap()); QueryWrapper<AnnualCompAward> queryWrapperaca = QueryGenerator.initQueryWrapper(annualCompAward, request.getParameterMap());
queryWrapperaca.eq("annucompid",list.get(i).getAnnualCompP()); queryWrapperaca.eq("annucompid",list.get(i).getAnnualCompP());
List<AnnualCompAward> listaca = annualCompAwardService.list(queryWrapperaca); List<AnnualCompAward> listaca = annualCompAwardService.list(queryWrapperaca);
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, request.getParameterMap());
queryWrappertm.eq("enroll_code",list.get(i).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){ if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1); list.get(i).setAwardsort(1);
list.get(i).setAwardid(listaca.get(0).getId()); list.get(i).setAwardid(listaca.get(0).getId());
list.get(i).setStudentcode(sysUser.getUsername());
list.get(i).setStudentname(sysUser.getRealname());
}else if(listaca.get(0).getSecondPrize().equals(list.get(i).getAwardname())){ }else if(listaca.get(0).getSecondPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(2); list.get(i).setAwardsort(2);
list.get(i).setAwardid(listaca.get(0).getId()); list.get(i).setAwardid(listaca.get(0).getId());
list.get(i).setStudentcode(sysUser.getUsername());
list.get(i).setStudentname(sysUser.getRealname());
}else if(listaca.get(0).getThirdPrize().equals(list.get(i).getAwardname())){ }else if(listaca.get(0).getThirdPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(3); list.get(i).setAwardsort(3);
list.get(i).setAwardid(listaca.get(0).getId()); list.get(i).setAwardid(listaca.get(0).getId());
list.get(i).setStudentcode(sysUser.getUsername());
list.get(i).setStudentname(sysUser.getRealname());
}else if(listaca.get(0).getFourthPrize().equals(list.get(i).getAwardname())){ }else if(listaca.get(0).getFourthPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(4); list.get(i).setAwardsort(4);
list.get(i).setAwardid(listaca.get(0).getId()); list.get(i).setAwardid(listaca.get(0).getId());
list.get(i).setStudentcode(sysUser.getUsername());
list.get(i).setStudentname(sysUser.getRealname());
}else if(listaca.get(0).getFifthPrize().equals(list.get(i).getAwardname())){ }else if(listaca.get(0).getFifthPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(5); list.get(i).setAwardsort(5);
list.get(i).setAwardid(listaca.get(0).getId()); list.get(i).setAwardid(listaca.get(0).getId());
list.get(i).setStudentcode(sysUser.getUsername());
list.get(i).setStudentname(sysUser.getRealname());
}else { }else {
return Result.error("文件导入失败:第"+(i+1)+"行奖项名称不存在"); return Result.error("文件导入失败:第"+(i+1)+"行奖项名称不存在");
} }

@ -91,10 +91,10 @@ public class AwardPersion implements Serializable {
private java.lang.String awardid; private java.lang.String awardid;
/**学生姓名*/ /**学生姓名*/
@Excel(name = "学生姓名", width = 15) @Excel(name = "学生姓名", width = 15)
@TableField(exist = false) @ApiModelProperty(value = "学生姓名")
private String studentname; private String studentname;
/**学生学号*/ /**学生学号*/
@Excel(name = "学生学号", width = 15) @Excel(name = "学生学号", width = 15)
@TableField(exist = false) @ApiModelProperty(value = "学生学号")
private String studentcode; private String studentcode;
} }

Loading…
Cancel
Save