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<>(); } }