| | |
| | | @Value("${config.path}") |
| | | public void setConfigPath(String configPath) { |
| | | CONFIG_PATH = configPath; |
| | | NAME = configValue.getConfigValue("name"); |
| | | URL = "jdbc:mysql://" + configValue.getConfigValue("ip") + ":" + configValue.getConfigValue("prot") + "/" + NAME + |
| | | NAME = configValue.getConfigValue("ShanXi_Qin_XiAn_MeiJi.name"); |
| | | URL = "jdbc:mysql://" + configValue.getConfigValue("ShanXi_Qin_XiAn_MeiJi.ip") + ":" + configValue.getConfigValue("ShanXi_Qin_XiAn_MeiJi.prot") + "/" + NAME + |
| | | "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8"; |
| | | USER = configValue.getConfigValue("username"); |
| | | PASSWORD = configValue.getConfigValue("password"); |
| | | USER = configValue.getConfigValue("ShanXi_Qin_XiAn_MeiJi.username"); |
| | | PASSWORD = configValue.getConfigValue("ShanXi_Qin_XiAn_MeiJi.password"); |
| | | String apiUrl = configValue.getConfigValue("ShanXi_Qin_XiAn_MeiJi.his_api_url"); |
| | | String apiPort = configValue.getConfigValue("ShanXi_Qin_XiAn_MeiJi.his_api_port"); |
| | | BASE_API_URL = apiUrl+":"+apiPort+configValue.getConfigValue("ShanXi_Qin_XiAn_MeiJi.hisapiappend"); |
| | |
| | | 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"))) { |
| | | JSONArray response = entries.getJSONArray("returnData"); |
| | | try { |
| | | dropTable(tabName, connection); |
| | | List<JSONObject> list = JSONUtil.toList(response, JSONObject.class); |
| | | for (JSONObject jsonObject : list) { |
| | | editDataBase(connection, tabName, jsonObject, name); |
| | | 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()); |
| | | } |
| | | } catch (SQLException e) { |
| | | log.error("删除表异常 ->{}", e.getMessage()); |
| | | editDataBase(connection, tabName, response, name); |
| | | }else { |
| | | JSONArray response = entries.getJSONArray("returnData"); |
| | | try { |
| | | dropTable(tabName, connection); |
| | | List<JSONObject> list = JSONUtil.toList(response, JSONObject.class); |
| | | for (JSONObject jsonObject : list) { |
| | | editDataBase(connection, tabName, jsonObject, name); |
| | | } |
| | | } 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"); |