⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createindexhtml.java

📁 java阿里巴巴代码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
        ArrayList saleList =  saleinfo.genSaleList( 4 );
        if( saleList != null && saleList.size() > 0 )
        {
        		for( int i = 0; i < saleList.size(); i++ )
        		{
        			  HashMap map = ( HashMap )saleList.get( i );
        			  String sale_id =""; 
       					String title ="";  
       					if( map.get( "sale_id" ) != null )
       					{
       						sale_id = map.get( "sale_id" ).toString();
       					}
       					if( map.get( "title" ) != null )
       					{
       						title =  map.get( "title" ).toString();
       						if( title.length() > 6 )
       						title = StringUtil.getLimitLengthString(title,"",14);
       					}
       					strTemp = strTemp + initStr;
       					strTemp = StrReplace.replace( strTemp, "{#href#}", "/zone_b2b/supply/saleInquiry.jsp?sale_id="+sale_id );///////////////////////////////////////////////////////////
       					strTemp = StrReplace.replace( strTemp, "{#supply#}", title );
         		}	
        }
        str = StrReplace.replace( str, "{#InformationCenter:supply:4#}", strTemp );
        
        
        /*
         * 新品推荐 {#NewProducts:picture:name:1#} {#NewProducts:picture:name:2#} {#NewProducts:12#}
         *
        */
        log.LOG_INFO( "新品推荐" );
        initStr = "<tr><td align=\"center\"><img src={#src_product#} width=\"100\" height=\"100\" /></td></tr><tr><td align=\"center\"><a href=\"{#link#}\" title=\"{#detail:title_long#}\" >{#title#}</a></td></tr>";
        initStr1 = "<li>·<a href=\"{#href#}\" title=\"{#detail:title_long#}\" class=\"news\">{#cust_name#}</a></li>";
      	strTemp = "";
      	strTemp1 = "";
      	strTemp2 = "";
      	SupplyInfo supplyinfo = new SupplyInfo();
        ArrayList supplyList = supplyinfo.getNewSaleInfoList( 0, 14 );
         if( supplyList != null && supplyList.size() > 0 )
         {
         		for( int i = 0; i < supplyList.size(); i++ )
         		{
         			HashMap map = (HashMap) supplyList.get(i);
         			String cust_id ="";  
         			String sale_id =""; 
         			String sale_name ="";  
         			String sub_sale_name="";
         			if( map.get( "sale_unit" ) != null )
         			{
         				cust_id = map.get( "sale_unit" ).toString();
         			}
         			if( map.get( "sale_id" ) != null )
         			{
         				sale_id = map.get( "sale_id" ).toString();
         			}
         			if( map.get( "title" ) != null )
         			{
         				sale_name = map.get( "title" ).toString();
         			}
         			if( sale_name.length()>8 )
         			{
	                sub_sale_name = StringUtil.getLimitLengthString(sale_name,"",14);
              }
              else
              {
                  sub_sale_name = sale_name;
              }
         			if( i == 0 )
         			{		
         				  String filePath1 = new Custinfo().getCustAttachPath( sale_id, "0");
		     					if( filePath1 == "" || filePath1 == null )
		     					{
		     						filePath1 = "/upload/default.gif";
		     					}
         					strTemp1 = strTemp1 + initStr;
         					 
         					strTemp1 = StrReplace.replace( strTemp1, "{#src_product#}", filePath1 );
         					//strTemp1 = StrReplace.replace( strTemp1, "{#alt#}", product_name );
         					strTemp1 = StrReplace.replace( strTemp1, "{#link#}", "/zone_b2b/supply/saleInquiry.jsp?sale_id="+sale_id  );    //////////////////////////////////////////////////////////////////////////////////
         					strTemp1 = StrReplace.replace( strTemp1, "{#detail:title_long#}", sale_name );
         					strTemp1 = StrReplace.replace( strTemp1, "{#title#}", sub_sale_name );
         			}
         			else if( i == 1)
         			{
         					String filePath2 = new Custinfo().getCustAttachPath( sale_id, "0");
		     					if( filePath2 == "" || filePath2 == null )
		     					{
		     						filePath2 = "/upload/default.gif";
		     					}
         					strTemp2 = strTemp2 + initStr;
         					 
         					strTemp2 = StrReplace.replace( strTemp2, "{#src_product#}", filePath2 );
         					//strTemp2 = StrReplace.replace( strTemp2, "{#alt#}", product_name );
         					strTemp2 = StrReplace.replace( strTemp2, "{#link#}", "/zone_b2b/supply/saleInquiry.jsp?sale_id="+sale_id );    //////////////////////////////////////////////////////////////////////////////////
         					strTemp2 = StrReplace.replace( strTemp2, "{#detail:title_long#}", sale_name );
         					strTemp2 = StrReplace.replace( strTemp2, "{#title#}", sub_sale_name );
         			} 
         			else if( i >= 2 && i < supplyList.size() )
         			{
         					strTemp = strTemp + initStr1;
         					strTemp = StrReplace.replace( strTemp, "{#href#}", "/zone_b2b/supply/saleInquiry.jsp?sale_id="+sale_id );   ///////////////////////////////////////////////////////////////////////////////////
         					strTemp = StrReplace.replace( strTemp, "{#detail:title_long#}", sale_name );	
         					strTemp = StrReplace.replace( strTemp, "{#cust_name#}", sub_sale_name );
         			}
         			
         		}		
         }
          str = StrReplace.replace(str,"{#NewProducts:picture:name:1#}", strTemp1 );
          str = StrReplace.replace(str,"{#NewProducts:picture:name:2#}", strTemp2 );
          str = StrReplace.replace(str,"{#NewProducts:12#}", strTemp ); 
          
        
        /*
         *行业资讯
         *
        */  
   			log.LOG_INFO( "行业资讯" );
        initStr = "<div align=center><a href=\"{#href#}\" class=\"ABC\">{#title#}</a></div>{#content#}"; 
        initStr1 = "<li>[<span class=\"zi\">{#newtype#}</span>]<a href = \"{#href#}\" class=\"news\">{#title#}</a></li>";
        String initStr2 = "<tr><td height=\"22\"><a href=\"{#link#}\" class=\"news\">{#title#}</a> </td><td class=\"zi\">[{#date#}]</td></tr> "+
        					 "<tr><td height=\"1\" class=\"xian\"></td><td class=\"xian\"></td></tr>";
        String initStr3 = "<tr><td><img src=\"{#src#}\" width=\"210\" height=\"130\" alt=\"{pic:name}\"></td></tr>";
        strTemp = "";
        strTemp1 ="";
        strTemp2 = "";
        String strTemp3 = "";
        NewsInfo news = new NewsInfo();
        ArrayList nwsList = news.genNewsByLevel( 5 );
        if( nwsList != null && nwsList.size() > 0 )
        {
        		for( int i = 0; i < nwsList.size(); i++ )
        		{
        				HashMap nwsmap = ( HashMap )nwsList.get( i );
        				String news_id = nwsmap.get( "news_id" ).toString();
        				String cust_id = nwsmap.get( "cust_id" ).toString();
        				String title = "";
        				String publish_date = "";
        				if( nwsmap.get( "title" ) != null )
        				{
        						title = nwsmap.get( "title" ).toString();
        						if( title.length() > 10 )
        						{
        							title = StringUtil.getLimitLengthString(title,"",22 );
        						}
        				}
        				if( nwsmap.get( "publish_date" ) != null )
        				{
        						publish_date = nwsmap.get( "publish_date" ).toString();
        						if( publish_date.length() > 10 )
        						{
        							publish_date = publish_date.substring( 2, 10 );
        						}
        				}
        				if( i == 0 )
        				{
        						String filePath = new NewsInfo().getCustAttachPath( news_id, "0");
			     					if( filePath == "" || filePath == null )
			     					{
			     						filePath = "/upload/default.gif";
			     					}
	         					strTemp3 = strTemp3 + initStr3;
	         					strTemp3 = StrReplace.replace( strTemp3, "{#src#}", filePath );
	         					//strTemp3 = StrReplace.replace( strTemp3, "{#link#}", "#" );    //////////////////////////////////////////////////////////////////////////////////
	         					strTemp3 = StrReplace.replace( strTemp3, "{pic:name}", title );
        				} 
        				strTemp2 = strTemp2 + initStr2;
      					strTemp2 = StrReplace.replace( strTemp2, "{#link#}",  "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////////////////////////
     						strTemp2 = StrReplace.replace( strTemp2, "{#title#}", title );
								strTemp2 = StrReplace.replace( strTemp2, "{#date#}", publish_date );	
        		}	
        }
        str = StrReplace.replace( str, "{#Top:Information#}", strTemp2 );
        str = StrReplace.replace( str, "{#Top:picture#}", strTemp3 );
        
        ArrayList newList = news.genNews();
        if( newList != null && newList.size() > 0 )
        {
        		for( int i = 0; i < newList.size(); i++ )
        		{
        				HashMap map = ( HashMap )newList.get( i );
        				String news_id ="";
        				String news_type = "",class_type="";
        				String title = "";
        				String content = "";
        				if( map.get( "news_id" ) != null )
        				{
        						news_id = map.get( "news_id" ).toString();
        				}
        				if( map.get( "title" ) != null )
        				{
        						title = map.get( "title" ).toString();
        						if( title.length() > 10 )
        						{
        							title = StringUtil.getLimitLengthString(title,"",30 );
        						}
        				}
        				if( map.get( "content" ) != null )
        				{
        						content = map.get( "content" ).toString();
        						if( content.length() > 10 )
        							content = StringUtil.getLimitLengthString(content,"",80 ) + "...";
        				}
        				if (map.get("news_type") != null) 
        				{
					        news_type = map.get("news_type").toString();
					        ArrayList list=new Productclass().genUpclassByClassId( news_type );
					        if(list !=null && list.size()>0)
					        {
					          HashMap claMap=(HashMap)list.get(0);
					          if( claMap.get( "class_name" ) != null )
					          {
					            class_type = claMap.get("class_name").toString();
					          }
		       			  }
								}
								if( i == 0 )
								{
										strTemp = strTemp + initStr;
										strTemp = StrReplace.replace( strTemp, "{#href#}",  "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id  );///////////////////////////////////////////////////////////
       							strTemp = StrReplace.replace( strTemp, "{#title#}", title );
       							strTemp = StrReplace.replace( strTemp, "{#content#}", content );
								}
								else if( i >=1 && i < newList.size() )
								{
									strTemp1 = strTemp1 + initStr1;
									strTemp1 = StrReplace.replace( strTemp1, "{#newtype#}", class_type );
									strTemp1 = StrReplace.replace( strTemp1, "{#href#}",  "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id  );///////////////////////////////////////////////////////////
       						strTemp1 = StrReplace.replace( strTemp1, "{#title#}", title );
									
								}
        		}
        }
        str = StrReplace.replace( str, "{#IndustryNews:title:content#}", strTemp ); 
        str = StrReplace.replace( str, "{#IndustryNews:7#}", strTemp1 );
        
        
        /*
        *信息管理
        */
				log.LOG_INFO( "信息管理" );
				String []infoTitle ={ "{#Classifieds:first#}","{#Classifieds:second#}","{#Classifieds:third#}" };
				String []subTitle = { "{#Classifieds:first:title#}","{#Classifieds:second:title#}","{#Classifieds:third:title#}" };
				initStr = "<tr><td height=\"25\"><a href=\"{#link#}\" class=\"news\">{#title#}</a></td><td>{#start_date#}</td><td>{#end_date#}</td></tr>"+
									"<tr><td height=\"1\" class=\"xian\"></td><td class=\"xian\"></td><td class=\"xian\"></td></tr>";
				ParamethodMgr comm = new ParamethodMgr();
				ArrayList infoList = comm.getCompareInfo( "B2B", "category_type" );
				if( infoList != null && infoList.size() > 0 )
				{
					for( int i = 0; i < 3 && i < infoList.size(); i++ )
					{
						 HashMap  infoMap = ( HashMap )infoList.get( i );
						 String type = infoMap.get( "para_code1" ).toString();
						 String inTitle = infoMap.get( "para_code2" ).toString();
						 strTemp ="";
    				 ArrayList processList = new ProcessInfo().genProcessByType( type );
    				  
    				 if( processList != null && processList.size() > 0 )
    				 {
    				 		for( int j = 0; j < processList.size(); j++ )
    				 		{
    				 				HashMap proMap = ( HashMap )processList.get( j );
    				 				String cust_id = proMap.get( "cust_id" ).toString();
    				 				String category_id = proMap.get( "category_id" ).toString();
    				 				String category_title = "";
    				 				String start_date = "";
    				 				String end_date = "";
    				 				if( proMap.get( "category_title" ) != null )
    				 				{
    				 						category_title = proMap.get( "category_title" ).toString();
    				 				}
    				 				if( proMap.get( "start_date" ) != null )
    				 				{
    				 						start_date = proMap.get( "start_date" ).toString();
    				 						if( start_date.length() > 10 )
    				 						start_date = start_date.substring(0,10);
    				 				}
    				 				if( proMap.get( "end_date" ) != null )
    				 				{
    				 						end_date = proMap.get( "end_date" ).toString();
    				 						if( end_date.length() > 10 )
    				 						end_date = end_date.substring(0,10);
    				 				} 
    				 				
    				 				strTemp = strTemp + initStr;
    				 				strTemp = StrReplace.replace( strTemp, "{#link#}", "/zone_b2b/product/proxyInfo.jsp?type="+type + "&category_id=" + category_id );    //////////////////////////////////////////////////////////////////////////////////
				         		strTemp = StrReplace.replace( strTemp, "{#title#}", category_title );
				         		strTemp = StrReplace.replace( strTemp, "{#start_date#}", start_date );
				         		strTemp = StrReplace.replace( strTemp, "{#end_date#}", end_date );
    				 		}
    				 }	
    				 	str = StrReplace.replace( str, infoTitle[i], inTitle );
    				 	str = StrReplace.replace( str, subTitle[i], strTemp );
					}
				
      }
        
				/*
				*按显示方式一显示新闻
				*
				*/
				log.LOG_INFO( "按显示方式一显示新闻" );
				String []className = { "{#first:class_name#}", "{#second:class_name#}", "{#third:class_name#}" };

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -