|
|
@@ -310,12 +310,12 @@ public class PlanNewOutController {
|
|
|
}).switchIfEmpty(Mono.just(getReturnLoop()));
|
|
|
Mono<List<Ad>> adtop = template.select(Query.query(Criteria.where("type").is(1).and("deleted_at").isNull()), Ad.class).onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage()+"4"))).collectList();////广告类型1顶部2底部3返回4安卓,ios的返回
|
|
|
Mono<List<Ad>> bottom = template.select(Query.query(Criteria.where("type").is(2).and("deleted_at").isNull()), Ad.class).onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage()+"5"))).collectList();
|
|
|
+
|
|
|
+
|
|
|
Mono<DataLists> dataListsMono = Mono.zip(code, listAudio, retAudioId, returnLoop, arrayListMono, adtop, bottom, wx_user_id).flatMap(f -> {
|
|
|
DataLists dataLists = new DataLists();
|
|
|
dataLists.setPlanNew(f.getT1());
|
|
|
- dataLists.setTransferPageBl(f.getT1().transferPageBl());
|
|
|
- dataLists.setTransferPageDomain(f.getT1().transferPageDomain());
|
|
|
- dataLists.setBackgroupDomain(f.getT1().backgroupDomain());
|
|
|
+
|
|
|
if (Objects.nonNull(f.getT2().id())) {
|
|
|
dataLists.setListAudio(f.getT2());
|
|
|
}
|
|
|
@@ -344,7 +344,56 @@ public class PlanNewOutController {
|
|
|
List<Ad> ads = f.getT7().subList(0, f.getT1().bottomAdvNum());
|
|
|
dataLists.setBottomAd(ads);
|
|
|
}
|
|
|
- return Mono.just(dataLists);
|
|
|
+ Mono<String> stringMono;
|
|
|
+ if (f.getT1().transferPageBl() == 1 && Objects.nonNull(f.getT1().transferPageDomain())) {
|
|
|
+ stringMono = template.select(Query.query(Criteria
|
|
|
+ .where("group_type_id").is(f.getT1().transferPageDomain())
|
|
|
+ .and("status").is(1)
|
|
|
+ .and("type").is(5)
|
|
|
+ .and("deleted_at").isNull()), DomainSelect.class)
|
|
|
+ .switchIfEmpty(Mono.error(new BaseException("transferPageDomain 域名查詢為空 group_type_id:::" + f.getT1().transferPageDomain())))
|
|
|
+ .onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage()))).collectList().flatMap(fff -> {
|
|
|
+ if (!fff.isEmpty()) {
|
|
|
+ DomainSelect domainSelect = fff.get(RandomUtil.randomInt(0, fff.size()));
|
|
|
+ String string = RandomUtil.randomString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 6);
|
|
|
+ String domain1 = domainSelect.domain();
|
|
|
+ return Mono.just(string+"."+domain1);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ throw new BaseException("transferPageDomain 中轉域名查詢為空 group_type_id:::" + f.getT1().transferPageDomain());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ stringMono = Mono.just(" ");
|
|
|
+ }
|
|
|
+ Mono<String> stringMono1;
|
|
|
+ if ( Objects.nonNull(f.getT1().backgroupDomain()) && !"".equals(f.getT1().backgroupDomain().trim()) ) {
|
|
|
+ stringMono1 = template.select(Query.query(Criteria
|
|
|
+ .where("group_type_id").is(f.getT1().backgroupDomain())
|
|
|
+ .and("status").is(1)
|
|
|
+ .and("type").is(4)
|
|
|
+ .and("deleted_at").isNull()), DomainSelect.class)
|
|
|
+ .switchIfEmpty(Mono.error(new BaseException("backgroupDomain 域名查詢為空 group_type_id" + f.getT1().backgroupDomain())))
|
|
|
+ .onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage()))).collectList().flatMap(fff -> {
|
|
|
+ if (!fff.isEmpty()) {
|
|
|
+ DomainSelect domainSelect = fff.get(RandomUtil.randomInt(0, fff.size()));
|
|
|
+ String string = RandomUtil.randomString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 6);
|
|
|
+ String domain1 = domainSelect.domain();
|
|
|
+ return Mono.just(string+"."+domain1);
|
|
|
+ } else {
|
|
|
+ throw new BaseException("backgroupDomain 背景域名查詢為空 group_type_id" + f.getT1().backgroupDomain());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ stringMono1 = Mono.just(" ");
|
|
|
+ }
|
|
|
+ return Mono.zip(stringMono,stringMono1,Mono.just(dataLists)).flatMap(fff->{
|
|
|
+ DataLists t3 = fff.getT3();
|
|
|
+ t3.setTransferPageBl(f.getT1().transferPageBl());
|
|
|
+ t3.setTransferPageDomain(fff.getT1());
|
|
|
+ t3.setBackgroupDomain(fff.getT2());
|
|
|
+ return Mono.just(t3);
|
|
|
+ });
|
|
|
});
|
|
|
return dataListsMono;
|
|
|
});
|