<?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:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:p="http://www.springframework.org/schema/p" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"> <bean id="uploadFileStatServiceImpl" class="com.szibr.workbench.task.biz.service.impl.UploadFileStatServiceImpl"> <property name="logDao"> <ref bean="logDao" /> </property> <property name="fileDao"> <ref bean="fileDao" /> </property> </bean> <bean id="jobDetailNews" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="uploadFileStatServiceImpl" /> <!-- 实现类 --> <property name="targetMethod" value="queryFileByDate" /> <!-- 执行方法 --> </bean> <bean id="cronTriggerNews" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetailNews" /> <property name="cronExpression" value="0 0 2 ? * SUN " /> <!-- 每个星期日,冷晨2点执行 --> </bean> <bean id="jobDetailEmail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="systemTaskService" /> <!-- 实现类 --> <property name="targetMethod" value="updateSendEmail" /> <!-- 执行方法 --> <property name="concurrent" value="false"/><!-- 是否允许任务并发执行。当值为false时,表示必须等到前一个线程处理完毕后才再启一个新的线程 --> </bean> <bean id="cronTriggerEmail" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetailEmail" /> <property name="cronExpression" value="0 0/5 * * * ? " /> <!-- 每5分钟执行一次 --> </bean> <!-- <bean id="jobDetailProjectWorkTime" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="systemTaskService" /> <property name="targetMethod" value="saveProjectWorkTimeEmail" /> <property name="concurrent" value="false"/> </bean> <bean id="cronTriggerProjectWorkTime" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetailProjectWorkTime" /> <property name="cronExpression" value="0 30 17 ? * MON-FRI " /> </bean> --> <!-- end 生成项目填报邮件内容 --> <!-- 生成工作任务邮件内容 --> <bean id="jobDetailWorktask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="systemTaskService" /> <!-- 实现类 --> <property name="targetMethod" value="saveWorkTaskEmail" /> <!-- 执行方法 --> <property name="concurrent" value="false"/><!-- 是否允许任务并发执行。当值为false时,表示必须等到前一个线程处理完毕后才再启一个新的线程 --> </bean> <bean id="cronTriggerWorktask" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetailWorktask" /> <property name="cronExpression" value="0 0/20 * ? * MON-FRI " /> <!-- 只有周一到周五执行 ,每个20分钟执行一次 --> </bean> <!-- end 生成工作任务邮件内容 --> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="jobDetails"> <list> <ref bean="jobDetailNews" /> <ref bean="jobDetailEmail" /> <!-- <ref bean="jobDetailProjectWorkTime" /> --> <!-- 项目填报,暂不发邮件 ,2013.06.28,李汉瑞 --> <ref bean="jobDetailWorktask" /> </list> </property> <property name="triggers"> <list> <ref bean="cronTriggerNews" /> <ref bean="cronTriggerEmail" /> <!-- <ref bean="cronTriggerProjectWorkTime" /> --> <!-- 项目填报,暂不发邮件 ,2013.06.28,李汉瑞--> <ref bean="cronTriggerWorktask" /> </list> </property> </bean> </beans>