job.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
  3. <beans>
  4. <!-- 定时任务(生成统计分析数据) -->
  5. <bean id="quartzClock" class="org.springframework.scheduling.quartz.JobDetailBean">
  6. <property name="jobClass">
  7. <value>com.hcks.cmfds.timer.GenerateAnalysisJob</value>
  8. </property>
  9. <property name="jobDataAsMap">
  10. <map>
  11. <entry key="windTurbineAnalysisService" value-ref="windTurbineAnalysisService" />
  12. <entry key="analysisService" value-ref="analysisService" />
  13. <entry key="analysisBranchCompanyService" value-ref="analysisBranchCompanyService" />
  14. </map>
  15. </property>
  16. </bean>
  17. <bean id="qtjob" class="org.springframework.scheduling.quartz.JobDetailBean">
  18. <property name="jobClass">
  19. <value>com.hcks.cmfds.timer.SSAnticipationJob</value>
  20. </property>
  21. <property name="jobDataAsMap">
  22. <map>
  23. <entry key="fjqtService" value-ref="fjqtService" />
  24. </map>
  25. </property>
  26. </bean>
  27. <!-- 风机离线记录补录损失电量 -->
  28. <bean id="statusLossPowerJobBean" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  29. <property name="targetObject" ref="statusLossPowerJob"></property>
  30. <property name="targetMethod" value="run"></property>
  31. <property name="concurrent" value="false"></property>
  32. </bean>
  33. <bean id="mailJob" class="org.springframework.scheduling.quartz.JobDetailBean">
  34. <property name="jobClass">
  35. <value>com.hcks.cmfds.timer.mailWarningJob</value>
  36. </property>
  37. <property name="jobDataAsMap">
  38. <map>
  39. <entry key="fjqtService" value-ref="fjqtService" />
  40. </map>
  41. </property>
  42. </bean>
  43. <!-- 这种配置可以精确几点执行定时任务 -->
  44. <bean id="cronQuartzClock" class="org.springframework.scheduling.quartz.CronTriggerBean">
  45. <property name="jobDetail" ref="quartzClock" />
  46. <property name="cronExpression">
  47. <value>0 20 0 ? * *</value>
  48. </property>
  49. </bean>
  50. <!-- 这种配置可以精确几点执行定时任务 -->
  51. <bean id="qtjobcronQuartzClock" class="org.springframework.scheduling.quartz.CronTriggerBean">
  52. <property name="jobDetail" ref="qtjob" />
  53. <property name="cronExpression">
  54. <value>0 0 2 * * ?</value>
  55. </property>
  56. </bean>
  57. <bean id="mailcronQuartzClock" class="org.springframework.scheduling.quartz.CronTriggerBean">
  58. <property name="jobDetail" ref="mailJob" />
  59. <property name="cronExpression">
  60. <value>0 0/20 * * * ?</value>
  61. <!-- <value>0/30 * * * * ?</value> -->
  62. </property>
  63. </bean>
  64. <bean id="statusLossPowerTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
  65. <property name="jobDetail" ref="statusLossPowerJobBean" />
  66. <property name="cronExpression">
  67. <value>0/2 * * * * ?</value>
  68. </property>
  69. </bean>
  70. <!--定时写入风机限电 -->
  71. <bean id="restrictwt" class="org.springframework.scheduling.quartz.CronTriggerBean">
  72. <property name="jobDetail" ref="reswtjob" />
  73. <property name="cronExpression">
  74. <value>0/60 * * ? * *</value>
  75. </property>
  76. </bean>
  77. <bean id="reswtjob" class="org.springframework.scheduling.quartz.JobDetailBean">
  78. <property name="jobClass">
  79. <value>com.hcks.cmfds.timer.Sendrestrictpowerjob</value>
  80. </property>
  81. <property name="jobDataAsMap">
  82. <map>
  83. <entry key="sendrestrictpowerService" value-ref="sendrestrictpowerService" />
  84. </map>
  85. </property>
  86. </bean>
  87. <!-- 受累零点转存调度器 -->
  88. <bean id="reportInvolvementJobDeatil" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  89. <property name="targetObject" ref="reportInvolvementJob"></property>
  90. <property name="targetMethod" value="run"></property>
  91. <property name="concurrent" value="false"></property>
  92. </bean>
  93. <bean id="reportInvolvementJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
  94. <property name="jobDetail" ref="reportInvolvementJobDeatil" />
  95. <property name="cronExpression">
  96. <value>0 1 0 * * ?</value>
  97. </property>
  98. </bean>
  99. <!--启动定时任务 -->
  100. <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
  101. <property name="triggers">
  102. <list>
  103. <ref bean="cronQuartzClock" />
  104. <!-- <ref bean="qtjobcronQuartzClock" /> -->
  105. <!-- edos缓存数据异常判断 -->
  106. <ref bean="mailcronQuartzClock" />
  107. <!-- <ref bean="restrictwt" />
  108. 风机离线记录补录损失电量
  109. <ref bean="statusLossPowerTrigger" />
  110. 受累零点转存调度器
  111. <ref bean="reportInvolvementJobTrigger"/>-->
  112. </list>
  113. </property>
  114. </bean>
  115. </beans>