<%@ page contentType="text/html;charset=utf-8"%> <%@ page import="com.cits.online.common.constance.*" %> <%@ page import="java.util.*" %> <%@ page import="java.util.List"%> <%@ page import="java.util.Date"%> <%@ page import="java.util.HashMap"%> <%@ page import="org.apache.commons.beanutils.DynaBean"%> <%@ page import="com.cits.online.buzlogic.bo.NewsBOHelper"%> <%@ page import="com.cits.online.common.util.CmnUtDate"%> <%@ page import="com.cits.online.buzlogic.bo.*" %> <%@ page import="com.cits.common.util.CmnUtFnc" %> <%@ page import="com.cits.common.constance.HotelConstance" %> <%@ page import="java.math.BigDecimal" %> <%@ page import="com.cits.online.common.util.CmnUtFormat" %> <%@ page import="java.sql.Timestamp" %> <%@ page import="java.text.SimpleDateFormat" %> <%@ page import="com.cits.online.common.util.CmnUtFunc"%> <%@ page import="com.cits.common.constance.PageConstance" %> <%@ page import="java.io.*" %> <%@ page import="org.w3c.dom.Document" %> <%@ page import="org.w3c.dom.Element" %> <%@ page import="org.w3c.dom.NodeList" %> <%@ page import="java.net.URL" %> <%@ page import="javax.xml.parsers.DocumentBuilder" %> <%@ page import="javax.xml.parsers.DocumentBuilderFactory" %> <%String xmlpath = pageContext.getServletContext().getRealPath("/");%> <%String CITS_IMAGE_DOMAIN = PageConstance.CITS_IMAGE_DOMAIN;%> <%! String leftlength(int slength, String strings){ if (strings.length() > slength) { return strings.substring(0,slength)+"..."; } else return strings; } %> <%! public class XMLDocumentUtil { public XMLDocumentUtil() { } public Document getDocument(String xmlFileName,String xmlFilePath) { Document xmlDocument = null; try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); File file = new File("."); xmlDocument = builder.parse(xmlFilePath + "/" + xmlFileName); } catch(Exception e) { e.printStackTrace(); } return xmlDocument; } } private List getThreshString(String typeId,String filepath) { List threshStringList = new ArrayList(); Document threshStringDoc = (new XMLDocumentUtil()).getDocument("hot.xml",filepath); if (threshStringDoc != null) { NodeList threshStringN = threshStringDoc.getElementsByTagName("ThreshString"); if (threshStringN.getLength()==1) { NodeList threshTypes = ((Element)threshStringN.item(0)).getElementsByTagName("ThreshType"); for (int i=0; i <% List lCity = (List) request.getAttribute("CITY"); int iCity = 0; if (lCity != null) { iCity = lCity.size(); } List lstHotD = (List) request.getAttribute("lstHotD"); List lstHotPriceD = (List) request.getAttribute("lstHotAPriceD"); int iHotD = 0; if (null != lstHotD) { iHotD = lstHotD.size(); } List lstHotOneday = (List) request.getAttribute("lstHotOneday"); List lstHotPriceOneday = (List) request.getAttribute("lstHotPriceOneday"); int iHotOneday = 0; if (null != lstHotOneday) { iHotOneday = lstHotOneday.size(); } List lstHotO = (List) request.getAttribute("lstHotO"); List lstHotPriceO = (List) request.getAttribute("lstHotAPriceO"); int iHotO = 0; if (null != lstHotO) { iHotO = lstHotO.size() ; } List hotelList = (List) request.getAttribute("hotelRes"); int iHotel = 0; if (null != hotelList) { iHotel = hotelList.size() < 6 ? hotelList.size() : 6; } List lSpcPriceTop10 = (List) request.getAttribute("PRICETOP10"); int iSpcPriceTop10 = 0; if (lSpcPriceTop10 != null) { iSpcPriceTop10 = lSpcPriceTop10.size() > 3 ? 3 : lSpcPriceTop10.size(); } List lTicketPrice = (List) request.getAttribute("priceList"); int iTicketPrice = 0; if (null != lTicketPrice) { iTicketPrice = lTicketPrice.size() <= (6-iSpcPriceTop10) ? lTicketPrice.size() : (6-iSpcPriceTop10); } List lOtherList = (List) request.getAttribute("otherList"); int iOtherList = 0; if (null != lOtherList) { iOtherList = lOtherList.size() <= 6 ? lOtherList.size() : 6; } List lNewsRes = (List) request.getAttribute("newsRes"); int iNewsRes = 0; if (null != lNewsRes) { iNewsRes = lNewsRes.size() <= 6 ? lNewsRes.size() : 6; } // Visa HashMap visaCountryMap = (HashMap) request.getAttribute("visaCountryMap"); String selectFirstWord = CmnCtDBWord.SELECT_FIRST_ALL_WORD; String selectFirstValue = CmnCtDBValue.SELECT_FIRST_ALL_VALUE; Date nowDate = new CmnUtDate(); Date lastDate = CmnUtDate.getAfterDay(nowDate,HotelConstance.PREORDER_LAST_DATE); Date nextDate = CmnUtDate.getAfterDay(nowDate, 1); String sNowDate = CmnUtDate.formatDate(nowDate); String sNextDate = CmnUtDate.formatDate(nextDate); String sLastDate = CmnUtDate.formatDate(lastDate); List startPlaceLst = (List) request.getAttribute("startPlaceLst"); List arIdLst = (List) request.getAttribute("arIdLst"); List startGNPlaceLst = (List) request.getAttribute("startGNPlaceLst"); List arGNIdLst = (List) request.getAttribute("arGNIdLst"); // selfhelp List selfHelpStartCityLs = (List) request.getAttribute("selfHelpStartCityLs"); List selfHelpEndCityLs = (List) request.getAttribute("selfHelpEndCityLs"); List lzxgjFastLink = (List) request.getAttribute("zxgjFastLink"); List lgnljFastLink = (List) request.getAttribute("gnljFastLink"); List lgwljFastLink = (List) request.getAttribute("gwljFastLink"); List lglfsFastLink = (List) request.getAttribute("glfsFastLink"); List lhzhbFastLink = (List) request.getAttribute("hzhbFastLink"); List lqtljFastLink = (List) request.getAttribute("qtljFastLink"); List lHotTitle = (List) request.getAttribute("HotTitle"); List lgnyKSTD = (List) request.getAttribute("gnyKSTD"); List lcjyKSTD = (List) request.getAttribute("cjyKSTD"); Calendar date = Calendar.getInstance(); date.add(Calendar.DAY_OF_YEAR,7); String departureDate = new SimpleDateFormat("yyyy-MM-dd").format(date.getTime()); String nowDatePreStr = CmnUtFunc.nvl(CmnUtDate.formatDate(new CmnUtDate())); String airTicketLocalDate = CmnUtDate.getAfterDay(nowDatePreStr, 1); %> 国旅在线

关闭

<%--顶部收缩--%>
出境游

北京出发

上海出发

成都出发

 
<%int countOutboundBj = 0; for(int i = 0;i <%}}%> <% for(int i = 0;i<6-countOutboundBj;i++){ %> <%}%>
 

线路名称

参考价格

<%=leftlength(28,sDisplayname)%> <%if(!sPrice.equals("")){%> ¥<%=sFormatPrice%> <%}%>

热点排行 <% String outbandbjtypeId = "outbandbj"; List outbandbjthreshStringList = getThreshString(outbandbjtypeId,xmlpath); HashMap outbandbjthreshAttr = new HashMap(); String outbandbjdisplayContentarray[] = new String[outbandbjthreshStringList.size()]; String outbandbjurlarray[] = new String[outbandbjthreshStringList.size()]; for (int i=0; i
<% for (int i=0; i <%=outbandbjdisplayContentarray[i]%>
<% } %>
<%int countOutboundSh = 0; for(int i = 0;i <%}}%> <% for(int i = 0;i<6-countOutboundSh;i++){ %> <%}%>
 

线路名称

参考价格

<%=leftlength(28,sDisplayname)%> <%if(!sPrice.equals("")){%> ¥<%=sFormatPrice%> <%}%>

热点排行 <% String outbandshtypeId = "outbandsh"; List outbandshthreshStringList = getThreshString(outbandshtypeId,xmlpath); HashMap outbandshthreshAttr = new HashMap(); String outbandshdisplayContentarray[] = new String[outbandshthreshStringList.size()]; String outbandshurlarray[] = new String[outbandshthreshStringList.size()]; for (int i=0; i
<% for (int i=0; i <%=outbandshdisplayContentarray[i]%>
<% } %>
<%int countOutboundCd = 0; for(int i = 0;i <%}}%> <% for(int i = 0;i<6-countOutboundCd;i++){ %> <%}%>
 

线路名称

参考价格

<%=leftlength(28,sDisplayname)%> <%if(!sPrice.equals("")){%> ¥<%=sFormatPrice%> <%}%>

热点排行 <% String outbandcdtypeId = "outbandcd"; List outbandcdthreshStringList = getThreshString(outbandcdtypeId,xmlpath); HashMap outbandcdthreshAttr = new HashMap(); String outbandcddisplayContentarray[] = new String[outbandcdthreshStringList.size()]; String outbandcdurlarray[] = new String[outbandcdthreshStringList.size()]; for (int i=0; i
<% for (int i=0; i <%=outbandcddisplayContentarray[i]%>
<% } %>
国内游

北京出发

上海出发

成都出发

 
<%int countDomesticBj = 0; for(int i = 0;i <%}}%> <% for(int i = 0;i<6-countDomesticBj;i++){ %> <%}%>
 

线路名称

参考价格

<%=leftlength(28,sDisplayname)%> <%if(!sPrice.equals("")){%> ¥<%=sFormatPrice%> <%}%>

热点排行 <% String domesticbjtypeId = "domesticbj"; List domesticbjthreshStringList = getThreshString(domesticbjtypeId,xmlpath); HashMap domesticbjthreshAttr = new HashMap(); String domesticbjdisplayContentarray[] = new String[domesticbjthreshStringList.size()]; String domesticbjurlarray[] = new String[domesticbjthreshStringList.size()]; for (int i=0; i
<% for (int i=0; i <%=domesticbjdisplayContentarray[i]%>
<% } %>
<%int countDomesticSh = 0; for(int i = 0;i <%}}%> <% for(int i = 0;i<6-countDomesticSh;i++){ %> <%}%>
 

线路名称

参考价格

<%=leftlength(28,sDisplayname)%> <%if(!sPrice.equals("")){%> ¥<%=sFormatPrice%> <%}%>

热点排行 <% String domesticshtypeId = "domesticsh"; List domesticshthreshStringList = getThreshString(domesticshtypeId,xmlpath); HashMap domesticshthreshAttr = new HashMap(); String domesticshdisplayContentarray[] = new String[domesticshthreshStringList.size()]; String domesticshurlarray[] = new String[domesticshthreshStringList.size()]; for (int i=0; i
<% for (int i=0; i <%=domesticshdisplayContentarray[i]%>
<% } %>
<%int countDomesticCd = 0; for(int i = 0;i <%}}%> <% for(int i = 0;i<6-countDomesticCd;i++){ %> <%}%>
 

线路名称

参考价格

<%=leftlength(28,sDisplayname)%> <%if(!sPrice.equals("")){%> ¥<%=sFormatPrice%> <%}%>

热点排行 <% String domesticcdtypeId = "domesticcd"; List domesticcdthreshStringList = getThreshString(domesticcdtypeId,xmlpath); HashMap domesticcdthreshAttr = new HashMap(); String domesticcddisplayContentarray[] = new String[domesticcdthreshStringList.size()]; String domesticcdurlarray[] = new String[domesticcdthreshStringList.size()]; for (int i=0; i
<% for (int i=0; i <%=domesticcddisplayContentarray[i]%>
<% } %>
签证

亚洲

欧洲

美洲

<% int nASA = 0; if (visaCountryMap != null) { String continentId = "ASA"; // 亚洲 List countryLs = (List) visaCountryMap.get(continentId); if (countryLs != null && countryLs.size() > 0) { int k = 0; while(k < countryLs.size() && nASA < 4) { %> <% for(int m = 0; m < 5; m++) { if (k < countryLs.size() && countryLs.get(k) != null) { String country_id = (String) ((HashMap) countryLs.get(k)).get("country_id"); String country_name = (String) ((HashMap) countryLs.get(k)).get("country_name"); %> <% } else { %> <% } k = k + 1; } %> <% nASA = nASA + 1; } } } for (int g = 0; g < 4 - nASA; g++) { %> <% } %>
<%=country_name%> 
    
<% int nEUR = 0; if (visaCountryMap != null) { String continentId = "EUR"; // 欧洲 List countryLs = (List) visaCountryMap.get(continentId); if (countryLs != null && countryLs.size() > 0) { int k = 0; while(k < countryLs.size() && nEUR < 4) { %> <% for(int m = 0; m < 5; m++) { if (k < countryLs.size() && countryLs.get(k) != null) { String country_id = (String) ((HashMap) countryLs.get(k)).get("country_id"); String country_name = (String) ((HashMap) countryLs.get(k)).get("country_name"); %> <% } else { %> <% } k = k + 1; } %> <% nEUR = nEUR + 1; } } } for (int g = 0; g < 4 - nEUR; g++) { %> <% } %>
<%=country_name%> 
    
<% int nNMESME = 0; if (visaCountryMap != null) { String continentId = "NME"; // 美洲(北美) List countryLs = (List) visaCountryMap.get(continentId); continentId = "SME"; // 美洲(南美) List countryLs2 = (List) visaCountryMap.get(continentId); if(countryLs != null && countryLs2 != null) { countryLs.addAll(countryLs2); } else if(countryLs == null && countryLs2 != null) { countryLs = countryLs2; } if (countryLs != null && countryLs.size() > 0) { int k = 0; while(k < countryLs.size() && nNMESME < 4) { %> <% for(int m = 0; m < 5; m++) { if (k < countryLs.size() && countryLs.get(k) != null) { String country_id = (String) ((HashMap) countryLs.get(k)).get("country_id"); String country_name = (String) ((HashMap) countryLs.get(k)).get("country_name"); %> <% } else { %> <% } k = k + 1; } %> <% nNMESME = nNMESME + 1; } } } for (int g = 0; g < 4 - nNMESME; g++) { %> <% } %>
<%=country_name%> 
    
热门签证: <% String visatypeId = "visa"; List visathreshStringList = getThreshString(visatypeId,xmlpath); HashMap visathreshAttr = new HashMap(); String visadisplayContent; String visaurl; for (int i=0; i <%=visadisplayContent%> <% } %>
精彩目的地      

 
<%for (int i = 0; i < iHotel; i++) { String[] hotelS = (String[]) hotelList.get(i); String sID = hotelS[0]; String shotelName = hotelS[1]; String sPrice = hotelS[4]; int tempprice = (int) Float.parseFloat(sPrice); sPrice = String.valueOf(tempprice); //String sRoom = hotelS[3]; %> <%}%> <%for (int i = 0; i < 6-iHotel; i++) { %> <%}%>
酒店
<%=leftlength(13,shotelName)%> ¥<%=sPrice%>
<% for (int i = 0; i < iSpcPriceTop10; i++) { DynaBean dbean = (DynaBean) lSpcPriceTop10.get(i); String localticketname = dbean.get("AirQuery_abbr") + " " + dbean.get("OrgCityQuery_name") + "-" + dbean.get("DstCityQuery_name"); %> <%}%> <% for (int i = 0; i < iTicketPrice; i++) { TicketPriceBO bo = (TicketPriceBO) lTicketPrice.get(i); String strProductId = bo.getProduct_id(); String strAirName = bo.getAir_name(); String strStartPlace = bo.getStart_place(); String strDestPlace = bo.getDest_place(); String strJnyType = bo.getJny_type(); int price = bo.getQuote().intValue(); String interticketname = strStartPlace + "-" + strDestPlace + "(" +strJnyType + ")"; %> <%}%> <% for (int i = 0; i < 6-iTicketPrice-iSpcPriceTop10; i++) { %> <%}%>
机票
"><%=leftlength(13,localticketname)%> ¥<%=(int)Double.parseDouble(dbean.get("PriceQuery_quote").toString())%>
<%=leftlength(13,interticketname)%> ¥<%=price%>
<% for(int i=0;i <%}%> <% for(int i=0;i<6-iHotOneday;i++){ %> <%}%>
一地游
"> "> <%=leftlength(13,CmnUtFnc.nvl(bean.get("routeQryC_" + RouteBaseinfoBOHelper.route_name)))%> <%if(!sPrice.equals("")){%> ¥<%=sFormatPrice%> <%}%>

<% for (int i = 0; i < iNewsRes; i++) { DynaBean dbean = (DynaBean)lNewsRes.get(i); String sId = dbean.get("NewsQuery_"+NewsBOHelper.news_id).toString(); String sTitle = dbean.get("NewsQuery_" + NewsBOHelper.news_title).toString(); String sDate = CmnUtDate.formatDate((Timestamp)dbean.get("NewsQuery_" + NewsBOHelper.exam_date),4); %> <%}%>
新闻
<%=leftlength(13,sTitle)%> <%=sDate%>