更新数据同步

This commit is contained in:
2025-11-17 16:46:40 +08:00
parent 53aedbc048
commit fbd01ad1da

View File

@@ -12,7 +12,6 @@ import com.mini.capi.model.info.TableTree;
import com.mini.capi.utils.*;
import jakarta.annotation.Resource;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -97,7 +96,7 @@ public class jobController {
@GetMapping("getJobDataTableMarge")
public ApiResult<?> getJobDataTableMarge() {
QueryWrapper<BizDbConfig> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_enabled","1");
queryWrapper.eq("is_enabled", "1");
List<BizDbConfig> configs = bizDbConfigService.list(queryWrapper);
List<CompletableFuture<Void>> futures = new ArrayList<>(configs.size());
for (BizDbConfig config : configs) {
@@ -107,8 +106,8 @@ public class jobController {
for (TableTree tableTree : tableTrees) {
DataTableInfo tableInfo = tableTree.getTableInfo();
List<DataTableField> tableFields = tableTree.getTableFields();
for (DataTableField field : tableFields) {
dataTableFieldService.save(field);
for (DataTableField tableField : tableFields) {
dataTableFieldService.save(tableField);
}
dataTableInfoService.save(tableInfo);
logger.info("已同步数据库:", tableInfo.getDataSource(), ",数据表:", tableInfo.getTableName(), ",总计:", tableFields.size(), "个字段");