|
@@ -1,10 +1,15 @@
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import jdk.internal.org.objectweb.asm.Handle;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.system.mapper.OrderFoodMapper;
|
|
@@ -44,6 +49,41 @@ public class OrderFoodServiceImpl implements IOrderFoodService {
|
|
|
return orderFoodMapper.selectOrderFoodList(orderFood);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult selectOrderFoodListRiLi(OrderFood orderFood) {
|
|
|
+ List<OrderFood> orderFoods = orderFoodMapper.selectOrderFoodList(orderFood);
|
|
|
+ Map<Date, List<OrderFood>> foodTime = new HashMap<>();
|
|
|
+ if (orderFoods != null && orderFoods.size() > 0){
|
|
|
+ foodTime = orderFoods.stream().collect(Collectors.groupingBy(OrderFood::getOrderFoodTime));
|
|
|
+ }
|
|
|
+ List<String> dayList = DateUtils.getDay(orderFood.getOrderFoodTime());
|
|
|
+ Map<String,Object> map = new HashMap<>(31);
|
|
|
+ if (dayList.size()> 0){
|
|
|
+ for (String day : dayList) {
|
|
|
+ map.put("date",day);
|
|
|
+ map.put("am","未预约");
|
|
|
+ map.put("pm","未预约");
|
|
|
+ if (foodTime.size() > 0){
|
|
|
+ List<OrderFood> orderFoodsList = foodTime.get(DateUtils.parseDate(day));
|
|
|
+ if (orderFoodsList != null && orderFoodsList.size() > 0){
|
|
|
+ for (OrderFood food : orderFoodsList) {
|
|
|
+ String orderFoodType = food.getOrderFoodType();
|
|
|
+ if ("1".equals(orderFoodType)){
|
|
|
+ map.put("am","已预约");
|
|
|
+ map.put("amId",food.getOrderFoodId());
|
|
|
+ }
|
|
|
+ else if ("2".equals(orderFoodType)){
|
|
|
+ map.put("pm","已预约");
|
|
|
+ map.put("pmId",food.getOrderFoodId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 新增订餐预约
|
|
|
*
|