Fix operation log bug

This commit is contained in:
SwallowGG
2023-11-03 16:52:35 +08:00
parent 368a2a8bf5
commit 7875a68391
3 changed files with 18 additions and 6 deletions

View File

@ -343,21 +343,21 @@ public class DlTemplateServiceImpl implements DlTemplateService {
.append(" ("); .append(" (");
for (int i = 1; i < row.size(); i++) { for (int i = 1; i < row.size(); i++) {
Header header = param.getHeaderList().get(i); Header header = param.getHeaderList().get(i);
String newValue = row.get(i); //String newValue = row.get(i);
if (newValue != null) { //if (newValue != null) {
script.append(metaSchema.getMetaDataName(header.getName())) script.append(metaSchema.getMetaDataName(header.getName()))
.append(","); .append(",");
} // }
} }
script.deleteCharAt(script.length() - 1); script.deleteCharAt(script.length() - 1);
script.append(") VALUES ("); script.append(") VALUES (");
for (int i = 1; i < row.size(); i++) { for (int i = 1; i < row.size(); i++) {
String newValue = row.get(i); String newValue = row.get(i);
if (newValue != null) { //if (newValue != null) {
Header header = param.getHeaderList().get(i); Header header = param.getHeaderList().get(i);
script.append(SqlUtils.getSqlValue(newValue, header.getDataType())) script.append(SqlUtils.getSqlValue(newValue, header.getDataType()))
.append(","); .append(",");
} //}
} }
script.deleteCharAt(script.length() - 1); script.deleteCharAt(script.length() - 1);
script.append(")"); script.append(")");

View File

@ -3,6 +3,8 @@ package ai.chat2db.server.web.api.controller.operation.log.vo;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime;
/** /**
* @author moji * @author moji
* @version DdlVO.java, v 0.1 2022年09月18日 11:06 moji Exp $ * @version DdlVO.java, v 0.1 2022年09月18日 11:06 moji Exp $
@ -16,6 +18,16 @@ public class OperationLogVO {
*/ */
private Long id; private Long id;
/**
* 创建时间
*/
private LocalDateTime gmtCreate;
/**
* 修改时间
*/
private LocalDateTime gmtModified;
/** /**
* 文件别名 * 文件别名
*/ */

View File

@ -186,7 +186,7 @@ public class SQLExecutor {
ExecuteResult executeResult = ExecuteResult.builder().sql(sql).success(Boolean.TRUE).build(); ExecuteResult executeResult = ExecuteResult.builder().sql(sql).success(Boolean.TRUE).build();
try (Statement stmt = connection.createStatement()) { try (Statement stmt = connection.createStatement()) {
stmt.setFetchSize(EasyToolsConstant.MAX_PAGE_SIZE); stmt.setFetchSize(EasyToolsConstant.MAX_PAGE_SIZE);
stmt.setQueryTimeout(30); //stmt.setQueryTimeout(30);
if (offset != null && count != null) { if (offset != null && count != null) {
stmt.setMaxRows(offset + count); stmt.setMaxRows(offset + count);
} }