From 81f11e3800f2fc693b1d8c0826712c00359aaeb8 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Mon, 9 Jun 2025 06:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canteen/core/cook/service/impl/CookDishesServiceImpl.java | 3 +++ .../core/cook/service/impl/CookRecipeServiceH5Impl.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java index 1da443e..4d0b78e 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java @@ -560,6 +560,9 @@ public class CookDishesServiceImpl implements ICookDishesService { Long userId = dishesDetailDTO.getUserId(); if (!ObjectUtil.isNull(userId) && userId != -1L) { AppletDishesDetailVO appletDishesDetailVO = cookDishesMapper.selectDishesDetailByDishesId(dishesDetailDTO); + if (Objects.isNull(appletDishesDetailVO)) { + return null; + } Long countDishes = this.cookCollectionDishesMapper.getCountByUserIdAndDishesId(userId, inputDishesId); if (ObjectUtil.isNotNull(countDishes) && countDishes > 0L) { appletDishesDetailVO.setIsFavorites(1); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceH5Impl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceH5Impl.java index 1cf4ecf..edae396 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceH5Impl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceH5Impl.java @@ -169,7 +169,8 @@ public class CookRecipeServiceH5Impl implements ICookRecipeH5Service { recipeIdList = this.cookRecipeH5Mapper.selectWeekRecipeId(content.getRecipeId()); } if(recipeIdList == null || recipeIdList.size() == 0){ - throw new ServiceException("本档口没有更早的历史菜谱记录"); + log.error("本档口没有更早的历史菜谱记录"); + return new ArrayList<>(); } }