MOKASZ\lw12420 2 лет назад
Родитель
Сommit
ce4a42b74b

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

@@ -108,6 +108,7 @@ public class PlanNewOutController {
         }
         throw new BaseException("typePlan 类型错误");
 
+
     }
     /**
      * 列表返回images(列表内容),shareQrurl(背景组) ,baiduDot,retAudio
@@ -171,7 +172,9 @@ public class PlanNewOutController {
      */
     @PostMapping("hfoInfo")
     public Mono<RStatus<DataLists>> hfoInfo(@RequestBody HfoRequest request){
-        Mono<PlanNew> code0 = template.selectOne(Query.query(Criteria.where("code").is(request.getCode())), PlanNew.class);
+        Mono<PlanNew> code0 = template.selectOne(Query.query(Criteria.where("code").is(request.getCode())), PlanNew.class)
+                .switchIfEmpty(Mono.error(new BaseException(" code错误")))
+                .onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage())));
         Mono<DataLists> dataListsMono1 = code0.flatMap(planNew -> {
             Mono<PlanNew> code = Mono.just(planNew);
             Long group_type_id ; //.and("group_type_id").is(group_type_id)
@@ -328,8 +331,10 @@ public class PlanNewOutController {
             map.put(request.getUnique(),0);
             request.setUserVisits(0);
         }
+
         Mono<PlanNew> code0 = template.selectOne(Query.query(Criteria.where("code").is(request.getCode())), PlanNew.class)
                 .switchIfEmpty(Mono.error(new BaseException(" code错误")))
+
                 .onErrorResume(throwable -> Mono.error(new Exception(throwable.getMessage())));
         Mono<DataLists0> dataLists0Mono =  code0.flatMap(ftmp->{
             //(如果wx_user_id值不为空则使用清水分类)