Commit 56827966b323ef598d637906472895dc6f044572
1 parent
e3e1c10e83
Exists in
master
and in
8 other branches
commit
Showing 3 changed files with 26 additions and 9 deletions
platform-job-index/src/main/java/com/lyms/platform/job/index/web/controller/SyncDataController.java
View file @
5682796
| 1 | 1 | package com.lyms.platform.job.index.web.controller; | 
| 2 | 2 | |
| 3 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
| 4 | +import com.lyms.platform.job.index.restore.data.SyncDataWork; | |
| 3 | 5 | import com.lyms.platform.job.index.service.SyncDataService; | 
| 4 | 6 | import org.springframework.beans.factory.annotation.Autowired; | 
| 5 | 7 | import org.springframework.beans.factory.annotation.Qualifier; | 
| ... | ... | @@ -11,7 +13,6 @@ | 
| 11 | 13 | |
| 12 | 14 | |
| 13 | 15 | /** | 
| 14 | - * | |
| 15 | 16 | * 同步2.1系统到3.0数据 | 
| 16 | 17 | * Created by lqy on | 
| 17 | 18 | */ | 
| 18 | 19 | |
| 19 | 20 | |
| 20 | 21 | |
| 21 | 22 | |
| 22 | 23 | |
| ... | ... | @@ -22,24 +23,39 @@ | 
| 22 | 23 | @Qualifier("job-index-syncdataservice") | 
| 23 | 24 | private SyncDataService syncDataService; | 
| 24 | 25 | |
| 26 | + @Autowired | |
| 27 | + private SyncDataWork syncDataWork; | |
| 28 | + | |
| 25 | 29 | /** | 
| 26 | 30 | * 孕妇同步 | 
| 31 | + * | |
| 27 | 32 | * @param oracleHid oracle 对应的医院id | 
| 28 | - * @param mysqlHid mysql 对应的医院id | |
| 33 | + * @param mysqlHid mysql 对应的医院id | |
| 29 | 34 | * @return | 
| 30 | 35 | */ | 
| 31 | 36 | @RequestMapping(value = "/syncPatientData", method = RequestMethod.GET) | 
| 32 | 37 | @ResponseBody | 
| 33 | - public String syncPatientData(@RequestParam(required = true) String oracleHid,@RequestParam(required = true) Integer mysqlHid) { | |
| 34 | - syncDataService.syncPatientData(oracleHid,mysqlHid); | |
| 38 | + public String syncPatientData(@RequestParam(required = true) String oracleHid, @RequestParam(required = true) Integer mysqlHid) { | |
| 39 | + syncDataService.syncPatientData(oracleHid, mysqlHid); | |
| 35 | 40 | return "patient starting..........."; | 
| 36 | 41 | } | 
| 37 | 42 | |
| 38 | 43 | |
| 39 | 44 | @RequestMapping(value = "/syncBabyData", method = RequestMethod.GET) | 
| 40 | 45 | @ResponseBody | 
| 41 | - public String syncBabyData(@RequestParam(required = true) String oracleHid,@RequestParam(required = true) Integer mysqlHid) { | |
| 46 | + public String syncBabyData(@RequestParam(required = true) String oracleHid, @RequestParam(required = true) Integer mysqlHid) { | |
| 42 | 47 | syncDataService.syncBabyData(oracleHid, mysqlHid); | 
| 48 | + return "baby starting..........."; | |
| 49 | + } | |
| 50 | + | |
| 51 | + @RequestMapping(value = "/sync", method = RequestMethod.GET) | |
| 52 | + @ResponseBody | |
| 53 | + public String syncDataToMami() { | |
| 54 | + try { | |
| 55 | + syncDataWork.sync(); | |
| 56 | + } catch (Exception e) { | |
| 57 | + ExceptionUtils.catchException(e, "syncDataToMami error"); | |
| 58 | + } | |
| 43 | 59 | return "baby starting..........."; | 
| 44 | 60 | } | 
| 45 | 61 | } | 
platform-job-index/src/main/resources/spring/applicationContext-sync-data.xml
View file @
5682796
| ... | ... | @@ -8,7 +8,7 @@ | 
| 8 | 8 | |
| 9 | 9 | <!-- 采用注释的方式配置bean --> | 
| 10 | 10 | <context:annotation-config /> | 
| 11 | - | |
| 11 | + <!-- | |
| 12 | 12 | <bean id="configProperties" | 
| 13 | 13 | class="org.springframework.beans.factory.config.PropertiesFactoryBean"> | 
| 14 | 14 | <property name="locations"> | 
| ... | ... | @@ -22,7 +22,7 @@ | 
| 22 | 22 | class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> | 
| 23 | 23 | <property name="properties" ref="configProperties" /> | 
| 24 | 24 | </bean> | 
| 25 | - | |
| 25 | +--> | |
| 26 | 26 | <!-- DataSource configuration 项目主数据库 --> | 
| 27 | 27 | <bean id="mainDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> | 
| 28 | 28 | <property name="driverClass" value="${maindata.driver}" /> | 
| ... | ... | @@ -98,6 +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 | + <!--<import resource="applicationContext-quartz.xml"/>--> | |
| 102 | 102 | </beans> | 
platform-job-index/src/main/resources/spring/applicationContext.xml
View file @
5682796