菜谱管理

This commit is contained in:
sxu 2025-05-31 10:51:27 +08:00
parent 596c7d16fd
commit 070bf9c495
1 changed files with 12 additions and 17 deletions

View File

@ -241,6 +241,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
if (!CollectionUtils.isEmpty(cookRecipeDTO.getRecipeDateList())) {
for (CookRecipeDateDTO recipeDateDTO : cookRecipeDTO.getRecipeDateList()) {
List<CookRecipeDetailDTO> detailList = recipeDateDTO.getDetailList();
if (!CollectionUtils.isEmpty(detailList)) {
for (CookRecipeDetailDTO detailDTO : detailList) {
if (CollectionUtils.isEmpty(detailDTO.getDishesList())) { //不插入空数据
continue;
@ -249,11 +250,13 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
}
}
}
}
// 插入生成的日循环详情数据周循环详情数据
List<CookRecipeDateDTO> generatedRecipeDateList = generateCookRecipeDateList(cookRecipeDTO);
if (!CollectionUtils.isEmpty(generatedRecipeDateList)) {
for (CookRecipeDateDTO recipeDateDTO : generatedRecipeDateList) {
List<CookRecipeDetailDTO> detailList = recipeDateDTO.getDetailList();
if (!CollectionUtils.isEmpty(detailList)) {
for (CookRecipeDetailDTO detailDTO : detailList) {
if (CollectionUtils.isEmpty(detailDTO.getDishesList())) { //不插入空数据
continue;
@ -263,6 +266,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
}
}
}
}
private static List<CookRecipeDateDTO> generateCookRecipeDateList(CookRecipeDTO cookRecipeDTO) {
List<CookRecipeDateDTO> recipeDateList = cookRecipeDTO.getRecipeDateList();
@ -293,15 +297,6 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
}
}
recipeDateListNew.add(cookRecipeDateDTO);
// if (!CollectionUtils.isEmpty(cookRecipeDateDTO.getDetailList())) {
// List<CookRecipeDetailDTO> detailList = cookRecipeDateDTO.getDetailList();
// for (CookRecipeDetailDTO detail : detailList) {
// if (!CollectionUtils.isEmpty(detail.getDishesList())) {
// recipeDateListNew.add(cookRecipeDateDTO);
// }
// break;
// }
// }
}
}
return recipeDateListNew;