|
@@ -1138,32 +1138,42 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//从子列表中随机抽取符合数据量的
|
|
//从子列表中随机抽取符合数据量的
|
|
|
|
|
|
List<BaseExpert> alltExpertList = new ArrayList<>();
|
|
List<BaseExpert> alltExpertList = new ArrayList<>();
|
|
-
|
|
|
|
|
|
+ if(technicalExpertNumber > 0 && technicalExpertList.size() < technicalExpertNumber){
|
|
|
|
+ throw new Exception("抽取到符合条件的技术专家数量不够");
|
|
|
|
+ }
|
|
if (!ObjectUtils.isEmpty(technicalExpertList)) {
|
|
if (!ObjectUtils.isEmpty(technicalExpertList)) {
|
|
alltExpertList.addAll(RandomUtil.getRandomList(technicalExpertList, technicalExpertNumber));
|
|
alltExpertList.addAll(RandomUtil.getRandomList(technicalExpertList, technicalExpertNumber));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(economicExpertNumber > 0 && economicExpertList.size() < economicExpertNumber){
|
|
|
|
+ throw new Exception("抽取到符合条件的经济专家数量不够");
|
|
|
|
+ }
|
|
if (!ObjectUtils.isEmpty(economicExpertList)) {
|
|
if (!ObjectUtils.isEmpty(economicExpertList)) {
|
|
alltExpertList.addAll(RandomUtil.getRandomList(economicExpertList, economicExpertNumber));
|
|
alltExpertList.addAll(RandomUtil.getRandomList(economicExpertList, economicExpertNumber));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(legalAffairsExpertNumber > 0 && legalAffairsExpertList.size() < legalAffairsExpertNumber){
|
|
|
|
+ throw new Exception("抽取到符合条件的法务专家数量不够");
|
|
|
|
+ }
|
|
if (!ObjectUtils.isEmpty(legalAffairsExpertList)) {
|
|
if (!ObjectUtils.isEmpty(legalAffairsExpertList)) {
|
|
alltExpertList.addAll(RandomUtil.getRandomList(legalAffairsExpertList, legalAffairsExpertNumber));
|
|
alltExpertList.addAll(RandomUtil.getRandomList(legalAffairsExpertList, legalAffairsExpertNumber));
|
|
}
|
|
}
|
|
|
|
|
|
- List<Integer> allExpertIdList = new ArrayList<>();
|
|
|
|
- if (!ObjectUtils.isEmpty(alltExpertList)) {
|
|
|
|
- for (BaseExpert baseExpert : alltExpertList) {
|
|
|
|
- allExpertIdList.add(baseExpert.getId());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ List<BaseExpert> spareExpertListNew = new ArrayList<>();
|
|
if (!ObjectUtils.isEmpty(spareExpertList)) {
|
|
if (!ObjectUtils.isEmpty(spareExpertList)) {
|
|
- List<BaseExpert> spareExpertListNew = new ArrayList<>();
|
|
|
|
|
|
+ //获取全部IDlist
|
|
|
|
+ List<Integer> allExpertIdList = new ArrayList<>();
|
|
|
|
+ if (!ObjectUtils.isEmpty(alltExpertList)) {
|
|
|
|
+ for (BaseExpert baseExpert : alltExpertList) {
|
|
|
|
+ allExpertIdList.add(baseExpert.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //遍历全部IDlist
|
|
if (!ObjectUtils.isEmpty(allExpertIdList)) { //去重
|
|
if (!ObjectUtils.isEmpty(allExpertIdList)) { //去重
|
|
for (BaseExpert baseExpert : spareExpertList) {
|
|
for (BaseExpert baseExpert : spareExpertList) {
|
|
if (!allExpertIdList.contains(baseExpert.getId())) {
|
|
if (!allExpertIdList.contains(baseExpert.getId())) {
|
|
@@ -1177,6 +1187,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
alltExpertList.addAll(RandomUtil.getRandomList(spareExpertListNew, spareExpertNumber));
|
|
alltExpertList.addAll(RandomUtil.getRandomList(spareExpertListNew, spareExpertNumber));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(spareExpertNumber > 0 && spareExpertListNew.size() < spareExpertNumber){
|
|
|
|
+ throw new Exception("抽取到符合条件的备用专家数量不够");
|
|
|
|
+ }
|
|
|
|
|
|
if (ObjectUtils.isEmpty(alltExpertList)) {
|
|
if (ObjectUtils.isEmpty(alltExpertList)) {
|
|
throw new Exception("没抽取到符合条件的专家");
|
|
throw new Exception("没抽取到符合条件的专家");
|