Commit 3b9edc2f authored by 陈祥烨's avatar 陈祥烨

导出更新

parent 76731139
...@@ -223,7 +223,9 @@ public class RelationService extends BaseService<RelationModel, Relation, Relati ...@@ -223,7 +223,9 @@ public class RelationService extends BaseService<RelationModel, Relation, Relati
String sql = this.getSelectSQL(tableSet, model.getName(), columns, agencyCode).toString(); String sql = this.getSelectSQL(tableSet, model.getName(), columns, agencyCode).toString();
List<Map<String, Object>> dataList = TableUtils.getMaps(sql, connection); List<Map<String, Object>> dataList = TableUtils.getMaps(sql, connection);
System.out.println(sql); System.out.println(sql);
if (!ObjectUtils.isEmpty(sql)) insertSql.append(TableUtils.getInsertSQL(dataList, columns, model.getName())); StringBuffer insertSQL = TableUtils.getInsertSQL(dataList, columns, model.getName());
System.out.println(insertSQL);
if (!ObjectUtils.isEmpty(sql)) insertSql.append(insertSQL);
} }
} }
if (insertSql.length() > 0) { if (insertSql.length() > 0) {
...@@ -233,6 +235,9 @@ public class RelationService extends BaseService<RelationModel, Relation, Relati ...@@ -233,6 +235,9 @@ public class RelationService extends BaseService<RelationModel, Relation, Relati
writer.write(insertSql.toString()); writer.write(insertSql.toString());
writer.write(BR + BR + DELIMITER + BR); writer.write(BR + BR + DELIMITER + BR);
} }
writer.flush();
writer.close();
out.close();
download(response, fileName, sqlFilePath); download(response, fileName, sqlFilePath);
} catch (SQLException | IOException e) { } catch (SQLException | IOException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.api.tool.face.service; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.api.tool.face.service;
import com.yeejoin.amos.api.tool.face.orm.entity.TableColumn; import com.yeejoin.amos.api.tool.face.orm.entity.TableColumn;
import com.yeejoin.amos.api.tool.utils.TableUtils; import com.yeejoin.amos.api.tool.utils.TableUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.sql.Connection; import java.sql.Connection;
......
...@@ -95,7 +95,8 @@ public class TableUtils { ...@@ -95,7 +95,8 @@ public class TableUtils {
List<TableColumn> columns = new ArrayList<>(); List<TableColumn> columns = new ArrayList<>();
for (Map<String, Object> map : columnList) { for (Map<String, Object> map : columnList) {
TableColumn column = JSON.parseObject(JSON.toJSONString(map), TableColumn.class); TableColumn column = JSON.parseObject(JSON.toJSONString(map), TableColumn.class);
columns.add(column); if(!column.getColumnName().equals("content"))
columns.add(column);
} }
return columns; return columns;
} }
......
#DB properties: #DB properties:
# jdbc_config # jdbc_config
spring.datasource.url=jdbc:mysql://39.98.45.134:3306/amos_studio?allowMultiQueries=true spring.datasource.url=jdbc:mysql://39.98.45.134:3306/amos_tool_library_test?allowMultiQueries=true
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=Yeejoin@2020 spring.datasource.password=Yeejoin@2020
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
......
spring.application.name=AMOS-ATL spring.application.name=AMOS-ATL
server.servlet.context-path=/atl server.servlet.context-path=/atl
#server.servlet.context-path=/jcs server.port=30201
server.port=30002
#server.port=20000
spring.profiles.active=dev spring.profiles.active=dev
......
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