| | |
| | | return; |
| | | for (HisSyncDict hisSyncDict : hisSyncDicts) { |
| | | boolean isFormatJson = false; |
| | | if (hisSyncDict.getDictName().equals("getKeShizd") || hisSyncDict.getDictName().equals("getKeShiByConditionszd")|| hisSyncDict.getDictName().equals("getShouFeiXmzd")) |
| | | if (hisSyncDict.getDictName().equals("getKeShizd") |
| | | || hisSyncDict.getDictName().equals("getKeShiByConditionszd") |
| | | || hisSyncDict.getDictName().equals("getShouFeiXmzd") |
| | | || hisSyncDict.getDictName().equals("getListYiShengZd") |
| | | ) |
| | | isFormatJson = true; |
| | | hisSyncDict.setDictName(hisSyncDict.getHospId()+"_"+hisSyncDict.getDictName()); |
| | | extracted(NAME, connection, hisSyncDict,token,isFormatJson); |
| | |
| | | JSONObject entries = execRequest(object.toString(),hisSyncDict,token); |
| | | log.info("请求返回 ->{}", entries.toString()); |
| | | if (isFormatJson){ |
| | | if (entries != null && "1".equals(entries.getStr("returnCode"))) { |
| | | if ("1".equals(entries.getStr("returnCode"))) { |
| | | JSONObject response = entries.getJSONObject("returnData"); |
| | | try { |
| | | dropTable(tabName, connection); |
| | |
| | | } |
| | | } |
| | | }else { |
| | | if (entries != null && "1".equals(entries.getStr("returnCode"))) { |
| | | if ("1".equals(entries.getStr("returnCode"))) { |
| | | Object returnData = entries.get("returnData"); |
| | | if (returnData instanceof JSONObject){ |
| | | JSONObject response = entries.getJSONObject("returnData"); |
| | | try { |
| | | dropTable(tabName, connection); |
| | | } catch (SQLException e) { |
| | | log.error("删除表异常 ->{}", e.getMessage()); |
| | | } |
| | | editDataBase(connection, tabName, response, name); |
| | | }else { |
| | | JSONArray response = entries.getJSONArray("returnData"); |
| | | try { |
| | | dropTable(tabName, connection); |
| | |
| | | } catch (SQLException e) { |
| | | log.error("删除表异常 ->{}", e.getMessage()); |
| | | } |
| | | } |
| | | if (isLimit) { |
| | | JSONArray response = entries.getJSONArray("returnData"); |
| | | if (tabName.contains("_getjianchaxmzd")) maxPage = 10000; |
| | | log.info("计算页码为 ->{}", maxPage); |
| | | if (maxPage > 1) { |
| | |
| | | } |
| | | } |
| | | } else { |
| | | JSONArray response = entries.getJSONArray("returnData"); |
| | | List<JSONObject> list = JSONUtil.toList(response, JSONObject.class); |
| | | for (JSONObject jsonObject : list) { |
| | | editDataBase(connection, tabName, jsonObject, name); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | log.error("对比字段插入数据异常"); |
| | | log.error(e.getSQLState()); |
| | | log.error(e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | |
| | | connection.setRequestMethod("POST"); |
| | | connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); |
| | | connection.setRequestProperty("Authorization", token); |
| | | if (hisSyncDict.getUrl().equals("/zhuShuJu/getListYiShengZd") || hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")){ |
| | | log.info("请求接口 ->{}", hisSyncDict.getUrl()); |
| | | if (hisSyncDict.getUrl().equals("/zhuShuJu/getListYiShengZd") || hisSyncDict.getUrl().equals("/zhuShuJu/getZhiGongPage") || hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")){ |
| | | connection.setRequestProperty("dangQianYhId","DBA"); |
| | | if (hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")) |
| | | connection.setRequestProperty("yuanQuId","1"); |