perf: 数据源同步状态接口

This commit is contained in:
fit2cloud-chenyw 2023-11-01 15:37:07 +08:00
parent adbc915b56
commit f39ab20bfb
3 changed files with 13 additions and 13 deletions

View File

@ -87,6 +87,13 @@ public class DataSourceManage {
coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE,OptConstants.OPT_TYPE.UPDATE); coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE,OptConstants.OPT_TYPE.UPDATE);
} }
@XpackInteract(value = "datasourceResourceTree", before = false)
public void innerEditStatus(CoreDatasource coreDatasource) {
UpdateWrapper<CoreDatasource> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", coreDatasource.getId());
coreDatasourceMapper.update(coreDatasource, updateWrapper);
}
@XpackInteract(value = "datasourceResourceTree", before = false) @XpackInteract(value = "datasourceResourceTree", before = false)
public void move(DatasourceDTO dataSourceDTO) { public void move(DatasourceDTO dataSourceDTO) {
Long id = dataSourceDTO.getId(); Long id = dataSourceDTO.getId();

View File

@ -12,8 +12,6 @@ import io.dataease.api.dataset.dto.DatasetTableDTO;
import io.dataease.api.dataset.dto.PreviewSqlDTO; import io.dataease.api.dataset.dto.PreviewSqlDTO;
import io.dataease.api.ds.DatasourceApi; import io.dataease.api.ds.DatasourceApi;
import io.dataease.api.ds.vo.*; import io.dataease.api.ds.vo.*;
import io.dataease.api.permissions.auth.api.InteractiveAuthApi;
import io.dataease.api.permissions.auth.dto.BusiResourceEditor;
import io.dataease.commons.constants.TaskStatus; import io.dataease.commons.constants.TaskStatus;
import io.dataease.commons.utils.CommonThreadPool; import io.dataease.commons.utils.CommonThreadPool;
import io.dataease.constant.DataSourceType; import io.dataease.constant.DataSourceType;
@ -43,7 +41,6 @@ import io.dataease.utils.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -88,8 +85,6 @@ public class DatasourceServer implements DatasourceApi {
@Resource @Resource
private DatasetDataManage datasetDataManage; private DatasetDataManage datasetDataManage;
@Autowired(required = false)
private InteractiveAuthApi interactiveAuthApi;
@Resource @Resource
private CoreUserManage coreUserManage; private CoreUserManage coreUserManage;
@ -618,14 +613,12 @@ public class DatasourceServer implements DatasourceApi {
record.setStatus(coreDatasource.getStatus()); record.setStatus(coreDatasource.getStatus());
QueryWrapper<CoreDatasource> wrapper = new QueryWrapper<>(); QueryWrapper<CoreDatasource> wrapper = new QueryWrapper<>();
wrapper.eq("id", coreDatasource.getId()); wrapper.eq("id", coreDatasource.getId());
datasourceMapper.update(record, wrapper); CoreDatasource originData = datasourceMapper.selectById(coreDatasource.getId());
if (interactiveAuthApi != null) { String originStatus = originData.getStatus();
BusiResourceEditor editor = new BusiResourceEditor(); if (StringUtils.equals(coreDatasource.getStatus(), originStatus)) {
editor.setId((long) coreDatasource.getId()); return datasourceDTO;
editor.setName(coreDatasource.getName());
editor.setExtraFlag(getExtraFlag(coreDatasource.getType(), coreDatasource.getStatus()));
interactiveAuthApi.editResource(editor);
} }
dataSourceManage.innerEditStatus(coreDatasource);
return datasourceDTO; return datasourceDTO;
} }

@ -1 +1 @@
Subproject commit 91f3ae793906139d6d761704b95c162de7d26a3d Subproject commit bd2abefb4c91e6399a7de3a6f4dcbadb5633163b