forked from github/dataease
Merge pull request #7742 from dataease/pr@dev-v2@perf_log_grid
perf: 日志列表增加状态字段
This commit is contained in:
commit
e5b38d9fd1
@ -6,7 +6,6 @@ import io.dataease.api.dataset.dto.DatasetTableDTO;
|
||||
import io.dataease.api.dataset.dto.SqlVariableDetails;
|
||||
import io.dataease.api.dataset.union.DatasetGroupInfoDTO;
|
||||
import io.dataease.api.dataset.vo.DataSetBarVO;
|
||||
import io.dataease.commons.constants.OptConstants;
|
||||
import io.dataease.constant.LogOT;
|
||||
import io.dataease.constant.LogST;
|
||||
import io.dataease.dataset.manage.DatasetGroupManage;
|
||||
@ -44,11 +43,13 @@ public class DatasetTreeServer implements DatasetTreeApi {
|
||||
return datasetGroupManage.save(dto, false);
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASET)
|
||||
@Override
|
||||
public DatasetNodeDTO move(DatasetGroupInfoDTO dto) throws Exception {
|
||||
return datasetGroupManage.move(dto);
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0", ot = LogOT.DELETE, st = LogST.DATASET)
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
datasetGroupManage.delete(id);
|
||||
|
@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import io.dataease.api.ds.vo.DatasourceDTO;
|
||||
import io.dataease.commons.constants.OptConstants;
|
||||
import io.dataease.constant.DataSourceType;
|
||||
import io.dataease.constant.LogOT;
|
||||
import io.dataease.constant.LogST;
|
||||
import io.dataease.datasource.dao.auto.entity.CoreDatasource;
|
||||
import io.dataease.datasource.dao.auto.mapper.CoreDatasourceMapper;
|
||||
import io.dataease.datasource.dao.ext.mapper.DataSourceExtMapper;
|
||||
@ -12,6 +14,7 @@ import io.dataease.datasource.dao.ext.po.DataSourceNodePO;
|
||||
import io.dataease.datasource.dto.DatasourceNodeBO;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import io.dataease.log.DeLog;
|
||||
import io.dataease.model.BusiNodeRequest;
|
||||
import io.dataease.model.BusiNodeVO;
|
||||
import io.dataease.operation.manage.CoreOptRecentManage;
|
||||
@ -25,7 +28,6 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class DataSourceManage {
|
||||
@ -71,12 +73,14 @@ public class DataSourceManage {
|
||||
return TreeUtils.mergeTree(nodes, BusiNodeVO.class, false);
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, st = LogST.DATASOURCE)
|
||||
@XpackInteract(value = "datasourceResourceTree", before = false)
|
||||
public void innerSave(CoreDatasource coreDatasource) {
|
||||
coreDatasourceMapper.insert(coreDatasource);
|
||||
coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE,OptConstants.OPT_TYPE.NEW);
|
||||
coreOptRecentManage.saveOpt(coreDatasource.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.NEW);
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE)
|
||||
@XpackInteract(value = "datasourceResourceTree", before = false)
|
||||
public void innerEdit(CoreDatasource coreDatasource) {
|
||||
UpdateWrapper<CoreDatasource> updateWrapper = new UpdateWrapper<>();
|
||||
@ -84,9 +88,10 @@ public class DataSourceManage {
|
||||
coreDatasource.setUpdateTime(System.currentTimeMillis());
|
||||
coreDatasource.setUpdateBy(AuthUtils.getUser().getUserId());
|
||||
coreDatasourceMapper.update(coreDatasource, updateWrapper);
|
||||
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);
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE)
|
||||
@XpackInteract(value = "datasourceResourceTree", before = false)
|
||||
public void innerEditStatus(CoreDatasource coreDatasource) {
|
||||
UpdateWrapper<CoreDatasource> updateWrapper = new UpdateWrapper<>();
|
||||
@ -94,6 +99,7 @@ public class DataSourceManage {
|
||||
coreDatasourceMapper.update(coreDatasource, updateWrapper);
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, st = LogST.DATASOURCE)
|
||||
@XpackInteract(value = "datasourceResourceTree", before = false)
|
||||
public void move(DatasourceDTO dataSourceDTO) {
|
||||
Long id = dataSourceDTO.getId();
|
||||
@ -106,6 +112,6 @@ public class DataSourceManage {
|
||||
sourceData.setPid(dataSourceDTO.getPid());
|
||||
sourceData.setName(dataSourceDTO.getName());
|
||||
coreDatasourceMapper.updateById(sourceData);
|
||||
coreOptRecentManage.saveOpt(sourceData.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE,OptConstants.OPT_TYPE.UPDATE);
|
||||
coreOptRecentManage.saveOpt(sourceData.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.UPDATE);
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ import io.dataease.api.ds.vo.*;
|
||||
import io.dataease.commons.constants.TaskStatus;
|
||||
import io.dataease.commons.utils.CommonThreadPool;
|
||||
import io.dataease.constant.DataSourceType;
|
||||
import io.dataease.constant.LogOT;
|
||||
import io.dataease.constant.LogST;
|
||||
import io.dataease.dataset.dto.DatasourceSchemaDTO;
|
||||
import io.dataease.dataset.manage.DatasetDataManage;
|
||||
import io.dataease.dataset.utils.TableUtils;
|
||||
@ -35,6 +37,7 @@ import io.dataease.i18n.Translator;
|
||||
import io.dataease.job.sechedule.CheckDsStatusJob;
|
||||
import io.dataease.job.sechedule.ScheduleManager;
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import io.dataease.log.DeLog;
|
||||
import io.dataease.model.BusiNodeRequest;
|
||||
import io.dataease.model.BusiNodeVO;
|
||||
import io.dataease.system.dao.auto.entity.CoreSysSetting;
|
||||
@ -136,7 +139,7 @@ public class DatasourceServer implements DatasourceApi {
|
||||
dataSourceManage.move(dataSourceDTO);
|
||||
}
|
||||
case "rename" -> {
|
||||
if(StringUtils.isEmpty(dataSourceDTO.getName())){
|
||||
if (StringUtils.isEmpty(dataSourceDTO.getName())) {
|
||||
DEException.throwException("名称不能为空!");
|
||||
}
|
||||
CoreDatasource datasource = datasourceMapper.selectById(dataSourceDTO.getId());
|
||||
@ -550,6 +553,7 @@ public class DatasourceServer implements DatasourceApi {
|
||||
return datasourceDTO;
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0", ot = LogOT.DELETE, st = LogST.DATASOURCE)
|
||||
@Override
|
||||
@XpackInteract(value = "datasourceResourceTree", before = false)
|
||||
public void delete(Long datasourceId) throws DEException {
|
||||
|
@ -17,8 +17,10 @@ import io.dataease.chart.manage.ChartViewManege;
|
||||
import io.dataease.commons.constants.DataVisualizationConstants;
|
||||
import io.dataease.commons.constants.OptConstants;
|
||||
import io.dataease.constant.CommonConstants;
|
||||
import io.dataease.constant.LogOT;
|
||||
import io.dataease.exception.DEException;
|
||||
import io.dataease.license.config.XpackInteract;
|
||||
import io.dataease.log.DeLog;
|
||||
import io.dataease.model.BusiNodeRequest;
|
||||
import io.dataease.model.BusiNodeVO;
|
||||
import io.dataease.operation.manage.CoreOptRecentManage;
|
||||
@ -89,6 +91,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
@Resource
|
||||
private VisualizationWatermarkMapper watermarkMapper;
|
||||
|
||||
@DeLog(id = "#p0", ot = LogOT.READ, stExp = "#p1")
|
||||
@Override
|
||||
public DataVisualizationVO findCopyResource(Long dvId, String busiFlag) {
|
||||
DataVisualizationVO result = findById(dvId, busiFlag);
|
||||
@ -121,6 +124,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
return null;
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.CREATE, stExp = "#p0.type")
|
||||
@Override
|
||||
@Transactional
|
||||
public String saveCanvas(DataVisualizationBaseRequest request) {
|
||||
@ -133,11 +137,13 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
visualizationInfo.setSelfWatermarkStatus(0);
|
||||
}
|
||||
Long newDvId = coreVisualizationManage.innerSave(visualizationInfo);
|
||||
request.setId(newDvId);
|
||||
//保存视图信
|
||||
chartDataManage.saveChartViewFromVisualization(request.getComponentData(), newDvId, request.getCanvasViewInfo());
|
||||
return newDvId.toString();
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, stExp = "#p0.type")
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateCanvas(DataVisualizationBaseRequest request) {
|
||||
@ -178,6 +184,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
* @Description: 更新基础信息;
|
||||
* 为什么单独接口:1.基础信息更新频繁数据且数据载量较小;2.防止出现更新过多信息的情况,造成视图的误删等操作
|
||||
*/
|
||||
@DeLog(id = "#p0.id", ot = LogOT.MODIFY, stExp = "#p0.type")
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateBase(DataVisualizationBaseRequest request) {
|
||||
@ -191,6 +198,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
/**
|
||||
* @Description: 逻辑删除可视化信息;将delete_flag 置为0
|
||||
*/
|
||||
@DeLog(id = "#p0", ot = LogOT.DELETE, stExp = "#p1")
|
||||
@Transactional
|
||||
@Override
|
||||
public void deleteLogic(Long dvId, String busiFlag) {
|
||||
@ -203,6 +211,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
return coreVisualizationManage.tree(request);
|
||||
}
|
||||
|
||||
@DeLog(id = "#p0.id", pid = "#p0.pid", ot = LogOT.MODIFY, stExp = "#p0.type")
|
||||
@Transactional
|
||||
@Override
|
||||
public void move(DataVisualizationBaseRequest request) {
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit fc34032acd1aa4b4fe2eb0e67685b1ee498aa4a3
|
||||
Subproject commit fceab26d2e4119424cd29a226cc6fec6b6792997
|
@ -16,4 +16,8 @@ public class LogGridVO implements Serializable {
|
||||
private String ip;
|
||||
|
||||
private Long time;
|
||||
|
||||
private boolean success;
|
||||
|
||||
private String msg;
|
||||
}
|
||||
|
@ -13,7 +13,9 @@ public @interface DeLog {
|
||||
|
||||
String pid() default "";
|
||||
|
||||
LogST st();
|
||||
LogST st() default LogST.PANEL;
|
||||
|
||||
LogOT ot();
|
||||
|
||||
String stExp() default "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user