applicationContext-quartz.xml 6.0 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:util="http://www.springframework.org/schema/util" 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"
       xsi:schemaLocation="
			http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd  
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- <description>定时任务调度配置</description> -->

    <bean id="jobInvokeBean" class="com.sibu.orderHelper.integralWeb.quart.ScheduleTask"></bean>

    <bean id="generateRoomStock"
          class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="jobInvokeBean"/>
        <property name="targetMethod" value="generateRoomStock"/>
        <property name="concurrent" value="false"/>
    </bean>


    <bean id="generateRoomStockCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="jobDetail" ref="generateRoomStock"/>
        <property name="cronExpression" value="0 0/30 9-10 * * ?"/>
    </bean>

    <!-- 定时发送入住前通知短信 -->
    <bean id="sendCheckinNoticeMessage"
          class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="jobInvokeBean"/>
        <property name="targetMethod" value="sendCheckinHotelNoticeMessage"/>
        <property name="concurrent" value="false"/>
    </bean>

    <bean id="sendCheckinNoticeMessageCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="jobDetail" ref="sendCheckinNoticeMessage"/>
        <property name="cronExpression" value="0 0 8 * * ?"/>
    </bean>

    <!-- 退款订单(仅退款,退全款),不同意退款状态超过3天时间, 自动关闭退单,并恢复订单原来流程状态 -->
    <bean id="autoCloseRefundMoneyOrderTypeAndDisagreeRefundMoneyStatusOrderTaskCronTrigger"
          class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="jobDetail">
            <bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
                <property name="targetObject" ref="autoCloseRefundMoneyOrderTypeAndDisagreeRefundMoneyStatusOrderTaskImpl"/>
                <property name="targetMethod" value="execute"/>
                <property name="concurrent" value="false"/>
            </bean>
        </property>
        <property name="cronExpression" value="0 0/15 * * * ? *"/>
    </bean>
    <!-- 退款退货订单,不同意退款状态,超过7天时间,自动关闭退单,并恢复订单原来流程状态 -->
    <bean id="autoCloseRefundMoneyAndGoodsOrderTypeAndDisagreeRefundMoneyStatusOrderTaskCronTrigger"
          class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="jobDetail">
            <bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
                <property name="targetObject" ref="autoCloseRefundMoneyAndGoodsOrderTypeAndDisagreeRefundMoneyStatusOrderTaskImpl"/>
                <property name="targetMethod" value="execute"/>
                <property name="concurrent" value="false"/>
            </bean>
        </property>
        <property name="cronExpression" value="0 0/15 * * * ? *"/>
    </bean>
    <!-- 退款退货订单,不同意退货状态,超过7天时间,自动关闭退单,并恢复订单原来流程状态 -->
    <bean id="autoCloseRefundMoneyAndGoodsOrderTypeAndDisagreeRefundGoodsStatusOrderTaskCronTrigger"
          class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="jobDetail">
            <bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
                <property name="targetObject" ref="autoCloseRefundMoneyAndGoodsOrderTypeAndDisagreeRefundGoodsStatusOrderTaskImpl"/>
                <property name="targetMethod" value="execute"/>
                <property name="concurrent" value="false"/>
            </bean>
        </property>
        <property name="cronExpression" value="0 0/15 * * * ? *"/>
    </bean>

    <!-- 定时更新订单结算时间 -->
    <bean id="settlementAmount"
          class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject" ref="jobInvokeBean"/>
        <property name="targetMethod" value="settlementAmount" />
        <property name="concurrent" value="false" />
    </bean>


    <bean id="settlementAmountCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="jobDetail" ref="settlementAmount" />
        <property name="cronExpression" value="0 0 0 20 * ?" />
    </bean>

    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="triggers">
            <list>
                <ref bean="generateRoomStockCronTrigger"/>
                <ref bean="sendCheckinNoticeMessageCronTrigger"/>
                <ref bean="settlementAmountCronTrigger" />
                <!--<ref bean="autoCloseRefundMoneyOrderTypeAndDisagreeRefundMoneyStatusOrderTaskCronTrigger"/>-->
                <!--<ref bean="autoCloseRefundMoneyAndGoodsOrderTypeAndDisagreeRefundMoneyStatusOrderTaskCronTrigger"/>-->
                <!--<ref bean="autoCloseRefundMoneyAndGoodsOrderTypeAndDisagreeRefundGoodsStatusOrderTaskCronTrigger"/>-->

            </list>
        </property>
    </bean>
</beans>