Merge pull request #9555 from dataease/pr@dev@fixdriver

Pr@dev@fixdriver
This commit is contained in:
taojinlong 2024-05-09 12:01:35 +08:00 committed by GitHub
commit 71cef0d57e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -294,7 +294,7 @@ public class ExportCenterService {
// with DataType
if ((excelTypes[j].equals(DeTypeConstants.DE_INT) || excelTypes[j].equals(DeTypeConstants.DE_FLOAT)) && rowData[j] != null) {
cell.setCellValue(Double.valueOf(rowData[j].toString()));
} else if(rowData[j] != null){
} else if (rowData[j] != null) {
cell.setCellValue(String.valueOf(rowData[j]));
}
} catch (Exception e) {
@ -501,7 +501,7 @@ public class ExportCenterService {
// with DataType
if ((excelTypes[j].equals(DeTypeConstants.DE_INT) || excelTypes[j].equals(DeTypeConstants.DE_FLOAT)) && StringUtils.isNotEmpty(cellValObj.toString())) {
cell.setCellValue(Double.valueOf(cellValObj.toString()));
} else if(cellValObj != null){
} else if (cellValObj != null) {
cell.setCellValue(cellValObj.toString());
}
} catch (Exception e) {
@ -533,6 +533,7 @@ public class ExportCenterService {
try (FileOutputStream outputStream = new FileOutputStream(dataPath + "/" + request.getViewName() + ".xlsx")) {
wb.write(outputStream);
outputStream.flush();
}
wb.close();
@ -546,7 +547,7 @@ public class ExportCenterService {
exportTask.setExportPogress("100");
exportTask.setExportStatus("SUCCESS");
setFileSize(dataPath + "/" + dataPath + "/" + request.getViewName() + ".xlsx", exportTask);
setFileSize(dataPath + "/" + request.getViewName() + ".xlsx", exportTask);
} catch (Exception e) {
LogUtil.error("Failed to export data", e);
exportTask.setExportStatus("FAILED");
@ -754,6 +755,7 @@ public class ExportCenterService {
exportTaskMapper.updateByPrimaryKey(exportTask);
}
wb.write(fileOutputStream);
fileOutputStream.flush();
fileOutputStream.close();
wb.close();
}

View File

@ -970,7 +970,7 @@ export default {
table.info.replace(/\n/g, '\\n').replace(/\r/g, '\\r')
).sql
}
if (JSON.parse(table.info).hasOwn('setKey')) {
if (JSON.parse(table.info).hasOwnProperty('setKey')) {
this.$set(this.param, 'setKey', JSON.parse(table.info).setKey)
this.param.keys = JSON.parse(table.info).keys
}