Administrator
2023-02-17 c23e613d2db47e0057873cd07050396ea998fd7b
提交 | 用户 | 时间
58d006 1 <?xml version="1.0" encoding="UTF-8"?>
A 2 <beans xmlns="http://www.springframework.org/schema/beans"
3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
4     xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
5        xmlns:mvc="http://www.springframework.org/schema/mvc"
6     xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jms="http://www.springframework.org/schema/jms"
7     xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
8     xmlns:jaxws="http://cxf.apache.org/jaxws"
9     xmlns:jaxrs="http://cxf.apache.org/jaxrs"
10     xsi:schemaLocation="http://www.springframework.org/schema/beans
11     http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
12     http://www.springframework.org/schema/util
13     http://www.springframework.org/schema/util/spring-util-4.1.xsd
14     http://www.springframework.org/schema/context
15     http://www.springframework.org/schema/context/spring-context-4.1.xsd
16     http://www.springframework.org/schema/aop
17     http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
18     http://www.springframework.org/schema/tx
19     http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
20     http://cxf.apache.org/jaxws
21     http://cxf.apache.org/schemas/jaxws.xsd
22     http://cxf.apache.org/jaxrs
23     http://cxf.apache.org/schemas/jaxrs.xsd">
24
25     <bean id="hikari" class="com.zaxxer.hikari.HikariDataSource">
26         <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" />
27         <property name="jdbcUrl" value="jdbc:jtds:sqlserver://10.1.1.9:1433;databaseName=goblin_test" />
28         <property name="username" value="sa" />
29         <property name="password" value="mingtai@80565" />
30         <!--<property name="jdbcUrl"
31             value="jdbc:jtds:sqlserver://127.0.0.1:1433;databaseName=goblin" />
32             <property name="username" value="sa" />
33         <property name="password" value="123" />-->
34         <!--<property name="jdbcUrl"
35             value="jdbc:jtds:sqlserver://127.0.0.1:1433;databaseName=goblin" />
36         <property name="username" value="sa" />
37         <property name="password" value="G1veMeP@ss" />-->
38         <property name="readOnly" value="false" />
39         <property name="connectionTimeout" value="30000" />
40         <property name="idleTimeout" value="600000" />
41         <property name="validationTimeout" value="3000" />
42         <property name="connectionTestQuery" value="select 1"></property>
43         <property name="minimumIdle" value="30" />
44         <property name="maxLifetime" value="1800000" />
45         <property name="maximumPoolSize" value="150" />
46     </bean>
47
48     <!-- mybatis相关配置 -->
49     <bean id="sqlsessionfactory" class="org.mybatis.spring.SqlSessionFactoryBean">
50         <property name="dataSource" ref="hikari"></property>
51         <property name="mapperLocations" value="classpath*:com/mandi/**/mapper/xmls/*.xml" />
52         <property name="configLocation" value="classpath:mybatis.xml"></property>
53     </bean>
54
55     <bean id="mapperscanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
56         <property name="basePackage" value="com.mandi.**.mapper"></property>
57         <property name="sqlSessionFactoryBeanName" value="sqlsessionfactory" />
58     </bean>
59
60
61     <bean id="mybatistxm"
62         class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
63         <property name="dataSource" ref="hikari"></property>
64     </bean>
65     <tx:annotation-driven transaction-manager="mybatistxm"
66         proxy-target-class="true"></tx:annotation-driven>
67
68
69     <bean id="sqlsessiontemplate" class="org.mybatis.spring.SqlSessionTemplate">
70         <constructor-arg index="0" ref="sqlsessionfactory" />
71     </bean>
72     <!-- -->
73     <bean id="dtf" class="java.text.SimpleDateFormat">
74         <constructor-arg value="yyyy-MM-dd HH:mm:ss" />
75     </bean>
76     <bean id="df" class="java.text.SimpleDateFormat">
77         <constructor-arg value="yyyy-MM-dd" />
78     </bean>
79     <bean id="tf" class="java.text.SimpleDateFormat">
80         <constructor-arg value="HH:mm:ss" />
81     </bean>
82     <bean id="ydf" class="java.text.SimpleDateFormat">
83         <constructor-arg value="yyyyMMdd" />
84     </bean>
85     <bean id="jdao" class="org.springframework.jdbc.core.JdbcTemplate">
86         <property name="dataSource">
87             <ref bean="hikari" />
88         </property>
89     </bean>
90
91     <!-- spring w文件上传 -->
92     <bean id="multipartResolver"
93         class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
94         <property name="defaultEncoding" value="utf-8"></property>
95         <property name="maxUploadSize" value="10485760000"></property>
96         <property name="maxInMemorySize" value="40960"></property>
97     </bean>
98
99     <!-- spring 多语言local配置 -->
100     <bean id="localeResolver"
101         class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
102         <property name="cookieMaxAge" value="604800" />
103         <property name="defaultLocale" value="zh_CN" />
104         <property name="cookieName" value="Language"></property>
105     </bean>
106
107
108     <!-- auto scan -->
109     <context:annotation-config />
110     <context:component-scan base-package="com.mandi">
111         <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
112     </context:component-scan>
113
114
115     <!--NC发货单推送分单系统-->
116     <bean id="invoiceInterface" class="com.mandi.webservice.service.impl.InvoiceService"></bean>
117      <jaxrs:server id="invoiceservice" address="/invoice">
118         <jaxrs:serviceBeans>
119             <ref bean="invoiceInterface"/>
120         </jaxrs:serviceBeans>
121     </jaxrs:server>
122
123 </beans>