|
|
@@ -70,7 +70,10 @@ public class PlanNewOutController {
|
|
|
|
|
|
public Mono<RStatus<DomainSelectRes>> domainSelect(@RequestParam("code") String code,@RequestParam("type") String type ,@RequestParam("typePlan") Integer typePlan ){
|
|
|
if (1 == typePlan) {
|
|
|
- Mono<PlanNew> code1 = template.selectOne(Query.query(Criteria.where("code").is(code)), PlanNew.class);
|
|
|
+ Mono<PlanNew> code1 = template
|
|
|
+ .selectOne(Query.query(Criteria.where("code").is(code)), PlanNew.class)
|
|
|
+ .switchIfEmpty(Mono.error(new BaseException("计划code异常"))) //Mono.error(new BaseException("查询海报模版 id:"+f.posterTemplateId()+"=>空"))
|
|
|
+ .onErrorResume(throwable -> Mono.error(new Exception( throwable.getMessage())));
|
|
|
Mono<DomainSelectRes> domainSelectResMono1 = code1.flatMap(f -> template.select(Query.query(Criteria.where("group_type_id").is(f.groupId())
|
|
|
.and("status").is(1).and("type").is(type)), DomainSelect.class)
|
|
|
.switchIfEmpty(Mono.error(new BaseException("查询domain为空")))
|
|
|
@@ -86,7 +89,9 @@ public class PlanNewOutController {
|
|
|
}));
|
|
|
return RStatus.success(domainSelectResMono1);
|
|
|
}else if(2==typePlan){
|
|
|
- Mono<ListeningPlanNew> code1 = template.selectOne(Query.query(Criteria.where("code").is(code)), ListeningPlanNew.class);
|
|
|
+ Mono<ListeningPlanNew> code1 = template.selectOne(Query.query(Criteria.where("code").is(code)), ListeningPlanNew.class)
|
|
|
+ .switchIfEmpty(Mono.error(new BaseException("计划code异常"))) //Mono.error(new BaseException("查询海报模版 id:"+f.posterTemplateId()+"=>空"))
|
|
|
+ .onErrorResume(throwable -> Mono.error(new Exception( throwable.getMessage())));;
|
|
|
Mono<DomainSelectRes> domainSelectResMono1 = code1.flatMap(f -> template.select(Query.query(Criteria.where("group_type_id").is(f.groupId())
|
|
|
.and("status").is(1).and("type").is(type)), DomainSelect.class)
|
|
|
.switchIfEmpty(Mono.error(new BaseException("查询domain为空")))
|