|
|
@@ -219,7 +219,7 @@ public class PlanNewOutController {
|
|
|
|
|
|
@PostMapping("kefuList")
|
|
|
public Mono<RStatus<DataListsKefu>> kefuList(@RequestBody KefuRequest request){
|
|
|
- Mono<PlanNew> code = template.selectOne(Query.query(Criteria.where("code").is(request.getCode())), PlanNew.class)
|
|
|
+ Mono<PlanNew> code = template.selectOne(Query.query(Criteria.where("code").is(request.getCode())).columns(COLUMNARRAYPLANNEW), PlanNew.class)
|
|
|
.switchIfEmpty(Mono.error(new BaseException("code查询返回结构为空"))) //Mono.error(new BaseException("查询海报模版 id:"+f.posterTemplateId()+"=>空"))
|
|
|
.onErrorResume(throwable -> Mono.error(new BaseException("通过code查询计划异常::" + throwable.getMessage())));
|
|
|
Mono<DataListsKefu> dataListsKefuMono = code.flatMap(planNew -> {
|
|
|
@@ -276,7 +276,7 @@ public class PlanNewOutController {
|
|
|
.switchIfEmpty(Mono.just(List.of()));
|
|
|
Mono<Audio> retAudioId = Mono.just(planNew).flatMap(plan -> {
|
|
|
if(Objects.nonNull(plan.retAudioId())){
|
|
|
- return template.selectOne(Query.query(Criteria.where("id").is(plan.retAudioId())), Audio.class)
|
|
|
+ return template.selectOne(Query.query(Criteria.where("id").is(plan.retAudioId())).columns("id,url,name,type".split(",")), Audio.class)
|
|
|
.switchIfEmpty(Mono.error(new BaseException(StrUtil.format("通过计划retAudioId:{}查询音频为空",plan.retAudioId()))))
|
|
|
.onErrorResume(throwable -> Mono.error(new BaseException(StrUtil.format("通过计划retAudioId:{}查询音频Error::",plan.retAudioId(),throwable.getMessage()))));
|
|
|
}else {
|
|
|
@@ -443,21 +443,22 @@ public class PlanNewOutController {
|
|
|
return Mono.just(new Audio(null,null,null,null,null,null,null,null));
|
|
|
}else {
|
|
|
return template.selectOne(
|
|
|
- Query.query(Criteria.where("id").is(plan.listAudioId()).and("deleted_at").isNull()),
|
|
|
+ Query.query(Criteria.where("id").is(plan.listAudioId()).and("deleted_at").isNull())
|
|
|
+ .columns("id,url,name,type".split(",")),
|
|
|
Audio.class);
|
|
|
} }
|
|
|
).onErrorResume(throwable -> Mono.error(new BaseException(throwable.getMessage()+"1")));
|
|
|
Mono<Audio> retAudioId = code.flatMap(plan -> template.selectOne(Query.query(Criteria.where("id")
|
|
|
- .is(plan.retAudioId()).and("deleted_at").isNull()), Audio.class)).onErrorResume(throwable -> Mono.error(new BaseException(throwable.getMessage()+"2")));
|
|
|
+ .is(plan.retAudioId()).and("deleted_at").isNull()) .columns("id,url,name,type".split(",")), Audio.class)).onErrorResume(throwable -> Mono.error(new BaseException(throwable.getMessage()+"2")));
|
|
|
Mono<ReturnLoop> returnLoop = code.flatMap(plan -> {
|
|
|
if (Objects.isNull(plan.returnLoopId())) {
|
|
|
return Mono.just(getReturnLoop());
|
|
|
} else {
|
|
|
- return template.selectOne(Query.query(Criteria.where("id").is(plan.returnLoopId()).and("deleted_at").isNull()), ReturnLoop.class).onErrorResume(throwable -> Mono.error(new BaseException(throwable.getMessage()+"3")));
|
|
|
+ return template.selectOne(Query.query(Criteria.where("id").is(plan.returnLoopId()).and("deleted_at").isNull()).columns("id,name,group_type,group_type_name,group_type_id,domain,is_show_list,return_list,return_number,type,domain_id".split(",")), ReturnLoop.class).onErrorResume(throwable -> Mono.error(new BaseException(throwable.getMessage()+"3")));
|
|
|
}
|
|
|
}).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 BaseException(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 BaseException(throwable.getMessage()+"5"))).collectList();
|
|
|
+ Mono<List<Ad>> adtop = template.select(Query.query(Criteria.where("type").is(1).and("deleted_at").isNull()).columns("id,name,type,image,show_beg_at,show_end_at,link".split(",")), Ad.class).onErrorResume(throwable -> Mono.error(new BaseException(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()).columns("id,name,type,image,show_beg_at,show_end_at,link".split(",")), Ad.class).onErrorResume(throwable -> Mono.error(new BaseException(throwable.getMessage()+"5"))).collectList();
|
|
|
|
|
|
|
|
|
Mono<DataLists> dataListsMono = Mono.zip(code, listAudio, retAudioId, returnLoop, arrayListMono, adtop, bottom, wx_user_id).flatMap(f -> {
|
|
|
@@ -791,15 +792,18 @@ public class PlanNewOutController {
|
|
|
private Mono<DataLists0> setAudioV(HftRequest request, Mono<DataLists0> dataLists0Mono) {
|
|
|
Mono<DataLists0> zip = dataLists0Mono.flatMap(f -> {
|
|
|
Mono<Audio> id = null;
|
|
|
+ String col="id,url,name,type";
|
|
|
if (Objects.nonNull(request.getWx_user_id()) && !"".equals(request.getWx_user_id())) {
|
|
|
PlanNewBackgroupPoster qsSetting = f.getQsSetting();
|
|
|
if (Objects.nonNull(qsSetting) && Objects.nonNull(qsSetting.audioId()) && 0 != qsSetting.audioId()) {
|
|
|
- id = template.selectOne(Query.query(Criteria.where("id").is(qsSetting.audioId()).and("deleted_at").isNull()), Audio.class);
|
|
|
+ id = template.selectOne(Query.query(Criteria.where("id").is(qsSetting.audioId()).and("deleted_at").isNull())
|
|
|
+ .columns(col.split(",")), Audio.class);
|
|
|
}
|
|
|
} else {
|
|
|
PlanNewBackgroupPoster fxSetting = f.getFxSetting();
|
|
|
if (Objects.nonNull(fxSetting) && Objects.nonNull(fxSetting.audioId()) && 0 != fxSetting.audioId()) {
|
|
|
- id = template.selectOne(Query.query(Criteria.where("id").is(fxSetting.audioId()).and("deleted_at").isNull()), Audio.class);
|
|
|
+ id = template.selectOne(Query.query(Criteria.where("id").is(fxSetting.audioId()).and("deleted_at").isNull())
|
|
|
+ .columns(col.split(",")), Audio.class);
|
|
|
}
|
|
|
}
|
|
|
if (Objects.isNull(id)) {
|
|
|
@@ -827,18 +831,22 @@ public class PlanNewOutController {
|
|
|
|
|
|
private Mono<List<PlanNewBackgroupPoster>> getPlanNewBackgroupPoster(Mono<PlanNew> code) {
|
|
|
return code.flatMap(plan -> template.select(Query.query(Criteria.where("plan_new_id")
|
|
|
- .is(plan.planNewId())).sort(Sort.by(Sort.Order.asc("idx"))), PlanNewBackgroupPoster.class)
|
|
|
+ .is(plan.planNewId())).sort(Sort.by(Sort.Order.asc("idx")))
|
|
|
+ .columns("id,audio_id,group_id,image,kefu,limit_time,limit_time_remark,status,idx,service_group_id,service_group_type,qs_or_fx,plan_new_id,generate_images_json,generate_images_url".split(",")), PlanNewBackgroupPoster.class)
|
|
|
.collectList());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private Mono<List<Poster>> getPoster(Mono<PlanNew> code) {
|
|
|
return code.flatMap(plan -> template.select(Query.query(Criteria.where("poster_template_id")
|
|
|
- .is(plan.posterTemplateId())).sort(Sort.by(Sort.Order.asc("created_at"))), Poster.class).collectList());
|
|
|
+ .is(plan.posterTemplateId()))
|
|
|
+ .columns("poster_id,poster_template_id,poster_template,generate_images_json,generate_images_url".split(","))
|
|
|
+ .sort(Sort.by(Sort.Order.asc("created_at"))), Poster.class).collectList());
|
|
|
}
|
|
|
|
|
|
private Mono<PosterTemplate> getPoster_template_id(Mono<PlanNew> code) {
|
|
|
return code.flatMap(plan -> template.selectOne(Query.query(Criteria.where("poster_template_id")
|
|
|
- .is(plan.posterTemplateId())), PosterTemplate.class));
|
|
|
+ .is(plan.posterTemplateId())).columns("poster_template_id,poster_template_name".split(",")), PosterTemplate.class));
|
|
|
}
|
|
|
private StringBuilder getStringBuilder(GoRequest goRequest) {
|
|
|
Optional<Item> first = goRequest.getItem().stream().filter(ff -> "cover".equals(ff.getT()) ).findFirst();
|