h5周菜谱
This commit is contained in:
parent
0e64334328
commit
05c03159ac
|
|
@ -1,106 +1,106 @@
|
|||
package com.bonus.canteen.core.cook.controller;
|
||||
|
||||
import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO;
|
||||
import com.bonus.canteen.core.cook.dto.CookH5WeekDetailsDTO;
|
||||
import com.bonus.canteen.core.cook.dto.UserInfoDTO;
|
||||
import com.bonus.canteen.core.cook.service.ICookH5Service;
|
||||
import com.bonus.canteen.core.cook.dto.CookH5ReserveRecipeDTO;
|
||||
import com.bonus.canteen.core.cook.vo.AppletDishesDetailVO;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/5/28 9:20
|
||||
*/
|
||||
@Api(tags = "H5菜品计划信息")
|
||||
@RestController
|
||||
@RequestMapping("/cook/h5")
|
||||
public class CookH5Controller extends BaseController {
|
||||
private static final Logger log = LoggerFactory.getLogger(CookH5Controller.class);
|
||||
|
||||
@Resource
|
||||
private ICookH5Service cookH5Service;
|
||||
|
||||
@GetMapping({"/list/week/canteen"})
|
||||
@ApiOperation("获取一周菜谱食堂列表")
|
||||
public AjaxResult getWeekMealList( UserInfoDTO dto) {
|
||||
startPage();
|
||||
try {
|
||||
return AjaxResult.success(this.cookH5Service.getWeekCanteenList(dto));
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return AjaxResult.error("获取一周菜谱食堂列表失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取一周菜谱详情")
|
||||
@GetMapping({"/week/recipe/detail"})
|
||||
public TableDataInfo getWeekRecipeDetail(@Valid CookH5WeekDetailsDTO dto) {
|
||||
try {
|
||||
startPage();
|
||||
dto.setApplyDate(LocalDate.parse(dto.getDate()));
|
||||
return getDataTable(this.cookH5Service.getWeekRecipeDetail(dto));
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("获取预定餐食堂列表")
|
||||
@GetMapping({"/list/reserve/canteen"})
|
||||
public TableDataInfo getReserveMealCanteenList(@Valid UserInfoDTO dto) {
|
||||
try {
|
||||
startPage();
|
||||
return getDataTable(this.cookH5Service.getReserveCanteenList(dto));
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取预定餐菜谱详情")
|
||||
@PostMapping({"/reserve/recipe/detail"})
|
||||
public TableDataInfo getReserveRecipeDetailList(@RequestBody CookH5ReserveRecipeDTO content) {
|
||||
try {
|
||||
return getDataTable(this.cookH5Service.getReserveRecipeDetailList(content));
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping({"/scheduledTasks"})
|
||||
@ApiOperation("定时任务")
|
||||
@Transactional
|
||||
public AjaxResult scheduledTasks() {
|
||||
this.cookH5Service.scheduledTask();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping({"/detail"})
|
||||
@ApiOperation("根据菜品id获取菜品详情")
|
||||
public AjaxResult getRecipeDetail(@RequestBody AppletDishesDetailDTO dto) {
|
||||
try {
|
||||
AppletDishesDetailVO dishesDetailVO = this.cookH5Service.getDishesDetailByDishesId(dto);
|
||||
return success(dishesDetailVO);
|
||||
}catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//package com.bonus.canteen.core.cook.controller;
|
||||
//
|
||||
//import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.CookH5WeekDetailsDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.UserInfoDTO;
|
||||
//import com.bonus.canteen.core.cook.service.ICookH5Service;
|
||||
//import com.bonus.canteen.core.cook.dto.CookH5ReserveRecipeDTO;
|
||||
//import com.bonus.canteen.core.cook.vo.AppletDishesDetailVO;
|
||||
//import com.bonus.common.core.web.controller.BaseController;
|
||||
//import com.bonus.common.core.web.domain.AjaxResult;
|
||||
//import com.bonus.common.core.web.page.TableDataInfo;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import javax.validation.Valid;
|
||||
//import java.time.LocalDate;
|
||||
//import java.util.ArrayList;
|
||||
//
|
||||
///**
|
||||
// * @author xliu
|
||||
// * @date 2025/5/28 9:20
|
||||
// */
|
||||
//@Api(tags = "H5菜品计划信息")
|
||||
//@RestController
|
||||
//@RequestMapping("/cook/h5")
|
||||
//public class CookH5Controller extends BaseController {
|
||||
// private static final Logger log = LoggerFactory.getLogger(CookH5Controller.class);
|
||||
//
|
||||
// @Resource
|
||||
// private ICookH5Service cookH5Service;
|
||||
//
|
||||
// @GetMapping({"/list/week/canteen"})
|
||||
// @ApiOperation("获取一周菜谱食堂列表")
|
||||
// public AjaxResult getWeekMealList( UserInfoDTO dto) {
|
||||
// startPage();
|
||||
// try {
|
||||
// return AjaxResult.success(this.cookH5Service.getWeekCanteenList(dto));
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return AjaxResult.error("获取一周菜谱食堂列表失败");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("获取一周菜谱详情")
|
||||
// @GetMapping({"/week/recipe/detail"})
|
||||
// public TableDataInfo getWeekRecipeDetail(@Valid CookH5WeekDetailsDTO dto) {
|
||||
// try {
|
||||
// startPage();
|
||||
// dto.setApplyDate(LocalDate.parse(dto.getDate()));
|
||||
// return getDataTable(this.cookH5Service.getWeekRecipeDetail(dto));
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return getDataTable(new ArrayList<>());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("获取预定餐食堂列表")
|
||||
// @GetMapping({"/list/reserve/canteen"})
|
||||
// public TableDataInfo getReserveMealCanteenList(@Valid UserInfoDTO dto) {
|
||||
// try {
|
||||
// startPage();
|
||||
// return getDataTable(this.cookH5Service.getReserveCanteenList(dto));
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return getDataTable(new ArrayList<>());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation("获取预定餐菜谱详情")
|
||||
// @PostMapping({"/reserve/recipe/detail"})
|
||||
// public TableDataInfo getReserveRecipeDetailList(@RequestBody CookH5ReserveRecipeDTO content) {
|
||||
// try {
|
||||
// return getDataTable(this.cookH5Service.getReserveRecipeDetailList(content));
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return getDataTable(new ArrayList<>());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @PostMapping({"/scheduledTasks"})
|
||||
// @ApiOperation("定时任务")
|
||||
// @Transactional
|
||||
// public AjaxResult scheduledTasks() {
|
||||
// this.cookH5Service.scheduledTask();
|
||||
// return AjaxResult.success();
|
||||
// }
|
||||
//
|
||||
// @PostMapping({"/detail"})
|
||||
// @ApiOperation("根据菜品id获取菜品详情")
|
||||
// public AjaxResult getRecipeDetail(@RequestBody AppletDishesDetailDTO dto) {
|
||||
// try {
|
||||
// AppletDishesDetailVO dishesDetailVO = this.cookH5Service.getDishesDetailByDishesId(dto);
|
||||
// return success(dishesDetailVO);
|
||||
// }catch (Exception e) {
|
||||
// return AjaxResult.error(e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,47 +1,47 @@
|
|||
package com.bonus.canteen.core.cook.mapper;
|
||||
|
||||
import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO;
|
||||
import com.bonus.canteen.core.cook.dto.CookH5WeekDetailsDTO;
|
||||
import com.bonus.canteen.core.cook.dto.UserInfoDTO;
|
||||
import com.bonus.canteen.core.cook.vo.*;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/5/28 9:25
|
||||
*/
|
||||
public interface CookH5Mapper {
|
||||
|
||||
List<CookH5WeekCanteenListVO> getWeekCanteenList(UserInfoDTO userInfoDTO);
|
||||
|
||||
List<CookH5WeekDetailsVO> getWeekRecipeDetail(CookH5WeekDetailsDTO dto);
|
||||
|
||||
|
||||
List<CookH5ReserveCanteenListVO> selectReserveMealCanteenList(UserInfoDTO dto);
|
||||
|
||||
List<StallMonthSalesVO> selectMonthSalesStall(@Param("stallIdList")List<Long> stallIdList);
|
||||
|
||||
List<Long> selectTopDishesIdList(@Param("stallIdList")List<Long> longs);
|
||||
|
||||
List<CookH5ReserveDishesVO> selectAllRecipeDishesList(Long recipeId);
|
||||
|
||||
List<CookH5ReserveRecipeDetailsVO> selectReserveRecipe(@Param("applyDate")LocalDate applyDate, @Param("recipeId")Long recipeId);
|
||||
|
||||
List<CookH5ReserveMealtimeStateVO> getCookMealtimeListByStallId(@Param("stallIdSet") Set<Long> recipeIdSet);
|
||||
|
||||
List<CookH5ReserveDishesNutritionVO> selectNutrition(@Param("dishesIdSet") Set<Long> dishesIdSet);
|
||||
|
||||
List<Long> selectRecipeIdList();
|
||||
|
||||
List<Long> recipeIdMap(@Param("recipeIdList")List<Long> recipeIdList, @Param("applyDate")LocalDate applyDate);
|
||||
|
||||
AppletDishesDetailVO selectDishesDetailByDishesId(AppletDishesDetailDTO dto);
|
||||
|
||||
List getMenuMaterialById(Long dishesId);
|
||||
}
|
||||
//package com.bonus.canteen.core.cook.mapper;
|
||||
//
|
||||
//import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.CookH5WeekDetailsDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.UserInfoDTO;
|
||||
//import com.bonus.canteen.core.cook.vo.*;
|
||||
//import org.apache.ibatis.annotations.MapKey;
|
||||
//import org.apache.ibatis.annotations.Param;
|
||||
//
|
||||
//import java.time.LocalDate;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//import java.util.Set;
|
||||
//
|
||||
///**
|
||||
// * @author xliu
|
||||
// * @date 2025/5/28 9:25
|
||||
// */
|
||||
//public interface CookH5Mapper {
|
||||
//
|
||||
// List<CookH5WeekCanteenListVO> getWeekCanteenList(UserInfoDTO userInfoDTO);
|
||||
//
|
||||
// List<CookH5WeekDetailsVO> getWeekRecipeDetail(CookH5WeekDetailsDTO dto);
|
||||
//
|
||||
//
|
||||
// List<CookH5ReserveCanteenListVO> selectReserveMealCanteenList(UserInfoDTO dto);
|
||||
//
|
||||
// List<StallMonthSalesVO> selectMonthSalesStall(@Param("stallIdList")List<Long> stallIdList);
|
||||
//
|
||||
// List<Long> selectTopDishesIdList(@Param("stallIdList")List<Long> longs);
|
||||
//
|
||||
// List<CookH5ReserveDishesVO> selectAllRecipeDishesList(Long recipeId);
|
||||
//
|
||||
// List<CookH5ReserveRecipeDetailsVO> selectReserveRecipe(@Param("applyDate")LocalDate applyDate, @Param("recipeId")Long recipeId);
|
||||
//
|
||||
// List<CookH5ReserveMealtimeStateVO> getCookMealtimeListByStallId(@Param("stallIdSet") Set<Long> recipeIdSet);
|
||||
//
|
||||
// List<CookH5ReserveDishesNutritionVO> selectNutrition(@Param("dishesIdSet") Set<Long> dishesIdSet);
|
||||
//
|
||||
// List<Long> selectRecipeIdList();
|
||||
//
|
||||
// List<Long> recipeIdMap(@Param("recipeIdList")List<Long> recipeIdList, @Param("applyDate")LocalDate applyDate);
|
||||
//
|
||||
// AppletDishesDetailVO selectDishesDetailByDishesId(AppletDishesDetailDTO dto);
|
||||
//
|
||||
// List getMenuMaterialById(Long dishesId);
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,27 @@
|
|||
package com.bonus.canteen.core.cook.service;
|
||||
|
||||
import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO;
|
||||
import com.bonus.canteen.core.cook.dto.CookH5ReserveRecipeDTO;
|
||||
import com.bonus.canteen.core.cook.dto.CookH5WeekDetailsDTO;
|
||||
import com.bonus.canteen.core.cook.dto.UserInfoDTO;
|
||||
import com.bonus.canteen.core.cook.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/5/28 9:21
|
||||
*/
|
||||
public interface ICookH5Service {
|
||||
List<CookH5WeekCanteenListVO> getWeekCanteenList(UserInfoDTO userInfoDTO);
|
||||
|
||||
List<CookH5WeekDetailsVO> getWeekRecipeDetail(CookH5WeekDetailsDTO dto);
|
||||
|
||||
List<CookH5ReserveCanteenListVO> getReserveCanteenList(UserInfoDTO dto);
|
||||
|
||||
List<CookH5ReserveRecipeDetailsVO> getReserveRecipeDetailList(CookH5ReserveRecipeDTO content);
|
||||
|
||||
void scheduledTask();
|
||||
|
||||
AppletDishesDetailVO getDishesDetailByDishesId(AppletDishesDetailDTO dto);
|
||||
}
|
||||
//package com.bonus.canteen.core.cook.service;
|
||||
//
|
||||
//import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.CookH5ReserveRecipeDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.CookH5WeekDetailsDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.UserInfoDTO;
|
||||
//import com.bonus.canteen.core.cook.vo.*;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * @author xliu
|
||||
// * @date 2025/5/28 9:21
|
||||
// */
|
||||
//public interface ICookH5Service {
|
||||
// List<CookH5WeekCanteenListVO> getWeekCanteenList(UserInfoDTO userInfoDTO);
|
||||
//
|
||||
// List<CookH5WeekDetailsVO> getWeekRecipeDetail(CookH5WeekDetailsDTO dto);
|
||||
//
|
||||
// List<CookH5ReserveCanteenListVO> getReserveCanteenList(UserInfoDTO dto);
|
||||
//
|
||||
// List<CookH5ReserveRecipeDetailsVO> getReserveRecipeDetailList(CookH5ReserveRecipeDTO content);
|
||||
//
|
||||
// void scheduledTask();
|
||||
//
|
||||
// AppletDishesDetailVO getDishesDetailByDishesId(AppletDishesDetailDTO dto);
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,279 +1,279 @@
|
|||
package com.bonus.canteen.core.cook.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.bonus.canteen.core.common.enums.YesOrNoEnum;
|
||||
import com.bonus.canteen.core.cook.domain.CookRecipe;
|
||||
import com.bonus.canteen.core.cook.domain.CookRecipeDetail;
|
||||
import com.bonus.canteen.core.cook.domain.CookRecipeDishes;
|
||||
import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO;
|
||||
import com.bonus.canteen.core.cook.dto.CookH5ReserveRecipeDTO;
|
||||
import com.bonus.canteen.core.cook.dto.CookH5WeekDetailsDTO;
|
||||
import com.bonus.canteen.core.cook.dto.UserInfoDTO;
|
||||
import com.bonus.canteen.core.cook.mapper.CookH5Mapper;
|
||||
import com.bonus.canteen.core.cook.mapper.CookRecipeDetailMapper;
|
||||
import com.bonus.canteen.core.cook.mapper.CookRecipeDishesMapper;
|
||||
import com.bonus.canteen.core.cook.mapper.CookRecipeMapper;
|
||||
import com.bonus.canteen.core.cook.service.ICookH5Service;
|
||||
import com.bonus.canteen.core.cook.service.ICookRecipeService;
|
||||
import com.bonus.canteen.core.cook.vo.*;
|
||||
import com.bonus.common.houqin.constant.DelFlagEnum;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.hibernate.validator.internal.util.StringHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/5/28 9:22
|
||||
*/
|
||||
@Service
|
||||
public class CookH5ServiceImpl implements ICookH5Service {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CookH5ServiceImpl.class);
|
||||
|
||||
@Resource
|
||||
private CookH5Mapper cookH5Mapper;
|
||||
@Resource
|
||||
private CookRecipeDetailMapper cookRecipeDetailMapper;
|
||||
@Resource
|
||||
private CookRecipeDishesMapper cookRecipeDishesMapper;
|
||||
|
||||
@Resource
|
||||
private CookRecipeMapper cookRecipeMapper;
|
||||
|
||||
@Override
|
||||
public List<CookH5WeekCanteenListVO> getWeekCanteenList(UserInfoDTO userInfoDTO) {
|
||||
return cookH5Mapper.getWeekCanteenList(userInfoDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CookH5WeekDetailsVO> getWeekRecipeDetail(CookH5WeekDetailsDTO dto) {
|
||||
List<CookH5WeekDetailsVO> resutlList = cookH5Mapper.getWeekRecipeDetail(dto);
|
||||
resutlList.sort(Comparator.comparingInt(CookH5WeekDetailsVO::getMealtimeType));
|
||||
return resutlList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CookH5ReserveCanteenListVO> getReserveCanteenList(UserInfoDTO dto) {
|
||||
List<CookH5ReserveCanteenListVO> resultList = this.cookH5Mapper.selectReserveMealCanteenList(dto);
|
||||
if (ObjectUtil.isEmpty(resultList)) {
|
||||
return resultList;
|
||||
}else{
|
||||
//获取集合中档口id
|
||||
List<Long> stallIdList = resultList.stream().flatMap((canteen) -> {
|
||||
return canteen.getStallList().stream().map(CookH5ReserveStallVO::getStallId);
|
||||
}).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(stallIdList)) {
|
||||
//获取每个档口月销量
|
||||
List<StallMonthSalesVO> stallMonthSalesList = this.cookH5Mapper.selectMonthSalesStall(stallIdList);
|
||||
//将档口月销量转换为Map
|
||||
Map<Integer, Integer> stallSaleMap = stallMonthSalesList.stream().collect(Collectors.toMap(StallMonthSalesVO::getStallId, StallMonthSalesVO::getMonthlySales));
|
||||
// 遍历食堂列表,将每个档口的月销量设置到对应的档口中
|
||||
resultList.forEach((canteen) -> {
|
||||
List<CookH5ReserveStallVO> stallList = canteen.getStallList();
|
||||
if (ObjectUtil.isNotEmpty(stallList)) {
|
||||
stallList.forEach((stall) -> {
|
||||
stall.setMonthlySales((stallSaleMap.get(stall.getStallId()) == null) ? 0 : stallSaleMap.get(stall.getStallId()));
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
//获取每个档口推荐菜品
|
||||
resultList.forEach((c) -> {
|
||||
List<CookH5ReserveStallVO> stallList = c.getStallList();
|
||||
if (ObjectUtil.isNotEmpty(stallList)) {
|
||||
stallList.forEach((s) -> {
|
||||
List<Long> topDishesIdList = this.cookH5Mapper.selectTopDishesIdList(Collections.singletonList(s.getStallId()));
|
||||
List<CookH5ReserveDishesVO> recommendList = Lists.newArrayList();
|
||||
List<CookH5ReserveDishesVO> allRecipeDishesList = cookH5Mapper.selectAllRecipeDishesList(s.getRecipeId());
|
||||
if (ObjectUtil.isNotEmpty(allRecipeDishesList) && ObjectUtil.isNotEmpty(topDishesIdList)) {
|
||||
Iterator var5 = topDishesIdList.iterator();
|
||||
|
||||
while(var5.hasNext()) {
|
||||
Long dishesId = (Long)var5.next();
|
||||
if (allRecipeDishesList.stream().map(CookH5ReserveDishesVO::getDishesId).collect(Collectors.toList()).contains(dishesId)) {
|
||||
CookH5ReserveDishesVO recommendDishes = (CookH5ReserveDishesVO)allRecipeDishesList.stream().filter((a) -> {
|
||||
return a.getDishesId().equals(dishesId);
|
||||
}).collect(Collectors.toList()).get(0);
|
||||
if (!recommendList.contains(recommendDishes)) {
|
||||
recommendList.add(recommendDishes);
|
||||
}
|
||||
|
||||
if (recommendList.size() >= 3) {
|
||||
s.setRecommendList(recommendList);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
s.setRecommendList(recommendList);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<CookH5ReserveRecipeDetailsVO> getReserveRecipeDetailList(CookH5ReserveRecipeDTO content) {
|
||||
List<CookH5ReserveRecipeDetailsVO> resultList = cookH5Mapper.selectReserveRecipe(content.getApplyDate(), content.getRecipeId());
|
||||
if (ObjectUtil.isEmpty(resultList)) {
|
||||
return resultList;
|
||||
} else {
|
||||
Set<Long> stallSet = new HashSet<>();
|
||||
resultList.forEach((typeList)-> {
|
||||
if (ObjectUtil.isNotEmpty(typeList.getTypeList())) {
|
||||
typeList.getTypeList().forEach((type) -> {
|
||||
if(ObjectUtil.isNotEmpty(type)){
|
||||
type.getDishesList().forEach((dishes) -> {
|
||||
stallSet.add(dishes.getStallId());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
resultList.sort(Comparator.comparingInt(CookH5ReserveRecipeDetailsVO::getMealtimeType));
|
||||
//设置默认配送方式
|
||||
List<CookH5AllocDeliveryCostVO> deliveryCostList = new ArrayList<>();
|
||||
CookH5AllocDeliveryCostVO deliveryCost = new CookH5AllocDeliveryCostVO();
|
||||
deliveryCost.setDeliveryType(1);
|
||||
deliveryCost.setDeliveryName("自取");
|
||||
deliveryCost.setDeliveryAmount(BigDecimal.valueOf(0));
|
||||
deliveryCost.setPackingFee(BigDecimal.valueOf(0));
|
||||
deliveryCostList.add(deliveryCost);
|
||||
|
||||
List<CookH5ReserveMealtimeStateVO> mealTimeList = cookH5Mapper.getCookMealtimeListByStallId(stallSet);
|
||||
if (ObjectUtil.isEmpty(mealTimeList)) {
|
||||
log.info("未获取到开启餐次");
|
||||
return Lists.newArrayList();
|
||||
} else {
|
||||
if (LocalDate.now().isEqual(content.getApplyDate())) {
|
||||
mealTimeList = mealTimeList.stream().filter((time) -> {
|
||||
return LocalTime.now().isBefore(time.getStartTime());
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
if (ObjectUtil.isEmpty(mealTimeList)) {
|
||||
log.info("未获取到餐次信息");
|
||||
return Lists.newArrayList();
|
||||
}else{
|
||||
List<CookH5ReserveMealtimeStateVO> finalMealTimeList = mealTimeList;
|
||||
resultList = resultList.stream().filter((time) -> {
|
||||
return finalMealTimeList.stream().map(CookH5ReserveMealtimeStateVO::getMealtimeType).collect(Collectors.toList()).contains(time.getMealtimeType());
|
||||
}).collect(Collectors.toList());
|
||||
resultList.forEach((time) -> {
|
||||
List<CookH5ReserveRecipeTypeVO> typeList = time.getTypeList();
|
||||
if (ObjectUtil.isNotEmpty(typeList)) {
|
||||
typeList.forEach((type) -> {
|
||||
List<CookH5ReserveRecipeDishesVO> dishesList = type.getDishesList();
|
||||
if (ObjectUtil.isNotEmpty(dishesList)) {
|
||||
dishesList.forEach((dishes) -> {
|
||||
//添加配送方式 默认全是自取
|
||||
dishes.setCostModelList(deliveryCostList);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
// 计算菜品分值 暂未开发
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void scheduledTask() {
|
||||
List<Long> recipeIdList = cookH5Mapper.selectRecipeIdList();
|
||||
//查询所有每周菜谱、指定日期菜谱id
|
||||
for(int i = 0; i < 7; ++i) {
|
||||
this.scheduledTaskRun(recipeIdList, LocalDate.now().plusDays(i));
|
||||
}
|
||||
}
|
||||
|
||||
public void scheduledTaskRun(List<Long> recipeIdList, LocalDate applyDate) {
|
||||
if (ObjectUtil.isEmpty(recipeIdList) && recipeIdList.size()==0) {
|
||||
log.info("未获取到菜谱id");
|
||||
}else{
|
||||
List<Long> recipeIdMap = cookH5Mapper.recipeIdMap(recipeIdList,applyDate);
|
||||
//去除当日已有菜品的菜谱id
|
||||
recipeIdList = new ArrayList<>(recipeIdList);
|
||||
recipeIdList.removeAll(recipeIdMap);
|
||||
if(recipeIdList.isEmpty()){
|
||||
log.info("当日无需要生成菜品");
|
||||
return;
|
||||
}
|
||||
List<CookRecipe> cookRecipeList = cookRecipeMapper.getCookRecipeByRecipeIds(recipeIdList);
|
||||
if(!cookRecipeList.isEmpty()){
|
||||
// Map<Long, CookRecipe> recipeMap = cookRecipeList.stream().collect(Collectors.toMap(CookRecipe::getRecipeId, Function.identity()));
|
||||
//获取菜谱id对应detailsId信息
|
||||
recipeIdList.forEach( recipeId -> {
|
||||
//获取具体的餐次信息
|
||||
List<CookRecipeDetail> cookRecipeDetailList = cookRecipeDetailMapper.getCookRecipeDetailLTemplate(recipeId, "1");
|
||||
if(!cookRecipeDetailList.isEmpty()){
|
||||
cookRecipeDetailList.forEach(detail -> {
|
||||
//设置菜谱id
|
||||
//detail.setRecipeId(recipeId);
|
||||
detail.setApplyDate(applyDate);
|
||||
detail.setDetailType(2L);
|
||||
detail.setApplyWeek(Long.valueOf(applyDate.getDayOfWeek().getValue()));
|
||||
List<CookRecipeDishes> cookRecipeDishesList = cookRecipeDishesMapper.getCookRecipeDishesByDetailId(detail.getRecipeDetailId());
|
||||
cookRecipeDetailMapper.insertCookRecipeDetail(detail);
|
||||
if(!cookRecipeDishesList.isEmpty()){
|
||||
cookRecipeDishesList.forEach(dishes -> {
|
||||
//设置菜品id
|
||||
dishes.setRecipeDetailId(detail.getRecipeDetailId());
|
||||
cookRecipeDishesMapper.insertCookRecipeDishes(dishes);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
//获取details对应的菜品信息
|
||||
});
|
||||
|
||||
}else{
|
||||
log.info("未获取到菜谱信息");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AppletDishesDetailVO getDishesDetailByDishesId(AppletDishesDetailDTO dto) {
|
||||
dto.setDelFlag(DelFlagEnum.DEL_FALSE.key());
|
||||
AppletDishesDetailVO appletDishesDetailVO = cookH5Mapper.selectDishesDetailByDishesId(dto);
|
||||
Long dishesId = ((AppletDishesSizeV2VO) appletDishesDetailVO.getDishesDetailList().get(0)).getDishesId();
|
||||
List materialList;
|
||||
if (appletDishesDetailVO.getMealType() == 1) {
|
||||
materialList = this.cookH5Mapper.getMenuMaterialById(dishesId);
|
||||
appletDishesDetailVO.setMaterialList(materialList);
|
||||
}
|
||||
|
||||
// int countDishes = this.cookH5Mapper.getCollectionCountByUserIdAndDishesId(SecurityUtils.getUserId(), dishesId);
|
||||
// if (countDishes > 0) {
|
||||
// appletDishesDetailVO.setIsFavorites(YesOrNoEnum.YES.key());
|
||||
// } else {
|
||||
// appletDishesDetailVO.setIsFavorites(YesOrNoEnum.NO.key());
|
||||
//package com.bonus.canteen.core.cook.service.impl;
|
||||
//
|
||||
//import cn.hutool.core.util.ObjectUtil;
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
//import com.bonus.canteen.core.common.enums.YesOrNoEnum;
|
||||
//import com.bonus.canteen.core.cook.domain.CookRecipe;
|
||||
//import com.bonus.canteen.core.cook.domain.CookRecipeDetail;
|
||||
//import com.bonus.canteen.core.cook.domain.CookRecipeDishes;
|
||||
//import com.bonus.canteen.core.cook.dto.AppletDishesDetailDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.CookH5ReserveRecipeDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.CookH5WeekDetailsDTO;
|
||||
//import com.bonus.canteen.core.cook.dto.UserInfoDTO;
|
||||
//import com.bonus.canteen.core.cook.mapper.CookH5Mapper;
|
||||
//import com.bonus.canteen.core.cook.mapper.CookRecipeDetailMapper;
|
||||
//import com.bonus.canteen.core.cook.mapper.CookRecipeDishesMapper;
|
||||
//import com.bonus.canteen.core.cook.mapper.CookRecipeMapper;
|
||||
//import com.bonus.canteen.core.cook.service.ICookH5Service;
|
||||
//import com.bonus.canteen.core.cook.service.ICookRecipeService;
|
||||
//import com.bonus.canteen.core.cook.vo.*;
|
||||
//import com.bonus.common.houqin.constant.DelFlagEnum;
|
||||
//import com.bonus.common.security.utils.SecurityUtils;
|
||||
//import com.google.common.collect.Lists;
|
||||
//import org.hibernate.validator.internal.util.StringHelper;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import java.math.BigDecimal;
|
||||
//import java.time.LocalDate;
|
||||
//import java.time.LocalTime;
|
||||
//import java.util.*;
|
||||
//import java.util.function.Function;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
///**
|
||||
// * @author xliu
|
||||
// * @date 2025/5/28 9:22
|
||||
// */
|
||||
//@Service
|
||||
//public class CookH5ServiceImpl implements ICookH5Service {
|
||||
//
|
||||
// private static final Logger log = LoggerFactory.getLogger(CookH5ServiceImpl.class);
|
||||
//
|
||||
// @Resource
|
||||
// private CookH5Mapper cookH5Mapper;
|
||||
// @Resource
|
||||
// private CookRecipeDetailMapper cookRecipeDetailMapper;
|
||||
// @Resource
|
||||
// private CookRecipeDishesMapper cookRecipeDishesMapper;
|
||||
//
|
||||
// @Resource
|
||||
// private CookRecipeMapper cookRecipeMapper;
|
||||
//
|
||||
// @Override
|
||||
// public List<CookH5WeekCanteenListVO> getWeekCanteenList(UserInfoDTO userInfoDTO) {
|
||||
// return cookH5Mapper.getWeekCanteenList(userInfoDTO);
|
||||
// }
|
||||
|
||||
return appletDishesDetailVO;
|
||||
}
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// public List<CookH5WeekDetailsVO> getWeekRecipeDetail(CookH5WeekDetailsDTO dto) {
|
||||
// List<CookH5WeekDetailsVO> resutlList = cookH5Mapper.getWeekRecipeDetail(dto);
|
||||
// resutlList.sort(Comparator.comparingInt(CookH5WeekDetailsVO::getMealtimeType));
|
||||
// return resutlList;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<CookH5ReserveCanteenListVO> getReserveCanteenList(UserInfoDTO dto) {
|
||||
// List<CookH5ReserveCanteenListVO> resultList = this.cookH5Mapper.selectReserveMealCanteenList(dto);
|
||||
// if (ObjectUtil.isEmpty(resultList)) {
|
||||
// return resultList;
|
||||
// }else{
|
||||
// //获取集合中档口id
|
||||
// List<Long> stallIdList = resultList.stream().flatMap((canteen) -> {
|
||||
// return canteen.getStallList().stream().map(CookH5ReserveStallVO::getStallId);
|
||||
// }).collect(Collectors.toList());
|
||||
// if (ObjectUtil.isNotEmpty(stallIdList)) {
|
||||
// //获取每个档口月销量
|
||||
// List<StallMonthSalesVO> stallMonthSalesList = this.cookH5Mapper.selectMonthSalesStall(stallIdList);
|
||||
// //将档口月销量转换为Map
|
||||
// Map<Integer, Integer> stallSaleMap = stallMonthSalesList.stream().collect(Collectors.toMap(StallMonthSalesVO::getStallId, StallMonthSalesVO::getMonthlySales));
|
||||
// // 遍历食堂列表,将每个档口的月销量设置到对应的档口中
|
||||
// resultList.forEach((canteen) -> {
|
||||
// List<CookH5ReserveStallVO> stallList = canteen.getStallList();
|
||||
// if (ObjectUtil.isNotEmpty(stallList)) {
|
||||
// stallList.forEach((stall) -> {
|
||||
// stall.setMonthlySales((stallSaleMap.get(stall.getStallId()) == null) ? 0 : stallSaleMap.get(stall.getStallId()));
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// });
|
||||
// //获取每个档口推荐菜品
|
||||
// resultList.forEach((c) -> {
|
||||
// List<CookH5ReserveStallVO> stallList = c.getStallList();
|
||||
// if (ObjectUtil.isNotEmpty(stallList)) {
|
||||
// stallList.forEach((s) -> {
|
||||
// List<Long> topDishesIdList = this.cookH5Mapper.selectTopDishesIdList(Collections.singletonList(s.getStallId()));
|
||||
// List<CookH5ReserveDishesVO> recommendList = Lists.newArrayList();
|
||||
// List<CookH5ReserveDishesVO> allRecipeDishesList = cookH5Mapper.selectAllRecipeDishesList(s.getRecipeId());
|
||||
// if (ObjectUtil.isNotEmpty(allRecipeDishesList) && ObjectUtil.isNotEmpty(topDishesIdList)) {
|
||||
// Iterator var5 = topDishesIdList.iterator();
|
||||
//
|
||||
// while(var5.hasNext()) {
|
||||
// Long dishesId = (Long)var5.next();
|
||||
// if (allRecipeDishesList.stream().map(CookH5ReserveDishesVO::getDishesId).collect(Collectors.toList()).contains(dishesId)) {
|
||||
// CookH5ReserveDishesVO recommendDishes = (CookH5ReserveDishesVO)allRecipeDishesList.stream().filter((a) -> {
|
||||
// return a.getDishesId().equals(dishesId);
|
||||
// }).collect(Collectors.toList()).get(0);
|
||||
// if (!recommendList.contains(recommendDishes)) {
|
||||
// recommendList.add(recommendDishes);
|
||||
// }
|
||||
//
|
||||
// if (recommendList.size() >= 3) {
|
||||
// s.setRecommendList(recommendList);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// s.setRecommendList(recommendList);
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return resultList;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public List<CookH5ReserveRecipeDetailsVO> getReserveRecipeDetailList(CookH5ReserveRecipeDTO content) {
|
||||
// List<CookH5ReserveRecipeDetailsVO> resultList = cookH5Mapper.selectReserveRecipe(content.getApplyDate(), content.getRecipeId());
|
||||
// if (ObjectUtil.isEmpty(resultList)) {
|
||||
// return resultList;
|
||||
// } else {
|
||||
// Set<Long> stallSet = new HashSet<>();
|
||||
// resultList.forEach((typeList)-> {
|
||||
// if (ObjectUtil.isNotEmpty(typeList.getTypeList())) {
|
||||
// typeList.getTypeList().forEach((type) -> {
|
||||
// if(ObjectUtil.isNotEmpty(type)){
|
||||
// type.getDishesList().forEach((dishes) -> {
|
||||
// stallSet.add(dishes.getStallId());
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// resultList.sort(Comparator.comparingInt(CookH5ReserveRecipeDetailsVO::getMealtimeType));
|
||||
// //设置默认配送方式
|
||||
// List<CookH5AllocDeliveryCostVO> deliveryCostList = new ArrayList<>();
|
||||
// CookH5AllocDeliveryCostVO deliveryCost = new CookH5AllocDeliveryCostVO();
|
||||
// deliveryCost.setDeliveryType(1);
|
||||
// deliveryCost.setDeliveryName("自取");
|
||||
// deliveryCost.setDeliveryAmount(BigDecimal.valueOf(0));
|
||||
// deliveryCost.setPackingFee(BigDecimal.valueOf(0));
|
||||
// deliveryCostList.add(deliveryCost);
|
||||
//
|
||||
// List<CookH5ReserveMealtimeStateVO> mealTimeList = cookH5Mapper.getCookMealtimeListByStallId(stallSet);
|
||||
// if (ObjectUtil.isEmpty(mealTimeList)) {
|
||||
// log.info("未获取到开启餐次");
|
||||
// return Lists.newArrayList();
|
||||
// } else {
|
||||
// if (LocalDate.now().isEqual(content.getApplyDate())) {
|
||||
// mealTimeList = mealTimeList.stream().filter((time) -> {
|
||||
// return LocalTime.now().isBefore(time.getStartTime());
|
||||
// }).collect(Collectors.toList());
|
||||
// }
|
||||
// if (ObjectUtil.isEmpty(mealTimeList)) {
|
||||
// log.info("未获取到餐次信息");
|
||||
// return Lists.newArrayList();
|
||||
// }else{
|
||||
// List<CookH5ReserveMealtimeStateVO> finalMealTimeList = mealTimeList;
|
||||
// resultList = resultList.stream().filter((time) -> {
|
||||
// return finalMealTimeList.stream().map(CookH5ReserveMealtimeStateVO::getMealtimeType).collect(Collectors.toList()).contains(time.getMealtimeType());
|
||||
// }).collect(Collectors.toList());
|
||||
// resultList.forEach((time) -> {
|
||||
// List<CookH5ReserveRecipeTypeVO> typeList = time.getTypeList();
|
||||
// if (ObjectUtil.isNotEmpty(typeList)) {
|
||||
// typeList.forEach((type) -> {
|
||||
// List<CookH5ReserveRecipeDishesVO> dishesList = type.getDishesList();
|
||||
// if (ObjectUtil.isNotEmpty(dishesList)) {
|
||||
// dishesList.forEach((dishes) -> {
|
||||
// //添加配送方式 默认全是自取
|
||||
// dishes.setCostModelList(deliveryCostList);
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// // 计算菜品分值 暂未开发
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return resultList;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void scheduledTask() {
|
||||
// List<Long> recipeIdList = cookH5Mapper.selectRecipeIdList();
|
||||
// //查询所有每周菜谱、指定日期菜谱id
|
||||
// for(int i = 0; i < 7; ++i) {
|
||||
// this.scheduledTaskRun(recipeIdList, LocalDate.now().plusDays(i));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void scheduledTaskRun(List<Long> recipeIdList, LocalDate applyDate) {
|
||||
// if (ObjectUtil.isEmpty(recipeIdList) && recipeIdList.size()==0) {
|
||||
// log.info("未获取到菜谱id");
|
||||
// }else{
|
||||
// List<Long> recipeIdMap = cookH5Mapper.recipeIdMap(recipeIdList,applyDate);
|
||||
// //去除当日已有菜品的菜谱id
|
||||
// recipeIdList = new ArrayList<>(recipeIdList);
|
||||
// recipeIdList.removeAll(recipeIdMap);
|
||||
// if(recipeIdList.isEmpty()){
|
||||
// log.info("当日无需要生成菜品");
|
||||
// return;
|
||||
// }
|
||||
// List<CookRecipe> cookRecipeList = cookRecipeMapper.getCookRecipeByRecipeIds(recipeIdList);
|
||||
// if(!cookRecipeList.isEmpty()){
|
||||
// // Map<Long, CookRecipe> recipeMap = cookRecipeList.stream().collect(Collectors.toMap(CookRecipe::getRecipeId, Function.identity()));
|
||||
// //获取菜谱id对应detailsId信息
|
||||
// recipeIdList.forEach( recipeId -> {
|
||||
// //获取具体的餐次信息
|
||||
// List<CookRecipeDetail> cookRecipeDetailList = cookRecipeDetailMapper.getCookRecipeDetailLTemplate(recipeId, "1");
|
||||
// if(!cookRecipeDetailList.isEmpty()){
|
||||
// cookRecipeDetailList.forEach(detail -> {
|
||||
// //设置菜谱id
|
||||
// //detail.setRecipeId(recipeId);
|
||||
// detail.setApplyDate(applyDate);
|
||||
// detail.setDetailType(2L);
|
||||
// detail.setApplyWeek(Long.valueOf(applyDate.getDayOfWeek().getValue()));
|
||||
// List<CookRecipeDishes> cookRecipeDishesList = cookRecipeDishesMapper.getCookRecipeDishesByDetailId(detail.getRecipeDetailId());
|
||||
// cookRecipeDetailMapper.insertCookRecipeDetail(detail);
|
||||
// if(!cookRecipeDishesList.isEmpty()){
|
||||
// cookRecipeDishesList.forEach(dishes -> {
|
||||
// //设置菜品id
|
||||
// dishes.setRecipeDetailId(detail.getRecipeDetailId());
|
||||
// cookRecipeDishesMapper.insertCookRecipeDishes(dishes);
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// //获取details对应的菜品信息
|
||||
// });
|
||||
//
|
||||
// }else{
|
||||
// log.info("未获取到菜谱信息");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public AppletDishesDetailVO getDishesDetailByDishesId(AppletDishesDetailDTO dto) {
|
||||
// dto.setDelFlag(DelFlagEnum.DEL_FALSE.key());
|
||||
// AppletDishesDetailVO appletDishesDetailVO = cookH5Mapper.selectDishesDetailByDishesId(dto);
|
||||
// Long dishesId = ((AppletDishesSizeV2VO) appletDishesDetailVO.getDishesDetailList().get(0)).getDishesId();
|
||||
// List materialList;
|
||||
// if (appletDishesDetailVO.getMealType() == 1) {
|
||||
// materialList = this.cookH5Mapper.getMenuMaterialById(dishesId);
|
||||
// appletDishesDetailVO.setMaterialList(materialList);
|
||||
// }
|
||||
//
|
||||
//// int countDishes = this.cookH5Mapper.getCollectionCountByUserIdAndDishesId(SecurityUtils.getUserId(), dishesId);
|
||||
//// if (countDishes > 0) {
|
||||
//// appletDishesDetailVO.setIsFavorites(YesOrNoEnum.YES.key());
|
||||
//// } else {
|
||||
//// appletDishesDetailVO.setIsFavorites(YesOrNoEnum.NO.key());
|
||||
//// }
|
||||
//
|
||||
// return appletDishesDetailVO;
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,413 +1,413 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!--<?xml version="1.0" encoding="UTF-8" ?>-->
|
||||
<!--<!DOCTYPE mapper-->
|
||||
<!--PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"-->
|
||||
<!--"http://mybatis.org/dtd/mybatis-3-mapper.dtd">-->
|
||||
|
||||
<mapper namespace="com.bonus.canteen.core.cook.mapper.CookH5Mapper">
|
||||
<!--<mapper namespace="com.bonus.canteen.core.cook.mapper.CookH5Mapper">-->
|
||||
|
||||
<resultMap id="appletWeekCanteenVO" type="com.bonus.canteen.core.cook.vo.CookH5WeekCanteenListVO">
|
||||
<result property="recipeId" column="recipe_id"/>
|
||||
<result property="stallName" column="stall_name"/>
|
||||
<result property="canteenName" column="canteen_name"/>
|
||||
<result property="canteenImgUrl" column="canteen_img_url"/>
|
||||
<result property="stallImgUrl" column="stall_img_url"/>
|
||||
</resultMap>
|
||||
<!-- <resultMap id="appletWeekCanteenVO" type="com.bonus.canteen.core.cook.vo.CookH5WeekCanteenListVO">-->
|
||||
<!-- <result property="recipeId" column="recipe_id"/>-->
|
||||
<!-- <result property="stallName" column="stall_name"/>-->
|
||||
<!-- <result property="canteenName" column="canteen_name"/>-->
|
||||
<!-- <result property="canteenImgUrl" column="canteen_img_url"/>-->
|
||||
<!-- <result property="stallImgUrl" column="stall_img_url"/>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
<resultMap id="appletWeekRecipeVO" type="com.bonus.canteen.core.cook.vo.CookH5WeekDetailsVO">
|
||||
<result property="mealtimeType" column="mealtime_type"/>
|
||||
<collection property="typeList" ofType="com.bonus.canteen.core.cook.vo.CookH5WeekTypeVO">
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="typeName" column="type_name"/>
|
||||
<collection property="dishesList" ofType="com.bonus.canteen.core.cook.vo.CookH5WeekDishesVO">
|
||||
<result property="dishesId" column="dishes_id"/>
|
||||
<result property="dishesName" column="dishes_name"/>
|
||||
<result property="dishesImgUrl" column="dishes_img_url"/>
|
||||
<result property="recipeDetailId" column="recipe_detail_id"/>
|
||||
<result property="canteenId" column="canteen_id"/>
|
||||
<result property="canteenName" column="canteen_name"/>
|
||||
<result property="stallId" column="stall_id"/>
|
||||
<result property="stallName" column="stall_name"/>
|
||||
<collection property="dishesDetailList" ofType="com.bonus.canteen.core.cook.vo.CookH5WeekDishesDetailsVO">
|
||||
<result property="dishesId" column="dishes_id"/>
|
||||
<result property="dishesName" column="dishes_name"/>
|
||||
<result property="remanentNum" column="remanent_num"/>
|
||||
<result property="limitNum" column="limit_num"/>
|
||||
<result property="dishesPrice" column="dishes_price"/>
|
||||
<result property="prefPrice" column="pref_price"/>
|
||||
<result property="sizeType" column="size_type"/>
|
||||
<result property="sizeJson" column="size_json"/>
|
||||
</collection>
|
||||
</collection>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<!-- <resultMap id="appletWeekRecipeVO" type="com.bonus.canteen.core.cook.vo.CookH5WeekDetailsVO">-->
|
||||
<!-- <result property="mealtimeType" column="mealtime_type"/>-->
|
||||
<!-- <collection property="typeList" ofType="com.bonus.canteen.core.cook.vo.CookH5WeekTypeVO">-->
|
||||
<!-- <result property="typeId" column="type_id"/>-->
|
||||
<!-- <result property="typeName" column="type_name"/>-->
|
||||
<!-- <collection property="dishesList" ofType="com.bonus.canteen.core.cook.vo.CookH5WeekDishesVO">-->
|
||||
<!-- <result property="dishesId" column="dishes_id"/>-->
|
||||
<!-- <result property="dishesName" column="dishes_name"/>-->
|
||||
<!-- <result property="dishesImgUrl" column="dishes_img_url"/>-->
|
||||
<!-- <result property="recipeDetailId" column="recipe_detail_id"/>-->
|
||||
<!-- <result property="canteenId" column="canteen_id"/>-->
|
||||
<!-- <result property="canteenName" column="canteen_name"/>-->
|
||||
<!-- <result property="stallId" column="stall_id"/>-->
|
||||
<!-- <result property="stallName" column="stall_name"/>-->
|
||||
<!-- <collection property="dishesDetailList" ofType="com.bonus.canteen.core.cook.vo.CookH5WeekDishesDetailsVO">-->
|
||||
<!-- <result property="dishesId" column="dishes_id"/>-->
|
||||
<!-- <result property="dishesName" column="dishes_name"/>-->
|
||||
<!-- <result property="remanentNum" column="remanent_num"/>-->
|
||||
<!-- <result property="limitNum" column="limit_num"/>-->
|
||||
<!-- <result property="dishesPrice" column="dishes_price"/>-->
|
||||
<!-- <result property="prefPrice" column="pref_price"/>-->
|
||||
<!-- <result property="sizeType" column="size_type"/>-->
|
||||
<!-- <result property="sizeJson" column="size_json"/>-->
|
||||
<!-- </collection>-->
|
||||
<!-- </collection>-->
|
||||
<!-- </collection>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
<select id="getWeekCanteenList" resultMap="appletWeekCanteenVO">
|
||||
select
|
||||
mr.recipe_id,
|
||||
ass.stall_name,
|
||||
ac.canteen_name,
|
||||
ac.img_url as canteen_img_url,
|
||||
ass.img_url as stall_img_url
|
||||
from
|
||||
cook_recipe_bind_app mar
|
||||
left join cook_recipe mr on mar.recipe_id = mr.recipe_id
|
||||
left join basic_canteen ac on mr.canteen_id = ac.canteen_id
|
||||
left join basic_stall ass on mr.stall_id = ass.stall_id
|
||||
where
|
||||
bind_type = 3
|
||||
</select>
|
||||
<!-- <select id="getWeekCanteenList" resultMap="appletWeekCanteenVO">-->
|
||||
<!-- select-->
|
||||
<!-- mr.recipe_id,-->
|
||||
<!-- ass.stall_name,-->
|
||||
<!-- ac.canteen_name,-->
|
||||
<!-- ac.img_url as canteen_img_url,-->
|
||||
<!-- ass.img_url as stall_img_url-->
|
||||
<!-- from-->
|
||||
<!-- cook_recipe_bind_app mar-->
|
||||
<!-- left join cook_recipe mr on mar.recipe_id = mr.recipe_id-->
|
||||
<!-- left join basic_canteen ac on mr.canteen_id = ac.canteen_id-->
|
||||
<!-- left join basic_stall ass on mr.stall_id = ass.stall_id-->
|
||||
<!-- where-->
|
||||
<!-- bind_type = 3-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getWeekRecipeDetail" resultMap="appletWeekRecipeVO">
|
||||
select
|
||||
mrd.mealtime_type,
|
||||
if(md.meal_type = 2, 2, mdt.dishes_type_id) as type_id,
|
||||
if(md.meal_type = 2, '套餐', mdt.dishes_type_name) as type_name,
|
||||
md.dishes_id,
|
||||
md.dishes_name,
|
||||
md.image_url as dishes_img_url,
|
||||
mrd.recipe_detail_id,
|
||||
m.remanent_num,
|
||||
m.limit_num,
|
||||
m.price as dishes_price,
|
||||
m.sale_price as pref_price,
|
||||
ac.canteen_id,
|
||||
ac.canteen_name,
|
||||
ass.stall_id,
|
||||
ass.stall_name,
|
||||
m.size_type,
|
||||
md.size_json
|
||||
from
|
||||
cook_recipe_detail mrd
|
||||
inner join cook_recipe_dishes m on mrd.recipe_detail_id = m.recipe_detail_id
|
||||
inner join cook_dishes md on m.dishes_id = md.dishes_id
|
||||
inner join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id
|
||||
inner join cook_recipe mr on mrd.recipe_id = mr.recipe_id
|
||||
left join cook_dishes_sale_record mdsr on md.dishes_id = mdsr.dishes_id
|
||||
and mr.stall_id = mdsr.stall_id
|
||||
and mdsr.sale_month = month(curdate())
|
||||
left join basic_canteen ac on mr.canteen_id = ac.canteen_id
|
||||
left join basic_stall ass on mr.stall_id = ass.stall_id
|
||||
where
|
||||
mrd.apply_date = #{applyDate}
|
||||
<!-- <select id="getWeekRecipeDetail" resultMap="appletWeekRecipeVO">-->
|
||||
<!-- select-->
|
||||
<!-- mrd.mealtime_type,-->
|
||||
<!-- if(md.meal_type = 2, 2, mdt.dishes_type_id) as type_id,-->
|
||||
<!-- if(md.meal_type = 2, '套餐', mdt.dishes_type_name) as type_name,-->
|
||||
<!-- md.dishes_id,-->
|
||||
<!-- md.dishes_name,-->
|
||||
<!-- md.image_url as dishes_img_url,-->
|
||||
<!-- mrd.recipe_detail_id,-->
|
||||
<!-- m.remanent_num,-->
|
||||
<!-- m.limit_num,-->
|
||||
<!-- m.price as dishes_price,-->
|
||||
<!-- m.sale_price as pref_price,-->
|
||||
<!-- ac.canteen_id,-->
|
||||
<!-- ac.canteen_name,-->
|
||||
<!-- ass.stall_id,-->
|
||||
<!-- ass.stall_name,-->
|
||||
<!-- m.size_type,-->
|
||||
<!-- md.size_json-->
|
||||
<!-- from-->
|
||||
<!-- cook_recipe_detail mrd-->
|
||||
<!-- inner join cook_recipe_dishes m on mrd.recipe_detail_id = m.recipe_detail_id-->
|
||||
<!-- inner join cook_dishes md on m.dishes_id = md.dishes_id-->
|
||||
<!-- inner join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id-->
|
||||
<!-- inner join cook_recipe mr on mrd.recipe_id = mr.recipe_id-->
|
||||
<!-- left join cook_dishes_sale_record mdsr on md.dishes_id = mdsr.dishes_id-->
|
||||
<!-- and mr.stall_id = mdsr.stall_id-->
|
||||
<!-- and mdsr.sale_month = month(curdate())-->
|
||||
<!-- left join basic_canteen ac on mr.canteen_id = ac.canteen_id-->
|
||||
<!-- left join basic_stall ass on mr.stall_id = ass.stall_id-->
|
||||
<!-- where-->
|
||||
<!-- mrd.apply_date = #{applyDate}-->
|
||||
|
||||
and mrd.recipe_id = #{recipeId}
|
||||
<!-- and mrd.recipe_id = #{recipeId}-->
|
||||
|
||||
order by
|
||||
m.remanent_num asc
|
||||
</select>
|
||||
<!-- order by-->
|
||||
<!-- m.remanent_num asc-->
|
||||
<!-- </select>-->
|
||||
|
||||
|
||||
<resultMap id="appletReserveCanteenVO" type="com.bonus.canteen.core.cook.vo.CookH5ReserveCanteenListVO">
|
||||
<result property="canteenId" column="canteen_id"/>
|
||||
<result property="canteenName" column="canteen_name"/>
|
||||
<result property="canteenImgUrl" column="canteen_img_url"/>
|
||||
<result property="startBusinessTime" column="start_business_time_ac"/>
|
||||
<result property="endBusinessTime" column="end_business_time_ac"/>
|
||||
<result property="businessState" column="business_state_ac"/>
|
||||
<collection property="stallList" ofType="com.bonus.canteen.core.cook.vo.CookH5ReserveStallVO">
|
||||
<result property="stallId" column="stall_id"/>
|
||||
<result property="stallName" column="stall_name"/>
|
||||
<result property="stallImgUrl" column="stall_img_url"/>
|
||||
<result property="recipeId" column="recipe_id"/>
|
||||
<result property="startBusinessTime" column="start_business_time"/>
|
||||
<result property="endBusinessTime" column="end_business_time"/>
|
||||
<result property="businessState" column="business_state"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<!-- <resultMap id="appletReserveCanteenVO" type="com.bonus.canteen.core.cook.vo.CookH5ReserveCanteenListVO">-->
|
||||
<!-- <result property="canteenId" column="canteen_id"/>-->
|
||||
<!-- <result property="canteenName" column="canteen_name"/>-->
|
||||
<!-- <result property="canteenImgUrl" column="canteen_img_url"/>-->
|
||||
<!-- <result property="startBusinessTime" column="start_business_time_ac"/>-->
|
||||
<!-- <result property="endBusinessTime" column="end_business_time_ac"/>-->
|
||||
<!-- <result property="businessState" column="business_state_ac"/>-->
|
||||
<!-- <collection property="stallList" ofType="com.bonus.canteen.core.cook.vo.CookH5ReserveStallVO">-->
|
||||
<!-- <result property="stallId" column="stall_id"/>-->
|
||||
<!-- <result property="stallName" column="stall_name"/>-->
|
||||
<!-- <result property="stallImgUrl" column="stall_img_url"/>-->
|
||||
<!-- <result property="recipeId" column="recipe_id"/>-->
|
||||
<!-- <result property="startBusinessTime" column="start_business_time"/>-->
|
||||
<!-- <result property="endBusinessTime" column="end_business_time"/>-->
|
||||
<!-- <result property="businessState" column="business_state"/>-->
|
||||
<!-- </collection>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
<select id="selectReserveMealCanteenList" resultMap="appletReserveCanteenVO">
|
||||
select
|
||||
ac.canteen_id,
|
||||
ac.canteen_name,
|
||||
ac.img_url as canteen_img_url,
|
||||
ass.stall_id,
|
||||
ass.stall_name,
|
||||
ass.img_url as stall_img_url,
|
||||
mr.recipe_id,
|
||||
ac.biz_start_time as start_business_time_ac,
|
||||
ac.biz_end_time as end_business_time_ac,
|
||||
ac.biz_state as business_state_ac,
|
||||
ass.biz_start_time as startBusinessTime,
|
||||
ass.biz_end_time as endBusinessTime,
|
||||
ass.biz_state as businessState
|
||||
from
|
||||
cook_recipe_bind_app mar
|
||||
left join cook_recipe mr on mar.recipe_id = mr.recipe_id
|
||||
left join basic_canteen ac on mr.canteen_id = ac.canteen_id
|
||||
left join basic_stall ass on mr.stall_id = ass.stall_id
|
||||
where
|
||||
bind_type = 2 and mr.del_flag = '0'
|
||||
</select>
|
||||
<!-- <select id="selectReserveMealCanteenList" resultMap="appletReserveCanteenVO">-->
|
||||
<!-- select-->
|
||||
<!-- ac.canteen_id,-->
|
||||
<!-- ac.canteen_name,-->
|
||||
<!-- ac.img_url as canteen_img_url,-->
|
||||
<!-- ass.stall_id,-->
|
||||
<!-- ass.stall_name,-->
|
||||
<!-- ass.img_url as stall_img_url,-->
|
||||
<!-- mr.recipe_id,-->
|
||||
<!-- ac.biz_start_time as start_business_time_ac,-->
|
||||
<!-- ac.biz_end_time as end_business_time_ac,-->
|
||||
<!-- ac.biz_state as business_state_ac,-->
|
||||
<!-- ass.biz_start_time as startBusinessTime,-->
|
||||
<!-- ass.biz_end_time as endBusinessTime,-->
|
||||
<!-- ass.biz_state as businessState-->
|
||||
<!-- from-->
|
||||
<!-- cook_recipe_bind_app mar-->
|
||||
<!-- left join cook_recipe mr on mar.recipe_id = mr.recipe_id-->
|
||||
<!-- left join basic_canteen ac on mr.canteen_id = ac.canteen_id-->
|
||||
<!-- left join basic_stall ass on mr.stall_id = ass.stall_id-->
|
||||
<!-- where-->
|
||||
<!-- bind_type = 2 and mr.del_flag = '0'-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectMonthSalesStall" resultType="com.bonus.canteen.core.cook.vo.StallMonthSalesVO">
|
||||
select
|
||||
stall_id,
|
||||
sum(monthly_sales) as monthly_sales
|
||||
from
|
||||
cook_dishes_sale_record
|
||||
where
|
||||
sale_month = month(curdate())
|
||||
and stall_id in
|
||||
<foreach collection="stallIdList" item="stallId" open="(" separator="," close=")">
|
||||
#{stallId}
|
||||
</foreach>
|
||||
group by
|
||||
stall_id
|
||||
</select>
|
||||
<!-- <select id="selectMonthSalesStall" resultType="com.bonus.canteen.core.cook.vo.StallMonthSalesVO">-->
|
||||
<!-- select-->
|
||||
<!-- stall_id,-->
|
||||
<!-- sum(monthly_sales) as monthly_sales-->
|
||||
<!-- from-->
|
||||
<!-- cook_dishes_sale_record-->
|
||||
<!-- where-->
|
||||
<!-- sale_month = month(curdate())-->
|
||||
<!-- and stall_id in-->
|
||||
<!-- <foreach collection="stallIdList" item="stallId" open="(" separator="," close=")">-->
|
||||
<!-- #{stallId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- group by-->
|
||||
<!-- stall_id-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectTopDishesIdList" resultType="java.lang.Long">
|
||||
<!-- <select id="selectTopDishesIdList" resultType="java.lang.Long">-->
|
||||
|
||||
select
|
||||
dishes_id
|
||||
from
|
||||
cook_dishes_sale_record
|
||||
<where>
|
||||
stall_id in
|
||||
<foreach collection="stallIdList" item="stallId" open="(" separator="," close=")">
|
||||
#{stallId}
|
||||
</foreach>
|
||||
</where>
|
||||
order by
|
||||
sale_num desc
|
||||
<!-- select-->
|
||||
<!-- dishes_id-->
|
||||
<!-- from-->
|
||||
<!-- cook_dishes_sale_record-->
|
||||
<!-- <where>-->
|
||||
<!-- stall_id in-->
|
||||
<!-- <foreach collection="stallIdList" item="stallId" open="(" separator="," close=")">-->
|
||||
<!-- #{stallId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </where>-->
|
||||
<!-- order by-->
|
||||
<!-- sale_num desc-->
|
||||
|
||||
</select>
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectAllRecipeDishesList" resultType="com.bonus.canteen.core.cook.vo.CookH5ReserveDishesVO">
|
||||
select
|
||||
md.dishes_id,
|
||||
md.dishes_name,
|
||||
m.price as dishes_price,
|
||||
md.image_url as dishes_img_url
|
||||
from
|
||||
cook_recipe_detail mrd
|
||||
inner join cook_recipe_dishes m on mrd.recipe_detail_id = m.recipe_detail_id
|
||||
inner join cook_dishes md on m.dishes_id = md.dishes_id
|
||||
where
|
||||
mrd.recipe_id = 1
|
||||
and mrd.apply_date = curdate()
|
||||
and mrd.mealtime_type = 1
|
||||
</select>
|
||||
<!-- <select id="selectAllRecipeDishesList" resultType="com.bonus.canteen.core.cook.vo.CookH5ReserveDishesVO">-->
|
||||
<!-- select-->
|
||||
<!-- md.dishes_id,-->
|
||||
<!-- md.dishes_name,-->
|
||||
<!-- m.price as dishes_price,-->
|
||||
<!-- md.image_url as dishes_img_url-->
|
||||
<!-- from-->
|
||||
<!-- cook_recipe_detail mrd-->
|
||||
<!-- inner join cook_recipe_dishes m on mrd.recipe_detail_id = m.recipe_detail_id-->
|
||||
<!-- inner join cook_dishes md on m.dishes_id = md.dishes_id-->
|
||||
<!-- where-->
|
||||
<!-- mrd.recipe_id = 1-->
|
||||
<!-- and mrd.apply_date = curdate()-->
|
||||
<!-- and mrd.mealtime_type = 1-->
|
||||
<!-- </select>-->
|
||||
|
||||
<resultMap id="appletReserveRecipeVO" type="com.bonus.canteen.core.cook.vo.CookH5ReserveRecipeDetailsVO">
|
||||
<result property="mealtimeType" column="mealtime_type"/>
|
||||
<collection property="typeList" ofType="com.bonus.canteen.core.cook.vo.CookH5ReserveRecipeTypeVO">
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="typeName" column="type_name"/>
|
||||
<collection property="dishesList" ofType="com.bonus.canteen.core.cook.vo.CookH5ReserveRecipeDishesVO">
|
||||
<result property="dishesId" column="dishes_id"/>
|
||||
<result property="dishesName" column="dishes_name"/>
|
||||
<result property="detailType" column="detail_type"/>
|
||||
<result property="dishesImgUrl" column="dishes_img_url"/>
|
||||
<result property="recipeDetailId" column="recipe_detail_id"/>
|
||||
<result property="canteenId" column="canteen_id"/>
|
||||
<result property="canteenName" column="canteen_name"/>
|
||||
<result property="stallId" column="stall_id"/>
|
||||
<result property="stallName" column="stall_name"/>
|
||||
<result property="recommendFlag" column="recommend_flag"/>
|
||||
<collection property="dishesDetailList" ofType="com.bonus.canteen.core.cook.vo.CookH5CurrentDishesDetailVO">
|
||||
<result property="dishesId" column="dishes_id"/>
|
||||
<result property="dishesName" column="dishes_name"/>
|
||||
<result property="remanentNum" column="remanent_num"/>
|
||||
<result property="limitNum" column="limit_num"/>
|
||||
<result property="dishesPrice" column="dishes_price"/>
|
||||
<result property="prefPrice" column="pref_price"/>
|
||||
<result property="sizeType" column="size_type"/>
|
||||
<result property="sizeJson" column="size_json"/>
|
||||
<result property="monthlySales" column="monthly_sales"/>
|
||||
<result property="goodProbability" column="good_probability"/>
|
||||
<collection property="nutritionInfo" resultMap="CookH5ReserveDishesNutritionMap">
|
||||
<!-- <resultMap id="appletReserveRecipeVO" type="com.bonus.canteen.core.cook.vo.CookH5ReserveRecipeDetailsVO">-->
|
||||
<!-- <result property="mealtimeType" column="mealtime_type"/>-->
|
||||
<!-- <collection property="typeList" ofType="com.bonus.canteen.core.cook.vo.CookH5ReserveRecipeTypeVO">-->
|
||||
<!-- <result property="typeId" column="type_id"/>-->
|
||||
<!-- <result property="typeName" column="type_name"/>-->
|
||||
<!-- <collection property="dishesList" ofType="com.bonus.canteen.core.cook.vo.CookH5ReserveRecipeDishesVO">-->
|
||||
<!-- <result property="dishesId" column="dishes_id"/>-->
|
||||
<!-- <result property="dishesName" column="dishes_name"/>-->
|
||||
<!-- <result property="detailType" column="detail_type"/>-->
|
||||
<!-- <result property="dishesImgUrl" column="dishes_img_url"/>-->
|
||||
<!-- <result property="recipeDetailId" column="recipe_detail_id"/>-->
|
||||
<!-- <result property="canteenId" column="canteen_id"/>-->
|
||||
<!-- <result property="canteenName" column="canteen_name"/>-->
|
||||
<!-- <result property="stallId" column="stall_id"/>-->
|
||||
<!-- <result property="stallName" column="stall_name"/>-->
|
||||
<!-- <result property="recommendFlag" column="recommend_flag"/>-->
|
||||
<!-- <collection property="dishesDetailList" ofType="com.bonus.canteen.core.cook.vo.CookH5CurrentDishesDetailVO">-->
|
||||
<!-- <result property="dishesId" column="dishes_id"/>-->
|
||||
<!-- <result property="dishesName" column="dishes_name"/>-->
|
||||
<!-- <result property="remanentNum" column="remanent_num"/>-->
|
||||
<!-- <result property="limitNum" column="limit_num"/>-->
|
||||
<!-- <result property="dishesPrice" column="dishes_price"/>-->
|
||||
<!-- <result property="prefPrice" column="pref_price"/>-->
|
||||
<!-- <result property="sizeType" column="size_type"/>-->
|
||||
<!-- <result property="sizeJson" column="size_json"/>-->
|
||||
<!-- <result property="monthlySales" column="monthly_sales"/>-->
|
||||
<!-- <result property="goodProbability" column="good_probability"/>-->
|
||||
<!-- <collection property="nutritionInfo" resultMap="CookH5ReserveDishesNutritionMap">-->
|
||||
|
||||
</collection>
|
||||
</collection>
|
||||
</collection>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<!-- </collection>-->
|
||||
<!-- </collection>-->
|
||||
<!-- </collection>-->
|
||||
<!-- </collection>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
<select id="selectReserveRecipe" resultMap="appletReserveRecipeVO">
|
||||
<!-- <select id="selectReserveRecipe" resultMap="appletReserveRecipeVO">-->
|
||||
|
||||
select
|
||||
mrd.mealtime_type,
|
||||
if(md.meal_type = 2, 2, mdt.dishes_type_id) as type_id,
|
||||
if(md.meal_type = 2, '套餐', mdt.dishes_type_name) as type_name,
|
||||
md.dishes_id,
|
||||
md.dishes_name,
|
||||
md.meal_type as detail_type,
|
||||
md.image_url as dishes_img_url,
|
||||
mrd.recipe_detail_id,
|
||||
m.remanent_num,
|
||||
m.limit_num,
|
||||
m.price as dishes_price,
|
||||
m.sale_price as pref_price,
|
||||
ac.canteen_id,
|
||||
ac.canteen_name,
|
||||
ass.stall_id,
|
||||
ass.stall_name,
|
||||
m.size_type,
|
||||
m.recommend_flag,
|
||||
md.size_json,
|
||||
mdsr.monthly_sales,
|
||||
mdsr.good_probability,
|
||||
md.dishes_id,
|
||||
md.initial_score,
|
||||
md.calories,
|
||||
md.protein,
|
||||
md.fat,
|
||||
md.carbohydrate,
|
||||
md.dietary_fiber,
|
||||
md.cholesterol,
|
||||
md.calcium,
|
||||
md.sodium,
|
||||
md.purine,
|
||||
md.iron,
|
||||
md.iodine,
|
||||
md.kalium,
|
||||
md.vitamin_a,
|
||||
md.vitamin_c,
|
||||
md.vitamin_e,
|
||||
md.magnesium,
|
||||
md.zinc,
|
||||
md.glycemic_index
|
||||
from
|
||||
cook_recipe_detail mrd
|
||||
inner join cook_recipe_dishes m on mrd.recipe_detail_id = m.recipe_detail_id
|
||||
inner join cook_dishes md on m.dishes_id = md.dishes_id
|
||||
inner join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id
|
||||
inner join cook_recipe mr on mrd.recipe_id = mr.recipe_id
|
||||
inner join cook_recipe_bind_app mar on mr.recipe_id = mar.recipe_id
|
||||
and mar.bind_type = 2
|
||||
left join cook_dishes_sale_record mdsr on md.dishes_id = mdsr.dishes_id
|
||||
and mr.stall_id = mdsr.stall_id
|
||||
and mdsr.sale_month = month(curdate())
|
||||
left join basic_canteen ac on mr.canteen_id = ac.canteen_id
|
||||
left join basic_stall ass on mr.stall_id = ass.stall_id
|
||||
where
|
||||
mrd.apply_date = #{applyDate}
|
||||
and mr.recipe_id = #{recipeId}
|
||||
</select>
|
||||
<!-- select-->
|
||||
<!-- mrd.mealtime_type,-->
|
||||
<!-- if(md.meal_type = 2, 2, mdt.dishes_type_id) as type_id,-->
|
||||
<!-- if(md.meal_type = 2, '套餐', mdt.dishes_type_name) as type_name,-->
|
||||
<!-- md.dishes_id,-->
|
||||
<!-- md.dishes_name,-->
|
||||
<!-- md.meal_type as detail_type,-->
|
||||
<!-- md.image_url as dishes_img_url,-->
|
||||
<!-- mrd.recipe_detail_id,-->
|
||||
<!-- m.remanent_num,-->
|
||||
<!-- m.limit_num,-->
|
||||
<!-- m.price as dishes_price,-->
|
||||
<!-- m.sale_price as pref_price,-->
|
||||
<!-- ac.canteen_id,-->
|
||||
<!-- ac.canteen_name,-->
|
||||
<!-- ass.stall_id,-->
|
||||
<!-- ass.stall_name,-->
|
||||
<!-- m.size_type,-->
|
||||
<!-- m.recommend_flag,-->
|
||||
<!-- md.size_json,-->
|
||||
<!-- mdsr.monthly_sales,-->
|
||||
<!-- mdsr.good_probability,-->
|
||||
<!-- md.dishes_id,-->
|
||||
<!-- md.initial_score,-->
|
||||
<!-- md.calories,-->
|
||||
<!-- md.protein,-->
|
||||
<!-- md.fat,-->
|
||||
<!-- md.carbohydrate,-->
|
||||
<!-- md.dietary_fiber,-->
|
||||
<!-- md.cholesterol,-->
|
||||
<!-- md.calcium,-->
|
||||
<!-- md.sodium,-->
|
||||
<!-- md.purine,-->
|
||||
<!-- md.iron,-->
|
||||
<!-- md.iodine,-->
|
||||
<!-- md.kalium,-->
|
||||
<!-- md.vitamin_a,-->
|
||||
<!-- md.vitamin_c,-->
|
||||
<!-- md.vitamin_e,-->
|
||||
<!-- md.magnesium,-->
|
||||
<!-- md.zinc,-->
|
||||
<!-- md.glycemic_index-->
|
||||
<!-- from-->
|
||||
<!-- cook_recipe_detail mrd-->
|
||||
<!-- inner join cook_recipe_dishes m on mrd.recipe_detail_id = m.recipe_detail_id-->
|
||||
<!-- inner join cook_dishes md on m.dishes_id = md.dishes_id-->
|
||||
<!-- inner join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id-->
|
||||
<!-- inner join cook_recipe mr on mrd.recipe_id = mr.recipe_id-->
|
||||
<!-- inner join cook_recipe_bind_app mar on mr.recipe_id = mar.recipe_id-->
|
||||
<!-- and mar.bind_type = 2-->
|
||||
<!-- left join cook_dishes_sale_record mdsr on md.dishes_id = mdsr.dishes_id-->
|
||||
<!-- and mr.stall_id = mdsr.stall_id-->
|
||||
<!-- and mdsr.sale_month = month(curdate())-->
|
||||
<!-- left join basic_canteen ac on mr.canteen_id = ac.canteen_id-->
|
||||
<!-- left join basic_stall ass on mr.stall_id = ass.stall_id-->
|
||||
<!-- where-->
|
||||
<!-- mrd.apply_date = #{applyDate}-->
|
||||
<!-- and mr.recipe_id = #{recipeId}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getCookMealtimeListByStallId" resultType="com.bonus.canteen.core.cook.vo.CookH5ReserveMealtimeStateVO">
|
||||
<!-- <select id="getCookMealtimeListByStallId" resultType="com.bonus.canteen.core.cook.vo.CookH5ReserveMealtimeStateVO">-->
|
||||
|
||||
SELECT
|
||||
mealtime_type AS mealtimeType,
|
||||
if_enable AS ifUse,
|
||||
start_time AS startTime,
|
||||
end_time AS endTime
|
||||
FROM
|
||||
basic_stall_mealtime
|
||||
WHERE
|
||||
stall_id in
|
||||
<foreach item="stallId" collection="stallIdSet" open="(" separator="," close=")">
|
||||
#{stallId}
|
||||
</foreach>
|
||||
<!-- SELECT-->
|
||||
<!-- mealtime_type AS mealtimeType,-->
|
||||
<!-- if_enable AS ifUse,-->
|
||||
<!-- start_time AS startTime,-->
|
||||
<!-- end_time AS endTime-->
|
||||
<!-- FROM-->
|
||||
<!-- basic_stall_mealtime-->
|
||||
<!-- WHERE-->
|
||||
<!-- stall_id in-->
|
||||
<!-- <foreach item="stallId" collection="stallIdSet" open="(" separator="," close=")">-->
|
||||
<!-- #{stallId}-->
|
||||
<!-- </foreach>-->
|
||||
|
||||
</select>
|
||||
<!-- </select>-->
|
||||
|
||||
<resultMap id="CookH5ReserveDishesNutritionMap" type="com.bonus.canteen.core.cook.vo.CookH5ReserveDishesNutritionVO">
|
||||
<result property="dishesId" column="dishes_id"/>
|
||||
<result property="initialScore" column="initial_score"/>
|
||||
<result property="calories" column="calories"/>
|
||||
<result property="protein" column="protein"/>
|
||||
<result property="fat" column="fat"/>
|
||||
<result property="carbohydrate" column="carbohydrate"/>
|
||||
<result property="dietaryFiber" column="dietary_fiber"/>
|
||||
<result property="cholesterol" column="cholesterol"/>
|
||||
<result property="calcium" column="calcium"/>
|
||||
<result property="sodium" column="sodium"/>
|
||||
<result property="purine" column="purine"/>
|
||||
<result property="iron" column="iron"/>
|
||||
<result property="iodine" column="iodine"/>
|
||||
<result property="kalium" column="kalium"/>
|
||||
<result property="vitaminA" column="vitamin_a"/>
|
||||
<result property="vitaminC" column="vitamin_c"/>
|
||||
<result property="vitaminE" column="vitamin_e"/>
|
||||
<result property="magnesium" column="magnesium"/>
|
||||
<result property="zinc" column="zinc"/>
|
||||
<result property="glycemicIndex" column="glycemic_index"/>
|
||||
</resultMap>
|
||||
<!-- <resultMap id="CookH5ReserveDishesNutritionMap" type="com.bonus.canteen.core.cook.vo.CookH5ReserveDishesNutritionVO">-->
|
||||
<!-- <result property="dishesId" column="dishes_id"/>-->
|
||||
<!-- <result property="initialScore" column="initial_score"/>-->
|
||||
<!-- <result property="calories" column="calories"/>-->
|
||||
<!-- <result property="protein" column="protein"/>-->
|
||||
<!-- <result property="fat" column="fat"/>-->
|
||||
<!-- <result property="carbohydrate" column="carbohydrate"/>-->
|
||||
<!-- <result property="dietaryFiber" column="dietary_fiber"/>-->
|
||||
<!-- <result property="cholesterol" column="cholesterol"/>-->
|
||||
<!-- <result property="calcium" column="calcium"/>-->
|
||||
<!-- <result property="sodium" column="sodium"/>-->
|
||||
<!-- <result property="purine" column="purine"/>-->
|
||||
<!-- <result property="iron" column="iron"/>-->
|
||||
<!-- <result property="iodine" column="iodine"/>-->
|
||||
<!-- <result property="kalium" column="kalium"/>-->
|
||||
<!-- <result property="vitaminA" column="vitamin_a"/>-->
|
||||
<!-- <result property="vitaminC" column="vitamin_c"/>-->
|
||||
<!-- <result property="vitaminE" column="vitamin_e"/>-->
|
||||
<!-- <result property="magnesium" column="magnesium"/>-->
|
||||
<!-- <result property="zinc" column="zinc"/>-->
|
||||
<!-- <result property="glycemicIndex" column="glycemic_index"/>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
<select id="selectNutrition" resultMap="CookH5ReserveDishesNutritionMap">
|
||||
select
|
||||
md.dishes_id,
|
||||
md.initial_score,
|
||||
md.calories,
|
||||
md.protein,
|
||||
md.fat,
|
||||
md.carbohydrate,
|
||||
md.dietary_fiber,
|
||||
md.cholesterol,
|
||||
md.calcium,
|
||||
md.sodium,
|
||||
md.purine,
|
||||
md.iron,
|
||||
md.iodine,
|
||||
md.kalium,
|
||||
md.vitamin_a,
|
||||
md.vitamin_c,
|
||||
md.vitamin_e,
|
||||
md.magnesium,
|
||||
md.zinc,
|
||||
md.glycemic_index
|
||||
from
|
||||
cook_dishes md
|
||||
left join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id
|
||||
where
|
||||
md.dishes_id in
|
||||
<foreach collection="dishesIdSet" item="dishesId" open="(" separator="," close=")">
|
||||
#{dishesId}
|
||||
</foreach>
|
||||
</select>
|
||||
<!-- <select id="selectNutrition" resultMap="CookH5ReserveDishesNutritionMap">-->
|
||||
<!-- select-->
|
||||
<!-- md.dishes_id,-->
|
||||
<!-- md.initial_score,-->
|
||||
<!-- md.calories,-->
|
||||
<!-- md.protein,-->
|
||||
<!-- md.fat,-->
|
||||
<!-- md.carbohydrate,-->
|
||||
<!-- md.dietary_fiber,-->
|
||||
<!-- md.cholesterol,-->
|
||||
<!-- md.calcium,-->
|
||||
<!-- md.sodium,-->
|
||||
<!-- md.purine,-->
|
||||
<!-- md.iron,-->
|
||||
<!-- md.iodine,-->
|
||||
<!-- md.kalium,-->
|
||||
<!-- md.vitamin_a,-->
|
||||
<!-- md.vitamin_c,-->
|
||||
<!-- md.vitamin_e,-->
|
||||
<!-- md.magnesium,-->
|
||||
<!-- md.zinc,-->
|
||||
<!-- md.glycemic_index-->
|
||||
<!-- from-->
|
||||
<!-- cook_dishes md-->
|
||||
<!-- left join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id-->
|
||||
<!-- where-->
|
||||
<!-- md.dishes_id in-->
|
||||
<!-- <foreach collection="dishesIdSet" item="dishesId" open="(" separator="," close=")">-->
|
||||
<!-- #{dishesId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectRecipeIdList" resultType="java.lang.Long">
|
||||
select recipe_id from cook_recipe
|
||||
where recipe_type in (2,3)
|
||||
</select>
|
||||
<!-- <select id="selectRecipeIdList" resultType="java.lang.Long">-->
|
||||
<!-- select recipe_id from cook_recipe-->
|
||||
<!-- where recipe_type in (2,3)-->
|
||||
<!-- </select>-->
|
||||
|
||||
|
||||
<select id="recipeIdMap" resultType="long">
|
||||
select recipe_id as recipeId from cook_recipe_detail
|
||||
WHERE apply_date = #{applyDate} and detail_type = 2
|
||||
and recipe_id in
|
||||
<foreach collection="recipeIdList" item="recipeId" open="(" separator="," close=")">
|
||||
#{recipeId}
|
||||
</foreach>
|
||||
GROUP BY recipe_id
|
||||
</select>
|
||||
<!-- <select id="recipeIdMap" resultType="long">-->
|
||||
<!-- select recipe_id as recipeId from cook_recipe_detail-->
|
||||
<!-- WHERE apply_date = #{applyDate} and detail_type = 2-->
|
||||
<!-- and recipe_id in-->
|
||||
<!-- <foreach collection="recipeIdList" item="recipeId" open="(" separator="," close=")">-->
|
||||
<!-- #{recipeId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- GROUP BY recipe_id-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="selectDishesDetailByDishesId" resultType="com.bonus.canteen.core.cook.vo.AppletDishesDetailVO">
|
||||
select
|
||||
md.dishes_id,
|
||||
md.meal_type,
|
||||
md.custom_id,
|
||||
md.dishes_name,
|
||||
md.alias_name,
|
||||
md.image_url,
|
||||
md.intro,
|
||||
md.particulars,
|
||||
mrd.size_type,
|
||||
md.size_json,
|
||||
mrd.price as dishes_price,
|
||||
mrd.sale_price as pref_price,
|
||||
mrd.supply_num - mrd.remanent_num as sales_num,
|
||||
mrd.remanent_num as surplusNum,
|
||||
mrd.limit_num as restrictNum,
|
||||
md.calories,
|
||||
md.protein,
|
||||
md.fat,
|
||||
md.carbohydrate,
|
||||
md.dietary_fiber,
|
||||
md.cholesterol,
|
||||
md.calcium,
|
||||
md.sodium
|
||||
from
|
||||
cook_dishes md
|
||||
left join cook_recipe_dishes mrd on md.dishes_id = mrd.dishes_id
|
||||
where
|
||||
md.dishes_id = #{dishesId}
|
||||
and mrd.recipe_detail_id = #{detailId}
|
||||
<!-- and md.del_flag = #{delFlag}-->
|
||||
limit 1
|
||||
</select>
|
||||
<!-- <select id="selectDishesDetailByDishesId" resultType="com.bonus.canteen.core.cook.vo.AppletDishesDetailVO">-->
|
||||
<!-- select-->
|
||||
<!-- md.dishes_id,-->
|
||||
<!-- md.meal_type,-->
|
||||
<!-- md.custom_id,-->
|
||||
<!-- md.dishes_name,-->
|
||||
<!-- md.alias_name,-->
|
||||
<!-- md.image_url,-->
|
||||
<!-- md.intro,-->
|
||||
<!-- md.particulars,-->
|
||||
<!-- mrd.size_type,-->
|
||||
<!-- md.size_json,-->
|
||||
<!-- mrd.price as dishes_price,-->
|
||||
<!-- mrd.sale_price as pref_price,-->
|
||||
<!-- mrd.supply_num - mrd.remanent_num as sales_num,-->
|
||||
<!-- mrd.remanent_num as surplusNum,-->
|
||||
<!-- mrd.limit_num as restrictNum,-->
|
||||
<!-- md.calories,-->
|
||||
<!-- md.protein,-->
|
||||
<!-- md.fat,-->
|
||||
<!-- md.carbohydrate,-->
|
||||
<!-- md.dietary_fiber,-->
|
||||
<!-- md.cholesterol,-->
|
||||
<!-- md.calcium,-->
|
||||
<!-- md.sodium-->
|
||||
<!-- from-->
|
||||
<!-- cook_dishes md-->
|
||||
<!-- left join cook_recipe_dishes mrd on md.dishes_id = mrd.dishes_id-->
|
||||
<!-- where-->
|
||||
<!-- md.dishes_id = #{dishesId}-->
|
||||
<!-- and mrd.recipe_detail_id = #{detailId}-->
|
||||
<!-- <!– and md.del_flag = #{delFlag}–>-->
|
||||
<!-- limit 1-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getMenuMaterialById" resultType="java.util.List">
|
||||
</select>
|
||||
</mapper>
|
||||
<!-- <select id="getMenuMaterialById" resultType="java.util.List">-->
|
||||
<!-- </select>-->
|
||||
<!--</mapper>-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue