diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeDetailMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeDetailMapper.java index 1e31043..5bf420f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeDetailMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeDetailMapper.java @@ -58,5 +58,7 @@ public interface CookRecipeDetailMapper { */ public int deleteCookRecipeDetailByRecipeDetailIds(Long[] recipeDetailIds); + public List getAllCookRecipeDetailIds(Long[] recipeIds); + public List getToDeleteCookRecipeDetailIds(Long recipeId); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java index f01dd94..6e03db9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java @@ -228,10 +228,10 @@ public class CookRecipeServiceImpl implements ICookRecipeService { */ @Override public int deleteCookRecipeByRecipeIds(Long[] recipeIds) { - //TODO 删除菜谱之菜品详情 - - //TODO 删除菜谱之执行计划 - + List cookRecipeDetailIds = cookRecipeDetailMapper.getAllCookRecipeDetailIds(recipeIds); + Long[] cookRecipeDetailArray = cookRecipeDetailIds.stream().toArray(Long[]::new); + cookRecipeDishesMapper.deleteCookRecipeDishesByCookRecipeDetailIds(cookRecipeDetailArray); + cookRecipeDetailMapper.deleteCookRecipeDetailByRecipeDetailIds(cookRecipeDetailArray); return cookRecipeMapper.deleteCookRecipeByRecipeIds(recipeIds); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeDetailMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeDetailMapper.xml index 316a6ee..e589bdf 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeDetailMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeDetailMapper.xml @@ -99,6 +99,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + +