|
@@ -1,436 +0,0 @@
|
|
|
-package com.tripto.api.supplier.cnbooking.service;
|
|
|
-
|
|
|
-import java.io.FileInputStream;
|
|
|
-import java.io.InputStreamReader;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Properties;
|
|
|
-
|
|
|
-import org.dom4j.Element;
|
|
|
-import org.json.JSONArray;
|
|
|
-import org.json.JSONObject;
|
|
|
-import org.json.XML;
|
|
|
-import org.jsoup.Jsoup;
|
|
|
-import org.jsoup.nodes.Document;
|
|
|
-
|
|
|
-import com.tripto.api.supplier.service.entity.BedTypeEntity;
|
|
|
-import com.tripto.api.supplier.service.entity.DistrictEntity;
|
|
|
-import com.tripto.api.supplier.service.entity.HoltelEnty;
|
|
|
-import com.tripto.api.supplier.service.entity.RoomEntity;
|
|
|
-import com.tripto.api.supplier.service.entity.RoomTypeEntity;
|
|
|
-import com.tripto.api.util.HttpRequestUtil;
|
|
|
-import com.tripto.api.util.ParseRequestUtil;
|
|
|
-import com.tripto.api.util.PropertiesUtil;
|
|
|
-import com.tripto.api.util.SignatureUtil;
|
|
|
-
|
|
|
-/**
|
|
|
- * 龙腾捷旅ServiceImpl
|
|
|
- * @author zhx
|
|
|
- *
|
|
|
- */
|
|
|
-public class CNBookingStaticInforServiceImpl implements CNBookingStaticInforService {
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取区域静态信息
|
|
|
- * @return 区域信息集合
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- public List<DistrictEntity> cityQuery() throws Exception {
|
|
|
- String url = PropertiesUtil.readValueFromProp("properties/URL.properties", "CNBookingURL");
|
|
|
- String auth = SignatureUtil.getCNBookingAuth();
|
|
|
- String html = HttpRequestUtil.CNBoookingGet(url + "?ActionName=CityQuery" + "&auth=" + auth);
|
|
|
- Document document = Jsoup.parse(html);
|
|
|
- String text = document.select("pre[id=xmlPrview]").get(0).text();
|
|
|
-
|
|
|
- DistrictEntity districtEntity = null;
|
|
|
- List<DistrictEntity> list = new ArrayList<DistrictEntity>();
|
|
|
-
|
|
|
- Element element = ParseRequestUtil.parseCNBookingXMl(text);
|
|
|
- List<Element> countrys = element.element("Countrys").elements("Country");
|
|
|
- for (Element country : countrys) {
|
|
|
- List<Element> provinces = country.elements("Province");
|
|
|
- if (!provinces.isEmpty()) {
|
|
|
- for (Element province : provinces) {
|
|
|
- List<Element> citys = province.elements("City");
|
|
|
- if (!citys.isEmpty()) {
|
|
|
- for (Element city : citys) {
|
|
|
- List<Element> locations = city.elements("Location");
|
|
|
- if (!locations.isEmpty()) {
|
|
|
- for (Element location : locations) {
|
|
|
- districtEntity = new DistrictEntity();
|
|
|
- list.add(districtEntity);
|
|
|
- districtEntity.setCountryId(country.attributeValue("CountryId"));
|
|
|
- districtEntity.setCountryName(country.attributeValue("CountryName"));
|
|
|
- districtEntity.setProvinceId(province.attributeValue("ProvinceId"));
|
|
|
- districtEntity.setProvinceName(province.attributeValue("ProvinceName"));
|
|
|
- districtEntity.setCityId(city.attributeValue("CityId"));
|
|
|
- districtEntity.setCityName(city.attributeValue("CityName"));
|
|
|
- districtEntity.setDistrictId(Long.valueOf(location.attributeValue("LocationId")));
|
|
|
- districtEntity.setDistrictName(location.attributeValue("LocationName"));
|
|
|
- }
|
|
|
- } else {
|
|
|
- districtEntity = new DistrictEntity();
|
|
|
- list.add(districtEntity);
|
|
|
- districtEntity.setCountryId(country.attributeValue("CountryId"));
|
|
|
- districtEntity.setCountryName(country.attributeValue("CountryName"));
|
|
|
- districtEntity.setProvinceId(province.attributeValue("ProvinceId"));
|
|
|
- districtEntity.setProvinceName(province.attributeValue("ProvinceName"));
|
|
|
- districtEntity.setCityId(city.attributeValue("CityId"));
|
|
|
- districtEntity.setCityName(city.attributeValue("CityName"));
|
|
|
- districtEntity.setDistrictId(null);
|
|
|
- districtEntity.setDistrictName(null);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- districtEntity = new DistrictEntity();
|
|
|
- list.add(districtEntity);
|
|
|
- districtEntity.setCountryId(country.attributeValue("CountryId"));
|
|
|
- districtEntity.setCountryName(country.attributeValue("CountryName"));
|
|
|
- districtEntity.setProvinceId(province.attributeValue("ProvinceId"));
|
|
|
- districtEntity.setProvinceName(province.attributeValue("ProvinceName"));
|
|
|
- districtEntity.setCityId(null);
|
|
|
- districtEntity.setCityName(null);
|
|
|
- districtEntity.setDistrictId(null);
|
|
|
- districtEntity.setDistrictName(null);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- districtEntity = new DistrictEntity();
|
|
|
- list.add(districtEntity);
|
|
|
- districtEntity.setCountryId(country.attributeValue("CountryId"));
|
|
|
- districtEntity.setCountryName(country.attributeValue("CountryName"));
|
|
|
- districtEntity.setProvinceId(null);
|
|
|
- districtEntity.setProvinceName(null);
|
|
|
- districtEntity.setCityId(null);
|
|
|
- districtEntity.setCityName(null);
|
|
|
- districtEntity.setDistrictId(null);
|
|
|
- districtEntity.setDistrictName(null);
|
|
|
- }
|
|
|
- }
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取床型静态信息
|
|
|
- * @return 床型信息集合
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- public List<BedTypeEntity> bedTypeQuery() throws Exception {
|
|
|
- String url = PropertiesUtil.readValueFromProp("properties/URL.properties", "CNBookingURL");
|
|
|
- String auth = SignatureUtil.getCNBookingAuth();
|
|
|
- String html = HttpRequestUtil.CNBoookingGet(url + "?ActionName=BedTypeQuery" + "&auth=" + auth);
|
|
|
- Document document = Jsoup.parse(html);
|
|
|
- String text = document.select("pre[id=xmlPrview]").get(0).text();
|
|
|
-
|
|
|
- BedTypeEntity bedTypeEntity = null;
|
|
|
- List<BedTypeEntity> list = new ArrayList<BedTypeEntity>();
|
|
|
-
|
|
|
- Element element = ParseRequestUtil.parseCNBookingXMl(text);
|
|
|
- List<Element> bedTypes = element.element("BedTypes").elements("BedType");
|
|
|
- for (Element bedType : bedTypes) {
|
|
|
- bedTypeEntity = new BedTypeEntity();
|
|
|
- list.add(bedTypeEntity);
|
|
|
- bedTypeEntity.setBedTypeName(bedType.attributeValue("BedTypeName"));
|
|
|
- bedTypeEntity.setBedTypeId(bedType.attributeValue("BedTypeId"));
|
|
|
- }
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取房型静态信息
|
|
|
- * @return 房型信息集合
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- public List<RoomTypeEntity> roomTypeQuery() throws Exception {
|
|
|
- String url = PropertiesUtil.readValueFromProp("properties/URL.properties", "CNBookingURL");
|
|
|
- String auth = SignatureUtil.getCNBookingAuth();
|
|
|
- String html = HttpRequestUtil.CNBoookingGet(url + "?ActionName=RoomTypeQuery" + "&auth=" + auth);
|
|
|
- Document document = Jsoup.parse(html);
|
|
|
- String text = document.select("pre[id=xmlPrview]").get(0).text();
|
|
|
-
|
|
|
- RoomTypeEntity roomEntity = null;
|
|
|
- List<RoomTypeEntity> list = new ArrayList<RoomTypeEntity>();
|
|
|
-
|
|
|
- Element element = ParseRequestUtil.parseCNBookingXMl(text);
|
|
|
- List<Element> roomTypes = element.element("RoomTypes").elements("RoomType");
|
|
|
- for (Element roomType : roomTypes) {
|
|
|
- roomEntity = new RoomTypeEntity();
|
|
|
- list.add(roomEntity);
|
|
|
- roomEntity.setRoomTypeId(roomType.attributeValue("RoomTypeId"));
|
|
|
- roomEntity.setRoomTypeName(roomType.attributeValue("RoomTypeName"));
|
|
|
- }
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取酒店总数
|
|
|
- * @param countryId 国家id
|
|
|
- * @return 酒店数量
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- public int getHotelCount(Long countryId) throws Exception {
|
|
|
- Element element = HttpRequestUtil.getCNBookingIdentityInfo(1, 1);
|
|
|
- //请求接口
|
|
|
- element.addElement("ActionName").addText("HotelSearch");
|
|
|
- //查询条件,设置国家id,语言
|
|
|
- Element searchConditions = element.addElement("SearchConditions");
|
|
|
- searchConditions.addElement("CountryId").addText(countryId.toString());
|
|
|
- searchConditions.addElement("Lang").addText("GB");
|
|
|
- //请求数据
|
|
|
- String result = HttpRequestUtil.CNBoookingPost(element.asXML());
|
|
|
- //解析
|
|
|
- element = ParseRequestUtil.parseCNBookingXMl(result);
|
|
|
- return Integer.valueOf(element.element("Hotels").elementTextTrim("HotelCount"));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取酒店静态信息
|
|
|
- * @param pageItems 每页条数
|
|
|
- * @param pageNo 页码
|
|
|
- * @param countryId 国家id
|
|
|
- * @return 酒店信息集合
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- public List<HoltelEnty> hotelSearch(int pageItems, int pageNo, Long countryId) throws Exception {
|
|
|
- Element element = HttpRequestUtil.getCNBookingIdentityInfo(pageItems, pageNo);
|
|
|
- //请求接口
|
|
|
- element.addElement("ActionName").addText("HotelSearch");
|
|
|
- //查询条件,设置国家id,语言
|
|
|
- Element searchConditions = element.addElement("SearchConditions");
|
|
|
- searchConditions.addElement("CountryId").addText(countryId.toString());
|
|
|
- searchConditions.addElement("Lang").addText("GB");
|
|
|
- //请求
|
|
|
- String result = HttpRequestUtil.CNBoookingPost(element.asXML());
|
|
|
- //解析
|
|
|
- element = ParseRequestUtil.parseCNBookingXMl(result);
|
|
|
- HoltelEnty holtelEnty = null;
|
|
|
- List<HoltelEnty> list = new ArrayList<HoltelEnty>();
|
|
|
- Element hotel = null;
|
|
|
- List<Element> hotels = element.element("Hotels").elements("Hotel");
|
|
|
- for (int i = 0; i < hotels.size(); i++) {
|
|
|
- if (hotel.elementTextTrim("Lon") == null || hotel.elementTextTrim("Lat") == null) {
|
|
|
- break;
|
|
|
- }
|
|
|
- if (Double.valueOf(hotel.elementTextTrim("Lon")) == 0 || Double.valueOf(hotel.elementTextTrim("Lat")) == 0) {
|
|
|
- break;
|
|
|
- }
|
|
|
- hotel = hotels.get(i);
|
|
|
- holtelEnty = new HoltelEnty();
|
|
|
- list.add(holtelEnty);
|
|
|
- holtelEnty.setHotelId(hotel.elementTextTrim("HotelId"));
|
|
|
- holtelEnty.setHotelName(hotel.elementTextTrim("HotelName"));
|
|
|
- holtelEnty.setCountryId(hotel.elementTextTrim("CountryId"));
|
|
|
- holtelEnty.setCountryName(hotel.elementTextTrim("CountryName"));
|
|
|
- holtelEnty.setProvinceId(hotel.elementTextTrim("ProvinceId"));
|
|
|
- holtelEnty.setProvinceName(hotel.elementTextTrim("ProvinceName"));
|
|
|
- holtelEnty.setCityId(hotel.elementTextTrim("CityId"));
|
|
|
- holtelEnty.setCityName(hotel.elementTextTrim("CityName"));
|
|
|
- holtelEnty.setAddress(hotel.elementTextTrim("Address"));
|
|
|
- holtelEnty.setPostCode(hotel.elementTextTrim("PostCode"));
|
|
|
- holtelEnty.setEmail(hotel.elementTextTrim("Email"));
|
|
|
- holtelEnty.setStartBusinessDate(hotel.elementTextTrim("StartBusinessDate"));
|
|
|
- holtelEnty.setRepairdate(hotel.elementTextTrim("Repairdate"));
|
|
|
- holtelEnty.setRecommendedLevel(hotel.elementTextTrim("RecommendedLevel"));
|
|
|
- holtelEnty.setStar(hotel.elementTextTrim("Star"));
|
|
|
- holtelEnty.setGoogleLon(hotel.elementTextTrim("Lon"));
|
|
|
- holtelEnty.setGoogleLat(hotel.elementTextTrim("Lat"));
|
|
|
- holtelEnty.setIntro(hotel.elementTextTrim("Intro"));
|
|
|
- holtelEnty.setAllowWebSale(hotel.elementTextTrim("AllowWebSale"));
|
|
|
- holtelEnty.setGuide(hotel.elementTextTrim("Guide"));
|
|
|
- holtelEnty.setReserve2(hotel.elementTextTrim("Reserve2"));
|
|
|
- holtelEnty.setImages(XML.toJSONObject(hotel.element("Reserve1").element("Images").asXML()).toString());
|
|
|
- holtelEnty.setLandmarks(XML.toJSONObject(hotel.element("Landmarks").asXML()).toString());
|
|
|
- }
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 房间查询
|
|
|
- * @param pageItems 每页条数
|
|
|
- * @param pageNo 页码
|
|
|
- * @param countryId 国家id
|
|
|
- * @return 房间信息集合
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- public List<RoomEntity> roomSearch(int pageItems, int pageNo, Long countryId) throws Exception {
|
|
|
- Element element = HttpRequestUtil.getCNBookingIdentityInfo(pageItems, pageNo);
|
|
|
- //请求接口
|
|
|
- element.addElement("ActionName").addText("RoomSearch");
|
|
|
- //查询条件,设置国家,语言
|
|
|
- Element searchConditions = element.addElement("SearchConditions");
|
|
|
- searchConditions.addElement("CountryId").addText("0001");
|
|
|
- searchConditions.addElement("Lang").addText("GB");
|
|
|
- //请求
|
|
|
- String result = HttpRequestUtil.CNBoookingPost(element.asXML());
|
|
|
- //解析
|
|
|
- element = ParseRequestUtil.parseCNBookingXMl(result);
|
|
|
- Element data = element.element("Hotels");
|
|
|
- RoomEntity roomEntity = null;
|
|
|
- List<RoomEntity> list = new ArrayList<RoomEntity>();
|
|
|
- if (!"0".equals(data.elementTextTrim("HotelCount"))) {
|
|
|
- List<Element> hotels = data.elements("Hotel");
|
|
|
- List<Element> rooms = null;
|
|
|
- for (Element hotel : hotels) {
|
|
|
- data = hotel.element("Rooms");
|
|
|
- if (!"0".equals(data.elementTextTrim("RoomCount"))) {
|
|
|
- rooms = data.elements("Room");
|
|
|
- for (Element room : rooms) {
|
|
|
- roomEntity = new RoomEntity();
|
|
|
- list.add(roomEntity);
|
|
|
- roomEntity.setHotelId(hotel.elementTextTrim("HotelId"));
|
|
|
- roomEntity.setRoomId(room.elementTextTrim("RoomId"));
|
|
|
- roomEntity.setRoomName(room.elementTextTrim("RoomName"));
|
|
|
- roomEntity.setRoomTypeId(room.elementTextTrim("RoomTypeId"));
|
|
|
- roomEntity.setRoomType(room.elementTextTrim("RoomType"));
|
|
|
- roomEntity.setBedTypeId(room.elementTextTrim("BedTypeId"));
|
|
|
- roomEntity.setBedType(room.elementTextTrim("BedType"));
|
|
|
- roomEntity.setAcreage(room.elementTextTrim("Acreage"));
|
|
|
- roomEntity.setFloor(room.elementTextTrim("Floor"));
|
|
|
- roomEntity.setRoomAcount(room.elementTextTrim("RoomAcount"));
|
|
|
- roomEntity.setMaxAdult(room.elementTextTrim("MaxAdult"));
|
|
|
- roomEntity.setMaxChild(room.elementTextTrim("MaxChild"));
|
|
|
- roomEntity.setHasWindow(room.elementTextTrim("HasWindow"));
|
|
|
- roomEntity.setAllowAddBed(room.elementTextTrim("AllowAddBed"));
|
|
|
- roomEntity.setAllowAddBedNum(room.elementTextTrim("AllowAddBedNum"));
|
|
|
- roomEntity.setAllowSmoke(room.elementTextTrim("AllowSmoke"));
|
|
|
- roomEntity.setHasNet(room.elementTextTrim("HasNet"));
|
|
|
- roomEntity.setIsNetFee(room.elementTextTrim("IsNetFee"));
|
|
|
- roomEntity.setNetFee(room.elementTextTrim("NetFee"));
|
|
|
- roomEntity.setNetFee(room.elementTextTrim("Intro"));
|
|
|
- roomEntity.setGuide(room.elementTextTrim("Guide"));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 数据字典静态信息
|
|
|
- */
|
|
|
- public void loadCNBookingDictionary() throws Exception {
|
|
|
- Properties properties = new Properties();
|
|
|
- InputStreamReader reader = new InputStreamReader(new FileInputStream(""), "utf-8");
|
|
|
- properties.load(reader);// 加载属性文件
|
|
|
- List<Object> params = new ArrayList<Object>();
|
|
|
- List<List<Object>> paramsList = new ArrayList<List<Object>>();
|
|
|
- for (Object key : properties.keySet()) {
|
|
|
- params = new ArrayList<Object>();
|
|
|
- params.add(key);
|
|
|
- params.add(properties.get(key));
|
|
|
- params.add(1);
|
|
|
- paramsList.add(params);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取价格计划静态信息
|
|
|
- * @param xml
|
|
|
- */
|
|
|
- public void RatePlanSearch(String xml){
|
|
|
- try {
|
|
|
- String result = HttpRequestUtil.CNBoookingPost(xml);
|
|
|
- System.out.println("龙腾捷旅数据处理开始。。。");
|
|
|
- JSONObject resultJson = XML.toJSONObject(result);
|
|
|
- JSONObject cnResponse = resultJson.getJSONObject("CNResponse");
|
|
|
- if(cnResponse.getJSONObject("MessageInfo").getInt("Code") == 30000) {
|
|
|
- JSONObject hotel = null;
|
|
|
- JSONArray hotels = null;
|
|
|
- JSONObject room = null;
|
|
|
- JSONArray rooms = null;
|
|
|
- JSONObject ratePlan = null;
|
|
|
- JSONArray ratePlans = null;
|
|
|
- JSONObject rate = null;
|
|
|
- JSONArray rates = null;
|
|
|
- JSONObject priceAndStatu = null;
|
|
|
- JSONArray priceAndStatus = null;
|
|
|
- List<Object> params = new ArrayList<Object>();
|
|
|
- List<List<Object>> paramsList = new ArrayList<List<Object>>();
|
|
|
- List<Object> rateParams = new ArrayList<Object>();
|
|
|
- List<List<Object>> rateParamsList = new ArrayList<List<Object>>();
|
|
|
- JSONObject data = cnResponse.getJSONObject("Data").getJSONObject("Hotels");
|
|
|
- if (data.getInt("HotelCount") != 0) {
|
|
|
- if (data.getInt("HotelCount") == 1) {
|
|
|
- hotels = new JSONArray("[" + data.getJSONObject("Hotel").toString() + "]");
|
|
|
- } else {
|
|
|
- hotels = cnResponse.getJSONObject("Data").getJSONObject("Hotels").getJSONArray("Hotel");
|
|
|
- }
|
|
|
- for (int i = 0; i < hotels.length(); i++) {
|
|
|
- hotel = hotels.getJSONObject(i);
|
|
|
- if (hotel.getJSONObject("Rooms").getInt("RoomCount") != 0) {
|
|
|
- if (hotel.getJSONObject("Rooms").getInt("RoomCount") == 1) {
|
|
|
- rooms = new JSONArray("[" + hotel.getJSONObject("Rooms").getJSONObject("Room").toString() + "]");
|
|
|
- }else {
|
|
|
- rooms = hotel.getJSONObject("Rooms").getJSONArray("Room");
|
|
|
- }
|
|
|
- for (int j = 0; j < rooms.length(); j++) {
|
|
|
- room = rooms.getJSONObject(j);
|
|
|
- if (room.getJSONObject("RatePlans").getInt("RatePlanCount") != 0) {
|
|
|
- if (room.getJSONObject("RatePlans").getInt("RatePlanCount") == 1) {
|
|
|
- ratePlans = new JSONArray("[" + room.getJSONObject("RatePlans").getJSONObject("RatePlan").toString() + "]");
|
|
|
- } else {
|
|
|
- ratePlans = room.getJSONObject("RatePlans").getJSONArray("RatePlan");
|
|
|
- }
|
|
|
- for (int m = 0; m < ratePlans.length(); m++) {
|
|
|
- ratePlan = ratePlans.getJSONObject(m);
|
|
|
- params = new ArrayList<Object>();
|
|
|
- params.add(room.get("RoomId"));
|
|
|
- params.add(ratePlan.get("RatePlanId"));
|
|
|
- params.add(ratePlan.get("RatePlanName"));
|
|
|
- params.add(ratePlan.get("CutOffDay"));
|
|
|
- params.add(ratePlan.get("CutOffTime"));
|
|
|
- params.add(ratePlan.get("Breakfast"));
|
|
|
- params.add(ratePlan.get("BreakfastType"));
|
|
|
- params.add(ratePlan.get("MinRoomCount"));
|
|
|
- params.add(ratePlan.get("PersonCount"));
|
|
|
- params.add(ratePlan.get("MinDay"));
|
|
|
- params.add(ratePlan.get("BedLimit"));
|
|
|
- params.add(ratePlan.get("Nationality"));
|
|
|
- params.add(ratePlan.get("Description"));
|
|
|
- paramsList.add(params);
|
|
|
- params.add(1);
|
|
|
- }
|
|
|
- if (room.getJSONObject("Rates").getInt("RateCount") != 0) {
|
|
|
- if (room.getJSONObject("Rates").getInt("RateCount") == 1) {
|
|
|
- rates = new JSONArray("[" + room.getJSONObject("Rates").getJSONObject("Rate") + "]");
|
|
|
- } else {
|
|
|
- rates = room.getJSONObject("Rates").getJSONArray("Rate");
|
|
|
- }
|
|
|
- for (int n = 0; n < rates.length(); n++) {
|
|
|
- rate = rates.getJSONObject(n);
|
|
|
- if (rate.getJSONObject("PriceAndStatus").getInt("PriceAndStatuCount") != 0) {
|
|
|
- if (rate.getJSONObject("PriceAndStatus").getInt("PriceAndStatuCount") == 1) {
|
|
|
- priceAndStatus = new JSONArray("[" + rate.getJSONObject("PriceAndStatus").getJSONObject("PriceAndStatu") + "]");
|
|
|
- } else {
|
|
|
- priceAndStatus = rate.getJSONObject("PriceAndStatus").getJSONArray("PriceAndStatu");
|
|
|
- }
|
|
|
- for (int k = 0; k < priceAndStatus.length(); k++) {
|
|
|
- priceAndStatu = priceAndStatus.getJSONObject(k);
|
|
|
- rateParams = new ArrayList<Object>();
|
|
|
- rateParams.add(ratePlan.get("RatePlanId"));
|
|
|
- rateParams.add(priceAndStatu.get("RateId"));
|
|
|
- rateParams.add(priceAndStatu.get("Date"));
|
|
|
- rateParams.add(priceAndStatu.get("Price"));
|
|
|
- rateParams.add(priceAndStatu.get("Currency"));
|
|
|
- rateParams.add(priceAndStatu.get("Count"));
|
|
|
- rateParams.add(priceAndStatu.get("Statu"));
|
|
|
- rateParams.add(priceAndStatu.get("LastCancelTime"));
|
|
|
- rateParams.add(1);
|
|
|
- rateParamsList.add(rateParams);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- throw new Exception("Code" + cnResponse.getJSONObject("MessageInfo").getInt("Code") + ", Description" + cnResponse.getJSONObject("MessageInfo").get("Description"));
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-}
|