public OrderOfDetail smartOfOrderDish(long restId,int personNum, float avPrice, Object obj) {

		OrderOfDetail ood = new OrderOfDetail();
		
		dishMap = new HashMap<String, List<DishDetail>>();
		//PageBean<Map<String, List<DishDetail>>> pageBean = new PageBean<Map<String, List<DishDetail>>>();

		if (personNum <= 0 || avPrice <= 0) {
			return null;
		}

		try {
			   list = new ArrayList<DishDetail>();

				//取凉菜
				//设置pegeNum和pageSize
				List<DishDetail> coldDish = dishService.selectDishByRestIdAndCategory(restId,Category.COLD.getNum(), 1, 5);

				int dishNum = randNum(coldDish.size());

				list.add(coldDish.get(dishNum));

				dishMap.put(Category.getNameByNum(Category.COLD.getNum()),list);


			        list = new ArrayList<DishDetail>();
				//取汤
				//设置pegeNum和pageSize
				List<DishDetail> soupDish = dishService.selectDishByRestIdAndCategory(restId, Category.SOUP.getNum(), 1, 5);

				dishNum = randNum(soupDish.size());

				list.add(coldDish.get(dishNum));

				dishMap.put(Category.getNameByNum(Category.SOUP.getNum()),list);

				//取热菜
				list = new ArrayList<DishDetail>();

				//设置pegeNum和pageSize
				List<DishDetail> hotDish = dishService.selectDishByRestIdAndCategory(restId, Category.HOT.getNum(), 1, 20);

				int[] nums = randNums(personNum,hotDish.size());

				for(int i = 0;i < nums.length;i++){
					
				    list.add(hotDish.get(nums[i]));
				}

				dishMap.put(Category.getNameByNum(Category.HOT.getNum()),list);

				ood.setAverPrice(avPrice);
				ood.setRestId(restId);
				ood.setPersonNum(personNum);
				//还要加订单创建的时间以及菜品的总价
				
				ood.dishs = dishMap;
			
		} catch (Exception e) {
			logger.warn("智能点餐失败", e);
			
			return null;
		}
		
		
		
		return ood;

	}