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