spring-web-context.xml 17 KB
<?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:util="http://www.springframework.org/schema/util"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/context/spring-context-3.1.xsd
                        http://www.springframework.org/schema/util
                        http://www.springframework.org/schema/util/spring-util.xsd
                        http://www.springframework.org/schema/aop
                        http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
                        http://www.springframework.org/schema/mvc
                        http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">

    <aop:aspectj-autoproxy proxy-target-class="true"/>
    <context:property-placeholder ignore-resource-not-found="true" location="classpath*:config.properties"/>

    <!-- Spring扫描目录,通过注解的方式注入bean,只扫描本工程的目录 -->
    <context:component-scan base-package="com.yohobuy"/>
    <bean id="serviceGlobalExceptionHandler" class="com.yoho.error.exception.handler.ServiceGlobalExceptionHandler"/>

    <!-- 启动SpringMVC的注解功能,完成请求和注解POJO的映射 -->
    <mvc:annotation-driven>
        <mvc:message-converters>
            <ref bean="stringConverter"/>
            <ref bean="jsonConverter"/>
        </mvc:message-converters>
    </mvc:annotation-driven>

    <!--字符串转换器-->
    <bean id="stringConverter"
          class="org.springframework.http.converter.StringHttpMessageConverter">
        <property name="supportedMediaTypes">
            <list>
                <value>text/plain;charset=UTF-8</value>
            </list>
        </property>
    </bean>

    <!-- json转换器  application/json -->
    <bean id="jsonConverter"
          class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
        <property name="features">
            <array>
                <value>DisableCircularReferenceDetect</value>
            </array>
        </property>
    </bean>

    <!-- 配置MultipartResolver 用于文件上传 使用spring的CommosMultipartResolver -->
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="defaultEncoding" value="UTF-8"></property>
        <property name="maxUploadSize" value="${file.maxsize}"></property>
        <!-- <property name="uploadTempDir" value="${file.uploadTempDir}"></property>-->
        <property name="resolveLazily" value="true"></property>
    </bean>

    <!-- 批量操作服务定义 -->
     <util:map id="batchImportBusiness" key-type="java.lang.String"
               value-type="com.yohobuy.platform.common.service.IBusinessImportService">
         <!--<entry key="price" value-ref="PriceImportServiceImpl"></entry>
         <entry key="brandCooperation" value-ref="brandCooperationImportServiceImpl"></entry>
         <entry key="productPool" value-ref="productPoolImportServiceImpl"></entry>
         <entry key="brandProperty" value-ref="BrandPropertyImportService"></entry>
         <entry key="searchSort" value-ref="SearchSortImportService"></entry>
         <entry key="baseProduct" value-ref="baseProductImportServiceImpl"></entry>
         <entry key="productImg" value-ref="batchProdImgImportServiceImpl"></entry>
         <entry key="productModelTry" value-ref="prodModelTryImportServiceImpl"></entry>
         <entry key="outletModify" value-ref="batchModifyOutletImportServiceImpl"></entry>
         <entry key="supplyModify" value-ref="batchModifySupplyImportServiceImpl"></entry>
         <entry key="drawlineUserQueue" value-ref="DrawlineUserQueueImportServiceImpl"></entry>
         <entry key="yohoCoin" value-ref="yohoCoinImportServiceImpl"></entry>
         <entry key="payDeliveryModify" value-ref="batchModifyPayDeliveryImportServiceImpl"></entry>
         <entry key="activityProduct" value-ref="activityProductService"></entry>
         <entry key="refundExchangeModify" value-ref="batchModifyRefundExchangeImportServiceImpl"></entry>
         <entry key="skuFactoryCodeModify" value-ref="updateSkuFactoryCodeServiceImpl"></entry>
         <entry key="appTypeModify" value-ref="batchModifyAppTypeImportServiceImpl"></entry>
         <entry key="productSaleModify" value-ref="batchModifyProductSaleImportServiceImpl"></entry>
         <entry key="storeProductSaleModify" value-ref="batchModifyStoreProductSaleImportServiceImpl"></entry>
         <entry key="productTagModify" value-ref="productTagImportServiceImpl"></entry>
         <entry key="productPriceAudit" value-ref="batchAuditProductPriceServiceImpl"></entry>
         <entry key="offShelveSkn" value-ref="OffShelveSknImportService"></entry>
         <entry key="studentPrice" value-ref="studentPriceImportService" />
         <entry key="limitProductUid" value-ref="limitUidImportServiceImpl"></entry>
         <entry key="onShelveSkn" value-ref="onShelveBatchSknImportService" />
         <entry key="categoryLinkProduct" value-ref="categoryLinkProductImportServiceImpl"></entry>
         <entry key="batchSknLink" value-ref="batchSknLinkImportServiceImpl"></entry>
         <entry key="secKill" value-ref="seckillImportServiceImpl"></entry>
         <entry key="shopsPromote" value-ref="shopsPromoteImportService" />
         <entry key="depositAdvance" value-ref="depositAdvanceImportServiceImpl"></entry>
         <entry key="depositAdvanceTime" value-ref="depositAdvanceTimeImportImpl"></entry>
         <entry key="productSingleDay" value-ref="productSingleDayService" />
         <entry key="makePromtion" value-ref="MakePromotionImportServiceImpl"></entry>
         <entry key="productSingleDay" value-ref="productSingleDayService" />
         <entry key="productBundle" value-ref="productBundleService" />
         <entry key="productBatch" value-ref="productBatchService" />
         <entry key="sockpupetCommentsImport" value-ref="sockpupetCommentsImportServiceImpl"/>
         <entry key="makePriceItemImport" value-ref="makePriceServiceImpl"/>
         <entry key="productBuyLimitImport" value-ref="productBuyLimitServiceImpl"/>
         <entry key="promotionPhrase" value-ref="PhraseBatchImportService"/>
         <entry key="skcFactoryCode" value-ref="updateSkcFactoryCodeServiceImpl"/>
         <entry key="sknYearAndSeason" value-ref="updateSknYearAndSeasonImpl"/>
         <entry key="skuUpmCode" value-ref="updateUpmServiceImpl"/>
         <entry key="brandSaleTime" value-ref="productBrandSaleTimeService"/>
         <entry key="brandClassic" value-ref="productBrandClassicService"/>
         <entry key="expectSaleTime" value-ref="productExpectSaleTimeService"/>
         <entry key="brandImageBatch" value-ref="batchBrandImgImportServiceImpl"/>
         <entry key="productPhrase" value-ref="productPhraseImportService"/>
         <entry key="productSknImport" value-ref="productSknImportServiceImpl"/>
         <entry key="productMaterialImport" value-ref="productMaterialServiceImpl"/>
         <entry key="recProduct" value-ref="newUserRecProductImportServiceImpl"></entry>
         <entry key="vipBatch" value-ref="vipServiceImpl"></entry>
         <entry key="couponLimitImport" value-ref="couponLimitServiceImpl"></entry>
         <entry key="activitySknImport" value-ref="activityRegistrationProductServiceImpl"></entry>
         <entry key="sellerProductImport" value-ref="sellerProductImportService"></entry>
         <entry key="unionUrlImport" value-ref="unionUrlImportServiceImpl"></entry>
         <entry key="couponProductLimit" value-ref="couponProductLimitImportService"></entry>
         <entry key="depositPrdImport" value-ref="depositPrdImportService"/>
         <entry key="shopCrossRecServiceImpl" value-ref="shopCrossRecServiceImpl"></entry>
         <entry key="advancePrdImport" value-ref="advancePrdImportService"></entry>
         <entry key="updateSknName" value-ref="updateProductNameService"></entry>
         <entry key="downSknName" value-ref="downloadProductNameService"></entry>
         <entry key="productPoolBatchDel" value-ref="ProductPoolBatchDelImportServiceImpl"></entry>
         <entry key="followPriceImport" value-ref="followPriceOperateService"></entry>
         <entry key="nationalCodeImportService" value-ref="nationalCodeImportService"></entry>
         <entry key="newNationalCodeImportService" value-ref="newNationalCodeImportService"></entry>
         <entry key="collageImport" value-ref="collageProductServiceImpl"></entry>
         <entry key="depositPrdDelImport" value-ref="depositPrdDelImportService" />
         <entry key="reportFormChannelIdService" value-ref="reportFormChannelIdServiceImpl"/>
         <entry key="distributionBatchImportService" value-ref="distributionBatchImportServiceImpl"/>
         <entry key="shopCouponLimitImport" value-ref="shopCouponLimitServiceImpl"></entry>
         <entry key="priceUpdateImport" value-ref="priceUpdateImportServiceImpl"></entry>
         <entry key="vipReturnCoinBatch" value-ref="vipReturnCoinServiceImpl"></entry>
         <entry key="changeSize" value-ref="changeSizeImportServiceImpl"></entry>-->
     </util:map>
    <!-- 批量操作服务定义 -->
    <util:map id="batchExportBusiness" key-type="java.lang.String"
              value-type="com.yohobuy.platform.common.service.IBusinessExportService">
        <!--<entry key="netSale" value-ref="NetSaleExportServiceImpl"></entry>
        <entry key="limitProductReminder" value-ref="LimitProductExportServiceImpl"></entry>
        <entry key="drawlineUserQueue" value-ref="DrawlineUserQueueExportServiceImpl"></entry>
        <entry key="yohoCoin" value-ref="yohoCoinExportService"></entry>
        <entry key="suggestExport" value-ref="suggestExportService"/>
        <entry key="linkExport" value-ref="linkExportService"/>
        <entry key="linkBatchExport" value-ref="linkBatchExportService"/>
        <entry key="brandPayDeliveryExport" value-ref="brandPayDeliveryExportServiceImpl"></entry>
        <entry key="brandPayDeliveryCheckExport" value-ref="brandPayDeliveryCheckExportServiceImpl"></entry>
        <entry key="productPayDeliveryExport" value-ref="productPayDeliveryExportServiceImpl"></entry>
        <entry key="couponLogsExport" value-ref="couponLogsExportServiceImpl"></entry>
        <entry key="useCouponLogsExport" value-ref="useCouponLogsExportServiceImpl"></entry>
        <entry key="pCouponSnsExport" value-ref="pcouponSnsExportServiceImpl"></entry>
        <entry key="baseProduce" value-ref="baseProduceExportServiceImpl"/>
        <entry key="productRefundExchangeExport" value-ref="productRefundExchangeExportServiceImpl"></entry>
        <entry key="productSortRefundExchangeExport" value-ref="productSortRefundExchangeExportServiceImpl"></entry>
        <entry key="couponSendErrorExport" value-ref="couponSendErrorExportService"/>
        <entry key="instalmentSknsExport" value-ref="instalmentSknsExportServiceImpl"/>
        <entry key="shopSaleExport" value-ref="shopSaleExportServiceImpl"/>
        <entry key="productSaleExport" value-ref="productSaleExportServiceImpl"/>
        <entry key="productSaleOnShelvesExport" value-ref="productSaleOnShelvesExportServiceImpl"/>
        <entry key="limitProductUid" value-ref="limitUidExportServiceImpl" />
        <entry key="sns" value-ref="showCommentExportService" />
        <entry key="changePriceExport" value-ref="changePriceExportServiceImpl"/>
        <entry key="productPriceExport" value-ref="productPriceExportServiceImpl"/>
        <entry key="makePromotionExportServiceImpl" value-ref="MakePromotionExportServiceImpl"/>
        <entry key="userCouponHistoryExport" value-ref="userCouponHistoryExportService"/>
        <entry key="userShareHistoryExport" value-ref="userShareHistoryExportService"/>
        <entry key="productBatchServiceExport" value-ref="productBatchServiceExportImpl"/>
        <entry key="productBundleServiceExport" value-ref="productBundleServiceExportImpl"/>
        <entry key="exportConsultServiceExport" value-ref="exportConsultServiceImpl"/>
        <entry key="productTagServiceExport" value-ref="productTagExportServiceImpl"/>
        <entry key="channelProductServiceExport" value-ref="channelProductServiceExportImpl"/>
        <entry key="promotionPhraseExport" value-ref="promotionPhraseExportImpl"/>
        <entry key="reportFormExport" value-ref="reportFormServiceImpl"/>
        <entry key="channelProductServiceExport" value-ref="channelProductServiceExportImpl"/>
        <entry key="productExportServiceImpl" value-ref="productExportService"/>
        <entry key="timeLimitDepositImportErrorMsgExport" value-ref="timeLimitDepositImportErrorMsgExportService" />
        <entry key="couponExport" value-ref="couponExportService" />
        <entry key="distributionBatchExportService" value-ref="distributionBatchExportServiceImpl"/>
        <entry key="collageActivityExport" value-ref="collageActivitiesServiceImpl" />
        <entry key="batchExportReturnCoin" value-ref="VipReturnCoinExportServiceImpl" />-->
    </util:map>
    <!-- 批量操作服务定义 -->
    <!--<util:map id="scheduledBusiness" key-type="java.lang.String"
              value-type="com.yohobuy.platform.product.service.scheduled.ScheduledService">
        <entry key="scheduledOnSaleAndNew" value-ref="scheduledOnSaleAndNew"></entry>
        <entry key="scheduledOnSaleNoNew" value-ref="scheduledOnSaleNoNew"></entry>
        <entry key="scheduledUpdatePrice" value-ref="scheduledUpdatePrice"/>
        <entry key="scheduledOutale" value-ref="scheduledOutale"/>
        &lt;!&ndash;<entry key="scheduledPushSecKillRemind" value-ref="scheduledPushSecKillRemind"/>&ndash;&gt;
        <entry key="scheduledSynChannelProduct" value-ref="scheduledSynChannelProduct"></entry>
        <entry key="scheduledChangeChannelProductPrice" value-ref="scheduledChangeChannelProductPrice"></entry>
        <entry key="scheduledUpdateMakePrice" value-ref="scheduledUpdateMakePrice"></entry>
        <entry key="scheduledSynChannelProductMany" value-ref="scheduledSynChannelProductMany"></entry>
    </util:map>-->

    <!-- 批量操作服务定义 -->
<!--    <util:map id="shopScheduledBusiness" key-type="java.lang.String"
              value-type="com.yohobuy.platform.shops.service.scheduledService.ShopScheduledService">
        <entry key="scheduledShopMessage" value-ref="scheduledShopMessage"></entry>
    </util:map>-->


   <!-- <util:map id="promotionScheduledBusiness" key-type="java.lang.String"
              value-type="com.yohobuy.promotion.service.scheduled.PromotionScheduledService">
        <entry key="scheduledExpiredLimitCode" value-ref="scheduledExpiredLimitCode"></entry>
        <entry key="scheduledExpiredSecKill" value-ref="scheduledExpiredSecKill"></entry>
    </util:map>-->

    <!--service接口调用拦截器-->
    <!--<bean id="serviceMethodInterceptor" class="com.yoho.core.common.monitor.interceptor.MethodProfileInterceptor">-->
    <!--</bean>-->
    <!--<aop:config>-->
    <!--<aop:pointcut id="serviceMethodPoint"-->
    <!--expression="(execution(* com.yohobuy.platform.*.service.*.*(..))) or (execution(* com.yohobuy.platform.*.restapi.*.*(..))) "/>-->
    <!--<aop:advisor pointcut-ref="serviceMethodPoint" advice-ref="serviceMethodInterceptor"/>-->
    <!--</aop:config>-->

    <!-- 图片批量上传异步线程池 -->
    <bean id="threadPool" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <property name="corePoolSize" value="5"/>
        <property name="maxPoolSize" value="20"/>
        <property name="queueCapacity" value="1000"/>
        <property name="keepAliveSeconds" value="300"/>
        <property name="rejectedExecutionHandler">
            <bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy"/>
        </property>
    </bean>

    <!--操作日志的拦截器-->
    <bean id="operateRecodeAnnotationInterceptor" class="com.yohobuy.platform.common.interceptor.OperateRecodeInterceptor">
        <property name="sellerControllerPath" value="com.yohobuy.platform.seller"></property>
    </bean>
    <aop:config>
        <aop:pointcut id="operateRecodeAnnotionPoint"
                      expression="within(@org.springframework.stereotype.Controller * or @org.springframework.web.bind.annotation.RestController *)"/>
        <aop:advisor pointcut-ref="operateRecodeAnnotionPoint" advice-ref="operateRecodeAnnotationInterceptor"/>
    </aop:config>



    <bean id="batchForkJoinPool" class="java.util.concurrent.ForkJoinPool" >
    </bean>

    <!--Excel模板生成器配置-->
    <util:map id="TemplateCreators" key-type="java.lang.String"
              value-type="com.yohobuy.platform.common.service.IExcelTemplatService">
        <!--商家端批量创建商品模板-->
    </util:map>
</beans>