| | |
| | | try { |
| | | Class.forName("com.mysql.cj.jdbc.Driver"); |
| | | } catch (ClassNotFoundException e) { |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e),e.getMessage()); |
| | | } |
| | | // try { |
| | | // InputStreamReader reader = new InputStreamReader(new FileInputStream(url), StandardCharsets.UTF_8); |
| | |
| | | for (Object resultDatum : resultData) { |
| | | JSONObject object = (JSONObject) resultDatum; |
| | | ajaxResult = save(object, type,hisApiConfig,JSONUtil.toJsonStr(params)); |
| | | // save(object, type,hisApiConfig,JSONUtil.toJsonStr(params)); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (String key : object.keySet()) { |
| | | String defaultVal = object.get(key).toString(); |
| | |
| | | } |
| | | } catch (Exception e) { |
| | | // throw new RuntimeException(e); |
| | | log.error(String.valueOf(e)); |
| | | log.error(String.valueOf(e),e.getMessage()); |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | |
| | | try { |
| | | creatTable(object, tabName, connection); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | return AjaxResult.error(); |
| | | log.error(String.valueOf(e),e.getMessage()); |
| | | // return AjaxResult.error(); |
| | | } |
| | | } |
| | | //插入数据 |
| | | try { |
| | | operationTable(object,connection,hisApiConfig,paramsJson,code); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | return AjaxResult.error(); |
| | | log.error(String.valueOf(e),e.getMessage()); |
| | | // return AjaxResult.error(); |
| | | }finally { |
| | | try { |
| | | connection.close(); |
| | |
| | | String key = entry.getKey().trim().toLowerCase(); |
| | | if (StrUtil.isBlank(defaultVal) || defaultVal.equals("null")) |
| | | continue; |
| | | String val = defaultVal.trim().replaceAll("\\s+", ""); |
| | | String val = defaultVal.trim().replaceAll("\\s+", "").replaceAll("[^\\x00-\\x7F]", ""); |
| | | if (primaryKesList.contains(key)) { |
| | | deleteSqlBuilder.append(key).append(" = '").append(val).append("' and "); |
| | | } |
| | |
| | | statement.close(); |
| | | return next; |
| | | } catch (SQLException throwables) { |
| | | throwables.printStackTrace(); |
| | | log.error(String.valueOf(throwables),throwables.getMessage()); |
| | | } |
| | | log.error("查询表执行sql返回为null ->{},{},{}",tabSql,DB_NAME,tableName); |
| | | return null; |
| | | } |
| | | |