菜谱-新增
This commit is contained in:
parent
cc0ffa7597
commit
054c21e9c1
|
|
@ -20,6 +20,7 @@ import com.bonus.canteen.core.cook.mapper.CookRecipeMapper;
|
|||
import com.bonus.canteen.core.cook.domain.CookRecipe;
|
||||
import com.bonus.canteen.core.cook.service.ICookRecipeService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* 菜品计划信息Service业务层处理
|
||||
|
|
@ -81,7 +82,11 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
for (CookRecipeDateDTO recipeDateDTO : recipeDateList) {
|
||||
List<CookRecipeDetailDTO> detailList = recipeDateDTO.getDetailList();
|
||||
for (CookRecipeDetailDTO detailDTO : detailList) {
|
||||
if (CollectionUtils.isEmpty(detailDTO.getDishesList())) {
|
||||
continue;
|
||||
}
|
||||
CookRecipeDetail cookRecipeDetail = new CookRecipeDetail();
|
||||
BeanUtils.copyProperties(recipeDateDTO, detailDTO);
|
||||
BeanUtils.copyProperties(detailDTO, cookRecipeDetail);
|
||||
cookRecipeDetail.setRecipeId(cookRecipeDTO.getRecipeId());
|
||||
cookRecipeDetailMapper.insertCookRecipeDetail(cookRecipeDetail); //插入菜谱之执行计划
|
||||
|
|
@ -89,7 +94,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
for (CookRecipeDishesDTO dishesDTO : dishesList) {
|
||||
CookRecipeDishes cookRecipeDishes = new CookRecipeDishes();
|
||||
BeanUtils.copyProperties(dishesDTO, cookRecipeDishes);
|
||||
cookRecipeDishes.setRecipeDetailId(detailDTO.getRecipeDetailId());
|
||||
cookRecipeDishes.setRecipeDetailId(cookRecipeDetail.getRecipeDetailId());
|
||||
cookRecipeDishesMapper.insertCookRecipeDishes(cookRecipeDishes); //插入菜谱之菜品详情
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue