Commit 23cc0b807639c3fc29c0d9d22d13d745518ba279

Authored by liquanyu
1 parent 83d0f47913

code update

Showing 2 changed files with 13 additions and 10 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/JdbcUtil.java View file @ 23cc0b8
... ... @@ -43,10 +43,12 @@
43 43 private static Map<String, String> datacontents = new HashMap<>();
44 44 private static Map<String, String> basicConfigs = new HashMap<>();
45 45  
  46 + private static Integer orgId = 0;
46 47  
  48 +
47 49 private static BlockingQueue<SimplePatient> bq = new LinkedBlockingQueue();
48 50  
49   - private static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(15, 20, 1, TimeUnit.HOURS, new LinkedBlockingQueue<Runnable>());
  51 + private static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10, 15, 1, TimeUnit.HOURS, new LinkedBlockingQueue<Runnable>());
50 52  
51 53 private static class Chanle extends Thread {
52 54 private MongoTemplate mongoTemplate;
... ... @@ -114,7 +116,8 @@
114 116 }
115 117 }
116 118  
117   - public static void initData() {
  119 + public static void initData(Integer mysqlHid) {
  120 + orgId = mysqlHid;
118 121 List<Map<String, Object>> listEmp = getListDataBySql("select e.e_name,e.e_id from mommy_employee e");
119 122 for (Map<String, Object> map : listEmp) {
120 123 employees.put(getString(map.get("E_ID")), getString(map.get("E_NAME")));
... ... @@ -137,7 +140,7 @@
137 140  
138 141 System.out.println("oracleHosps------" + oracleHosps.size());
139 142  
140   - List<Map<String, Object>> usersList = getMysqlListDataBySql("select id,name from users where org_id = 216 ");
  143 + List<Map<String, Object>> usersList = getMysqlListDataBySql("select id,name from users where org_id = "+mysqlHid);
141 144 for (Map<String, Object> map : usersList) {
142 145 System.out.println(map);
143 146 users.put(getString(map.get("name")), getString(map.get("id")));
... ... @@ -176,7 +179,7 @@
176 179  
177 180  
178 181 public static String getOrgIdByName(String name) {
179   - return "216";
  182 + return String.valueOf(orgId);
180 183 }
181 184  
182 185 public static String getEmpNameById(String id) {
... ... @@ -986,7 +989,7 @@
986 989 " INNER JOIN PLAT_DATACONTENT K ON J.ME_WORNINGID = K.DC_ID AND K.DC_ISVALID=1 AND K.DC_DATATYPEID='fb43fd5a-b153-4cb9-9180-c46f5612ba43' AND K.DC_NAME<>'其他' \n" +
987 990 " --高危等级\n" +
988 991 " INNER JOIN PLAT_DATACONTENT L ON K.DC_PARENTID=L.DC_ID AND L.DC_ISVALID=1\n" +
989   - " INNER JOIN LYMS_BASICCONFIG LL ON K.DC_NAME=LL.NAME\n" +
  992 + " INNER JOIN LYMS_BASICCONFIG LL ON K.DC_NAME=LL.NAME AND LL.PARENTID IN ('49a36aea-c5b6-4162-87d2-9eb3c6ec00c2','eb146c03-b19f-4e28-b85f-fda574b2283b','315107bd-91fe-42a1-9237-752f3c046a40','e637b361-99cf-41eb-84f2-f0dab596e928','224b2329-cb82-4da3-a071-8527f8283aab') \n" +
990 993 " -- UNION ALL \n" +
991 994 " --其他高危评分\n" +
992 995 " --SELECT M.ID,M.MO_CONTENT,M.MO_COLORNAME,M.MO_VALUES FROM MOMMY_OTHERWORNING M\n" +
993 996  
... ... @@ -1119,12 +1122,12 @@
1119 1122 while (true) {
1120 1123 List<Map<String, Object>> list = getListDataBySql(" SELECT * FROM ( SELECT A.*, ROWNUM RN FROM " +
1121 1124 " (select replace(m.PI_ID,'-','') as ID,m.* from MOMMY_PATIENTINFO m where m.pi_bookbuildinghospitalid='" + hospitalId + "') " +
1122   - " A WHERE ROWNUM < " + (num + 20) + " ) WHERE RN >= " + num + " ");
  1125 + " A WHERE ROWNUM < " + (num + 50) + " ) WHERE RN >= " + num + " ");
1123 1126 if (list == null || list.size() == 0) {
1124 1127 break;
1125 1128 }
1126 1129  
1127   - num = num + 20;
  1130 + num = num + 50;
1128 1131 for (Map<String, Object> map : list) {
1129 1132 try {
1130 1133 PersonModel personModel = new PersonModel();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 23cc0b8
... ... @@ -97,7 +97,7 @@
97 97  
98 98 @RequestMapping(value = "/syncData", method = RequestMethod.GET)
99 99 @ResponseBody
100   - public String syncData(@RequestParam(required = true) final String hid) {
  100 + public String syncData(@RequestParam(required = true) final String oracleHid,@RequestParam(required = true) final Integer mysqlHid) {
101 101 final MongoTemplate template = mongoTemplate;
102 102 // new Thread(new Runnable() {
103 103 // @Override
104 104  
... ... @@ -107,11 +107,11 @@
107 107 // System.out.print("同步结束儿童>>>>>>>>>>>>>>>>>>>>>>>>>");
108 108 // }
109 109 // }).start();
110   - JdbcUtil.initData();
  110 + JdbcUtil.initData(mysqlHid);
111 111 System.out.println("initData------");
112 112  
113 113 System.out.println("同步开始孕妇1>>>>>>>>>>>>>>>>>>>>>>>>>");
114   - JdbcUtil.syncDataPat(hid, template);
  114 + JdbcUtil.syncDataPat(oracleHid, template);
115 115 System.out.println("同步结束孕妇1>>>>>>>>>>>>>>>>>>>>>>>>>");
116 116  
117 117