package com.wechat.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.beust.jcommander.internal.Lists;
import com.wechat.dao.MdeHotelCompanyDao;
import com.wechat.model.dbEntity.MdeHotelCompany;
import com.wechat.model.dto.HotelCompanyDto;
import com.wechat.model.responseDto.HotelCompanyResp;

@Service
public class MdeHotelCompanyService {

	@Autowired
	MdeHotelCompanyDao mdeHotelCompanyDao;

	//获取所有酒店公司
	public List<MdeHotelCompany> getAllHotelCompanyByLang(Map<String, String> map) {
		return mdeHotelCompanyDao.getAllHotelCompanyByLang(map);
	}

	public List<HotelCompanyResp> getAllHotelCompanyInternational() {
		List<HotelCompanyResp> listHotelDto = Lists.newArrayList();
		HotelCompanyResp hotelDto = new HotelCompanyResp();
		List<HotelCompanyDto> list = mdeHotelCompanyDao.getAllHotelCompany();
		// 0.所有
		hotelDto.setInternational("0");
		hotelDto.setListHotelCompany(list);
		listHotelDto.add(hotelDto);
		
		/*// 1.国际
		List<HotelCompanyDto> list1 = Lists.newArrayList();

		// 2.国内
		List<HotelCompanyDto> list2 = Lists.newArrayList();
		for (HotelCompanyDto mdeHotelCompany : list) {
			if (mdeHotelCompany.getInternational().equals("1")) {
				list1.add(mdeHotelCompany);
			}
			if (mdeHotelCompany.getInternational().equals("2")) {
				list2.add(mdeHotelCompany);
			}
		}
		HotelCompanyResp hotelDto1 = new HotelCompanyResp();
		hotelDto1.setInternational("1");
		hotelDto1.setListHotelCompany(list1);
		listHotelDto.add(hotelDto1);
		HotelCompanyResp hotelDto2 = new HotelCompanyResp();
		hotelDto2.setInternational("2");
		hotelDto2.setListHotelCompany(list2);
		listHotelDto.add(hotelDto2);*/
		
		return listHotelDto;
	}
}
