<! -- Define the method of the call object and the call object --> <! -- Scheduled task A start --> <bean id = "jobtask" class = "org. springframework. scheduling. quartz. MethodInvokingJobDetailFactoryBean"> <! -- Called class --> <property name = "targetObject"> <ref bean = "quartzJobAction"/> </property> <! -- Call methods in the class --> <property name = "targetMethod"> <value> updateData </value> </property> </bean> <! -- Define the trigger time --> <bean id = "doTime" class = "org. springframework. scheduling. quartz. cronTriggerBean "> <property name =" jobDetail "> <ref bean =" jobtask "/> </property> <! -- Cron expression --> <property name = "cronExpression"> <value> 0 0 2 **? </Value> </property> </bean> <! -- Scheduled task A end --> <! -- Scheduled task B start unpaid orders automatically closed for three days --> <bean id = "orderJob" class = "org. springframework. scheduling. quartz. methodInvokingJobDetailFactoryBean "> <property name =" targetObject "> <ref bean =" payService "/> </property> <property name =" targetMethod "> <value> updateOrderStatus </value> </property> </bean> <bean id = "triggerTime" class = "org. springframework. scheduling. quartz. cronTriggerBean "> <property name =" jobDetail "> <ref bean = "OrderJob"/> </property> <property name = "cronExpression"> <! -- Execute once every morning at (test execution once every minute 0 */1 ***?) --> <Value> 0 0 1 **? </Value> </property> </bean> <! -- Scheduled task B end --> <! -- If the general management class uses lazy-init = 'false', the container will execute the scheduler when it is started --> <bean id = "startQuertz" lazy-init = "false" autowire = "no "class =" org. springframework. scheduling. quartz. schedulerFactoryBean "> <property name =" triggers "> <list> <ref bean =" doTime "/> <ref bean =" triggerTime "/> </list> </property> </bean>