任务导出导入优化

This commit is contained in:
wanxiaoli 2026-01-12 20:39:00 +08:00
parent da930d6adc
commit d14f381b3a

View File

@ -47,9 +47,7 @@ import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.*;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.sql.*;
@ -1398,6 +1396,22 @@ public class TsTaskServiceImpl extends ServiceImpl<TsTaskMapper, TsTask> impleme
private void executeFileBatch(List<String> inserts) {
String mergedSql = mergeFileInsert(inserts);
try {
jdbcTemplate.update(mergedSql);
LOGGER.info("ts_files 批量插入 {} 条", inserts.size());
} catch (Exception e) {
LOGGER.error("ts_files 批量插入失败", e);
throw e; // 触发事务回滚
}
}
/**
* 合并同一表的 INSERT VALUES
*/