mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
报表模块mycat环境无法路由修复
This commit is contained in:
+5
-2
@@ -24,7 +24,10 @@ public interface ReportDatasetMapper extends BaseMapperX<ReportDatasetDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@OrganIgnore
|
@OrganIgnore
|
||||||
default List<ReportDatasetDO> selectNormalDatasetList(Set<Long> datasetIds) {
|
default List<ReportDatasetDO> selectNormalDatasetList(Set<Long> datasetIds, Long organId) {
|
||||||
return selectList(new LambdaQueryWrapperX<ReportDatasetDO>().in(ReportDatasetDO::getId, datasetIds));
|
return selectList(new LambdaQueryWrapperX<ReportDatasetDO>()
|
||||||
|
.eq(ReportDatasetDO::getOrganId, organId)
|
||||||
|
.in(ReportDatasetDO::getId, datasetIds)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-4
@@ -343,19 +343,21 @@ public class ReportTemplateServiceImpl implements ReportTemplateService {
|
|||||||
* @param reportDefinition 报表定义
|
* @param reportDefinition 报表定义
|
||||||
*/
|
*/
|
||||||
private void queryDatasource(ReportTemplateDO templateDO, ReportDefinition reportDefinition) {
|
private void queryDatasource(ReportTemplateDO templateDO, ReportDefinition reportDefinition) {
|
||||||
|
Long organId = SecurityFrameworkUtils.getUserOrganId();
|
||||||
|
|
||||||
Set<Long> datasourceIds = templateDO.getDatasourceIds();
|
Set<Long> datasourceIds = templateDO.getDatasourceIds();
|
||||||
Set<Long> datasetIds = templateDO.getDatasetIds();
|
Set<Long> datasetIds = templateDO.getDatasetIds();
|
||||||
List<ReportDatasourceDO> reportDatasourceDOS = new ArrayList<>();
|
List<ReportDatasourceDO> reportDatasourceDOS = new ArrayList<>();
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(datasourceIds)) {
|
if (CollUtil.isNotEmpty(datasourceIds)) {
|
||||||
// 查询模板下的数据源
|
// 查询模板下的数据源
|
||||||
reportDatasourceDOS = datasourceMapper.selectNormalDatasourceList(datasourceIds, SecurityFrameworkUtils.getUserOrganId());
|
reportDatasourceDOS = datasourceMapper.selectNormalDatasourceList(datasourceIds, organId);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ReportDatasetDO> reportDatasetDOS = new ArrayList<>();
|
List<ReportDatasetDO> reportDatasetDOS = new ArrayList<>();
|
||||||
if (CollUtil.isNotEmpty(datasetIds)) {
|
if (CollUtil.isNotEmpty(datasetIds)) {
|
||||||
// 查询模板下的数据集
|
// 查询模板下的数据集
|
||||||
reportDatasetDOS = datasetMapper.selectNormalDatasetList(datasetIds);
|
reportDatasetDOS = datasetMapper.selectNormalDatasetList(datasetIds, organId);
|
||||||
}
|
}
|
||||||
// 转换ureport对象后的数据源列表
|
// 转换ureport对象后的数据源列表
|
||||||
List<DatasourceDefinition> datasourceDefinitions = new ArrayList<>();
|
List<DatasourceDefinition> datasourceDefinitions = new ArrayList<>();
|
||||||
@@ -452,6 +454,8 @@ public class ReportTemplateServiceImpl implements ReportTemplateService {
|
|||||||
* @param reportDefinition 报表定义
|
* @param reportDefinition 报表定义
|
||||||
*/
|
*/
|
||||||
private void queryPreviewDatasource(Map<String, Object> query, ReportDefinition reportDefinition) {
|
private void queryPreviewDatasource(Map<String, Object> query, ReportDefinition reportDefinition) {
|
||||||
|
Long organId = SecurityFrameworkUtils.getUserOrganId();
|
||||||
|
|
||||||
Object datasetIdsObj = query.get(DATASETIDS_FIELD_NAME);
|
Object datasetIdsObj = query.get(DATASETIDS_FIELD_NAME);
|
||||||
Object datasourceIdsObj = query.get(DATASOURCEIDS_FIELD_NAME);
|
Object datasourceIdsObj = query.get(DATASOURCEIDS_FIELD_NAME);
|
||||||
|
|
||||||
@@ -465,13 +469,13 @@ public class ReportTemplateServiceImpl implements ReportTemplateService {
|
|||||||
if (ObjectUtil.isNotNull(datasourceIdsObj)) {
|
if (ObjectUtil.isNotNull(datasourceIdsObj)) {
|
||||||
List<Long> datasourceIds = (List) datasourceIdsObj;
|
List<Long> datasourceIds = (List) datasourceIdsObj;
|
||||||
// 查询模板下的数据源
|
// 查询模板下的数据源
|
||||||
reportDatasourceDOS = datasourceMapper.selectNormalDatasourceList(new HashSet<>(datasourceIds), SecurityFrameworkUtils.getUserOrganId());
|
reportDatasourceDOS = datasourceMapper.selectNormalDatasourceList(new HashSet<>(datasourceIds), organId);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ReportDatasetDO> reportDatasetDOS = new ArrayList<>();
|
List<ReportDatasetDO> reportDatasetDOS = new ArrayList<>();
|
||||||
if (CollUtil.isNotEmpty(datasetIds)) {
|
if (CollUtil.isNotEmpty(datasetIds)) {
|
||||||
// 查询模板下的数据集
|
// 查询模板下的数据集
|
||||||
reportDatasetDOS = datasetMapper.selectNormalDatasetList(new HashSet<>(datasetIds));
|
reportDatasetDOS = datasetMapper.selectNormalDatasetList(new HashSet<>(datasetIds), organId);
|
||||||
}
|
}
|
||||||
// 转换ureport对象后的数据源列表
|
// 转换ureport对象后的数据源列表
|
||||||
List<DatasourceDefinition> datasourceDefinitions = new ArrayList<>();
|
List<DatasourceDefinition> datasourceDefinitions = new ArrayList<>();
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@ public class TenantParamsUtils {
|
|||||||
// 内置数据集名称列表
|
// 内置数据集名称列表
|
||||||
List<String> buildinDsNames = new ArrayList<>();
|
List<String> buildinDsNames = new ArrayList<>();
|
||||||
// 遍历获取所有上级数据源
|
// 遍历获取所有上级数据源
|
||||||
List<ReportDatasetDO> reportDatasetDOS = datasetMapper.selectNormalDatasetList(datasetIds.stream().collect(Collectors.toSet()));
|
List<ReportDatasetDO> reportDatasetDOS = datasetMapper.selectNormalDatasetList(datasetIds.stream().collect(Collectors.toSet()), userOrganId);
|
||||||
for (ReportDatasetDO datasetDO : reportDatasetDOS) {
|
for (ReportDatasetDO datasetDO : reportDatasetDOS) {
|
||||||
Long datasourceId = datasetDO.getDatasourceId();
|
Long datasourceId = datasetDO.getDatasourceId();
|
||||||
// 查询数据源,如果是内置数据源则把数据集的name传给ureport
|
// 查询数据源,如果是内置数据源则把数据集的name传给ureport
|
||||||
|
|||||||
Reference in New Issue
Block a user