Commit 1fd155a076737b5b63391ddf7ceed730f4ce50f9
1 parent
1f2dd213c9
Exists in
master
and in
8 other branches
code update
Showing 2 changed files with 24 additions and 16 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/JdbcUtil.java
View file @
1fd155a
... | ... | @@ -37,11 +37,8 @@ |
37 | 37 | private static List<Map<String,String>> datacontents = new ArrayList<>(); |
38 | 38 | private static List<Map<String,String>> basicConfigs = new ArrayList<>(); |
39 | 39 | |
40 | - static | |
41 | - { | |
42 | - initData(); | |
43 | - } | |
44 | 40 | |
41 | + | |
45 | 42 | public static void initData() |
46 | 43 | { |
47 | 44 | List<Map<String,Object>> listEmp = getListDataBySql("select e.e_name,e.e_id from mommy_employee e"); |
48 | 45 | |
... | ... | @@ -53,7 +50,9 @@ |
53 | 50 | employees.add(emap); |
54 | 51 | } |
55 | 52 | |
53 | + System.out.println("employees------"+employees.size()); | |
56 | 54 | |
55 | + | |
57 | 56 | List<Map<String,Object>> datacontentsList = getListDataBySql("select dc_name,dc_id from plat_datacontent "); |
58 | 57 | for(Map<String,Object> map : datacontentsList) |
59 | 58 | { |
... | ... | @@ -62,6 +61,8 @@ |
62 | 61 | data.put("name",getString(map.get("DC_NAME"))); |
63 | 62 | datacontents.add(data); |
64 | 63 | } |
64 | + | |
65 | + System.out.println("datacontents------"+datacontents.size()); | |
65 | 66 | List<Map<String,Object>> orcleHospsList = getListDataBySql("select h_name,h_id from plat_hospital h"); |
66 | 67 | for(Map<String,Object> map : orcleHospsList) |
67 | 68 | { |
... | ... | @@ -71,6 +72,7 @@ |
71 | 72 | oracleHosps.add(data); |
72 | 73 | } |
73 | 74 | |
75 | + System.out.println("oracleHosps------"+oracleHosps.size()); | |
74 | 76 | |
75 | 77 | List<Map<String,Object>> usersList = getMysqlListDataBySql("select id,name from users"); |
76 | 78 | for(Map<String,Object> map : usersList) |
77 | 79 | |
... | ... | @@ -80,8 +82,8 @@ |
80 | 82 | data.put("name",getString(map.get("NAME"))); |
81 | 83 | users.add(data); |
82 | 84 | } |
85 | + System.out.println("users------"+users.size()); | |
83 | 86 | |
84 | - | |
85 | 87 | List<Map<String,Object>> mysqlHospsList = getMysqlListDataBySql("select id,name from organization"); |
86 | 88 | for(Map<String,Object> map : mysqlHospsList) |
87 | 89 | { |
... | ... | @@ -90,7 +92,9 @@ |
90 | 92 | data.put("name",getString(map.get("NAME"))); |
91 | 93 | mysqlHosps.add(data); |
92 | 94 | } |
93 | - List<Map<String,Object>> oracleBasicList = getListDataBySql("select id,name.parentId from lyms_basicconfig "); | |
95 | + | |
96 | + System.out.println("mysqlHosps------"+mysqlHosps.size()); | |
97 | + List<Map<String,Object>> oracleBasicList = getListDataBySql("select id,name,parentId from lyms_basicconfig "); | |
94 | 98 | for(Map<String,Object> map : oracleBasicList) |
95 | 99 | { |
96 | 100 | Map<String,String> data = new HashMap<>(); |
... | ... | @@ -100,6 +104,8 @@ |
100 | 104 | basicConfigs.add(data); |
101 | 105 | } |
102 | 106 | |
107 | + System.out.println("basicConfigs------"+basicConfigs.size()); | |
108 | + | |
103 | 109 | } |
104 | 110 | |
105 | 111 | |
106 | 112 | |
107 | 113 | |
108 | 114 | |
109 | 115 | |
110 | 116 | |
... | ... | @@ -1631,36 +1637,36 @@ |
1631 | 1637 | |
1632 | 1638 | } |
1633 | 1639 | |
1634 | - public void syncDataPat1(String hid,MongoTemplate mongoTemplate) | |
1640 | + public static void syncDataPat1(String hid,MongoTemplate mongoTemplate) | |
1635 | 1641 | { |
1636 | 1642 | try { |
1637 | 1643 | syncPatientData(hid, mongoTemplate,1,3000); |
1638 | 1644 | } |
1639 | 1645 | catch (Exception e) |
1640 | 1646 | { |
1641 | - ExceptionUtils.catchException(e,"孕妇同步出错。。。。。。。。。。。。。。"); | |
1647 | + ExceptionUtils.catchException(e,"孕妇同步出错1。。。。。。。。。。。。。。"); | |
1642 | 1648 | } |
1643 | 1649 | |
1644 | 1650 | } |
1645 | - public void syncDataPat2(String hid,MongoTemplate mongoTemplate) | |
1651 | + public static void syncDataPat2(String hid,MongoTemplate mongoTemplate) | |
1646 | 1652 | { |
1647 | 1653 | try { |
1648 | 1654 | syncPatientData(hid,mongoTemplate,30001,8000); |
1649 | 1655 | } |
1650 | 1656 | catch (Exception e) |
1651 | 1657 | { |
1652 | - ExceptionUtils.catchException(e,"孕妇同步出错。。。。。。。。。。。。。。"); | |
1658 | + ExceptionUtils.catchException(e,"孕妇同步出错2。。。。。。。。。。。。。。"); | |
1653 | 1659 | } |
1654 | 1660 | |
1655 | 1661 | } |
1656 | - public void syncDataPat3(String hid,MongoTemplate mongoTemplate) | |
1662 | + public static void syncDataPat3(String hid,MongoTemplate mongoTemplate) | |
1657 | 1663 | { |
1658 | 1664 | try { |
1659 | 1665 | syncPatientData(hid,mongoTemplate,8001,100000000); |
1660 | 1666 | } |
1661 | 1667 | catch (Exception e) |
1662 | 1668 | { |
1663 | - ExceptionUtils.catchException(e,"孕妇同步出错。。。。。。。。。。。。。。"); | |
1669 | + ExceptionUtils.catchException(e,"孕妇同步出错3。。。。。。。。。。。。。。"); | |
1664 | 1670 | } |
1665 | 1671 | |
1666 | 1672 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
1fd155a
1 | 1 | package com.lyms.platform.operate.web.controller; |
2 | 2 | |
3 | -import com.lyms.platform.operate.web.utils.JdbcUtil; | |
3 | +import com.lyms.platform.biz.JdbcUtil; | |
4 | 4 | import org.springframework.beans.factory.annotation.Autowired; |
5 | 5 | import org.springframework.data.mongodb.core.MongoTemplate; |
6 | 6 | import org.springframework.stereotype.Controller; |
7 | 7 | |
... | ... | @@ -107,12 +107,14 @@ |
107 | 107 | // System.out.print("同步结束儿童>>>>>>>>>>>>>>>>>>>>>>>>>"); |
108 | 108 | // } |
109 | 109 | // }).start(); |
110 | + JdbcUtil.initData(); | |
111 | + System.out.println("initData------"); | |
110 | 112 | |
111 | 113 | new Thread(new Runnable() { |
112 | 114 | @Override |
113 | 115 | public void run() { |
114 | 116 | System.out.print("同步开始孕妇1>>>>>>>>>>>>>>>>>>>>>>>>>"); |
115 | - new com.lyms.platform.biz.JdbcUtil().syncDataPat1(hid, template); | |
117 | + JdbcUtil.syncDataPat1(hid, template); | |
116 | 118 | System.out.print("同步结束孕妇1>>>>>>>>>>>>>>>>>>>>>>>>>"); |
117 | 119 | } |
118 | 120 | }).start(); |
... | ... | @@ -120,7 +122,7 @@ |
120 | 122 | @Override |
121 | 123 | public void run() { |
122 | 124 | System.out.print("同步开始孕妇2>>>>>>>>>>>>>>>>>>>>>>>>>"); |
123 | - new com.lyms.platform.biz.JdbcUtil().syncDataPat2(hid, template); | |
125 | + JdbcUtil.syncDataPat2(hid, template); | |
124 | 126 | System.out.print("同步结束孕妇2>>>>>>>>>>>>>>>>>>>>>>>>>"); |
125 | 127 | } |
126 | 128 | }).start(); |
... | ... | @@ -128,7 +130,7 @@ |
128 | 130 | @Override |
129 | 131 | public void run() { |
130 | 132 | System.out.print("同步开始孕妇3>>>>>>>>>>>>>>>>>>>>>>>>>"); |
131 | - new com.lyms.platform.biz.JdbcUtil().syncDataPat3(hid, template); | |
133 | + JdbcUtil.syncDataPat3(hid, template); | |
132 | 134 | System.out.print("同步结束孕妇3>>>>>>>>>>>>>>>>>>>>>>>>>"); |
133 | 135 | } |
134 | 136 | }).start(); |