main
黄海 9 months ago
commit ce2695a177

@ -81,9 +81,9 @@
cols: [[
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '分类', field: 'parent_name', align: 'center' },
{ title: '数据集', field: 'dataset_name', align: 'center'},
{ title: '表名', field: 'table_name', align: 'center'},
{ title: '操作', toolbar: '#table-bar', align: 'center'}
{ title: '数据集', field: 'dataset_name', align: 'center' },
// { title: '表名', field: 'table_name', align: 'center' },
{ title: '操作', toolbar: '#table-bar', align: 'center' }
]],
skin: 'line',
defaultToolbar: []

@ -167,8 +167,6 @@
layer.msg("保存成功!", {
icon: 1,
time: 1300
}, function () {
history.back();
});
} else {
layer.msg(result.message, {
@ -180,14 +178,12 @@
});
});
$("#back").click(function () {
history.back();
});
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);

@ -60,7 +60,7 @@ public class GenerateExcel {
for (int i = 1; i <= columnCount; i++) {
Cell cell = row.createCell(i - 1);
Object value = resultSet.getObject(i);
cell.setCellValue(value.toString());
if (value != null) cell.setCellValue(value.toString());
cell.setCellStyle(dataStyle);
}
}
@ -108,13 +108,13 @@ public class GenerateExcel {
List<String> files = getFiles(directoryPath);
int cnt = 0;//有问题的查询个数
for (String file : files) {
if(!file.contains(".sql")) continue;
if (!file.contains(".sql")) continue;
String sql = FileUtil.readUtf8String(file);
try {
String excelFilePath = file.replace(".sql", ".xlsx");
ResultSet rs = statement.executeQuery(sql);
//如果数据集是空的,返回
if(!rs.isBeforeFirst()) continue;
if (!rs.isBeforeFirst()) continue;
//否则导出
cnt++;
exportResultSetToExcel(rs, excelFilePath);

Loading…
Cancel
Save