apzl_leasing/config/applicationContext.xml
2020-01-08 16:57:43 +08:00

251 lines
15 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
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-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.0.xsd
">
<util:properties id="collectProperties" location="classpath:collect_config.properties" />
<bean id="collectConfig" class="com.amarsoft.app.awe.config.CollectProperties">
<!-- 代收付系统 测试接口地址 -->
<property name="c_serverUrl" value="#{collectProperties['com.tenwa.yangdm.collect.serverUrl']}"></property>
<!-- 清算文件下载请求 地址 -->
<property name="b_serverUrl" value="#{collectProperties['com.tenwa.yangdm.bank.serverUrl']}"></property>
<!-- 银行卡、签约 接口 地址 -->
<property name="clearRequestUrl" value="#{collectProperties['com.tenwa.yangdm.bank.clearRequestUrl']}"></property>
<!-- 商户号 -->
<property name="merchantId" value="#{collectProperties['com.tenwa.yangdm.merchantId']}"></property>
<!-- 收付标志 S 代表 代收 -->
<property name="flag" value="#{collectProperties['com.tenwa.yangdm.collect.flag']}"></property>
<!-- 测试用户 -->
<property name="userName" value="#{collectProperties['com.tenwa.yangdm.collect.userName']}"></property>
<property name="userPass" value="#{collectProperties['com.tenwa.yangdm.collect.userPass']}"></property>
<property name="businessCode" value="#{collectProperties['com.tenwa.yangdm.collect.businessCode']}"></property>
<!-- 批量代收,其他参数同实时 -->
<property name="batch_trxCode" value="#{collectProperties['com.tenwa.yangdm.batch.trxCode']}"></property>
<!-- 实时代收 -->
<property name="c_dataType" value="#{collectProperties['com.tenwa.yangdm.collect.dataType']}"></property>
<property name="c_level" value="#{collectProperties['com.tenwa.yangdm.collect.level']}"></property>
<property name="c_trxCode" value="#{collectProperties['com.tenwa.yangdm.collect.trxCode']}"></property>
<property name="c_version" value="#{collectProperties['com.tenwa.yangdm.collect.version']}"></property>
<!-- 银行卡四要素验证 -->
<property name="b_trxCode" value="#{collectProperties['com.tenwa.yangdm.bank.trxCode']}"></property>
<property name="b_version" value="#{collectProperties['com.tenwa.yangdm.bank.version']}"></property>
<property name="b_dataType" value="#{collectProperties['com.tenwa.yangdm.bank.dataType']}"></property>
<property name="b_level" value="#{collectProperties['com.tenwa.yangdm.bank.level']}"></property>
<!-- 公钥、私钥地址 -->
<property name="publicKeyUrl" value="#{collectProperties['com.tenwa.yangdm.publicKeyUrl']}"></property>
<property name="privateKeyUrl" value="#{collectProperties['com.tenwa.yangdm.privateKeyUrl']}"></property>
</bean>
<!-- 增加天津扣款参数 -->
<util:properties id="collectPropertiesTj" location="classpath:collect_config_tj.properties" />
<bean id="collectConfigTj" class="com.amarsoft.app.awe.config.CollectPropertiesTj">
<!-- 代收付系统 测试接口地址 -->
<property name="c_serverUrl" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.serverUrl']}"></property>
<!-- 清算文件下载请求 地址 -->
<property name="b_serverUrl" value="#{collectPropertiesTj['com.tenwa.yangdm.bank.serverUrl']}"></property>
<!-- 银行卡、签约 接口 地址 -->
<property name="clearRequestUrl" value="#{collectPropertiesTj['com.tenwa.yangdm.bank.clearRequestUrl']}"></property>
<!-- 商户号 -->
<property name="merchantId" value="#{collectPropertiesTj['com.tenwa.yangdm.merchantId']}"></property>
<!-- 收付标志 S 代表 代收 -->
<property name="flag" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.flag']}"></property>
<!-- 测试用户 -->
<property name="userName" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.userName']}"></property>
<property name="userPass" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.userPass']}"></property>
<property name="businessCode" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.businessCode']}"></property>
<!-- 批量代收,其他参数同实时 -->
<property name="batch_trxCode" value="#{collectPropertiesTj['com.tenwa.yangdm.batch.trxCode']}"></property>
<!-- 实时代收 -->
<property name="c_dataType" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.dataType']}"></property>
<property name="c_level" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.level']}"></property>
<property name="c_trxCode" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.trxCode']}"></property>
<property name="c_version" value="#{collectPropertiesTj['com.tenwa.yangdm.collect.version']}"></property>
<!-- 银行卡四要素验证 -->
<property name="b_trxCode" value="#{collectPropertiesTj['com.tenwa.yangdm.bank.trxCode']}"></property>
<property name="b_version" value="#{collectPropertiesTj['com.tenwa.yangdm.bank.version']}"></property>
<property name="b_dataType" value="#{collectPropertiesTj['com.tenwa.yangdm.bank.dataType']}"></property>
<property name="b_level" value="#{collectPropertiesTj['com.tenwa.yangdm.bank.level']}"></property>
<!-- 公钥、私钥地址 -->
<property name="publicKeyUrl" value="#{collectPropertiesTj['com.tenwa.yangdm.publicKeyUrl']}"></property>
<property name="privateKeyUrl" value="#{collectPropertiesTj['com.tenwa.yangdm.privateKeyUrl']}"></property>
</bean>
<util:properties id="secondHandCarProperties" location="classpath:second_handCar.properties" />
<bean id="secondHandCarConfig" class="com.amarsoft.app.awe.config.SecondHandCarProperties">
<!-- 二手车接口调用前缀 -->
<property name="prefix" value="#{secondHandCarProperties['com.tenwa.zhanglei.prefix']}"></property>
<!-- 二手车接口调用令牌 -->
<property name="token" value="#{secondHandCarProperties['com.tenwa.zhanglei.token']}"></property>
<!-- 操作类型 -->
<property name="oper" value="#{secondHandCarProperties['com.tenwa.zhanglei.oper']}"></property>
<!-- 乘用车型库版本信息 -->
<property name="version" value="#{secondHandCarProperties['com.tenwa.zhanglei.version']}"></property>
<!-- 商用车车型库版本信息 -->
<property name="comversion" value="#{secondHandCarProperties['com.tenwa.zhanglei.commercial.version']}"></property>
</bean>
<util:properties id="jdbcProperties" location="classpath:quartz.properties" />
<bean id="dataSourceJDBC" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="#{jdbcProperties['org.quartz.dataSource.zhulhDS.driver']}" />
<property name="jdbcUrl" value="#{jdbcProperties['org.quartz.dataSource.zhulhDS.URL']}" />
<!--连接池中保留的最小连接数。 -->
<property name="minPoolSize">
<value>#{jdbcProperties['c3p0.minPoolSize']}</value>
</property>
<!--连接池中保留的最大连接数。Default: 15 -->
<property name="maxPoolSize">
<value>#{jdbcProperties['c3p0.maxPoolSize']}</value>
</property>
<!--初始化时获取的连接数取值应在minPoolSize与maxPoolSize之间。Default: 3 -->
<property name="initialPoolSize">
<value>#{jdbcProperties['c3p0.initialPoolSize']}</value>
</property>
<!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
<property name="maxIdleTime">
<value>#{jdbcProperties['c3p0.maxIdleTime']}</value>
</property>
<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
<property name="acquireIncrement">
<value>#{jdbcProperties['c3p0.acquireIncrement']}</value>
</property>
<!--JDBC的标准参数用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements
属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。
如果maxStatements与maxStatementsPerConnection均为0则缓存被关闭。Default: 0 -->
<property name="maxStatements">
<value>#{jdbcProperties['c3p0.maxStatements']}</value>
</property>
<!--每60秒检查所有连接池中的空闲连接。Default: 0 -->
<property name="idleConnectionTestPeriod">
<value>#{jdbcProperties['c3p0.idleConnectionTestPeriod']}</value>
</property>
<!--当连接池用完时客户端调用getConnection()后等待获取新连接的时间,超时后将抛出
SQLException,如设为0则无限期等待。单位毫秒。Default: 0 -->
<property name="checkoutTimeout">
<value>#{jdbcProperties['c3p0.checkoutTimeout']}</value>
</property>
<!--定义在从数据库获取新连接失败后重复尝试的次数。Default: 30 -->
<property name="acquireRetryAttempts">
<value>#{jdbcProperties['c3p0.acquireRetryAttempts']}</value>
</property>
<!--两次连接中间隔时间单位毫秒。Default: 1000 -->
<property name="acquireRetryDelay">
<value>#{jdbcProperties['c3p0.acquireRetryDelay']}</value>
</property>
<!--获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常。但是数据源仍有效
保留并在下次调用getConnection()的时候继续尝试获取连接。如果设为true那么在尝试
获取连接失败后该数据源将申明已断开并永久关闭。Default: false -->
<property name="breakAfterAcquireFailure">
<value>#{jdbcProperties['c3p0.breakAfterAcquireFailure']}</value>
</property>
<!--因性能消耗大请只在需要的时候使用它。如果设为true那么在每个connection提交的
时候都将校验其有效性。建议使用idleConnectionTestPeriod或automaticTestTable
等方法来提升连接测试的性能。Default: false -->
<property name="testConnectionOnCheckout">
<value>#{jdbcProperties['c3p0.testConnectionOnCheckout']}</value>
</property>
<!--如果设为true那么在取得连接的同时将校验连接的有效性。Default: false -->
<property name="testConnectionOnCheckin">
<value>#{jdbcProperties['c3p0.testConnectionOnCheckin']}</value>
</property>
<!--定义所有连接测试都执行的测试语句。在使用连接测试的情况下这个一显著提高测试速度。注意:
测试的表必须在初始数据源的时候就存在。Default: null -->
<property name="preferredTestQuery">
<value>#{jdbcProperties['c3p0.preferredTestQuery']}</value>
</property>
<property name="properties" ref="dataSourceProperties"/>
</bean>
<bean id="dataSourceProperties" class="com.tenwa.quartz.PropertiesEncryptFactoryBean">
<property name="properties">
<props>
<prop key="user">#{jdbcProperties['org.quartz.dataSource.zhulhDS.user']}</prop>
<prop key="key">#{jdbcProperties['org.quartz.dataSource.zhulhDS.key']}</prop>
</props>
</property>
</bean>
<!-- JdbcTemplate配置 -->
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSourceJDBC"></property>
</bean>
<!--配置事务管理器 -->
<!-- spring transaction 事务管理 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" scope="singleton">
<property name="dataSource" ref="dataSourceJDBC" />
<property name="globalRollbackOnParticipationFailure" value="false" />
</bean>
<!-- the transactional advice (what 'happens'; see the <aop:advisor/> bean below) -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="create*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="save*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="add*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="insert*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="modify*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="remove*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="delete*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="update*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="reset*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="upload*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="download*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="delegate*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="transfer*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="run*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="deploy*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="start*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="submit*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="back*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="import*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="export*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="do*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="apply*" isolation="DEFAULT" propagation="REQUIRED" rollback-for="java.lang.Exception" />
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:advisor pointcut="execution(* com.amarsoft..*.serviceImpl..*.*(..))" advice-ref="txAdvice" />
</aop:config>
<!-- enable autowire -->
<context:annotation-config />
</beans>