预订餐h5
This commit is contained in:
parent
3ba062c3d5
commit
9a2a6db3a6
|
|
@ -33,7 +33,7 @@ public class AllocStallMealtime extends BaseEntity {
|
|||
/** 餐次类型 */
|
||||
@Excel(name = "餐次类型")
|
||||
@ApiModelProperty(value = "餐次类型")
|
||||
private Long mealtimeType;
|
||||
private Integer mealtimeType;
|
||||
|
||||
/** 餐次名称 */
|
||||
@Excel(name = "餐次名称")
|
||||
|
|
|
|||
|
|
@ -204,53 +204,8 @@ public class MenuAppRecipeServiceImpl implements IMenuAppRecipeService {
|
|||
resultList = resultList.stream().filter((time) -> {
|
||||
return finalMealTimeList.stream().map(AllocStallMealtime::getMealtimeType).collect(Collectors.toList()).contains(time.getMealtimeType());
|
||||
}).collect(Collectors.toList());
|
||||
Set<Long> dishesIdSet = resultList.stream().flatMap((time) -> {
|
||||
return time.getTypeList().stream().flatMap((type) -> {
|
||||
return type.getDishesList().stream().map((item) -> {
|
||||
return (item.getDishesDetailList().get(0)).getDishesId();
|
||||
});
|
||||
});
|
||||
}).collect(Collectors.toSet());
|
||||
if (ObjectUtil.isEmpty(dishesIdSet)) {
|
||||
return resultList;
|
||||
} else {
|
||||
Iterator var10 = resultList.iterator();
|
||||
|
||||
while (true) {
|
||||
List<AppletReserveRecipeTypeVO> typeList;
|
||||
do {
|
||||
if (!var10.hasNext()) {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
AppletReserveRecipeVO mealtime = (AppletReserveRecipeVO) var10.next();
|
||||
typeList = mealtime.getTypeList();
|
||||
} while (!ObjectUtil.isNotEmpty(typeList));
|
||||
|
||||
List<AppletReserveRecipeDishesVO> recommendList = Lists.newArrayList();
|
||||
|
||||
for (AppletReserveRecipeTypeVO type : typeList) {
|
||||
List<AppletReserveRecipeDishesVO> dishesList = type.getDishesList();
|
||||
if (ObjectUtil.isNotEmpty(dishesList)) {
|
||||
List<AppletReserveRecipeDishesVO> tempList = dishesList.stream().filter((d) -> {
|
||||
return d.getRecommendFlag() == 1;
|
||||
}).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(tempList)) {
|
||||
recommendList.addAll(tempList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(recommendList)) {
|
||||
AppletReserveRecipeTypeVO recommend = new AppletReserveRecipeTypeVO();
|
||||
recommend.setTypeId(999L);
|
||||
recommend.setTypeName("推荐");
|
||||
recommend.setDishesList(recommendList);
|
||||
typeList.add(0, recommend);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue