新增菜谱
This commit is contained in:
parent
127a8c6c11
commit
abb944ab32
|
|
@ -98,8 +98,8 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
return null;
|
||||
}
|
||||
List<CookRecipeDateDTO> recipeDateListNew = new ArrayList<>();
|
||||
if (2 == cookRecipeDTO.getRecipeType()) { //每日循环
|
||||
List<CookRecipeDetailDTO> recipeDetailList = cookRecipeDTO.getRecipeDateList().get(0).getDetailList();
|
||||
if (2 == cookRecipeDTO.getRecipeType() && Objects.nonNull(recipeDateList.get(0))) { //每日循环
|
||||
List<CookRecipeDetailDTO> recipeDetailList = recipeDateList.get(0).getDetailList();
|
||||
//新增详情
|
||||
CookRecipeDateDTO cookRecipeDateDTO = new CookRecipeDateDTO();
|
||||
cookRecipeDateDTO.setDetailList(recipeDetailList);
|
||||
|
|
@ -109,7 +109,6 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
}
|
||||
recipeDateListNew.add(cookRecipeDateDTO);
|
||||
} else if (3 == cookRecipeDTO.getRecipeType()) { //每周循环
|
||||
List<CookRecipeDateDTO> recipeDateList1 = cookRecipeDTO.getRecipeDateList();
|
||||
LocalDate now = LocalDate.now();
|
||||
HashMap<Integer, LocalDate> dateHashMap = new HashMap<>();
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
|
|
@ -123,6 +122,11 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
CookRecipeDateDTO cookRecipeDateDTO = new CookRecipeDateDTO();
|
||||
cookRecipeDateDTO.setApplyWeek(Long.valueOf(entry.getKey()));
|
||||
cookRecipeDateDTO.setApplyDate(entry.getValue());
|
||||
for (CookRecipeDateDTO recipeDateDTO : recipeDateList) {
|
||||
if (Long.valueOf(entry.getKey()).equals(recipeDateDTO.getApplyWeek())) {
|
||||
cookRecipeDateDTO.setDetailList(recipeDateDTO.getDetailList());
|
||||
}
|
||||
}
|
||||
recipeDateListNew.add(cookRecipeDateDTO);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue