任务导出导入优化
This commit is contained in:
parent
da930d6adc
commit
d14f381b3a
@ -47,9 +47,7 @@ import org.springframework.dao.DataAccessException;
|
|||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.*;
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.sql.*;
|
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
|
* 合并同一表的 INSERT VALUES
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user