|
|
@@ -990,16 +990,16 @@ public class PlanNewCommonOutController {
|
|
|
});
|
|
|
Mono<List<AlbumReq>> albumList = Mono.just(List.of());
|
|
|
if (Objects.nonNull(request.getAlbumNum()) && 0 != request.getAlbumNum()) {
|
|
|
- Mono<String> stringMono = reactiveRedisTemplate.opsForValue().get(request.getUnique()+"_albumList").switchIfEmpty(Mono.just(""));
|
|
|
+ Mono<String> stringMono = Mono.just(""); //reactiveRedisTemplate.opsForValue().get(request.getUnique()+"_albumList").switchIfEmpty(Mono.just(""));
|
|
|
albumList = stringMono.flatMap(s -> {
|
|
|
- if (!"".equals(s)) {
|
|
|
- JSONArray jsonArray = JSONUtil.parseArray(s);
|
|
|
- List<AlbumReq> collect = jsonArray.stream().map(o -> {
|
|
|
- JSONObject jsonObject = JSONUtil.parseObj(o);
|
|
|
- return JSONUtil.toBean(jsonObject, AlbumReq.class);
|
|
|
- }).collect(Collectors.toList());
|
|
|
- return Mono.just(collect);
|
|
|
- }
|
|
|
+// if (!"".equals(s)) {
|
|
|
+// JSONArray jsonArray = JSONUtil.parseArray(s);
|
|
|
+// List<AlbumReq> collect = jsonArray.stream().map(o -> {
|
|
|
+// JSONObject jsonObject = JSONUtil.parseObj(o);
|
|
|
+// return JSONUtil.toBean(jsonObject, AlbumReq.class);
|
|
|
+// }).collect(Collectors.toList());
|
|
|
+// return Mono.just(collect);
|
|
|
+// }
|
|
|
Mono<List<Long>> album_id = template.select(Query.query(Criteria.where("group_id").is(plan.groupId())).columns("album_id"), Album.class)
|
|
|
.flatMap(album -> Mono.just(album.albumId())).collectList();
|
|
|
return album_id.flatMap(lists -> {
|
|
|
@@ -1012,10 +1012,7 @@ public class PlanNewCommonOutController {
|
|
|
Long aLong = collect.get(RandomUtil.randomInt(0, collect.size()));
|
|
|
longs.add(aLong);
|
|
|
}
|
|
|
- Mono<List<AlbumReq>> listMono = Flux.fromIterable(longs).flatMap(id -> {
|
|
|
- return sourceMaterialInterface.infoAlbum(id);
|
|
|
- }).collectList();
|
|
|
- return listMono;
|
|
|
+ return Flux.fromIterable(longs).flatMap(id -> sourceMaterialInterface.infoAlbum(id)).collectList();
|
|
|
});
|
|
|
});
|
|
|
|
|
|
@@ -1121,8 +1118,8 @@ public class PlanNewCommonOutController {
|
|
|
List<AlbumReq> t2 = tuple.getT2();
|
|
|
PlanNewCommonMaterialRes t1 = tuple.getT1();
|
|
|
if(!t2.isEmpty()){
|
|
|
- String s = JSONUtil.toJsonStr(t2);
|
|
|
- reactiveRedisTemplate.opsForValue().set(request.getUnique() + "_albumList",s, Duration.ofHours(2L)).subscribe();
|
|
|
+ // String s = JSONUtil.toJsonStr(t2);
|
|
|
+ // reactiveRedisTemplate.opsForValue().set(request.getUnique() + "_albumList",s, Duration.ofHours(2L)).subscribe();
|
|
|
t1.setAlbumList(t2);
|
|
|
}
|
|
|
t1.setDJs(tuple.getT3());
|