|
|
@@ -1607,7 +1607,6 @@ public class VoluntaryService {
|
|
|
}
|
|
|
VoluntaryDto.VoluntaryRecord voluntaryRecord = optionalVoluntary.get();
|
|
|
List<VoluntaryDto.VoluntaryMajorRecord> newRecordList = Lists.newArrayList();
|
|
|
- voluntaryRecord.setMajors(newRecordList);
|
|
|
for(VoluntaryDto.VoluntaryMajorRecord r : voluntaryRecord.getMajors()) {
|
|
|
if(r.getMajorId().equals(majorId)) {
|
|
|
continue;
|
|
|
@@ -1615,7 +1614,12 @@ public class VoluntaryService {
|
|
|
r.setRank(newRecordList.size());
|
|
|
newRecordList.add(r);
|
|
|
}
|
|
|
- updateWishRecord(wishRecord, voluntaryRecordList);
|
|
|
+ if(newRecordList.isEmpty()) {
|
|
|
+ updateWishRecord(wishRecord, voluntaryRecordList.stream().filter(t -> !t.getUniversityId().equals(plan.getUniversityId())).collect(Collectors.toList()));
|
|
|
+ } else {
|
|
|
+ voluntaryRecord.setMajors(newRecordList);
|
|
|
+ updateWishRecord(wishRecord, voluntaryRecordList);
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -1630,7 +1634,7 @@ public class VoluntaryService {
|
|
|
voluntaryRecord = optionalVoluntary.get();
|
|
|
Integer rank;
|
|
|
for(VoluntaryDto.VoluntaryMajorRecord record : voluntaryRecord.getMajors()) {
|
|
|
- if(null == (rank = majorRankMap.remove(record.getUniversityId()))) {
|
|
|
+ if(null == (rank = majorRankMap.remove(record.getMajorId()))) {
|
|
|
throw new RuntimeException("错误的专业计划ID");
|
|
|
}
|
|
|
record.setRank(rank);
|