fix: updates

This commit is contained in:
zhouwentao 2026-02-08 14:39:54 +08:00
parent 0a6e0f54f4
commit cf4e7f8a56
3 changed files with 36 additions and 46 deletions

View File

@ -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{

View File

@ -592,12 +592,6 @@ public class YxCalculationMajorServiceImpl extends ServiceImpl<YxCalculationMajo
continue;
}
// && "美术学(师范)".equals(recommendMajorDTO.getMajorName())
if("2565".equals(recommendMajorDTO.getSchoolCode())
&& "视觉传达设计".equals(recommendMajorDTO.getMajorName())){
System.out.println("qvq");
}
//不是体育类的专业如果是文过专排并且没有录取计算运算符时文过专排是文*0+*1,专过文排是文*1+*0
if ("文过专排".equals(rulesEnrollProbability) && StringUtils.isBlank(probabilityOperator)) {
probabilityOperator = "文*0+专*1";

View File

@ -72,7 +72,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
BigDecimal culturalScore = userScore.getCulturalScore();//文化成绩
BigDecimal professionalScore = userScore.getProfessionalScore();//专业成绩
//获取已填报的志愿单
List<VolunteerRecordDTO> recordDTOList = yxVolunteerRecordService.listDTOByVolunteerId(userScore.getId(),userScore.getCalculationTableName(),volunteer.getId());
List<VolunteerRecordDTO> recordDTOList = yxVolunteerRecordService.listDTOByVolunteerId(userScore.getId(), userScore.getCalculationTableName(), volunteer.getId());
//临时变量
String schoolCode;
String majorName;
@ -140,7 +140,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
BeanUtils.copyProperties(volunteer, volunteerDTO);
volunteerDTO.setUserScoreInfo(userScore);
//获取已填报的志愿单
List<VolunteerRecordDTO> recordDTOList = yxVolunteerRecordService.listDTOByVolunteerId(userScore.getId(),userScore.getCalculationTableName(),volunteer.getId());
List<VolunteerRecordDTO> 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<YxVolunteerMapper, YxVol
for (VolunteerRecordDTO volunteerRecordDTO : recordDTOList) {
if (YxConstant.batchSet1.contains(volunteerRecordDTO.getBatch())) {
volunteerRecordUndergraduateList.add(volunteerRecordDTO);
}else if(YxConstant.zhuanke.equals(volunteerRecordDTO.getBatch())){
} else if (YxConstant.zhuanke.equals(volunteerRecordDTO.getBatch())) {
volunteerRecordJuniorCollegeList.add(volunteerRecordDTO);
}
}
@ -206,7 +206,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
if (YxConstant.batchList1.contains(yxVolunteerRecord.getBatch())) {
benke++;
yxVolunteerRecord.setIndexs(benke);
}else if ("高职高专".equals(yxVolunteerRecord.getBatch())) {
} else if ("高职高专".equals(yxVolunteerRecord.getBatch())) {
zhuan++;
yxVolunteerRecord.setIndexs(zhuan);
}
@ -223,7 +223,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
LambdaQueryWrapper<YxVolunteer> 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<YxVolunteer> volunteerList = this.list(queryWrapper);
List<VolunteerDTO> list = new ArrayList<>();
@ -322,11 +322,11 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
YxUserScore newUserScore = yxUserScoreService.copyById(saveVolunteerVO.getScoreId());
String scoreId = newUserScore.getId();
//复制新的专业结果
yxCalculationMajorService.copyNew(saveVolunteerVO.getScoreId(),scoreId, YxConstant.oldCalculationMajorName,YxConstant.newCalculationMajorName);
yxCalculationMajorService.copyNew(saveVolunteerVO.getScoreId(), scoreId, YxConstant.oldCalculationMajorName, YxConstant.newCalculationMajorName);
//将之前的志愿单状态改为0
LambdaUpdateWrapper<YxVolunteer> 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<YxVolunteerMapper, YxVol
@Override
public void closeUserVolunteer(String userId) {
LambdaUpdateWrapper<YxVolunteer> 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<YxVolunteerMapper, YxVol
public void removeOldScore(String userId) {
LambdaQueryWrapper<YxUserScore> 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<YxUserScore> list = yxUserScoreService.list(lambdaQueryWrapper);
//根据 userId 分组组装成 Map<String,List<YxUserScore>>
Set<String> removeScoreIdSet=new HashSet<>();
Set<String> removeScoreIdSet = new HashSet<>();
if (CollectionUtils.isNotEmpty(list)) {
Map<String, List<YxUserScore>> listMap = list.stream().collect(Collectors.groupingBy(YxUserScore::getCreateBy));
List<YxUserScore> yxUserScores= null;
List<YxUserScore> 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<YxVolunteerMapper, YxVol
if (CollectionUtils.isNotEmpty(removeScoreIdSet)) {
//将需要删除的成绩单状态改为-1
LambdaUpdateWrapper<YxUserScore> 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<YxVolunteer> 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<YxCalculationMajor> 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<YxVolunteerMapper, YxVol
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
VolunteerDTO activeByCreateVolunteerDto = getActiveByCreate(loginUser.getId());
//如果有志愿单时才可以添加志愿明细
if (activeByCreateVolunteerDto!=null && StringUtils.isNotBlank(activeByCreateVolunteerDto.getId())) {
if (activeByCreateVolunteerDto != null && StringUtils.isNotBlank(activeByCreateVolunteerDto.getId())) {
List<VolunteerRecordDTO> volunteerRecordEarlyAdmissionList = activeByCreateVolunteerDto.getVolunteerRecordEarlyAdmissionList();
List<VolunteerRecordDTO> volunteerRecordUndergraduateList = activeByCreateVolunteerDto.getVolunteerRecordUndergraduateList();
@ -432,25 +432,25 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
String volunteerId = activeByCreateVolunteerDto.getId();
YxCalculationMajor calculationMajor = null;
for (YxVolunteerRecord yxVolunteerRecord : volunteerRecordList) {
if (yxVolunteerRecord.getIndexs()>64) {
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 ServiceImpl<YxVolunteerMapper, YxVol
}
}
//过滤没有专业id的数据,然后保存数据里
volunteerRecordList = volunteerRecordList.stream().filter(v->StringUtils.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<YxVolunteerMapper, YxVol
}
//根据当前用户id获取他的志愿单
VolunteerDTO activeByCreateVolunteerDto = getActiveByCreate(loginUser.getId());
if (activeByCreateVolunteerDto!=null) {
if (activeByCreateVolunteerDto != null) {
//根据志愿单id+删除的志愿明细id删除
String id = activeByCreateVolunteerDto.getId();
LambdaQueryWrapper<YxVolunteerRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId,id);
lambdaQueryWrapper.in(YxVolunteerRecord::getId,volunteerRecordIdList);
lambdaQueryWrapper.eq(YxVolunteerRecord::getVolunteerId, id);
lambdaQueryWrapper.in(YxVolunteerRecord::getId, volunteerRecordIdList);
//List<YxVolunteerRecord> 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<YxVolunteerMapper, YxVol
yxVolunteerRecordService.remove(new LambdaQueryWrapper<YxVolunteerRecord>().eq(YxVolunteerRecord::getVolunteerId, saveVolunteerVO.getVolunteerId()));
try {
if (CollectionUtils.isNotEmpty(calculationMajorIdList)) {
List<YxCalculationMajor> yxCalculationMajorList = yxCalculationMajorService.listByIdsOfYear(saveVolunteerVO.getCalculationMajorIdList(),YxConstant.newCalculationMajorName);
List<YxCalculationMajor> yxCalculationMajorList = yxCalculationMajorService.listByIdsOfYear(saveVolunteerVO.getCalculationMajorIdList(), YxConstant.newCalculationMajorName);
List<YxVolunteerRecord> yxVolunteerRecordList = new ArrayList<>();
Optional<YxCalculationMajor> findAny;
YxCalculationMajor yxCalculationMajor;
@ -539,7 +539,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
if ("高职高专".equals(yxCalculationMajor.getBatch())) {
index2++;
yxVolunteerRecord.setIndexs(index2);
}else{
} else {
index++;
yxVolunteerRecord.setIndexs(index);
}
@ -549,7 +549,7 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
yxVolunteerRecordService.saveBatch(yxVolunteerRecordList);
}
return yxVolunteer.getId();
}catch (Exception e){
} catch (Exception e) {
log.debug(e.getMessage());
throw new RuntimeException("保存失败", e);
}