处理菜品不存在的情况
This commit is contained in:
		| @ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.service.order; | ||||
| import cn.hutool.core.collection.CollectionUtil; | ||||
| import cn.hutool.core.util.NumberUtil; | ||||
| import cn.hutool.core.util.ObjUtil; | ||||
| import cn.hutool.core.util.ObjectUtil; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| @ -165,10 +166,12 @@ public class OrderServiceImpl implements OrderService { | ||||
|  | ||||
|                 appOrderDetailRespVOS.forEach(respVo -> { | ||||
|                     DishesRespDto dishesRespDto = dishMap.get(respVo.getDishesId()); | ||||
|                     if(ObjectUtil.isNotEmpty(dishesRespDto)){ | ||||
|                         respVo.setDishesBasePrice(dishesRespDto.getDishesBasePrice()) | ||||
|                                 .setDishesSumPrice(dishesRespDto.getDishesSumPrice()) | ||||
|                                 .setDishesNumber(dishesRespDto.getDishesNumber()); | ||||
|                     } | ||||
|  | ||||
|                     respVo.setDishesBasePrice(dishesRespDto.getDishesBasePrice()) | ||||
|                             .setDishesSumPrice(dishesRespDto.getDishesSumPrice()) | ||||
|                             .setDishesNumber(dishesRespDto.getDishesNumber()); | ||||
|                 }); | ||||
|                 dishOrderDO.setRefundStatus(refundService.getRefundStatus(dishOrderDO.getId())); | ||||
|             } | ||||
|  | ||||
| @ -576,7 +576,12 @@ public class MemberUserServiceImpl implements MemberUserService { | ||||
|                     .collect(Collectors.toList()); | ||||
|             //获取菜品营养信息 | ||||
|             List<DishesNutritionRespDTO> dishesList=new ArrayList<>(); | ||||
|             collect1.forEach(x-> dishesList.addAll(dishesNutritionApil.getDishesList(x))); | ||||
|             collect1.forEach(x-> { | ||||
|                 List<DishesNutritionRespDTO> dishesList1 = dishesNutritionApil.getDishesList(x); | ||||
|                 if ( CollectionUtil.isNotEmpty(dishesList1)){ | ||||
|                     dishesList.addAll(dishesList1); | ||||
|                 } | ||||
|             }); | ||||
|             //根据营养名称进行分组 | ||||
|             if(ObjUtil.isNotEmpty(dishesList)){ | ||||
|                 BigDecimal reduce = value1.stream() | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 seesaw
					seesaw