|
|
@@ -520,11 +520,13 @@ public class ProgrammeService {
|
|
|
|
|
|
int size = programmeList.size();
|
|
|
// 数量小于 ,未填仅限选择或仅限选择为false
|
|
|
- if (size < quantity && (ObjectUtil.isNull(arrange.getSelectedOnly()) || !arrange.getSelectedOnly())) {
|
|
|
- programmeList.addAll(byPerformanceId.stream()
|
|
|
- .filter(programme -> !arrange.getSpecialtyId().contains(programme.getParentSpecialtyId()))
|
|
|
- .limit(quantity - size)
|
|
|
- .collect(Collectors.toList()));
|
|
|
+ if (size < quantity) {
|
|
|
+ if (ObjectUtil.isNull(arrange.getSelectedOnly()) || !arrange.getSelectedOnly()) {
|
|
|
+ programmeList.addAll(byPerformanceId.stream()
|
|
|
+ .filter(programme -> !arrange.getSpecialtyId().contains(programme.getParentSpecialtyId()))
|
|
|
+ .limit(quantity - size)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
+ }
|
|
|
flag = false;
|
|
|
}
|
|
|
|
|
|
@@ -593,6 +595,7 @@ public class ProgrammeService {
|
|
|
.map(Programme::getParentSpecialtyId)
|
|
|
.distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
+ specialtyIds.remove(null);
|
|
|
arrange.setSpecialtyId(specialtyIds);
|
|
|
arrange.setQuantity(arrange.getQuantity() - 1);
|
|
|
arrangeRepo.save(arrange);
|
|
|
@@ -613,6 +616,7 @@ public class ProgrammeService {
|
|
|
|
|
|
arrange.setQuantity(arrange.getQuantity() + 1);
|
|
|
List<Long> specialtyId = arrange.getSpecialtyId();
|
|
|
+ specialtyId.remove(null);
|
|
|
if (!specialtyId.contains(programme.getParentSpecialtyId())) {
|
|
|
specialtyId.add(programme.getParentSpecialtyId());
|
|
|
}
|