From 85fd6a7868085a136dd22f149db64e03a5112358 Mon Sep 17 00:00:00 2001 From: liux <963924687@qq.com> Date: Tue, 29 Apr 2025 17:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0h5=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=91=A8=E8=8F=9C=E8=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/menu/mapper/MenuAppRecipeMapper.java | 8 +++++ .../service/impl/MenuRecipeServiceImpl.java | 36 ++++++++++++++++++- .../mapper/menu/MenuAppRecipeMapper.xml | 27 ++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuAppRecipeMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuAppRecipeMapper.java index 773519dc..63b5f657 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuAppRecipeMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuAppRecipeMapper.java @@ -4,6 +4,8 @@ import com.bonus.canteen.core.menu.vo.AppletReserveCanteenVO; import com.bonus.canteen.core.menu.vo.AppletWeekCanteenVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + +import java.time.LocalDate; import java.util.List; import java.util.Set; @@ -15,4 +17,10 @@ public interface MenuAppRecipeMapper { List selectReserveMealCanteenList(@Param("effIdSet") Set effIdSet); + List selectWeekRecipeIdHistory(@Param("recipeIdList") List recipeId, @Param("effIdSet") Set effIdSet, @Param("applyDate") LocalDate applyDate); + + List getRecipeIdListByRecipeId(@Param("recipeId") Long recipeId); + + String getBingTimeByRecipeId(@Param("recipeId") Long recipeId); + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuRecipeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuRecipeServiceImpl.java index 019bdf0a..f029c88c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuRecipeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuRecipeServiceImpl.java @@ -165,7 +165,41 @@ public class MenuRecipeServiceImpl extends ServiceImpl repeIdList = this.menuAppRecipeMapper.getRecipeIdListByRecipeId(content.getRecipeId()); + recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeIdHistory(repeIdList, null,applyDate); + if(recipeIdList == null || recipeIdList.size() == 0){ + ((List) recipeIdList).add(content.getRecipeId()); + } + } + } + } else if (applyDate.isAfter(now)) { + System.out.println("applyDate 晚于当前日期"); + recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeId(content.getRecipeId(), null); + } else { + System.out.println("applyDate 等于当前日期"); + recipeIdList = this.menuAppRecipeMapper.selectWeekRecipeId(content.getRecipeId(), null); + } + if(recipeIdList == null || recipeIdList.size() == 0){ + throw new ServiceException("本档口没有更早的历史菜谱记录"); + // recipeIdList.add(content.getRecipeId()); + } + // ((List) recipeIdList).add(content.getRecipeId()); } this.generateRecipe((List) recipeIdList, content.getApplyDate()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuAppRecipeMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuAppRecipeMapper.xml index 3f7ea5fd..01f6034c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuAppRecipeMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuAppRecipeMapper.xml @@ -335,4 +335,31 @@ + + + + + + + + +