📄 createindexhtml.java
字号:
if( promap.get( "city" ) != null )
{
city = promap.get( "city" ).toString();
}
strTemp = strTemp + initStr;
strTemp = StrReplace.replace( strTemp, "{#product#}", class_name );
strTemp = StrReplace.replace( strTemp, "{#link#}", "/zone_b2b/enterprise/customer/" + cust_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#custName#}", cust_name );
strTemp = StrReplace.replace( strTemp, "{#province#}", province );
strTemp = StrReplace.replace( strTemp, "{#city#}", city );
}
}
str = StrReplace.replace(str,"{#PromotionCenter#}", strTemp );
/*
*中间新闻
*/
log.LOG_INFO("中间新闻");
String []newsTitleUP = { "{#first:up#}","{#second:up#}","{#third:up#}","{#forth:up#}","{#five:up#}" };
String []newsTitleDown = { "{#first:down#}","{#second:down#}","{#third:down#}","{#forth:down#}","{#five:down#}" };
initStr = "<td align=center><strong><a href=\"{#link1#}\">{#title1#}</a></strong><br />"+
"[<a href=\"{#link2#}\">{#title2#}</a>]"+
"[<a href=\"{#link3#}\">{#title3#}</a>]</td>";
initStr1 ="<tr><td height=\"22\"><a href=\"{#link#}\" class=\"news\">{#title#}</a></td></tr>";
strTemp = "";
strTemp1 ="";
strTemp2 = "";
ArrayList newsTypeList = new Productclass().genClassByRsrv_str1( "5", 5 );
if( newsTypeList != null & newsTypeList.size() > 0 )
{
for( int i = 0; i < newsTypeList.size(); i++ )
{
HashMap ntmap = ( HashMap )newsTypeList.get( i );
String class_id = ntmap.get( "class_id" ).toString();
String class_name = "";
if( ntmap.get( "class_name" ) != null )
{
class_name = ntmap.get( "class_name" ).toString();
}
strTemp2 = strTemp2 + replaceHtml( i, class_name );
strTemp1 ="";
strTemp = "";
ArrayList priList = new NewsInfo().genNewsByNewsType( class_id, 7 );
if( priList != null && priList.size() == 1)
{
for( int j = 0; j < priList.size(); j++ )
{
HashMap nmap = ( HashMap )priList.get( j );
String news_id = "";
String cust_id ="";
String title = "",sub_title="";
if( nmap.get( "news_id" ) != null )
{
news_id = nmap.get( "news_id" ).toString();
}
if( nmap.get( "cust_id" ) != null )
{
cust_id = nmap.get( "cust_id" ).toString();
}
if( nmap.get( "title" ) != null )
{
title = nmap.get( "title" ).toString();
if( title.length() > 15 )
title = StringUtil.getLimitLengthString(title,"",32);
}
else
{
title = "";
}
strTemp = strTemp + initStr;
strTemp = StrReplace.replace( strTemp, "{#link1#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title1#}", title );
strTemp = StrReplace.replace( strTemp, "{#link2#}", "" );
strTemp = StrReplace.replace( strTemp, "{#title2#}", "" );
strTemp = StrReplace.replace( strTemp, "{#link3#}", "");///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title3#}", "" );
strTemp1 = strTemp1 + initStr1;
strTemp1 = StrReplace.replace( strTemp1, "{#link#}", "" );///////////////////////////////////////
strTemp1 = StrReplace.replace( strTemp1, "{#title#}", "" );
}
}
else if( priList != null && priList.size() == 2 )
{
for( int j = 0; j < priList.size(); j++ )
{
HashMap nmap = ( HashMap )priList.get( j );
String news_id = "";
String cust_id ="";
String title = "",sub_title="";
if( nmap.get( "news_id" ) != null )
{
news_id = nmap.get( "news_id" ).toString();
}
if( nmap.get( "cust_id" ) != null )
{
cust_id = nmap.get( "cust_id" ).toString();
}
if( nmap.get( "title" ) != null )
{
title = nmap.get( "title" ).toString();
}
else
{
title = "";
}
if( j == 0)
{
if( title.length() > 15 )
title = StringUtil.getLimitLengthString(title,"",32);
strTemp = strTemp + initStr;
strTemp = StrReplace.replace( strTemp, "{#link1#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title1#}", title );
}
if( j == 1 )
{
if( title.length() > 10 )
{
title = StringUtil.getLimitLengthString( title,"",14);
}
strTemp = StrReplace.replace( strTemp, "{#link2#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title2#}", title );
strTemp = StrReplace.replace( strTemp, "{#link3#}", "");
strTemp = StrReplace.replace( strTemp, "{#title3#}", "" );
strTemp1 = strTemp1 + initStr1;
strTemp1 = StrReplace.replace( strTemp1, "{#link#}", "" );
strTemp1 = StrReplace.replace( strTemp1, "{#title#}", "" );
}
}
}
else if( priList != null && priList.size() == 3 )
{
for( int j = 0; j < priList.size(); j++ )
{
HashMap nmap = ( HashMap )priList.get( j );
String news_id = "";
String cust_id ="";
String title = "",sub_title="";
if( nmap.get( "news_id" ) != null )
{
news_id = nmap.get( "news_id" ).toString();
}
if( nmap.get( "cust_id" ) != null )
{
cust_id = nmap.get( "cust_id" ).toString();
}
if( nmap.get( "title" ) != null )
{
title = nmap.get( "title" ).toString();
}
else
{
title = "";
}
if( j == 0)
{
if( title.length() > 15 )
title = StringUtil.getLimitLengthString(title,"",32);
strTemp = strTemp + initStr;
strTemp = StrReplace.replace( strTemp, "{#link1#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title1#}", title );
}
if( j == 1 )
{
if( title.length() > 10 )
{
title = StringUtil.getLimitLengthString( title,"",14);
}
strTemp = StrReplace.replace( strTemp, "{#link2#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title2#}", title );
}
if( j == 2 )
{
if( title.length() > 10 )
{
title = StringUtil.getLimitLengthString( title,"",14);
}
strTemp = StrReplace.replace( strTemp, "{#link3#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title3#}", title );
strTemp1 = strTemp1 + initStr1;
strTemp1 = StrReplace.replace( strTemp1, "{#link#}", "" );
strTemp1 = StrReplace.replace( strTemp1, "{#title#}", "" );
}
}
}
else
{
for( int j = 0; j < priList.size(); j++ )
{
HashMap nmap = ( HashMap )priList.get( j );
String news_id = "";
String cust_id ="";
String title = "",sub_title="";
if( nmap.get( "news_id" ) != null )
{
news_id = nmap.get( "news_id" ).toString();
}
if( nmap.get( "cust_id" ) != null )
{
cust_id = nmap.get( "cust_id" ).toString();
}
if( nmap.get( "title" ) != null )
{
title = nmap.get( "title" ).toString();
}
else
{
title = "";
}
if( j == 0)
{
if( title.length() > 15 )
title = StringUtil.getLimitLengthString(title,"",32);
strTemp = strTemp + initStr;
strTemp = StrReplace.replace( strTemp, "{#link1#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title1#}", title );
}
if( j == 1 )
{
if( title.length() > 10 )
{
title = StringUtil.getLimitLengthString( title,"",14);
}
strTemp = StrReplace.replace( strTemp, "{#link2#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title2#}", title );
}
if( j == 2 )
{
if( title.length() > 10 )
{
title = StringUtil.getLimitLengthString( title,"",14);
}
strTemp = StrReplace.replace( strTemp, "{#link3#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#title3#}", title );
}
if( j >= 3 && j < priList.size())
{
strTemp1 = strTemp1 + initStr1;
strTemp1 = StrReplace.replace( strTemp1, "{#link#}", "/zone_b2b/news/zixun_list_content.jsp?news_id="+news_id );///////////////////////////////////////
strTemp1 = StrReplace.replace( strTemp1, "{#title#}", title );
}
}
}
str = StrReplace.replace(str,newsTitleUP[i], strTemp );
str = StrReplace.replace(str,newsTitleDown[i], strTemp1 );
}
str = StrReplace.replace(str,"{#Middle:News#}", strTemp2 );
}
/*
*信息中心 {#InformationCenter:4#}
*/
log.LOG_INFO("信息中心");
initStr = "<li>[求] <a href=\"{#href#}\">{#stack#}</a></li>";
strTemp = "";
Stockorderinfo stockinfo = new Stockorderinfo();
ArrayList stockList = stockinfo.genStockorderLimit( 4 );
if( stockList != null && stockList.size() > 0 )
{
for( int i = 0; i < stockList.size(); i++ )
{
HashMap map = ( HashMap )stockList.get( i );
String stock_id ="";
String title ="";
if( map.get( "stock_id" ) != null )
{
stock_id = map.get( "stock_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/stock/stockInquiry.jsp?stock_id=" + stock_id );///////////////////////////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#stack#}", title );
}
}
str = StrReplace.replace( str, "{#InformationCenter:stock:4#}", strTemp );
/*
*信息中心供应 {#InformationCenter:supply:4#}
*/
initStr = "<li>[供] <a href=\"{#href#}\">{#supply#}</a></li>";
strTemp = "";
SaleInfo saleinfo = new SaleInfo();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -