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

导出更新

parent 76731139
......@@ -223,7 +223,9 @@ public class RelationService extends BaseService<RelationModel, Relation, Relati
String sql = this.getSelectSQL(tableSet, model.getName(), columns, agencyCode).toString();
List<Map<String, Object>> dataList = TableUtils.getMaps(sql, connection);
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) {
......@@ -233,6 +235,9 @@ public class RelationService extends BaseService<RelationModel, Relation, Relati
writer.write(insertSql.toString());
writer.write(BR + BR + DELIMITER + BR);
}
writer.flush();
writer.close();
out.close();
download(response, fileName, sqlFilePath);
} catch (SQLException | IOException e) {
e.printStackTrace();
......
......@@ -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.utils.TableUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Connection;
......
......@@ -95,6 +95,7 @@ public class TableUtils {
List<TableColumn> columns = new ArrayList<>();
for (Map<String, Object> map : columnList) {
TableColumn column = JSON.parseObject(JSON.toJSONString(map), TableColumn.class);
if(!column.getColumnName().equals("content"))
columns.add(column);
}
return columns;
......
#DB properties:
# 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.password=Yeejoin@2020
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
......
spring.application.name=AMOS-ATL
server.servlet.context-path=/atl
#server.servlet.context-path=/jcs
server.port=30002
#server.port=20000
server.port=30201
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