上传代码

This commit is contained in:
zhangdongxu
2017-12-19 14:55:52 +08:00
commit 13acafd43d
4777 changed files with 898870 additions and 0 deletions

View File

@@ -0,0 +1,349 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:tool="http://www.springframework.org/schema/tool"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd"
default-lazy-init="true">
<!-- 引入jdbc.properties,加密密码 ;<context:property-placeholder location="classpath:jdbc.properties"
/> -->
<bean id="propertyConfigurer" class="com.nis.util.PropertyPlaceholderConfigurerCrypt">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
<value>classpath:nis.properties</value>
</list>
</property>
</bean>
<bean id="parentDataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"></bean>
<!-- 数据源定义采用BoneCP连接池 ,用户管理数据源 -->
<bean id="DevlopDataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.devlop.driver}"></property>
<property name="jdbcUrl" value="${jdbc.devlop.url}"></property>
<property name="username" value="${jdbc.devlop.username}"></property>
<property name="password" value="${jdbc.devlop.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes" value="${bonecp.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.statementsCacheSize}" />
</bean>
<!--数据源定义采用BoneCP连接池 ,业务配置服务数据库 -->
<bean id="ProductDataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.product.driver}"></property>
<property name="jdbcUrl" value="${jdbc.product.url}"></property>
<property name="username" value="${jdbc.product.username}"></property>
<property name="password" value="${jdbc.product.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes" value="${bonecp.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.statementsCacheSize}" />
</bean>
<!--数据源定义采用BoneCP连接池 ,业务配置服务数据库 -->
<bean id="LogDataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.log.driver}"></property>
<property name="jdbcUrl" value="${jdbc.log.url}"></property>
<property name="username" value="${jdbc.log.username}"></property>
<property name="password" value="${jdbc.log.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes" value="${bonecp.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.statementsCacheSize}" />
</bean>
<!--数据源定义采用BoneCP连接池 ,业务配置服务数据库 -->
<bean id="LogCDataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.logC.driver}"></property>
<property name="jdbcUrl" value="${jdbc.logC.url}"></property>
<property name="username" value="${jdbc.logC.username}"></property>
<property name="password" value="${jdbc.logC.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes" value="${bonecp.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.statementsCacheSize}" />
</bean>
<!--数据源定义采用BoneCP连接池 ,业务配置服务数据库 -->
<bean id="LogADataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.logA.driver}"></property>
<property name="jdbcUrl" value="${jdbc.logA.url}"></property>
<property name="username" value="${jdbc.logA.username}"></property>
<property name="password" value="${jdbc.logA.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes" value="${bonecp.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.statementsCacheSize}" />
</bean>
<!--数据源定义采用BoneCP连接池 ,业务配置服务数据库 -->
<bean id="JkDataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.jk.driver}"></property>
<property name="jdbcUrl" value="${jdbc.jk.url}"></property>
<property name="username" value="${jdbc.jk.username}"></property>
<property name="password" value="${jdbc.jk.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes" value="${bonecp.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.statementsCacheSize}" />
</bean>
<!--A版hive数据源定义采用BoneCP连接池 ,业务配置服务数据库 -->
<bean id="HiveADataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.hiveA.driver}"></property>
<property name="jdbcUrl" value="${jdbc.hiveA.url}"></property>
<property name="username" value="${jdbc.hiveA.username}"></property>
<property name="password" value="${jdbc.hiveA.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes"
value="${bonecp.hive.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.hive.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.hive.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.hive.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.hive.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.hive.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.hive.statementsCacheSize}" />
</bean>
<!--B版hive数据源定义采用BoneCP连接池 ,业务配置服务数据库 -->
<bean id="HiveBDataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.hiveB.driver}"></property>
<property name="jdbcUrl" value="${jdbc.hiveB.url}"></property>
<property name="username" value="${jdbc.hiveB.username}"></property>
<property name="password" value="${jdbc.hiveB.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes"
value="${bonecp.hive.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.hive.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.hive.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.hive.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.hive.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.hive.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.hive.statementsCacheSize}" />
</bean>
<!--数据源定义采用BoneCP连接池 ,神通数据库 -->
<bean id="LogClusterDataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.log.cluster.driver}"></property>
<property name="jdbcUrl" value="${jdbc.log.cluster.url}"></property>
<property name="username" value="${jdbc.log.cluster.username}"></property>
<property name="password" value="${jdbc.log.cluster.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes" value="${bonecp.cluster.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.cluster.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.cluster.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.cluster.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.cluster.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.cluster.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.cluster.statementsCacheSize}" />
</bean>
<!--测试数据源,后期会删除 -->
<bean id="TestDataSource" parent="parentDataSource"
class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="${jdbc.test.driver}"></property>
<property name="jdbcUrl" value="${jdbc.test.url}"></property>
<property name="username" value="${jdbc.test.username}"></property>
<property name="password" value="${jdbc.test.password}"></property>
<!-- 检查数据库连接池中空闲连接的间隔时间单位是分默认值240如果要取消则设置为0 -->
<property name="idleConnectionTestPeriodInMinutes" value="${bonecp.idleConnectionTestPeriodInMinutes}"></property>
<!-- 连接池中未使用的链接最大存活时间单位是分默认值60如果要永远存活设置为0 -->
<property name="idleMaxAgeInMinutes" value="${bonecp.idleMaxAgeInMinutes}" />
<!-- 每个分区最大的连接数 -->
<property name="maxConnectionsPerPartition" value="${bonecp.maxConnectionsPerPartition}" />
<!-- 每个分区最小的连接数 -->
<property name="minConnectionsPerPartition" value="${bonecp.minConnectionsPerPartition}" />
<!-- 分区数 默认值2最小1推荐3-4视应用而定 -->
<property name="partitionCount" value="${bonecp.partitionCount}" />
<!-- 每次去拿数据库连接的时候一次性要拿几个,默认值2 -->
<property name="acquireIncrement" value="${bonecp.acquireIncrement}" />
<!-- 缓存prepared statements的大小默认值0 -->
<property name="statementsCacheSize" value="${bonecp.statementsCacheSize}" />
</bean>
<bean id="dynamicDataSource" class="com.nis.datasource.DynamicDataSource">
<property name="targetDataSources">
<map key-type="java.lang.String">
<entry value-ref="DevlopDataSource" key="dataSourceA"></entry>
<entry value-ref="ProductDataSource" key="dataSourceB"></entry>
<entry value-ref="LogDataSource" key="dataSourceC"></entry>
<!--测试数据源,后期会删除 -->
<entry value-ref="TestDataSource" key="dataSourceD"></entry>
<entry value-ref="JkDataSource" key="dataSourceE"></entry>
<entry value-ref="LogADataSource" key="dataSourceF"></entry>
<entry value-ref="LogCDataSource" key="dataSourceG"></entry>
<entry value-ref="LogClusterDataSource" key="dataSourceH"></entry>
</map>
</property>
<property name="defaultTargetDataSource" ref="DevlopDataSource"></property>
</bean>
<!-- mybatis 配置扫描相关mapper文件 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dynamicDataSource"></property>
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<!--<property name="mapperLocations" value="classpath*:dbmap/*Mapper.xml"></property> -->
</bean>
<!--创建数据映射器,数据映射器必须为接口 -->
<!-- 扫描basePackage下所有以@MyBatisDao注解的接口 -->
<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
<property name="basePackage" value="com.nis.web.dao" />
<property name="annotationClass" value="com.nis.web.dao.MyBatisDao" />
</bean>
<bean id="defaultLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler"
lazy-init="true"></bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dynamicDataSource"></property>
</bean>
<!-- 配置事务异常封装 -->
<bean id="persistenceExceptionTranslationPostProcessor"
class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"></bean>
<!-- 定义transactionManager作事务管理,get*方法事务为readonly,其它方法按默认设置 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="true" propagation="NOT_SUPPORTED"/>
<tx:method name="find*" read-only="true" propagation="NOT_SUPPORTED"/>
<tx:method name="query*" read-only="true" propagation="NOT_SUPPORTED"/>
<tx:method name="search*" read-only="true" propagation="NOT_SUPPORTED"/>
<tx:method name="*" />
</tx:attributes>
</tx:advice>
<!-- proxy-target-class="true" -->
<aop:config expose-proxy="true">
<aop:pointcut expression="execution(* com.nis.web.service..*Service.*(..))"
id="txPointcut" />
<aop:advisor pointcut-ref="txPointcut" advice-ref="txAdvice" />
</aop:config>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dynamicDataSource"></property>
</bean>
</beans>

View File

@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd"
default-lazy-init="true">
<description>Shiro Configuration</description>
<!-- 引入jdbc.properties,加密密码 ;<context:property-placeholder location="classpath:jdbc.properties" />-->
<bean id="propertyConfigurer" class="com.nis.util.PropertyPlaceholderConfigurerCrypt">
<property name="locations" >
<list>
<value>classpath:jdbc.properties</value>
<value>classpath:nis.properties</value>
</list>
</property>
</bean>
<!-- autodetection of such annotated controllers -->
<!-- 使用Annotation自动注册Bean解决事物失效问题在主容器中不扫描@Controller注解在SpringMvc中只扫描@Controller注解。 -->
<context:component-scan base-package="com.nis.web">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!-- 缓存配置 -->
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="classpath:${ehcache.configFile}" />
</bean>
<!-- Shiro权限过滤过滤器定义 -->
<bean name="shiroFilterChainDefinitions" class="java.lang.String">
<constructor-arg>
<value>
/static/** = anon
/userfiles/** = anon
${adminPath}/cas = cas
/login = authc
/logout = logout
${adminPath}/** = user
<!--
/act/rest/service/editor/** = perms[act:model:edit]
/act/rest/service/model/** = perms[act:model:edit]
/act/rest/service/** = user
/ReportServer/** = user
-->
</value>
</constructor-arg>
</bean>
<!-- 安全认证过滤器 -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"></property>
<property name="loginUrl" value="/login"></property>
<property name="successUrl" value="${adminPath}/index"></property>
<property name="unauthorizedUrl" value="/unauthorized"></property>
<property name="filters">
<map>
<entry key="cas" value-ref="casFilter"></entry>
<entry key="authc" value-ref="formAuthenticationFilter"/>
</map>
</property>
<property name="filterChainDefinitions">
<ref bean="shiroFilterChainDefinitions"/>
</property>
</bean>
<!-- CAS认证过滤器 -->
<bean id="casFilter" class="org.apache.shiro.cas.CasFilter">
<property name="failureUrl" value="/login"/>
</bean>
<!-- 定义Shiro安全管理配置 -->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="systemAuthorizingRealm" />
<property name="sessionManager" ref="sessionManager" />
<property name="cacheManager" ref="shiroCacheManager" />
</bean>
<!-- 自定义会话管理配置 -->
<bean id="sessionManager" class="com.nis.web.security.SessionManager">
<property name="sessionDAO" ref="sessionDAO"/>
<!-- 会话超时时间,单位:毫秒 -->
<property name="globalSessionTimeout" value="${session.sessionTimeout}"/>
<!-- 定时清理失效会话, 清理用户直接关闭浏览器造成的孤立会话 -->
<property name="sessionValidationInterval" value="${session.sessionTimeoutClean}"/>
<!-- <property name="sessionValidationSchedulerEnabled" value="false"/> -->
<property name="sessionValidationSchedulerEnabled" value="true"/>
<property name="sessionIdCookie" ref="sessionIdCookie"/>
<property name="sessionIdCookieEnabled" value="true"/>
</bean>
<!-- 指定本系统SESSIONID, 默认为: JSESSIONID 问题: 与SERVLET容器名冲突, 如JETTY, TOMCAT 等默认JSESSIONID,
当跳出SHIRO SERVLET时如ERROR-PAGE容器会为JSESSIONID重新分配值导致登录会话丢失! -->
<bean id="sessionIdCookie" class="org.apache.shiro.web.servlet.SimpleCookie">
<constructor-arg name="name" value="nis.session.id"/>
</bean>
<bean id="sessionDAO" class="com.nis.web.security.CacheSessionDAO">
<property name="sessionIdGenerator" ref="idGen" />
<property name="activeSessionsCacheName" value="activeSessionsCache" />
<property name="cacheManager" ref="shiroCacheManager" />
</bean>
<!-- 定义授权缓存管理器 -->
<!-- <bean id="shiroCacheManager" class="com.thinkgem.jeesite.common.security.shiro.cache.SessionCacheManager" /> -->
<bean id="shiroCacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManager" ref="cacheManager"/>
</bean>
<!-- 保证实现了Shiro内部lifecycle函数的bean执行 -->
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
<!-- AOP式方法级权限检查,enable shiro annotations for Spring-configured beans.only run after -->
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor">
<property name="proxyTargetClass" value="true" />
</bean>
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManager"/>
</bean>
<!-- 登陆时验证码的配置 -->
<bean id="captchaProducer" class="com.google.code.kaptcha.impl.DefaultKaptcha">
<property name="config">
<bean class="com.google.code.kaptcha.util.Config">
<!--通过构造函数注入属性值 -->
<constructor-arg type="java.util.Properties">
<props>
<!-- 验证码宽度 -->
<prop key="kaptcha.image.width">115</prop>
<!-- 验证码高度 -->
<prop key="kaptcha.image.height">46</prop>
<!-- 生成验证码内容范围 -->
<prop key="kaptcha.textproducer.char.string">abcde012345678gfynmnpwx</prop>
<!-- 验证码个数 -->
<prop key="kaptcha.textproducer.char.length">5</prop>
<!-- 是否有边框 -->
<prop key="kaptcha.border">no</prop>
<!-- 验证码字体颜色 -->
<prop key="kaptcha.textproducer.font.color">white</prop>
<!-- 验证码字体大小 -->
<prop key="kaptcha.textproducer.font.size">25</prop>
<!-- 验证码所属字体样式 -->
<prop key="kaptcha.textproducer.font.names">Arial, Courier</prop>
<prop key="kaptcha.background.clear.from">104,183,26</prop>
<prop key="kaptcha.background.clear.to">104,183,26</prop>
<prop key="kaptcha.obscurificator.impl">com.google.code.kaptcha.impl.ShadowGimpy</prop>
<prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
<!-- 干扰线颜色 -->
<prop key="kaptcha.noise.color">red</prop>
<!-- 验证码文本字符间距 -->
<prop key="kaptcha.textproducer.char.space">1</prop>
</props>
</constructor-arg>
</bean>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ehcache updateCheck="false" name="defaultCache">
<diskStore path="../temp/nis/ehcache" />
<!-- 默认缓存配置. -->
<defaultCache maxEntriesLocalHeap="100" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600"
overflowToDisk="true" maxEntriesLocalDisk="100000" />
<!-- 系统缓存 -->
<cache name="sysCache" maxEntriesLocalHeap="100" eternal="true" overflowToDisk="true"/>
<!-- 用户缓存 -->
<cache name="userCache" maxEntriesLocalHeap="100" eternal="true" overflowToDisk="true"/>
<!-- 工作流模块缓存 -->
<cache name="actCache" maxEntriesLocalHeap="100" eternal="true" overflowToDisk="true"/>
<!-- 内容管理模块缓存
<cache name="cmsCache" maxEntriesLocalHeap="100" eternal="true" overflowToDisk="true"/> -->
<!-- 系统活动会话缓存 -->
<cache name="activeSessionsCache" maxEntriesLocalHeap="10000" overflowToDisk="true"
eternal="true" timeToLiveSeconds="0" timeToIdleSeconds="0"
diskPersistent="true" diskExpiryThreadIntervalSeconds="600"/>
<!-- 简单页面缓存
<cache name="SimplePageCachingFilter" maxEntriesLocalHeap="100" eternal="false" overflowToDisk="true"
timeToIdleSeconds="120" timeToLiveSeconds="120" memoryStoreEvictionPolicy="LFU"/> -->
</ehcache>

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<ehcache updateCheck="false" name="defaultCache">
<!--
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual, socketTimeoutMillis=2000, rmiUrls=//localhost:40001/defaultCache" />
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=localhost, port=40000, socketTimeoutMillis=2000"/> -->
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=automatic,multicastGroupAddress=230.0.0.1, multicastGroupPort=4446" />
<cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" />
<diskStore path="../temp/nis/ehcache" />
<!-- 默认缓存配置. -->
<defaultCache maxEntriesLocalHeap="100" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600"
overflowToDisk="true" maxEntriesLocalDisk="100000" >
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicatePuts=false,replicateUpdatesViaCopy=false"/>
</defaultCache>
<!-- 系统缓存 -->
<cache name="sysCache" maxEntriesLocalHeap="100" eternal="true" overflowToDisk="true">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
</cache>
<!-- 用户缓存 -->
<cache name="userCache" maxEntriesLocalHeap="100" eternal="true" overflowToDisk="true">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
</cache>
<!-- 工作流模块缓存 -->
<cache name="actCache" maxEntriesLocalHeap="100" eternal="true" overflowToDisk="true">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
</cache>
<!-- 内容管理模块缓存
<cache name="cmsCache" maxEntriesLocalHeap="100" eternal="true" overflowToDisk="true">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/>
</cache> -->
<!-- 系统活动会话缓存 -->
<cache name="activeSessionsCache" maxEntriesLocalHeap="10000" overflowToDisk="true"
eternal="true" timeToLiveSeconds="0" timeToIdleSeconds="0"
diskPersistent="true" diskExpiryThreadIntervalSeconds="600">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
replicateUpdatesViaCopy=false, replicateRemovals=true "/>
</cache>
<!-- 简单页面缓存
<cache name="SimplePageCachingFilter" maxEntriesLocalHeap="100" eternal="false" overflowToDisk="true"
timeToIdleSeconds="120" timeToLiveSeconds="120" memoryStoreEvictionPolicy="LFU">
<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=true, replicatePuts=true, replicateUpdates=true,
replicateUpdatesViaCopy=false, replicateRemovals=true "/>
</cache> -->
</ehcache>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<classPathEntry location="C:\Users\chenghui\.m2\repository\mysql\mysql-connector-java\5.1.36\mysql-connector-java-5.1.36.jar" />
<context id="mysqlTables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://192.168.10.2:3306/bjbusxf?useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull"
userId="root" password="ictsoft">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<javaModelGenerator targetPackage="com.nis.domain" targetProject="bjbusxf/src/main/java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="com.nis.web.dao" targetProject="bjbusxf/src/main/java">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<javaClientGenerator type="XMLMAPPER" targetPackage="com.nis.web.dao" targetProject="bjbusxf/src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<table tableName="reg_attach_info"
domainObjectName="regAttachInfo"
enableCountByExample="false"
enableSelectByExample="false"
enableUpdateByExample="false"
enableDeleteByExample="false">
</table>
</context>
</generatorConfiguration>

View File

@@ -0,0 +1,123 @@
#jdbc for oracle
#jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.devlop.driver=com.mysql.jdbc.Driver
jdbc.devlop.url=jdbc:mysql://10.0.6.100:3306/web_frame?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
jdbc.devlop.username=dfh
jdbc.devlop.key=xLtQB+Bp6joOYrVIfBdrRA==
jdbc.devlop.password=/+7+DgxK++ZaD1nIcRRmDg==
jdbc.product.driver=oracle.jdbc.driver.OracleDriver
#jdbc.product.url=jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.17)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA =(SERVICE_NAME = ORCL)(FAILOVER_MODE =(TYPE = select)(METHOD = basic)(RETRIES = 180)(DELAY = 180))))
jdbc.product.url=jdbc:oracle:thin:@10.0.6.212:1523:app
#jdbc.product.url=jdbc:oracle:thin:@10.174.196.20:1521:orcl
jdbc.product.username=gk_pz
#jdbc.product.username=z2_5x9pz
jdbc.product.key=3X3ZBejyxS7lkVsHVm9KTw==
jdbc.product.password=sHqDBZIUS0hYZCbC+1xN3A==
jdbc.log.driver=oracle.jdbc.driver.OracleDriver
jdbc.log.url=jdbc:oracle:thin:@10.0.6.212:1523:app
#jdbc.log.url=jdbc:oracle:thin:@10.174.196.22:1521:orcl
jdbc.log.username=gk_log
#jdbc.log.username=z2_5x9logb
jdbc.log.key=pHl+0udycGQWNZcN68Sv9A==
jdbc.log.password=Z/pVMDXcWNxzVGAX0yRp3Q==
jdbc.logA.driver=oracle.jdbc.driver.OracleDriver
#jdbc.logA.url=jdbc:oracle:thin:@10.0.6.212:1523:app
jdbc.logA.url=jdbc:oracle:thin:@10.174.196.21:1521:orcl
#jdbc.logA.username=gk_log_a
jdbc.logA.username=z2_5x9loga
jdbc.logA.key=SXHfLUwzPw0cQEc1wzwM4w==
jdbc.logA.password=auvtDoVZpGP6P4OqfBrWAg==
jdbc.logC.driver=oracle.jdbc.driver.OracleDriver
jdbc.logC.url=jdbc:oracle:thin:@10.0.6.212:1523:app
jdbc.logC.username=gk_log_c
jdbc.logC.key=MvwfUIYP0nLyiQeprHB/5A==
jdbc.logC.password=3HXvsqpbOoNBIkHDS5c9Aw==
jdbc.jk.driver=oracle.jdbc.driver.OracleDriver
jdbc.jk.url=jdbc:oracle:thin:@10.0.6.212:1523:app
#jdbc.jk.url=jdbc:oracle:thin:@10.174.196.20:1521:orcl
jdbc.jk.username=gk_jk
#jdbc.jk.username=z2_5x9jk
jdbc.jk.key=+FaavsHgQ0qBSebsAoochw==
jdbc.jk.password=wBrNar7gX/iQR7IyCSHuSg==
bonecp.idleMaxAgeInMinutes=60
bonecp.idleConnectionTestPeriodInMinutes=240
bonecp.maxConnectionsPerPartition=50
bonecp.minConnectionsPerPartition=10
bonecp.partitionCount=3
bonecp.acquireIncrement=5
bonecp.statementsCacheSize=100
############################################################################################################################################
#数据中心神通数据库接口配置
############################################################################################################################################
bonecp.cluster.idleMaxAgeInMinutes=60
bonecp.cluster.idleConnectionTestPeriodInMinutes=240
bonecp.cluster.maxConnectionsPerPartition=10
bonecp.cluster.minConnectionsPerPartition=5
bonecp.cluster.partitionCount=3
bonecp.cluster.acquireIncrement=5
bonecp.cluster.statementsCacheSize=100
jdbc.log.cluster.driver=com.oscar.cluster.BulkDriver
jdbc.log.cluster.url=jdbc:oscarclusterbulk://10.3.129.125:2010/logdb
jdbc.log.cluster.username=xa_z2_iie
jdbc.log.cluster.key=2fa3hQn28+4AOdJXL4Ud2w==
jdbc.log.cluster.password=uut+weC9of5ocPheagBJ4A==
############################################################################################################################################
#数据中心hive接口配置
############################################################################################################################################
#A版日志库
jdbc.hiveA.driver=org.apache.hive.jdbc.HiveDriver
jdbc.hiveA.url=jdbc:hive2://10.3.130.24:10000/default
jdbc.hiveA.username=xa_z2_mesa
jdbc.hiveA.key=aC/8fTC9vfPVhCk+CDzbAQ==
#加密后密码
#jdbc.hiveA.password=V3GyFlG8Mg01bTt8ykFVaA==
#实际密码
jdbc.hiveA.password=123!@#qwe
#B版日志库
jdbc.hiveB.driver=org.apache.hive.jdbc.HiveDriver
jdbc.hiveB.url=jdbc:hive2://10.3.130.25:10000/default
jdbc.hiveB.username=xa_z2_mesa
jdbc.hiveB.key=aC/8fTC9vfPVhCk+CDzbAQ==
#加密后密码
#jdbc.hiveB.password=V3GyFlG8Mg01bTt8ykFVaA==
#实际密码
jdbc.hiveB.password=123!@#qwe
bonecp.hive.idleMaxAgeInMinutes=60
bonecp.hive.idleConnectionTestPeriodInMinutes=240
bonecp.hive.maxConnectionsPerPartition=20
bonecp.hive.minConnectionsPerPartition=10
bonecp.hive.partitionCount=3
bonecp.hive.acquireIncrement=5
bonecp.hive.statementsCacheSize=100
############################################################################################################################################
#下面的库为测试库,测试完成后会删除
############################################################################################################################################
jdbc.test.driver=oracle.jdbc.driver.OracleDriver
jdbc.test.url=jdbc:oracle:thin:@10.0.6.212:1523:app
jdbc.test.username=gk_pztest
jdbc.test.key=cV9126WUYdojQjvuKNjidw==
jdbc.test.password=OrTu/cLwlduYPW/tmxqNgQ==

View File

@@ -0,0 +1,22 @@
#Log4j
log4j.rootLogger=info,console,file
# 控制台日志设置
log4j.appender.console=org.apache.log4j.ConsoleAppender
#log4j.appender.console.Threshold=info
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] [%-5p] [Thread\:%t] %l %x - <%m>%n
# 文件日志设置
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.Threshold=error
log4j.appender.file.encoding=UTF-8
log4j.appender.file.Append=true
log4j.appender.file.file=${nis.root}/WEB-INF/log/nis.log
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.layout=org.apache.log4j.PatternLayout
#log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss} %X{ip} [%t] %5p %c{1} %m%n
log4j.appender.file.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] [%-5p] %X{ip} [Thread\:%t] %l %x - %m%n
#MyBatis 配置com.nis.web.dao是mybatis接口所在包
log4j.logger.com.nis.web.dao=debug
#bonecp数据源配置
log4j.category.com.jolbox=debug,console

View File

@@ -0,0 +1,37 @@
#编译表表名
compileTabName=CONFIG_COMPILE
#编译表 新增配置时添加的字段 英文逗号分隔
compileFieldName=COMPILE_ID ,SERVICE ,ACTION , CONT_TYPE, ATTR_TYPE, CONT_LABEL, Task_id, Guarantee_ID, AFFAIR_ID, TOPIC_ID, DO_BLACKLIST ,DO_LOG ,EFFECTIVE_RANGE , ACTIVE_SYS, CONFIG_PERCENT ,CONFIG_OPTION ,START_TIME ,END_TIME , USER_REGION, IS_VALID,GROUP_NUM,FATHER_CFG_ID ,OP_TIME
#编译表 配置状态更新的条件
compileUpdateCondition=COMPILE_ID
#分组表表名
groupTabName=CONFIG_GROUP
#分组表 新增配置时添加的字段 英文逗号分隔
#注意:第一个字段必需是分组表主键
groupFieldName=ID,GROUP_ID, COMPILE_ID, IS_VALID, OP_TIME
#分组表主键使用序列号
groupSeqName=SEQ_CONFIG_GROUP
#分组表 配置状态更新的条件
groupUpdateCondition=GROUP_ID,COMPILE_ID
#域配置表配置ID字段名称
regionId = REGION_ID
#字符域表 新增配置时添加字段 英文逗号分隔
strRegionFieldName=REGION_ID, GROUP_ID, KEYWORDS, EXPR_TYPE, MATCH_METHOD , IS_HEXBIN, IS_VALID, OP_TIME
#增强字符域表 新增配置时添加字段 英文逗号分隔
strongStrRegionFieldName=REGION_ID, GROUP_ID, DISTRICT, KEYWORDS, EXPR_TYPE, MATCH_METHOD , IS_HEXBIN, IS_VALID, OP_TIME
#IP域表 新增配置时添加字段 英文逗号分隔
ipRegionFieldName=REGION_ID, GROUP_ID, ADDR_TYPE, SRC_IP, MASK_SRC_IP, SRC_PORT, MASK_SRC_PORT, DST_IP, MASK_DST_IP, DST_PORT, MASK_DST_PORT, PROTOCOL, DIRECTION, IS_VALID, OP_TIME
#数值域表 新增配置时添加字段 英文逗号分隔
numRegionFieldName = REGION_ID,GROUP_ID,LOW_BOUNDARY,UP_BOUNDARY,IS_VALID,OP_TIME
#是否包含LAST_UPDATE字段 (状态更新中使用)
hasLastUpdate=true
#配置状态更新的字段
updateFields=IS_VALID,OP_TIME

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright 2009-2012 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<!-- 使全局的映射器启用或禁用缓存。 -->
<setting name="cacheEnabled" value="true"/>
<!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载。 -->
<setting name="lazyLoadingEnabled" value="true"/>
<!-- 当启用时,有延迟加载属性的对象在被调用时将会完全加载任意属性。否则,每种属性将会按需要加载。 -->
<setting name="aggressiveLazyLoading" value="true"/>
<!-- 是否允许单条sql 返回多个数据集 (取决于驱动的兼容性) default:true -->
<setting name="multipleResultSetsEnabled" value="true"/>
<!-- 是否可以使用列的别名 (取决于驱动的兼容性) default:true -->
<setting name="useColumnLabel" value="true"/>
<!-- 允许JDBC 生成主键。需要驱动器支持。如果设为了true这个设置将强制使用被生成的主键有一些驱动器不兼容不过仍然可以执行。 default:false -->
<setting name="useGeneratedKeys" value="false"/>
<!-- 指定 MyBatis 如何自动映射 数据基表的列 NONE不隐射 PARTIAL:部分 FULL:全部 -->
<setting name="autoMappingBehavior" value="PARTIAL"/>
<!-- 这是默认的执行类型 SIMPLE: 简单; REUSE: 执行器可能重复使用prepared statements语句BATCH: 执行器可以重复执行语句和批量更新) -->
<setting name="defaultExecutorType" value="SIMPLE"/>
<!-- 使用驼峰命名法转换字段。 -->
<setting name="mapUnderscoreToCamelCase" value="true"/>
<!-- 设置本地缓存范围 session:就会有数据的共享 statement:语句范围 (这样就不会有数据的共享 ) defalut:session -->
<setting name="localCacheScope" value="SESSION"/>
<!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER插入空值时不需要指定类型 -->
<setting name="jdbcTypeForNull" value="NULL"/>
</settings>
<!--通过指定包名设置在相关映射时可使用不带包的简短名字bean的首字母小写作为默认别名 -->
<typeAliases>
<package name="com.nis.domain"/>
</typeAliases>
<!-- 插件配置 -->
<plugins>
<plugin interceptor="com.nis.persistence.interceptor.PaginationInterceptor" />
</plugins>
</configuration>

View File

@@ -0,0 +1,237 @@
#\u7ba1\u7406\u57fa\u7840\u8def\u5f84, \u9700\u540c\u6b65\u4fee\u6539\uff1aweb.xml
adminPath=/nis
#Restful\u670D\u52A1\u9ED8\u8BA4\u8DEF\u5F84<38>
servicePath=/service
#\u5206\u9875\u914d\u7f6e
page.pageSize=30
#\u5206\u9875\u914d\u7f6e
page.count=0
#\u7d22\u5f15\u9875\u8def\u5f84
web.view.index=/nis/index
#\u7f13\u5b58\u8bbe\u7f6e
ehcache.configFile=cache/ehcache-local.xml
#ehcache.configFile=cache/ehcache-rmi.xml
#\u4f1a\u8bdd\u8d85\u65f6\uff0c \u5355\u4f4d\uff1a\u6beb\u79d2\uff0c 20m=1200000ms, 30m=1800000ms, 60m=3600000ms
session.sessionTimeout=1800000
#\u4f1a\u8bdd\u6e05\u7406\u95f4\u9694\u65f6\u95f4\uff0c \u5355\u4f4d\uff1a\u6beb\u79d2\uff0c2m=120000ms\u3002
session.sessionTimeoutClean=120000
#\u9759\u6001\u6587\u4ef6\u540e\u7f00
web.staticFile=.css,.js,.png,.jpg,.gif,.jpeg,.bmp,.ico,.swf,.psd,.htc,.htm,.html,.crx,.xpi,.exe,.ipa,.apk
#\u7f51\u7ad9URL\u540e\u7f00
urlSuffix=.jsp
#\u89c6\u56fe\u6587\u4ef6\u5b58\u653e\u8def\u5f84
web.view.prefix=/WEB-INF/views/
web.view.suffix=.jsp
#\u662f\u5426\u4e0d\u5141\u8bb8\u5237\u65b0\u4e3b\u9875\uff0c\u4e0d\u5141\u8bb8\u60c5\u51b5\u4e0b\uff0c\u5237\u65b0\u4e3b\u9875\u4f1a\u5bfc\u81f4\u91cd\u65b0\u767b\u5f55
notAllowRefreshIndex=false
#\u524d\u7aef\u57fa\u7840\u8def\u5f84
frontPath=/f
#\u662F\u5426\u8FD0\u884C\u591A\u8D26\u6237\u540C\u65F6\u767B\u5F55?
user.multiAccountLogin=true
#\u7855\u6b63\u7ec4\u4ef6\u662f\u5426\u4f7f\u7528\u7f13\u5b58
supcan.useCache=false
#\u901a\u77e5\u95f4\u9694\u65f6\u95f4\u8bbe\u7f6e, \u5355\u4f4d\uff1a\u6beb\u79d2, 30s=30000ms, 60s=60000ms
work.notify.remind.interval=60000
#============================#
#===== System settings ======#
#============================#
#\u4ea7\u54c1\u4fe1\u606f\u8bbe\u7f6e
productName=gk
copyrightYear=2015
version=V1.0.0
#\u4e0a\u4f20\u6587\u4ef6\u7edd\u5bf9\u8def\u5f84, \u8def\u5f84\u4e2d\u4e0d\u5141\u8bb8\u5305\u542b\u201cuserfiles\u201d
userfiles.basedir=upload
#============================#
#===== webservice settings ======#
#============================#
#ESB<53><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B9A9>ͳһ<CDB3><D2BB>ַ
webservice.esb.endpoint=http://10.55.0.197:7879/TongServiceProxy_doprocess/services/WebService1/
#webservice RID
webservice.rid=XFBL
#webservice user SID
webservice.yh.sid=s_2016_x2000
#webservice office SID
webservice.jg.sid=s_2015_x2000
#webservice data dict SID
webservice.data.dict.sid=s_2031_x2000
#webservice data dict bm SID
webservice.data.dict.bm.sid=s_2032_x2000
#webservice data dict code SID
webservice.data.dict.code.sid=s_2042_0660BD17-35E4-4482-AA3A-556F2C024902
#webservice request timeout for seconds
webservice.request.timeout=30
#<23><><EFBFBD><EFBFBD><EFBFBD>URL
webservice.jg.service.url=http://10.55.0.155:8080/jgService
#<23>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>URL
webservice.yh.service.url=http://10.55.0.155:8080/ryService
#<23><><EFBFBD><EFBFBD>ֵ<EFBFBD>URL
webservice.data.dict.service.url=http://10.55.0.155:8080/sjzdService
#<23><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>URL
webservice.data.dict.bm.url=http://10.55.0.155:8080/sjzdbmService
#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>URL
webservice.data.code.url=http://10.55.0.155:8080/sjmbService
#webservice<63>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD>ÿҳ<C3BF><D2B3><EFBFBD><EFBFBD>
webservice.data.pagesize = 2000
#webservice<63><65>ǰĬ<C7B0><C4AC>ҳ
webservice.data.currentpage = 1
#webservice <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
webservice.jgmb.name=CK_T_JC_RY
#webservice <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
webservice.yhmb.name=CK_T_YH_RY
#webservice<63><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȫ<><C8AB>
webservice.method.name.ql=getData
# webservice<63><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
webservice.method.name.zl=getDataZL
# redis配置文件
#redis 各个分片的 IP端口
redis.cluster.host_port=10.0.6.32:6379,10.0.6.32:6380,10.0.6.32:6381,10.0.6.33:6379,10.0.6.33:6380,10.0.6.33:6381
#中心现场redis地址和端口
#redis.cluster.host_port=10.174.196.33:6379,10.174.196.33:6380,10.174.196.33:6381,10.174.196.34:6379,10.174.196.34:6380,10.174.196.34:6381,10.174.196.35:6379,10.174.196.35:6380,10.174.196.35:6381,10.174.196.36:6379,10.174.196.36:6380,10.174.196.36:6381,10.174.196.37:6379,10.174.196.37:6380,10.174.196.37:6381,10.174.196.38:6379,10.174.196.38:6380,10.174.196.38:6381,10.174.196.39:6379,10.174.196.39:6380,10.174.196.39:6381
redis.cluster.connectiontimeout=5000
redis.cluster.sotimeout=5000
redis.cluster.maxattempts=3
#redis连接池相关配置
redis.pool.maxtotal=500
redis.pool.maxidle=500
redis.pool.maxwaitmillis=-1
redis.pool.blockwhenexhausted=true
redis.pool.numtestsperevictionrun=60000
redis.pool.testonborrow=true
redis.pool.testonreturn=false
redis.pool.testwhileidle=true
redis.pool.timebetweenevictionrunsmillis=60000
redis.pool.minevictableidletimemillis=60000
#oracle数据redis存储时间(秒为单位 默认3分钟即180s)
oracleExpire=180
#hive数据中心数据redis存储时间(秒为单位 默认20分钟即1200s)
hiveExpire=300
#redis开关
isOpenRedis=false
#是否将数据中心的日志加入到redis中
dataCenterOpenRedis=true
#跨域问题允许 的url Access-Control-Allow-Origin *允许所有设置成其他url只允许该url.不能设置多个url
target_url=*
#跨域问题 3600表明在3600秒内不需要再发送预请求可以缓存该结果
ACCESS_CONTROL_MAX_AGE=3600
##########HTTPCLIENT POOL START###################
#从连接池中获取到连接的最长时间
http.request.connectionRequestTimeout=500
#5000
http.request.connectTimeout=5000
#数据传输的最长时间
http.request.socketTimeout=30000
#提交请求前测试连接是否可用
http.request.staleConnectionCheckEnabled=true
#设置连接总数
http.pool.maxTotal=200
#设置每个地址的并发数
http.pool.defaultMaxPerRoute=100
##########HTTPCLIENT POOL END###################
search.dateformat=yyyy-MM-dd HH:mm:ss
search.eshostandport_A=10.0.6.115:9200
search.eshostandport_B=10.0.6.115:9200
search.eshostandport_C=10.0.6.115:9200
#search.eshostandport=10.174.196.135:9200
#日志是否从hive中查询
selFromHive=false
#是否获取数据中心查询记录的总条数
isGetHiveCount=false
#每次获取数据中心多少条数据,咱们在对获取的数据进行分页处理
everyGetHiveDataNum=10000
#oracle数据库有问题不从oracle查询数据,所有日志数据均从数据中心查询
onlySelFromHive=false
#\u662F\u5426\u67E5\u8BE2\u795E\u901A\u6570\u636E\u5E93
isSelectCluster=true
#用户查询日志超过多少小时去数据中心查询
dataCenterTime=48
#是否开启基础验证
baseValidate=true
#是否开启业务验证
serviceValidate=true
#\u65E5\u5FD7\u5B58\u50A8\u672C\u5730\u65F6\u95F4(\u5355\u4F4D\u5C0F\u65F6)
logLocalTime=48
#\u5B9E\u65F6\u7EDF\u8BA1\u9ED8\u8BA4\u67E5\u8BE2\u672C\u5730\u4E00\u4E2A\u5C0F\u65F6\u7684\u6570\u636E(\u5355\u4F4D\uFF1A\u5C0F\u65F6)
reportLocalTime=1
#\u795E\u901A\u6570\u636E\u5E93\u6700\u65E9\u65E5\u5FD7\u65F6\u95F4(A\u7248\u6BEB\u79D2)
#2017-08-13 10:07:25
clusterAStartTime=1503504000725
#\u795E\u901A\u6570\u636E\u5E93\u6700\u65E9\u7ED3\u675F\u65F6\u95F4(B\u7248\u6BEB\u79D2)
#2017-08-13 10:07:25
clusterBStartTime=1503504000725
############################################################################################################################################
#设置配置是否入库
############################################################################################################################################
isCommit=true
############################################################################################################################################
############################################################################################################################################
httpUrl=http://127.0.0.1:8080/gk/service/cfg/v1/configSources
#use elasticsearch or not#
isUseES=false
#数据中心A版数据库名称,程序中每次查询时使用的数据库名称 use dbA
jdbc.hive.AName=xa_dfbhit_hive
#数据中心B版数据库名称
jdbc.hive.BName=xa_z2_mesalog_hive
maxPageSize=100000

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
<classpath>
<dir name="D:/workspace/springmvc4_frame/target/classes">
</dir>
<dir name="D:/workspace/springmvc4_frame/target/test-classes">
</dir>
</classpath>
<web>
<link target="/">
<dir name="D:/workspace/springmvc4_frame/src/main/webapp">
</dir>
</link>
</web>
</application>

View File

@@ -0,0 +1,22 @@
#!/bin/sh
log_file=/usr/local/nignx/nignx_job.log
echo "/usr/local/nginx/sbin/shouhu_nignx.sh Start At:" >> $log_file
date >> $log_file
#count=1
while [ 1 -eq 1 ]
do
sleep 30
if [ `ps -ef | grep nignx | grep -v grep | wc -l` -lt 1 ]
then
echo -n "Down at:" >> $log_file
date >> $log_file
# --------- start /usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx
echo "/usr/local/nginx/sbin/nginx Start...." >>$log_file
fi
sleep 1
done

View File

@@ -0,0 +1,5 @@
nignx_shouhu.shΪnignx<6E><78><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӽ<EFBFBD><D3BC><EFBFBD>һ<EFBFBD><D2BB>nignx<6E><78><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tomcat_shouhu.shΪtomcat<61><74><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD>̣<EFBFBD>5<EFBFBD><35><EFBFBD>Ӽ<EFBFBD><D3BC><EFBFBD>һ<EFBFBD><D2BB>tomcat<61><74><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tomcat_resart.shΪtomcat<61><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD>̣<EFBFBD>24Сʱ<D0A1><CAB1><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>tomcat<61><74><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tomcat_shouhu.sh<73><68>tomcat_restart.sh<73><68><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3>ڵ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD><EFBFBD><EFBFBD>tomcat<61>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶Բ<C2B6><D4B2><EFBFBD>tomcatֻ<74><D6BB><EFBFBD><EFBFBD>tomcat_shouhu.sh<73><68>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>tomcat<EFBFBD><EFBFBD><EFBFBD><EFBFBD>tomcat_shouhu.sh<73><68>tomcat_restart.sh,<2C>Ա<EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>Ⱥ<EFBFBD><C8BA><EFBFBD>ȶ<EFBFBD><C8B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԡ<EFBFBD>

View File

@@ -0,0 +1,50 @@
#!/bin/sh
log_file=/home/dongxiaooyan/apache-tomcat-7.0.59/logs/tomcat_restart_job.log
tomcat_home=/home/dongxiaooyan/apache-tomcat-7.0.59
echo "/home/dongxiaooyan/apache-tomcat-7.0.59/bin/shouhu.sh Start At:" >> $log_file
date >> $log_file
#count=1
while [ 1 -eq 1 ]
do
sleep 86400
#sleep 30
if [ `ps -ef | grep apache-tomcat-7.0.59 | grep -v grep | wc -l` -lt 1 ]
then
echo -n "Down at:" >> $log_file
date >> $log_file
# --------- start apache-tomcat-7.0.59
$tomcat_home/bin/startup.sh
echo "$tomcat_home Start...." >>$log_file
fi
if [ `ps -ef | grep apache-tomcat-7.0.59 | grep -v grep | wc -l` -eq 1 ]
then
echo -n "apache-tomcat-7.0.59 is running at:" >> $log_file
date >> $log_file
echo "Now will restart apache-tomcat-7.0.59 ...." >> $log_file
# --------- Now will to shutdowd the apache-tomcat-7.0.59
a=`ps axf|grep 'apache-tomcat-7.0.59'|grep -v grep|awk '{print \$1}'`;
echo "tomcat process id: $a " >> $log_file
kill -9 $a;
echo -n "kille tomcat at:" >> $log_file
date >> $log_file
echo "check apache-tomcat-7.0.59 stat " >> $log_file
if [ `ps -ef | grep apache-tomcat-7.0.59 | grep -v grep | wc -l` -lt 1 ]
then
echo "apache-tomcat-7.0.59 has been killed! " >> $log_file
# --------- Now will to start apache-tomcat-7.0.59
echo "Now will to start apache-tomcat-7.0.59 ...." >> $log_file
$tomcat_home/bin/startup.sh &
echo "$tomcat_home Start...." >>$log_file
if [ `ps -ef | grep apache-tomcat-7.0.59 | grep -v grep | wc -l` -lt 1 ]
then
echo -n "Start apache-tomcat-7.0.59 faild!" >> $log_file
date >> $log_file
fi
fi
fi
sleep 1
done

View File

@@ -0,0 +1,22 @@
#!/bin/sh
log_file=/home/dongxiaooyan/apache-tomcat-7.0.59/logs/tomcat_job.log
echo "/home/dongxiaooyan/apache-tomcat-7.0.59/bin/shouhu.sh Start At:" >> $log_file
date >> $log_file
#count=1
while [ 1 -eq 1 ]
do
sleep 300
if [ `ps -ef | grep apache-tomcat-7.0.59 | grep -v grep | wc -l` -lt 1 ]
then
echo -n "Down at:" >> $log_file
date >> $log_file
# --------- start apache-tomcat-7.0.59
/home/dongxiaooyan/apache-tomcat-7.0.59/bin/startup.sh
echo "/home/dongxiaooyan/apache-tomcat-7.0.59 Start...." >>$log_file
fi
sleep 1
done

View File

@@ -0,0 +1,269 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:lang="http://www.springframework.org/schema/lang" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:cache="http://www.springframework.org/schema/cache" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache.xsd">
<!-- 加载配置属性文件 -->
<context:property-placeholder
ignore-unresolvable="true" location="classpath:nis.properties" />
<!-- 静态资源访问交由default Servlet handler -->
<mvc:default-servlet-handler />
<!-- 静态资源映射 -->
<mvc:resources mapping="/static/**" location="/static/"
cache-period="31536000" />
<mvc:resources mapping="/upload/**" location="/upload/"
cache-period="31536000" />
<mvc:resources mapping="/swagger/**" location="/swagger/"
cache-period="31536000" />
<!-- 定义无Controller的path<->view直接映射 -->
<mvc:view-controller path="/" view-name="redirect:/nis/index" />
<!-- 启用spring mvc注解 -->
<context:annotation-config />
<!-- 默认注解映射支持 -->
<mvc:annotation-driven />
<bean class="com.nis.restful.SwaggerConfig" />
<!-- redis 工具类-->
<bean id="redisDao" class="com.nis.util.redis.RedisDao" />
<!-- elasticsearch 工具类 将查询转化为elasticsearch-sql支持的语法-->
<bean id="elasticsearchSqlDao" class="com.nis.util.elasticsearch.ElasticsearchSqlDao"/>
<!-- 定义httpclient连接池 -->
<bean id="httpClientConnectionManager" class="org.apache.http.impl.conn.PoolingHttpClientConnectionManager" destroy-method="close">
<!-- 设置连接总数 -->
<property name="maxTotal" value="${http.pool.maxTotal}"></property>
<!-- 设置每个地址的并发数 -->
<property name="defaultMaxPerRoute" value="${http.pool.defaultMaxPerRoute}"></property>
</bean>
<!-- 定义 HttpClient工厂这里使用HttpClientBuilder构建-->
<bean id="httpClientBuilder" class="org.apache.http.impl.client.HttpClientBuilder" factory-method="create">
<property name="connectionManager" ref="httpClientConnectionManager"></property>
</bean>
<!-- 得到httpClient的实例 -->
<bean id="httpClient" factory-bean="httpClientBuilder" factory-method="build"/>
<!-- 定期清理无效的连接 -->
<bean class="com.nis.util.httpclient.IdleConnectionEvictor" destroy-method="shutdown">
<constructor-arg index="0" ref="httpClientConnectionManager" />
<!-- 间隔一分钟清理一次 -->
<constructor-arg index="1" value="60000" />
</bean>
<!-- 定义requestConfig的工厂 -->
<bean id="requestConfigBuilder" class="org.apache.http.client.config.RequestConfig.Builder">
<!-- 从连接池中获取到连接的最长时间 -->
<property name="connectionRequestTimeout" value="${http.request.connectionRequestTimeout}"/>
<!-- 创建连接的最长时间 -->
<property name="connectTimeout" value="${http.request.connectTimeout}"/>
<!-- 数据传输的最长时间 -->
<property name="socketTimeout" value="${http.request.socketTimeout}"/>
<!-- 提交请求前测试连接是否可用 -->
<property name="staleConnectionCheckEnabled" value="${http.request.staleConnectionCheckEnabled}"/>
</bean>
<!-- 得到requestConfig实例 -->
<bean id="requestConfig" factory-bean="requestConfigBuilder" factory-method="build" />
<!--事务控制驱动注解,发现注解@Transactional 时找transactionManager事务管理器 -->
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- autodetection of such annotated controllers -->
<context:component-scan base-package="com.nis.web"></context:component-scan>
<context:component-scan base-package="com.nis.restful"></context:component-scan>
<!-- 默认的注解映射的支持org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping -->
<mvc:annotation-driven
content-negotiation-manager="contentNegotiationManager">
<mvc:message-converters register-defaults="true">
<!-- 将StringHttpMessageConverter的默认编码设为UTF-8 -->
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" />
</bean>
<!-- 将Jackson2HttpMessageConverter的默认格式化输出为false -->
<bean
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>application/json;charset=UTF-8</value>
</list>
</property>
<property name="prettyPrint" value="false" />
<property name="objectMapper">
<bean class="com.nis.util.JsonMapper"></bean>
</property>
</bean>
<!-- 使用XML格式输出数据 -->
<bean
class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
<constructor-arg>
<bean class="org.springframework.oxm.xstream.XStreamMarshaller">
<property name="streamDriver">
<bean class="com.thoughtworks.xstream.io.xml.StaxDriver" />
</property>
<property name="annotatedClasses">
<list>
<value>com.nis.domain.BaseEntity</value>
<value>com.nis.supcan.TreeList</value>
<value>com.nis.supcan.Col</value>
<value>com.nis.supcan.Group</value>
</list>
</property>
</bean>
</constructor-arg>
<property name="supportedMediaTypes" value="application/xml"></property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!-- REST中根据URL后缀自动判定Content-Type及相应的View -->
<bean id="contentNegotiationManager"
class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="mediaTypes">
<map>
<entry key="xml" value="application/xml" />
<entry key="json" value="application/json" />
</map>
</property>
<property name="ignoreAcceptHeader" value="true" />
<property name="favorPathExtension" value="true" />
</bean>
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/nis/**" />
<mvc:exclude-mapping path="/nis/" />
<mvc:exclude-mapping path="/nis/login" />
<mvc:exclude-mapping path="/nis/sys/index" />
<mvc:exclude-mapping path="/nis/sys/menu/tree" />
<mvc:exclude-mapping path="/nis/sys/menu/treeData" />
<mvc:exclude-mapping path="/nis/sys/user/getToDoTaskNum" />
<mvc:exclude-mapping path="/nis/sys/user/toDoTask" />
<bean class="com.nis.interceptor.LogInterceptor" />
</mvc:interceptor>
<!-- 数据源拦截器该拦截路径下使用数据源B -->
<mvc:interceptor>
<mvc:mapping path="/service/cfg/**" />
<bean class="com.nis.interceptor.DataSourceBInterceptor"></bean>
</mvc:interceptor>
<!-- 数据源拦截器该拦截路径下使用数据源C -->
<mvc:interceptor>
<mvc:mapping path="/service/log/**" />
<bean class="com.nis.interceptor.DataSourceCInterceptor"></bean>
</mvc:interceptor>
<!-- 数据源拦截器该拦截路径下使用数据源D,后期会删除 -->
<mvc:interceptor>
<mvc:mapping path="/service/test/**" />
<bean class="com.nis.interceptor.DataSourceDInterceptor"></bean>
</mvc:interceptor>
<!-- 数据源拦截器该拦截路径下使用数据源E -->
<mvc:interceptor>
<mvc:mapping path="/service/jk/**" />
<bean class="com.nis.interceptor.DataSourceEInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>
<!-- 视图文件解析 -->
<bean id="internalResourceViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/views/"></property>
<property name="suffix" value=".jsp"></property>
<property name="viewNames" value="jsp/*"></property>
<property name="order" value="1"></property>
</bean>
<bean id="urlBaseViewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/views/"></property>
<property name="suffix" value=".jsp"></property>
<property name="order" value="2"></property>
</bean>
<!-- 支持Shiro对Controller的方法级AOP安全控制 begin -->
<bean
class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
depends-on="lifecycleBeanPostProcessor">
<property name="proxyTargetClass" value="true" />
</bean>
<bean id="annotationMethodHandlerExceptionResolver"
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver">
<property name="order" value="0" />
</bean>
<bean id="RestServiceExceptionHandler" class="com.nis.restful.AppExceptionHandler">
<property name="order" value="1" />
<property name="errorResolver">
<bean class="com.nis.restful.DefaultRestErrorResolver">
<property name="exceptionMappingDefinitions">
<map>
<entry key="com.nis.restful.RestServiceException" value="404" />
<entry key="Throwable" value="500" />
</map>
</property>
</bean>
</property>
</bean>
<bean
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="org.apache.shiro.authz.UnauthorizedException">error/403</prop>
<prop key="java.lang.Throwable">error/500</prop>
</props>
</property>
</bean>
<!-- 支持Shiro对Controller的方法级AOP安全控制 end -->
<!-- 上传文件拦截设置最大文件大小10m=10*1024*1024(B)=10485760 bytes -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="utf-8"></property>
<property name="maxUploadSize" value="10485760"></property>
<!--<property name="maxInMemorySize" value="1000"></property> -->
</bean>
</beans>

View File

@@ -0,0 +1,84 @@
#由于数据中心日志表的表名会变动,所以本系统中将日志中心的表名提取到配置文件中方便后期修改
#\u6570\u636E\u4E2D\u5FC3hive\u6570\u636E\u5E93\u8868\u540D
df_ip_port_log=t_df_ip_port_log
df_http_req_log=t_df_http_req_log_v3
df_http_res_log=t_df_http_res_log_v3
df_http_keyword_log=t_df_http_keyword_log
df_mail_log=t_df_mail_log
df_dns_log=t_df_dns_log
df_ftp_log=t_df_ftp_log
df_pptp_log=t_df_pptp_log
df_l2tp_log=t_df_l2tp_log
df_ipsec_log=t_df_ipsec_log
df_openvpn_log=t_df_openvpn_log
df_ssh_log=t_df_ssh_log
df_ssl_log=t_df_ssl_log
df_tunnel_random_log=t_df_tunnel_random_log
#\u6570\u636E\u4E2D\u5FC3\u795E\u901A\u6570\u636E\u5E93A\u7248\u8868\u540D
DfIpPortLogA=t_xa_df_ip_port_log_hit_mpp
DfHttpReqLogA=t_xa_df_http_req_log_hit_mpp
DfHttpResLogA=t_xa_df_http_res_log_hit_mpp
DfHttpKeywordLogA=t_xa_df_http_keyword_log_hit_mpp
DfMailLogA=t_xa_df_mail_log_hit_mpp
DfDnsLogA=t_xa_df_dns_log_hit_mpp
DfFtpLogA=t_xa_df_ftp_log_hit_mpp
DfPptpLogA=t_xa_df_pptp_log_hit_mpp
DfL2tpLogA=t_xa_df_l2tp_log_hit_mpp
DfIpsecLogA=t_xa_df_ipsec_log_hit_mpp
DfOpenvpnLogA=t_xa_df_openvpn_log_hit_mpp
DfSshLogA=t_xa_df_ssh_log_hit_mpp
DfSslLogA=t_xa_df_ssl_log_hit_mpp
DfTunnelRandomLogA=t_xa_df_tunnel_random_log_hit_mpp
#\u795E\u901A\u6570\u636E\u5E93B\u7248\u8868\u540D
DfIpPortLogB=t_xa_df_ip_port_log_mpp
DfHttpReqLogB=t_xa_df_http_req_log_mpp
DfHttpResLogB=t_xa_df_http_res_log_mpp
DfHttpKeywordLogB=t_xa_df_http_keyword_log_mpp
DfMailLogB=t_xa_df_mail_log_mpp
DfDnsLogB=t_xa_df_dns_log_mpp
DfFtpLogB=t_xa_df_ftp_log_mpp
DfPptpLogB=t_xa_df_pptp_log_mpp
DfL2tpLogB=t_xa_df_l2tp_log_mpp
DfIpsecLogB=t_xa_df_ipsec_log_mpp
DfOpenvpnLogB=t_xa_df_openvpn_log_mpp
DfSshLogB=t_xa_df_ssh_log_mpp
DfSslLogB=t_xa_df_ssl_log_mpp
DfTunnelRandomLogB=t_xa_df_tunnel_random_log_mpp