Commit f9774e60e789df9aece8126e3af9b7f1da1b6c9e

Authored by jiangjiazhi
1 parent b870ff81cc

commit

Showing 4 changed files with 38 additions and 1 deletions

platform-job-index/src/main/resources/conf.properties View file @ f9774e6
... ... @@ -49,5 +49,5 @@
49 49 report.db.username=LYMS_ODS
50 50 report.db.password=Welcome1
51 51  
52   -file.path=c://
  52 +file.path=c://lastsynctime.txt
platform-job-index/src/main/resources/spring/applicationContext-quartz.xml View file @ f9774e6
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<beans xmlns="http://www.springframework.org/schema/beans"
  3 + xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
  4 + xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5 + xmlns:cache="http://www.springframework.org/schema/cache" xmlns:task="http://www.springframework.org/schema/task"
  6 + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7 + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
  8 + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
  9 + http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd
  10 + http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
  11 +
  12 + <bean id="syncDataWork" class="com.lyms.platform.job.index.restore.data.SyncDataWork"></bean>
  13 + <!-- 配置任务的具体类和方法 -->
  14 + <bean id="startWorkTask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
  15 + <!-- 要调用的bean -->
  16 + <property name="targetObject" ref="syncDataWork"></property>
  17 + <!-- 要调用的Method -->
  18 + <property name="targetMethod" value="sync"></property>
  19 + <!-- 是否并发,false表示 如果发生错误也不影响下一次的调用 -->
  20 + <property name="concurrent" value="false"></property>
  21 + </bean>
  22 + <!-- 配置一个触发器 -->
  23 + <bean id="startWorkTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
  24 + <property name="jobDetail" ref="startWorkTask"></property>
  25 + <property name="cronExpression" value="0 0 1 * * ?"></property>
  26 + </bean>
  27 +
  28 + <!-- 总调度,用于启动定时器 -->
  29 + <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
  30 + <property name="triggers" >
  31 + <list>
  32 + <ref bean="startWorkTrigger"/>
  33 + </list>
  34 + </property>
  35 + </bean>
  36 +</beans>
platform-job-index/src/main/resources/spring/applicationContext-sync-data.xml View file @ f9774e6
... ... @@ -98,5 +98,6 @@
98 98 <context:component-scan base-package="com.lyms.platform.biz.service"/>
99 99  
100 100 <import resource="spring-mongodb.xml"/>
  101 + <import resource="applicationContext-quartz.xml"/>
101 102 </beans>
platform-job-index/src/main/webapp/WEB-INF/lib/main-data-1.0-SNAPSHOT.jar View file @ f9774e6

No preview for this file type