Commit 950116bb authored by chenzai's avatar chenzai

commit 导出

parent 2f4e99bd
...@@ -174,25 +174,25 @@ public class StudioResourceService extends BaseService<StudioResourceModel, Stud ...@@ -174,25 +174,25 @@ public class StudioResourceService extends BaseService<StudioResourceModel, Stud
Connection connection = this.getConnection(databaseConnectionService.queryBySeq(ipSeq),databaseName1); Connection connection = this.getConnection(databaseConnectionService.queryBySeq(ipSeq),databaseName1);
String sql="select * from studio_application where SEQUENCE_NBR="+variables.get("appSeq"); String sql="select * from studio_application where SEQUENCE_NBR="+variables.get("appSeq");
List<Map<String, Object>> maps = DatabaseUtils.getMaps(sql, connection); List<Map<String, Object>> maps = DatabaseUtils.getMaps(sql, connection);
String appKey=""; String appK="";
String insertSql2=""; String insertSql2="";
if (maps!=null||maps.size()!=0){ if (maps!=null||maps.size()!=0){
for (Map<String, Object> map : maps) { for (Map<String, Object> map : maps) {
// 遍历每一个Map // 遍历每一个Map
for (Map.Entry<String, Object> entry : map.entrySet()) { for (Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
if (key.equals(appKey)){ if (appKey.equals(key)){
appKey =(String) map.get(key); appK =(String) map.get(key);
} }
} }
} }
connection.close(); connection.close();
Connection conn = this.getConnection(databaseConnectionService.queryBySeq(ipSeq),databaseName2); Connection conn = this.getConnection(databaseConnectionService.queryBySeq(ipSeq),databaseName2);
String projectSql="select * from privilege_permission where APP_CODE = '"+appKey+"'"; String projectSql="select * from privilege_permission where APP_CODE = '"+appK+"'";
List<Map<String, Object>> projectMaps = DatabaseUtils.getMaps(projectSql, conn); List<Map<String, Object>> projectMaps = DatabaseUtils.getMaps(projectSql, conn);
if (projectMaps!=null||projectMaps.size()!=0){ if (projectMaps!=null||projectMaps.size()!=0){
List<TableColumn> tableColumn = DatabaseUtils.getTableColumn("privilege_permission",conn); List<TableColumn> tableColumn = DatabaseUtils.getTableColumn("privilege_permission",conn);
insertSql2=DatabaseUtils.getInsertSQL(projectMaps, tableColumn, "privilege_permission").toString(); insertSql2=DatabaseUtils.getInsertSQL(projectMaps, tableColumn, "privilege_permission").toString();
} }
conn.close(); conn.close();
} }
...@@ -363,7 +363,6 @@ public class StudioResourceService extends BaseService<StudioResourceModel, Stud ...@@ -363,7 +363,6 @@ public class StudioResourceService extends BaseService<StudioResourceModel, Stud
databaseNames.add(allDbs.get(idx - 1)); databaseNames.add(allDbs.get(idx - 1));
} }
// 查询到需要导出多个,在databaseNames中,循环,多次下载 // 查询到需要导出多个,在databaseNames中,循环,多次下载
// TODO 有bug,connection是同一个。。。
for (String databaseName : databaseNames) { for (String databaseName : databaseNames) {
List<String> tableNames = DatabaseUtils.getList("select table_name from information_schema.tables where table_schema='" + databaseName + "';", connection); List<String> tableNames = DatabaseUtils.getList("select table_name from information_schema.tables where table_schema='" + databaseName + "';", connection);
List<StudioResourceModel> resourceList = queryForStudioResourceList(resourceCode); List<StudioResourceModel> resourceList = queryForStudioResourceList(resourceCode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment