From cf4e7f8a563aefa5aa32c4fd87e511c101d9173e Mon Sep 17 00:00:00 2001 From: zhouwentao Date: Sun, 8 Feb 2026 14:39:54 +0800 Subject: [PATCH] fix: updates --- .../yx/service/impl/BiaoyanService.java | 4 -- .../impl/YxCalculationMajorServiceImpl.java | 6 -- .../service/impl/YxVolunteerServiceImpl.java | 72 +++++++++---------- 3 files changed, 36 insertions(+), 46 deletions(-) diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/service/impl/BiaoyanService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/service/impl/BiaoyanService.java index befcaba..a428867 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/service/impl/BiaoyanService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/service/impl/BiaoyanService.java @@ -321,10 +321,6 @@ public class BiaoyanService { key = recommendMajorDTO.getCategory(); - if (recommendMajorDTO.getSchoolCode().equals("9088") && "戏剧影视表演".equals(recommendMajorDTO.getMajorName())) { - System.out.println("qvqq"); - } - if("高职高专".equals(recommendMajorDTO.getBatch())){ key = key + "-" + recommendMajorDTO.getBatch(); }else{ diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/service/impl/YxCalculationMajorServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/service/impl/YxCalculationMajorServiceImpl.java index 73fefcb..42e982f 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/service/impl/YxCalculationMajorServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/yx/service/impl/YxCalculationMajorServiceImpl.java @@ -592,12 +592,6 @@ public class YxCalculationMajorServiceImpl extends ServiceImpl recordDTOList = yxVolunteerRecordService.listDTOByVolunteerId(userScore.getId(),userScore.getCalculationTableName(),volunteer.getId()); + List recordDTOList = yxVolunteerRecordService.listDTOByVolunteerId(userScore.getId(), userScore.getCalculationTableName(), volunteer.getId()); //临时变量 String schoolCode; String majorName; @@ -140,7 +140,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl recordDTOList = yxVolunteerRecordService.listDTOByVolunteerId(userScore.getId(),userScore.getCalculationTableName(),volunteer.getId()); + List recordDTOList = yxVolunteerRecordService.listDTOByVolunteerId(userScore.getId(), userScore.getCalculationTableName(), volunteer.getId()); //获取上一年的招生人数 yxHistoryMajorEnrollService.volunteerRecordDTOListSetHistoryInfo(recordDTOList); volunteerDTO.setVolunteerRecordEarlyAdmissionList(new ArrayList<>()); @@ -151,7 +151,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(YxVolunteer::getCreateBy, sysUser.getId()); queryWrapper.orderByDesc(YxVolunteer::getCreateTime); - queryWrapper.ne(YxVolunteer::getState,-1); + queryWrapper.ne(YxVolunteer::getState, -1); queryWrapper.last("limit 0,5"); List volunteerList = this.list(queryWrapper); List list = new ArrayList<>(); @@ -322,11 +322,11 @@ public class YxVolunteerServiceImpl extends ServiceImpl yxVolunteerLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); - yxVolunteerLambdaUpdateWrapper.eq(YxVolunteer::getScoreId,saveVolunteerVO.getScoreId()); - yxVolunteerLambdaUpdateWrapper.set(YxVolunteer::getState,"0"); + yxVolunteerLambdaUpdateWrapper.eq(YxVolunteer::getScoreId, saveVolunteerVO.getScoreId()); + yxVolunteerLambdaUpdateWrapper.set(YxVolunteer::getState, "0"); this.update(yxVolunteerLambdaUpdateWrapper); //创建新的志愿单 YxVolunteer yxVolunteer = new YxVolunteer(); @@ -369,9 +369,9 @@ public class YxVolunteerServiceImpl extends ServiceImpl yxVolunteerLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); - yxVolunteerLambdaUpdateWrapper.eq(YxVolunteer::getCreateBy,userId); - yxVolunteerLambdaUpdateWrapper.eq(YxVolunteer::getState,"1"); - yxVolunteerLambdaUpdateWrapper.set(YxVolunteer::getState,"0"); + yxVolunteerLambdaUpdateWrapper.eq(YxVolunteer::getCreateBy, userId); + yxVolunteerLambdaUpdateWrapper.eq(YxVolunteer::getState, "1"); + yxVolunteerLambdaUpdateWrapper.set(YxVolunteer::getState, "0"); this.update(yxVolunteerLambdaUpdateWrapper); } @@ -380,20 +380,20 @@ public class YxVolunteerServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); if (StringUtils.isNotBlank(userId)) { - lambdaQueryWrapper.eq(YxUserScore::getCreateBy,userId); + lambdaQueryWrapper.eq(YxUserScore::getCreateBy, userId); } - lambdaQueryWrapper.ne(YxUserScore::getState,-1); + lambdaQueryWrapper.ne(YxUserScore::getState, -1); lambdaQueryWrapper.orderByDesc(YxUserScore::getUpdateTime); List list = yxUserScoreService.list(lambdaQueryWrapper); //根据 userId 分组,组装成 Map> - Set removeScoreIdSet=new HashSet<>(); + Set removeScoreIdSet = new HashSet<>(); if (CollectionUtils.isNotEmpty(list)) { Map> listMap = list.stream().collect(Collectors.groupingBy(YxUserScore::getCreateBy)); - List yxUserScores= null; + List yxUserScores = null; for (String key : listMap.keySet()) { //遍历每个用户的分数 yxUserScores = listMap.get(key); - if (yxUserScores.size()>5) { + if (yxUserScores.size() > 5) { //用户有5个分数以上的,删除 removeScoreIdSet.addAll(yxUserScores.subList(5, yxUserScores.size()).stream().map(YxUserScore::getId).collect(Collectors.toSet())); } @@ -402,17 +402,17 @@ public class YxVolunteerServiceImpl extends ServiceImpl updateWrapper = new LambdaUpdateWrapper<>(); - updateWrapper.in(YxUserScore::getId,removeScoreIdSet); - updateWrapper.set(YxUserScore::getState,-1); + updateWrapper.in(YxUserScore::getId, removeScoreIdSet); + updateWrapper.set(YxUserScore::getState, -1); yxUserScoreService.update(updateWrapper); //删除志愿单,状态改为-1 LambdaUpdateWrapper yxVolunteerLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); - yxVolunteerLambdaUpdateWrapper.in(YxVolunteer::getScoreId,removeScoreIdSet); - yxVolunteerLambdaUpdateWrapper.set(YxVolunteer::getState,-1); + yxVolunteerLambdaUpdateWrapper.in(YxVolunteer::getScoreId, removeScoreIdSet); + yxVolunteerLambdaUpdateWrapper.set(YxVolunteer::getState, -1); super.update(yxVolunteerLambdaUpdateWrapper); //将计算表里的数据删除 LambdaQueryWrapper yxCalculationMajorLambdaQueryWrapper = new LambdaQueryWrapper<>(); - yxCalculationMajorLambdaQueryWrapper.in(YxCalculationMajor::getScoreId,removeScoreIdSet); + yxCalculationMajorLambdaQueryWrapper.in(YxCalculationMajor::getScoreId, removeScoreIdSet); yxCalculationMajorService.remove(yxCalculationMajorLambdaQueryWrapper); } @@ -424,7 +424,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl volunteerRecordEarlyAdmissionList = activeByCreateVolunteerDto.getVolunteerRecordEarlyAdmissionList(); List volunteerRecordUndergraduateList = activeByCreateVolunteerDto.getVolunteerRecordUndergraduateList(); @@ -432,25 +432,25 @@ public class YxVolunteerServiceImpl extends ServiceImpl64) { + if (yxVolunteerRecord.getIndexs() > 64) { throw new JeecgBootException("各批次仅可加64个志愿"); } //判断有没有专业Id if (StringUtils.isBlank(yxVolunteerRecord.getCalculationMajorId())) { continue; } - calculationMajor = yxCalculationMajorService.getCalculationById(activeByCreateVolunteerDto.getUserScoreInfo().getCalculationTableName() ,yxVolunteerRecord.getCalculationMajorId()); + calculationMajor = yxCalculationMajorService.getCalculationById(activeByCreateVolunteerDto.getUserScoreInfo().getCalculationTableName(), yxVolunteerRecord.getCalculationMajorId()); if (calculationMajor == null) { continue; } // 防止志愿顺序重复填报 if (!"高职高专".equals(calculationMajor.getBatch())) { // 本科批 - if (volunteerRecordUndergraduateList.stream().filter(p->p.getIndexs().equals(yxVolunteerRecord.getIndexs())).findAny().isPresent()) { + if (volunteerRecordUndergraduateList.stream().filter(p -> p.getIndexs().equals(yxVolunteerRecord.getIndexs())).findAny().isPresent()) { throw new JeecgBootException("保存失败,该志愿顺序已填报!请重新登录账号尝试"); } - }else{ - if (activeByCreateVolunteerDto.getVolunteerRecordJuniorCollegeList().stream().filter(p->p.getIndexs().equals(yxVolunteerRecord.getIndexs())).findAny().isPresent()) { + } else { + if (activeByCreateVolunteerDto.getVolunteerRecordJuniorCollegeList().stream().filter(p -> p.getIndexs().equals(yxVolunteerRecord.getIndexs())).findAny().isPresent()) { throw new JeecgBootException("保存失败,该志愿顺序已填报!请重新登录账号尝试"); } } @@ -467,12 +467,12 @@ public class YxVolunteerServiceImpl extends ServiceImplStringUtils.isNotBlank(v.getCalculationMajorId())).collect(Collectors.toList()); + volunteerRecordList = volunteerRecordList.stream().filter(v -> StringUtils.isNotBlank(v.getCalculationMajorId())).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(volunteerRecordList)) { yxVolunteerRecordService.saveBatch(volunteerRecordList); } return Result.OK("保存成功"); - }catch (Exception e){ + } catch (Exception e) { return Result.error(e.getMessage()); } } @@ -486,17 +486,17 @@ public class YxVolunteerServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId,id); - lambdaQueryWrapper.in(YxVolunteerRecord::getId,volunteerRecordIdList); + lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId, id); + lambdaQueryWrapper.in(YxVolunteerRecord::getId, volunteerRecordIdList); //List volunteerRecordList = yxVolunteerRecordMapper.selectList(lambdaQueryWrapper); yxVolunteerRecordMapper.delete(lambdaQueryWrapper); } return Result.OK("删除成功"); - }catch (Exception e){ + } catch (Exception e) { return Result.error(e.getMessage()); } } @@ -513,7 +513,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl().eq(YxVolunteerRecord::getVolunteerId, saveVolunteerVO.getVolunteerId())); try { if (CollectionUtils.isNotEmpty(calculationMajorIdList)) { - List yxCalculationMajorList = yxCalculationMajorService.listByIdsOfYear(saveVolunteerVO.getCalculationMajorIdList(),YxConstant.newCalculationMajorName); + List yxCalculationMajorList = yxCalculationMajorService.listByIdsOfYear(saveVolunteerVO.getCalculationMajorIdList(), YxConstant.newCalculationMajorName); List yxVolunteerRecordList = new ArrayList<>(); Optional findAny; YxCalculationMajor yxCalculationMajor; @@ -539,7 +539,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl