From a6d48a4b08a27fd2203bbe918a5ab3440126a589 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 28 May 2025 10:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8F=9C=E8=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/cook/service/impl/CookRecipeServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 7fe64c4..20e5fc6 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 @@ -121,10 +121,10 @@ public class CookRecipeServiceImpl implements ICookRecipeService { if (2 == cookRecipeDTO.getRecipeType() && Objects.nonNull(recipeDateList.get(0))) { //每日循环 List recipeDetailList = recipeDateList.get(0).getDetailList(); //新增详情 - CookRecipeDateDTO cookRecipeDateDTO = new CookRecipeDateDTO(); - cookRecipeDateDTO.setDetailList(recipeDetailList); LocalDate now = LocalDate.now(); for (int i = 0; i < 7; ++i) { + CookRecipeDateDTO cookRecipeDateDTO = new CookRecipeDateDTO(); + cookRecipeDateDTO.setDetailList(recipeDetailList); cookRecipeDateDTO.setApplyDate(now.plusDays(i)); recipeDateListNew.add(cookRecipeDateDTO); } @@ -162,6 +162,8 @@ public class CookRecipeServiceImpl implements ICookRecipeService { cookRecipeDetail.setApplyWeek(recipeDateDTO.getApplyWeek()); cookRecipeDetail.setApplyMonth(detailDTO.getApplyMonth()); cookRecipeDetail.setRecipeId(cookRecipeDTO.getRecipeId()); + cookRecipeDetail.setCreateBy(SecurityUtils.getUsername()); + cookRecipeDetail.setCreateTime(DateUtils.getNowDate()); if (Objects.isNull(cookRecipeDetail.getApplyDate())) { cookRecipeDetail.setDetailType(1L); //模板数据 } else { @@ -172,6 +174,7 @@ public class CookRecipeServiceImpl implements ICookRecipeService { for (CookRecipeDishesDTO dishesDTO : dishesList) { CookRecipeDishes cookRecipeDishes = new CookRecipeDishes(); BeanUtils.copyProperties(dishesDTO, cookRecipeDishes); + cookRecipeDishes.setCreateTime(DateUtils.getNowDate()); cookRecipeDishes.setRecipeDetailId(cookRecipeDetail.getRecipeDetailId()); cookRecipeDishesMapper.insertCookRecipeDishes(cookRecipeDishes); //插入菜谱之菜品详情 }