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