修改奖项新增编辑导入逻辑:如果是团队则获取队长的信息作为代表

main
Gitea 5 months ago
parent e3ca1cf887
commit 5138b41ec3
  1. 150
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java

@ -188,14 +188,31 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
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);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP());
annualCompPoint.setIsPj(1);
annualCompPointService.updateById(annualCompPoint);
return Result.OK("添加成功!");
if(listtm.size()>1){
TeamManagement teamManagement1 = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm1 = QueryGenerator.initQueryWrapper(teamManagement1, req.getParameterMap());
queryWrappertm1.eq("enroll_code",awardPersion.getEnrollCode());
queryWrappertm1.eq("captain","1");
List<TeamManagement> listtm1 = teamManagementService.list(queryWrappertm1);
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP());
annualCompPoint.setIsPj(1);
annualCompPointService.updateById(annualCompPoint);
return Result.OK("添加成功!");
}else {
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.save(awardPersion);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP());
annualCompPoint.setIsPj(1);
annualCompPointService.updateById(annualCompPoint);
return Result.OK("添加成功!");
}
}
}
@ -229,11 +246,25 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
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);
return Result.OK("编辑成功!");
if(listtm.size()>1){
TeamManagement teamManagement1 = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm1 = QueryGenerator.initQueryWrapper(teamManagement1, req.getParameterMap());
queryWrappertm1.eq("enroll_code",awardPersion.getEnrollCode());
queryWrappertm1.eq("captain","1");
List<TeamManagement> listtm1 = teamManagementService.list(queryWrappertm1);
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.updateById(awardPersion);
return Result.OK("编辑成功!");
}else {
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername());
awardPersionService.updateById(awardPersion);
return Result.OK("编辑成功!");
}
}
}
@ -421,36 +452,73 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
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())){
list.get(i).setAwardsort(1);
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())){
list.get(i).setAwardsort(2);
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())){
list.get(i).setAwardsort(3);
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())){
list.get(i).setAwardsort(4);
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())){
list.get(i).setAwardsort(5);
list.get(i).setAwardid(listaca.get(0).getId());
list.get(i).setStudentcode(sysUser.getUsername());
list.get(i).setStudentname(sysUser.getRealname());
if(listtm.size()>1){
TeamManagement teamManagement1 = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm1 = QueryGenerator.initQueryWrapper(teamManagement1, request.getParameterMap());
queryWrappertm1.eq("enroll_code",list.get(i).getEnrollCode());
queryWrappertm1.eq("captain","1");
List<TeamManagement> listtm1 = teamManagementService.list(queryWrappertm1);
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1);
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())){
list.get(i).setAwardsort(2);
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())){
list.get(i).setAwardsort(3);
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())){
list.get(i).setAwardsort(4);
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())){
list.get(i).setAwardsort(5);
list.get(i).setAwardid(listaca.get(0).getId());
list.get(i).setStudentcode(sysUser.getUsername());
list.get(i).setStudentname(sysUser.getRealname());
}else {
return Result.error("文件导入失败:第"+(i+1)+"行奖项名称不存在");
}
}else {
return Result.error("文件导入失败:第"+(i+1)+"行奖项名称不存在");
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1);
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())){
list.get(i).setAwardsort(2);
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())){
list.get(i).setAwardsort(3);
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())){
list.get(i).setAwardsort(4);
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())){
list.get(i).setAwardsort(5);
list.get(i).setAwardid(listaca.get(0).getId());
list.get(i).setStudentcode(sysUser.getUsername());
list.get(i).setStudentname(sysUser.getRealname());
}else {
return Result.error("文件导入失败:第"+(i+1)+"行奖项名称不存在");
}
}
}
//update-begin-author:taoyan date:20190528 for:批量插入数据
long start = System.currentTimeMillis();

Loading…
Cancel
Save