job.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. <!-- 这种配置可以精确几点执行定时任务 -->
  34. <bean id="cronQuartzClock" class="org.springframework.scheduling.quartz.CronTriggerBean">
  35. <property name="jobDetail" ref="quartzClock" />
  36. <property name="cronExpression">
  37. <value>0 20 0 ? * *</value>
  38. </property>
  39. </bean>
  40. <!-- 这种配置可以精确几点执行定时任务 -->
  41. <bean id="qtjobcronQuartzClock" class="org.springframework.scheduling.quartz.CronTriggerBean">
  42. <property name="jobDetail" ref="qtjob" />
  43. <property name="cronExpression">
  44. <value>0 0 2 * * ?</value>
  45. </property>
  46. </bean>
  47. <bean id="statusLossPowerTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
  48. <property name="jobDetail" ref="statusLossPowerJobBean" />
  49. <property name="cronExpression">
  50. <value>0/2 * * * * ?</value>
  51. </property>
  52. </bean>
  53. <!--定时写入风机限电 -->
  54. <bean id="restrictwt" class="org.springframework.scheduling.quartz.CronTriggerBean">
  55. <property name="jobDetail" ref="reswtjob" />
  56. <property name="cronExpression">
  57. <value>0/60 * * ? * *</value>
  58. </property>
  59. </bean>
  60. <bean id="reswtjob" class="org.springframework.scheduling.quartz.JobDetailBean">
  61. <property name="jobClass">
  62. <value>com.hcks.cmfds.timer.Sendrestrictpowerjob</value>
  63. </property>
  64. <property name="jobDataAsMap">
  65. <map>
  66. <entry key="sendrestrictpowerService" value-ref="sendrestrictpowerService" />
  67. </map>
  68. </property>
  69. </bean>
  70. <!-- 受累零点转存调度器 -->
  71. <bean id="reportInvolvementJobDeatil" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  72. <property name="targetObject" ref="reportInvolvementJob"></property>
  73. <property name="targetMethod" value="run"></property>
  74. <property name="concurrent" value="false"></property>
  75. </bean>
  76. <bean id="reportInvolvementJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
  77. <property name="jobDetail" ref="reportInvolvementJobDeatil" />
  78. <property name="cronExpression">
  79. <value>0 1 0 * * ?</value>
  80. </property>
  81. </bean>
  82. <bean id="led" class="org.springframework.scheduling.quartz.JobDetailBean">
  83. <property name="jobClass">
  84. <value>com.hcks.cmfds.timer.ledJob</value>
  85. </property>
  86. <property name="jobDataAsMap">
  87. <map>
  88. <entry key="ledshowService" value-ref="ledshowService" />
  89. </map>
  90. </property>
  91. </bean>
  92. <bean id="ledQuartzClock" class="org.springframework.scheduling.quartz.CronTriggerBean">
  93. <property name="jobDetail" ref="led" />
  94. <property name="cronExpression">
  95. <value>0/5 * * * * ?</value>
  96. <!-- 自己设置多少时间执行一次 -->
  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. <ref bean="restrictwt" />
  106. 风机离线记录补录损失电量
  107. <ref bean="statusLossPowerTrigger" />
  108. 受累零点转存调度器
  109. <ref bean="reportInvolvementJobTrigger"/>
  110. LED数据写入
  111. <ref bean="ledQuartzClock"/> -->
  112. </list>
  113. </property>
  114. </bean>
  115. </beans>