%@page import="java.net.URLEncoder"%>
<%@page import="com.hanweb.common.util.NumberUtil" %>
<%@page import="com.hanweb.common.util.SpringUtil" %>
<%@page import="com.hanweb.jcms.plugins.xxgk.service.Jcms_Xxgk_JdBLF" %>
<%@page import="com.hanweb.jcms.service.info.generalformat.GeneralFormatBLF" %>
<%@ page import="com.hanweb.jcms.service.plugin.Jcms_ExtramodalBLF" %>
<%@ page import="com.hanweb.jcms.service.website.Jcms_WebinfomationBLF" %>
<%@ page import="com.hanweb.jcms.sys.service.SysInfo" %>
<%@ page import="com.hanweb.jcms.util.SafeUtil" %>
<%@ page import="com.hanweb.common.util.mvc.Script" %>
<%@ page import="com.hanweb.jcms.util.AccessUtil" %>
<%@page contentType="text/html;charset=UTF-8" %>
<%@ include file="config.jsp" %>
<%
Script script = Script.getInstanceOnly();
if(!AccessUtil.checkAccess(request)){ //阻止跨站点请求伪造
out.print(script.addScript("location.href='../../';").getScript());
return;
}
//这个jsp获取年份,只需要获取当前网站
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", -10);
//页面传递的参数值
//节点编码
String area = SafeUtil.getSafeString(request.getParameter("area"));
if(SafeUtil.isSqlAndXss(area)){
out.println("请输入合法area参数!");
return ;
}
//当前网站ID
int nWebID = NumberUtil.getInt(strWebID);
if (!Jcms_ExtramodalBLF.isExist("xxgk", nWebID)) {
out.println("信息公开扩展功能不存在!");
return;
}
int webid = NumberUtil.getInt(strWebID);
//获取必要参数组织内外网路径
String strPath = application.getRealPath("").replaceAll("\\\\", "/") + "/jcms_files/jcms" + strAppID + "/web" + nWebID + "/site/";
String strModulePath = strPath + "module/xxgk/";
String strConfigPath = strModulePath + "config/config.xml"; //信息公开外挂配置文件
//内外网
int type = NumberUtil.getInt(xmlFile.getContent("webtype", strConfigPath), 1);
//应用名称
String appName = xmlFile.getContent("web_in_servername", strConfigPath);
String headPath = "/" + appName + "/jcms_files/jcms" + strAppID + "/web" + nWebID + "/site/";
SysInfo sys = new SysInfo();
sys.initSysPara(SpringUtil.getRequest());
String strDomain = Jcms_WebinfomationBLF.modifyAndGetWebDomain(strAppID, webid);
//String strDomain = sys.getStrDomain();
if (type == 2) {
headPath = "http://" + strDomain;
}
//获取有信息的最早的年份,组织年份列表
//获取年报元数据表名,如果未null说明不存在
String[][] tableNameARR = generalFormatBLF.getReportTable();
if (tableNameARR == null || tableNameARR.length == 0) {
out.println("信息公开报表元数据不存在!");
return;
}
String tablename = tableNameARR[0][0];
//获取年报有信息的时间列表
String[][] times = generalFormatBLF.getHasInfo(tablename,webid,area);
out.print(getYearCSS());
out.println(getYearList(times, getJspPath(headPath),area));
out.print("
");
%>
<%!
GeneralFormatBLF generalFormatBLF = SpringUtil.getBean(GeneralFormatBLF.class);
Jcms_Xxgk_JdBLF jdBLF = SpringUtil.getBean(Jcms_Xxgk_JdBLF.class);
/**
* 获取本文件
* @param strPath 路径前缀
* @return
*/
public String getJspPath(String strPath) {
String relativePath = "";
if (strPath.endsWith("/")) {
relativePath = strPath + "module/xxgk/xxgkAnnualReport.jsp";
} else {
relativePath = strPath + "/module/xxgk/xxgkAnnualReport.jsp";
}
return relativePath;
}
public String getYearCSS(){
String str = "\n";
return str;
}
/**
* 获取时间列表
* @return
*/
public String getYearList(String[][] times, String strPath,String area) {
try{
area = URLEncoder.encode(area, "utf-8");
}catch(Exception e){
e.printStackTrace();
}
String str = "";
str += "";
if(times ==null || times.length ==0){
return "";
}
for (int i = 0; i - ·"
+ times[i][0] + "年
";
}
str += "
\n";
str +="";
return str;
}
/**
* 获取公共样式
* @return
*/
public String getStyleCSS(){
String str ="body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, input, button, textarea, p, blockquote, th, td{margin:0;padding:0;}\n" +
"body {color: #333;text-align: left;font-size: 14px;font-family:\"微软雅黑\";font-family: microsoft yahei,Arial,Helvetica,sans-serif;/* background: url(../images/ind_mbg.png) ; */background: #fdfdfe;}\n" +
"\n" +
"\n" +
"a{ text-decoration:none; color:inherit; color: #222;font-family:\"微软雅黑\";}\n" +
"a:link,a:visited {\n" +
"\tcolor: inherit;\n" +
"\ttext-decoration: none;\n" +
"}\n" +
"a:active,a:hover {\n" +
"\tcolor: #0062eb;\n" +
"\ttext-decoration: none;\n" +
"}\n" +
"img{ margin:0px; padding:0px; border: none;}\n" +
"p{ margin:0px; padding:0px;}\n" +
"\n" +
"em {\n" +
"\tfont-style: normal;\n" +
"}\n" +
"li,ul {\n" +
"\tlist-style: none;\n" +
"\ttext-decoration: none;\n" +
"}\n" +
"li {\n" +
"\tlist-style-type: none;\n" +
"}\n" +
"div {\n" +
"\tword-wrap: break-word;\n" +
"\tword-break: break-all;\n" +
"}\n" +
"h1,h2,h3,h4,h5,h6 {\n" +
"\tfont-size: 9pt; font-weight: normal;\n" +
"\tfont-family:\"微软雅黑\";\n" +
"}";
return str;
}
%>