新增菜谱
This commit is contained in:
parent
def2530573
commit
a6d48a4b08
|
|
@ -121,10 +121,10 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
if (2 == cookRecipeDTO.getRecipeType() && Objects.nonNull(recipeDateList.get(0))) { //每日循环
|
if (2 == cookRecipeDTO.getRecipeType() && Objects.nonNull(recipeDateList.get(0))) { //每日循环
|
||||||
List<CookRecipeDetailDTO> recipeDetailList = recipeDateList.get(0).getDetailList();
|
List<CookRecipeDetailDTO> recipeDetailList = recipeDateList.get(0).getDetailList();
|
||||||
//新增详情
|
//新增详情
|
||||||
CookRecipeDateDTO cookRecipeDateDTO = new CookRecipeDateDTO();
|
|
||||||
cookRecipeDateDTO.setDetailList(recipeDetailList);
|
|
||||||
LocalDate now = LocalDate.now();
|
LocalDate now = LocalDate.now();
|
||||||
for (int i = 0; i < 7; ++i) {
|
for (int i = 0; i < 7; ++i) {
|
||||||
|
CookRecipeDateDTO cookRecipeDateDTO = new CookRecipeDateDTO();
|
||||||
|
cookRecipeDateDTO.setDetailList(recipeDetailList);
|
||||||
cookRecipeDateDTO.setApplyDate(now.plusDays(i));
|
cookRecipeDateDTO.setApplyDate(now.plusDays(i));
|
||||||
recipeDateListNew.add(cookRecipeDateDTO);
|
recipeDateListNew.add(cookRecipeDateDTO);
|
||||||
}
|
}
|
||||||
|
|
@ -162,6 +162,8 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
cookRecipeDetail.setApplyWeek(recipeDateDTO.getApplyWeek());
|
cookRecipeDetail.setApplyWeek(recipeDateDTO.getApplyWeek());
|
||||||
cookRecipeDetail.setApplyMonth(detailDTO.getApplyMonth());
|
cookRecipeDetail.setApplyMonth(detailDTO.getApplyMonth());
|
||||||
cookRecipeDetail.setRecipeId(cookRecipeDTO.getRecipeId());
|
cookRecipeDetail.setRecipeId(cookRecipeDTO.getRecipeId());
|
||||||
|
cookRecipeDetail.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
cookRecipeDetail.setCreateTime(DateUtils.getNowDate());
|
||||||
if (Objects.isNull(cookRecipeDetail.getApplyDate())) {
|
if (Objects.isNull(cookRecipeDetail.getApplyDate())) {
|
||||||
cookRecipeDetail.setDetailType(1L); //模板数据
|
cookRecipeDetail.setDetailType(1L); //模板数据
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -172,6 +174,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
for (CookRecipeDishesDTO dishesDTO : dishesList) {
|
for (CookRecipeDishesDTO dishesDTO : dishesList) {
|
||||||
CookRecipeDishes cookRecipeDishes = new CookRecipeDishes();
|
CookRecipeDishes cookRecipeDishes = new CookRecipeDishes();
|
||||||
BeanUtils.copyProperties(dishesDTO, cookRecipeDishes);
|
BeanUtils.copyProperties(dishesDTO, cookRecipeDishes);
|
||||||
|
cookRecipeDishes.setCreateTime(DateUtils.getNowDate());
|
||||||
cookRecipeDishes.setRecipeDetailId(cookRecipeDetail.getRecipeDetailId());
|
cookRecipeDishes.setRecipeDetailId(cookRecipeDetail.getRecipeDetailId());
|
||||||
cookRecipeDishesMapper.insertCookRecipeDishes(cookRecipeDishes); //插入菜谱之菜品详情
|
cookRecipeDishesMapper.insertCookRecipeDishes(cookRecipeDishes); //插入菜谱之菜品详情
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue