| | |
| | | * @param code 接口代码 |
| | | * @return 执行是否成功 |
| | | */ |
| | | public AjaxResult save(String json, String code) { |
| | | public AjaxResult save(JSONObject object, String code) { |
| | | code = code.toLowerCase(); |
| | | JSONObject jsonObject = JSONUtil.parseObj(json); |
| | | JSONObject response = jsonObject.getJSONObject("Response"); |
| | | // JSONObject jsonObject = JSONUtil.parseObj(json); |
| | | // JSONObject response = jsonObject.getJSONObject("Response"); |
| | | String tabName = "ltkj_" + code; |
| | | if (response.getStr("ResultCode").equals("0")) { |
| | | JSONArray resultData = response.getJSONArray("ResultData"); |
| | | // if (response.getStr("ResultCode").equals("0")) { |
| | | // JSONObject object = response.getJSONObject("ResultData"); |
| | | Connection connection = getConnection(); |
| | | for (Object resultDatum : resultData) { |
| | | JSONObject object = (JSONObject) resultDatum; |
| | | // for (Object resultDatum : resultData) { |
| | | // JSONObject object = (JSONObject) resultDatum; |
| | | Boolean isExists = tabIsExists(connection, tabName); |
| | | if (null == isExists) |
| | | return AjaxResult.error(); |
| | |
| | | throwables.printStackTrace(); |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | // } |
| | | try { |
| | | if (connection != null) |
| | | connection.close(); |
| | | } catch (SQLException throwables) { |
| | | } |
| | | } |
| | | // } |
| | | return AjaxResult.success(); |
| | | } |
| | | |