记得上下班打卡 | git大法好,push需谨慎

Commit 6d878609 authored by jiangxiulong's avatar jiangxiulong

ConcurrentModificationException: null

parent 0315caa1
...@@ -25,6 +25,7 @@ import org.springframework.data.mongodb.core.query.BasicQuery; ...@@ -25,6 +25,7 @@ import org.springframework.data.mongodb.core.query.BasicQuery;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -81,23 +82,31 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM ...@@ -81,23 +82,31 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
} }
} }
// List<String> ids = Arrays.asList("");
// 推荐 // 推荐
int is_native = 1; int is_native = 1;
int recommend = performancesListNew.size(); int recommend = performancesListNew.size();
List<KylinPerformanceVo> performancesListNewUnqui = new ArrayList<>();
performancesListNewUnqui.addAll(performancesListNew);
if (recommend <= 2) { if (recommend <= 2) {
List<KylinPerformanceVo> performancesListRecommend = dataUtils.getPerformancesListIsSystemRecommend(); List<KylinPerformanceVo> performancesListRecommend = dataUtils.getPerformancesListIsSystemRecommend();
if (performancesListRecommend.size() > 0) {
/*List<KylinPerformanceVo> collect = performancesListRecommend.stream().filter(r -> !ids.contains(r.getPerformancesId())).collect(Collectors.toList());
performancesListNew.addAll(collect);*/
if (CollectionUtils.isEmpty(performancesListRecommend)) {
is_native = 0; is_native = 0;
if(recommend > 0) {// 去重 if(recommend > 0) {// 去重
for(KylinPerformanceVo recommendInfo : performancesListRecommend) { for(KylinPerformanceVo recommendInfo : performancesListRecommend) {
for(KylinPerformanceVo info : performancesListNew) { for(KylinPerformanceVo info : performancesListNew) {
if (!recommendInfo.getPerformancesId().equalsIgnoreCase(info.getPerformancesId())) { if (!recommendInfo.getPerformancesId().equals(info.getPerformancesId())) {
performancesListNew.add(recommendInfo); performancesListNewUnqui.add(recommendInfo);
} }
} }
} }
} else { } else {
performancesListNew.addAll(performancesListRecommend); performancesListNewUnqui.addAll(performancesListRecommend);
} }
} }
} }
...@@ -107,7 +116,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM ...@@ -107,7 +116,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
info.put("is_native", is_native); // 本地演出少是否推荐了其他演出 0有推荐 1没有 info.put("is_native", is_native); // 本地演出少是否推荐了其他演出 0有推荐 1没有
info.put("recommend", recommend); // 从第几个开始是其他推荐演出 后台设置的那个推荐 info.put("recommend", recommend); // 从第几个开始是其他推荐演出 后台设置的那个推荐
info.put("total", 0); info.put("total", 0);
info.put("list", performancesListNew); info.put("list", performancesListNewUnqui);
return info; return info;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment