فهرست منبع

听书裂变3.12

(cherry picked from commit f4674e520ea25586a4274b71de84b35e13f6479b)
(cherry picked from commit 7550e898b912b50abc19c7ce52f6b4d30c06d146)
MOKASZ\lw12420 2 سال پیش
والد
کامیت
961bcc83f2

+ 7 - 2
launch-admin/src/main/java/com/webflux/launchadmin/mysql/controller/planNew/PlanNewOutController.java

@@ -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为空")))