|  |  | 
 |  |  | /** | 
 |  |  |  * Copyright (c) 2018 人人开源 All rights reserved. | 
 |  |  |  * | 
 |  |  |  * <p> | 
 |  |  |  * https://www.renren.io | 
 |  |  |  * | 
 |  |  |  * <p> | 
 |  |  |  * 版权所有,侵权必究! | 
 |  |  |  */ | 
 |  |  |  | 
 |  |  | 
 |  |  | public class SysGeneratorController { | 
 |  |  |  | 
 |  |  |     @GetMapping("properties") | 
 |  |  |     @RequiresPermissions(Constant.Permissions.SUPER_ADMIN) | 
 |  |  |     //@RequiresPermissions(Constant.Permissions.SUPER_ADMIN) | 
 |  |  |     public Result<JSONObject> queryProperties() { | 
 |  |  |         JSONObject jsonObject = new JSONObject(); | 
 |  |  |         try { | 
 |  |  | 
 |  |  |             eqList.add(json); | 
 |  |  |         } | 
 |  |  |         jsonObject.put("eqList", eqList); | 
 |  |  |  | 
 |  |  |         DbProperties jdbc = queryJdbcProperties(); | 
 |  |  |  | 
 |  |  |         DataTable table = null; | 
 |  |  |         Connection conn = null; | 
 |  |  |         try { | 
 |  |  |             // 注册数据库驱动 | 
 |  |  |             Class.forName(jdbc.getDriverClass()); | 
 |  |  |             Properties props = new Properties(); | 
 |  |  |             props.put("remarksReporting", "true");// 为了得到说明 | 
 |  |  |             props.setProperty("user", jdbc.getUserName()); | 
 |  |  |             props.setProperty("password", jdbc.getPassWord()); | 
 |  |  |             // 获取连接 | 
 |  |  |             conn = DriverManager.getConnection(jdbc.getUrl(), props); | 
 |  |  |             table = DBUtil.getTableList(conn, false); | 
 |  |  |  | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             e.printStackTrace(); | 
 |  |  |         } finally { | 
 |  |  |             if (conn != null) { | 
 |  |  |                 try { | 
 |  |  |                     conn.close(); | 
 |  |  |                 } catch (SQLException e) { | 
 |  |  |                     e.printStackTrace(); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         jsonObject.put("tableList", table.toJSONArray()); | 
 |  |  |         return Result.ok(jsonObject); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |                 JSONObject json = array.getJSONObject(i); | 
 |  |  |                 String columnName = json.getString("columnName"); | 
 |  |  |                 if ("is_delete,dept_id,company_id,tenant_id,creator,create_date,updater,update_date" | 
 |  |  |                         .indexOf(columnName) >= 0) { | 
 |  |  |                         .indexOf(columnName.toLowerCase()) >= 0) { | 
 |  |  |                     json.put("isTableColumn", "false"); | 
 |  |  |                 } | 
 |  |  |             } |