数据总览多维度合并展示
This commit is contained in:
13
.idea/compiler.xml
generated
13
.idea/compiler.xml
generated
@@ -14,11 +14,22 @@
|
||||
<module name="system" />
|
||||
<module name="task" />
|
||||
<module name="common" />
|
||||
<module name="data" />
|
||||
<module name="flowable" />
|
||||
<module name="approve" />
|
||||
<module name="project" />
|
||||
</profile>
|
||||
<profile name="Annotation profile for SDM" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<processorPath useClasspath="false">
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct-processor/1.5.2.Final/mapstruct-processor-1.5.2.Final.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/mapstruct/mapstruct/1.5.2.Final/mapstruct-1.5.2.Final.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar" />
|
||||
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok-mapstruct-binding/0.2.0/lombok-mapstruct-binding-0.2.0.jar" />
|
||||
</processorPath>
|
||||
<module name="data" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="gateway" target="17" />
|
||||
|
||||
@@ -43,15 +43,15 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
/**
|
||||
* 根据项目ID和节点类型获取所有节点信息
|
||||
*
|
||||
* @param uuid 项目ID
|
||||
* @param uuids 项目ID
|
||||
* @param nextNodeType 下一级节点类型
|
||||
* @return SdmResponse<AllNodeByProjectIdAndTypeResp> 节点信息
|
||||
*/
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(String uuid, String nextNodeType) {
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(List<String> uuids, String nextNodeType) {
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
|
||||
try {
|
||||
log.info("根据项目ID和节点类型获取所有节点信息请求参数:uuid={}, nextNodeType={}", uuid, nextNodeType);
|
||||
response = ISimulationNodeFeignClient.getAllNodeByProjectIdAndType(uuid, nextNodeType);
|
||||
log.info("根据项目ID和节点类型获取所有节点信息请求参数:uuid={}, nextNodeType={}", uuids, nextNodeType);
|
||||
response = ISimulationNodeFeignClient.getAllNodeByProjectIdAndType(uuids, nextNodeType);
|
||||
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
|
||||
return SdmResponse.failed("获取节点信息失败");
|
||||
}
|
||||
@@ -65,11 +65,11 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(String uuid) {
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(List<String> uuids) {
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
|
||||
try {
|
||||
log.info("获取节点下的task列表请求参数:uuid={}", uuid);
|
||||
response = ISimulationNodeFeignClient.getNodeTaskList(uuid);
|
||||
log.info("获取节点下的task列表请求参数:uuid={}", uuids);
|
||||
response = ISimulationNodeFeignClient.getNodeTaskList(uuids);
|
||||
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
|
||||
return SdmResponse.failed("获取节点下的task列表失败");
|
||||
}
|
||||
@@ -81,11 +81,11 @@ public class SimulationNodeFeignClientImpl implements ISimulationNodeFeignClient
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(String uuid) {
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(List<String> uuids) {
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response;
|
||||
try {
|
||||
log.info("获取task下的run请求参数:uuid={}", uuid);
|
||||
response = ISimulationNodeFeignClient.getTaskRunList(uuid);
|
||||
log.info("获取task下的run请求参数:uuid={}", uuids);
|
||||
response = ISimulationNodeFeignClient.getTaskRunList(uuids);
|
||||
if (!response.isSuccess() || response.getData() == null || response.getData().isEmpty()) {
|
||||
return SdmResponse.failed("获取task下的run失败");
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.project.SpdmNodeListReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -27,24 +26,24 @@ public interface ISimulationNodeFeignClient {
|
||||
/**
|
||||
* 根据项目ID和节点类型获取所有节点信息
|
||||
*
|
||||
* @param uuid 项目ID
|
||||
* @param uuids 项目ID
|
||||
* @param nextNodeType 下一级节点类型
|
||||
* @return SdmResponse<List<AllNodeByProjectIdAndTypeResp>> 节点信息
|
||||
*/
|
||||
@GetMapping("/node/getAllNodeByProjectIdAndType")
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(@RequestParam(value = "chooseNodeId") String uuid, @RequestParam(value = "nextNodeType") String nextNodeType);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(@RequestParam(value = "chooseNodeIds") List<String> uuids, @RequestParam(value = "nextNodeType") String nextNodeType);
|
||||
|
||||
/**
|
||||
* 获取节点下的task列表
|
||||
*/
|
||||
@GetMapping("/node/getNodeTaskList")
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(@RequestParam(value = "uuid") String uuid);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(@RequestParam(value = "uuids") List<String> uuids);
|
||||
|
||||
/**
|
||||
* 获取task下的run
|
||||
*/
|
||||
@GetMapping("/node/getNodeTaskRunList")
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(@RequestParam(value = "uuid") String uuid);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(@RequestParam(value = "uuids") List<String> uuids);
|
||||
|
||||
@PostMapping("node/delteNode")
|
||||
SdmResponse delteNode(@RequestBody DelNodeReq req);
|
||||
|
||||
27
data/pom.xml
27
data/pom.xml
@@ -16,6 +16,9 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spring-boot.version>3.3.5</spring-boot.version>
|
||||
<org.mapstruct.version>1.5.2.Final</org.mapstruct.version>
|
||||
<lombok.version>1.18.30</lombok.version>
|
||||
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- 引入模块common -->
|
||||
@@ -108,6 +111,13 @@
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MapStruct -->
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct</artifactId>
|
||||
<version>${org.mapstruct.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
@@ -134,6 +144,23 @@
|
||||
<compilerArgs>
|
||||
<arg>-parameters</arg>
|
||||
</compilerArgs>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${org.mapstruct.version}</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-mapstruct-binding</artifactId>
|
||||
<version>${lombok-mapstruct-binding.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.sdm.data.controller;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.data.model.dto.FileMetadataChildrenDTO;
|
||||
import com.sdm.data.model.entity.FileMetadataInfo;
|
||||
import com.sdm.data.model.req.*;
|
||||
import com.sdm.data.service.IDimensionTemplateService;
|
||||
@@ -40,7 +41,7 @@ public class DataOverviewController {
|
||||
*/
|
||||
@PostMapping("/getSimulationNodeTree")
|
||||
@Operation(summary = "根据数据显示维度展示左侧节点树")
|
||||
public SdmResponse<List<FileMetadataInfo>> getSimulationNodeTree(@RequestBody GetSimulationNodeTreeReq req) {
|
||||
public SdmResponse<List<FileMetadataChildrenDTO>> getSimulationNodeTree(@RequestBody GetSimulationNodeTreeReq req) {
|
||||
return dimensionTemplateService.getSimulationNodeTree(req);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.sdm.data.convert;
|
||||
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.data.model.dto.FileMetadataChildrenDTO;
|
||||
import com.sdm.data.model.entity.FileMetadataInfo;
|
||||
import jdk.jfr.Name;
|
||||
import org.mapstruct.*;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface FileMetadataConvert {
|
||||
|
||||
FileMetadataConvert INSTANCE = Mappers.getMapper(FileMetadataConvert.class);
|
||||
|
||||
@Named("baseResp")
|
||||
@Mappings({
|
||||
@Mapping(target = "fileUrl", ignore = true),
|
||||
@Mapping(target = "creatorName", ignore = true),
|
||||
@Mapping(target = "updaterName", ignore = true),
|
||||
@Mapping(target = "projectName", ignore = true),
|
||||
@Mapping(target = "analysisDirectionName", ignore = true),
|
||||
@Mapping(target = "poolInfos", ignore = true),
|
||||
@Mapping(target = "approvalStatus", ignore = true),
|
||||
@Mapping(target = "approveType", ignore = true),
|
||||
@Mapping(target = "tempMetadata", ignore = true),
|
||||
@Mapping(target = "cidFlowId", ignore = true),
|
||||
@Mapping(target = "uploadTaskId", ignore = true),
|
||||
@Mapping(target = "uploadStatus", ignore = true),
|
||||
@Mapping(target = "cidFlowReviewer", ignore = true),
|
||||
@Mapping(target = "tag1", ignore = true),
|
||||
@Mapping(target = "tag2", ignore = true),
|
||||
@Mapping(target = "tag3", ignore = true),
|
||||
@Mapping(target = "tag4", ignore = true),
|
||||
@Mapping(target = "tag5", ignore = true),
|
||||
@Mapping(target = "tag6", ignore = true),
|
||||
@Mapping(target = "tag7", ignore = true),
|
||||
@Mapping(target = "tag8", ignore = true),
|
||||
@Mapping(target = "tag9", ignore = true),
|
||||
@Mapping(target = "tag10", ignore = true)
|
||||
})
|
||||
FileMetadataInfoResp convertToFileMetadataInfoResp(FileMetadataInfo fileMetadataInfo);
|
||||
|
||||
@IterableMapping(qualifiedByName = "baseResp")
|
||||
List<FileMetadataInfoResp> convertToFileMetadataInfoRespList(List<FileMetadataInfo> fileMetadataInfoList);
|
||||
|
||||
@Named("childrenResp")
|
||||
@Mappings({
|
||||
@Mapping(target = "children", ignore = true),
|
||||
@Mapping(target = "totalName", ignore = true),
|
||||
@Mapping(target = "fileUrl", ignore = true),
|
||||
@Mapping(target = "creatorName", ignore = true),
|
||||
@Mapping(target = "updaterName", ignore = true),
|
||||
@Mapping(target = "projectName", ignore = true),
|
||||
@Mapping(target = "analysisDirectionName", ignore = true),
|
||||
@Mapping(target = "poolInfos", ignore = true),
|
||||
@Mapping(target = "approvalStatus", ignore = true),
|
||||
@Mapping(target = "approveType", ignore = true),
|
||||
@Mapping(target = "tempMetadata", ignore = true),
|
||||
@Mapping(target = "cidFlowId", ignore = true),
|
||||
@Mapping(target = "uploadTaskId", ignore = true),
|
||||
@Mapping(target = "uploadStatus", ignore = true),
|
||||
@Mapping(target = "cidFlowReviewer", ignore = true),
|
||||
@Mapping(target = "tag1", ignore = true),
|
||||
@Mapping(target = "tag2", ignore = true),
|
||||
@Mapping(target = "tag3", ignore = true),
|
||||
@Mapping(target = "tag4", ignore = true),
|
||||
@Mapping(target = "tag5", ignore = true),
|
||||
@Mapping(target = "tag6", ignore = true),
|
||||
@Mapping(target = "tag7", ignore = true),
|
||||
@Mapping(target = "tag8", ignore = true),
|
||||
@Mapping(target = "tag9", ignore = true),
|
||||
@Mapping(target = "tag10", ignore = true)
|
||||
})
|
||||
FileMetadataChildrenDTO convertToFileMetadataChildrenDTO(FileMetadataInfo fileMetadataInfo);
|
||||
}
|
||||
@@ -16,6 +16,6 @@ import java.util.List;
|
||||
*/
|
||||
public interface FileMetadataInfoMapper extends BaseMapper<FileMetadataInfo> {
|
||||
List<FileMetadataInfo> listSimulationNodeDir(@Param("dirIds") List<Long> dirIds, @Param("filterEmptyData") boolean filterEmptyData, @Param("tenantId") Long tenantId);
|
||||
List<FileMetadataInfo> listSimulationNodeFiles(@Param("parentId") Long parentId,@Param("fileIds") List<Long> fileIds, @Param("filterEmptyData") boolean isFilterEmptyData,@Param("tenantId") Long tenantId);
|
||||
List<FileMetadataInfo> listSimulationNodeFiles(@Param("parentIds") List<Long> parentIds, @Param("fileIds") List<Long> fileIds, @Param("filterEmptyData") boolean isFilterEmptyData, @Param("tenantId") Long tenantId);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.sdm.data.model.dto;
|
||||
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "带有子节点的文件元数据信息DTO")
|
||||
public class FileMetadataChildrenDTO extends FileMetadataInfoResp {
|
||||
|
||||
@Schema(description = "子节点列表")
|
||||
private List<FileMetadataInfoResp> children;
|
||||
|
||||
@Schema(description = "总名称(去除projectNode/前缀的bucketName)")
|
||||
private String totalName;
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class GetSimulationNodeTreeReq {
|
||||
/**
|
||||
@@ -14,7 +16,7 @@ public class GetSimulationNodeTreeReq {
|
||||
private Long dimensionTemplateId;
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
* 聚合文件ID列表
|
||||
*/
|
||||
private Long fileId;
|
||||
private List<Long> fileIds;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ListSimulationNodeTreeReq extends BaseReq {
|
||||
/**
|
||||
@@ -15,11 +17,16 @@ public class ListSimulationNodeTreeReq extends BaseReq {
|
||||
Long dimensionTemplateId;
|
||||
|
||||
/**
|
||||
* 文件夹ID
|
||||
* 文件夹ID 只用来控制根目录
|
||||
*/
|
||||
@Schema(description = "文件夹ID")
|
||||
Long fileId;
|
||||
|
||||
/**
|
||||
* 聚合文件ID列表
|
||||
*/
|
||||
private List<Long> fileIds;
|
||||
|
||||
/**
|
||||
* 是否过滤空数据
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.sdm.data.service;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.req.data.CreateDirReq;
|
||||
import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.data.model.dto.FileMetadataChildrenDTO;
|
||||
import com.sdm.data.model.entity.DimensionTemplate;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sdm.data.model.entity.FileMetadataInfo;
|
||||
@@ -30,7 +31,7 @@ public interface IDimensionTemplateService extends IService<DimensionTemplate> {
|
||||
|
||||
SdmResponse deleteTemplateWithHierarchies(Long id);
|
||||
|
||||
SdmResponse<List<FileMetadataInfo>> getSimulationNodeTree(GetSimulationNodeTreeReq req);
|
||||
SdmResponse<List<FileMetadataChildrenDTO>> getSimulationNodeTree(GetSimulationNodeTreeReq req);
|
||||
|
||||
/**
|
||||
* 根据数据显示维度展示左侧节点树
|
||||
|
||||
@@ -19,5 +19,5 @@ public interface IFileMetadataInfoService extends IService<FileMetadataInfo> {
|
||||
* @return
|
||||
*/
|
||||
List<FileMetadataInfo> listSimulationNodeDir(List<Long> dirIds,boolean filterEmptyData,Long tenantId);
|
||||
List<FileMetadataInfo> listSimulationNodeFiles(Long parentId, List<Long> fileIds, boolean isFilterEmptyData,Long tenantId);
|
||||
List<FileMetadataInfo> listSimulationNodeFiles(List<Long> parentIds, List<Long> fileIds, boolean isFilterEmptyData, Long tenantId);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class DataStorageAnalysisImpl implements DataStorageAnalysis {
|
||||
IFileStorageQuotaService fileStorageQuotaService;
|
||||
|
||||
public SdmResponse<List<JSONObject>> getNodeSizeByNodeType(String queryNodeType, String uuid, Integer intervalMonths, String targetYm) {
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response = simuluationNodeFeignClient.getAllNodeByProjectIdAndType(uuid, queryNodeType);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> response = simuluationNodeFeignClient.getAllNodeByProjectIdAndType(List.of(uuid), queryNodeType);
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
if (!response.isSuccess()) {
|
||||
log.error("获取节点信息失败");
|
||||
|
||||
@@ -16,11 +16,14 @@ import com.sdm.common.entity.req.data.UploadFilesReq;
|
||||
import com.sdm.common.entity.req.project.DelNodeReq;
|
||||
import com.sdm.common.entity.req.system.UserQueryReq;
|
||||
import com.sdm.common.entity.resp.AllNodeByProjectIdAndTypeResp;
|
||||
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
|
||||
import com.sdm.common.entity.resp.system.CIDUserResp;
|
||||
import com.sdm.common.feign.impl.project.SimulationNodeFeignClientImpl;
|
||||
import com.sdm.common.feign.impl.system.SysUserFeignClientImpl;
|
||||
import com.sdm.common.utils.CidSysUserUtil;
|
||||
import com.sdm.common.utils.PageUtils;
|
||||
import com.sdm.data.convert.FileMetadataConvert;
|
||||
import com.sdm.data.model.dto.FileMetadataChildrenDTO;
|
||||
import com.sdm.data.model.entity.DimensionTemplate;
|
||||
import com.sdm.data.dao.DimensionTemplateMapper;
|
||||
import com.sdm.data.model.entity.DimensionTemplateHierarchy;
|
||||
@@ -38,14 +41,12 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -179,7 +180,7 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<FileMetadataInfo>> getSimulationNodeTree(GetSimulationNodeTreeReq req) {
|
||||
public SdmResponse<List<FileMetadataChildrenDTO>> getSimulationNodeTree(GetSimulationNodeTreeReq req) {
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
// 根据展示维度获取展示节点类型顺序
|
||||
Long dimensionTemplateId = req.getDimensionTemplateId();
|
||||
@@ -189,26 +190,26 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
|
||||
List<String> uuids = new ArrayList<>();
|
||||
List<FileMetadataInfo> resultDir = new ArrayList<>();
|
||||
if (ObjectUtils.isEmpty(req.getFileId())) {
|
||||
if (ObjectUtils.isEmpty(req.getFileIds())) {
|
||||
// 选中维度了,没有选节点,按照模版,展示模版的第一层节点数据
|
||||
String rootNodeType = dimensionNodeTyepOrderList.get(0);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> allNodeByNodeTypeResponse = simuluationNodeFeignClient.getAllNodeByNodeType(null, rootNodeType);
|
||||
|
||||
if (!allNodeByNodeTypeResponse.isSuccess()) {
|
||||
log.error("获取节点信息失败");
|
||||
return SdmResponse.success();
|
||||
return SdmResponse.success(Collections.emptyList());
|
||||
}
|
||||
|
||||
uuids.addAll(allNodeByNodeTypeResponse.getData().stream().map(AllNodeByProjectIdAndTypeResp::getUuid).toList());
|
||||
} else {
|
||||
// 选中维度了,也选中了节点,按照模版,展示该节点下的普通文件夹、任务、算列、按照展示模版指定的下一层节点文件夹
|
||||
Long fileId = req.getFileId();
|
||||
List<Long> fileIds = req.getFileIds();
|
||||
|
||||
// 1、先获取普通文件夹
|
||||
List<FileMetadataInfo> dirInfos = fileMetadataInfoService
|
||||
.lambdaQuery()
|
||||
.eq(FileMetadataInfo::getTenantId, tenantId)
|
||||
.eq(FileMetadataInfo::getParentId, fileId)
|
||||
.in(FileMetadataInfo::getParentId, fileIds)
|
||||
.eq(FileMetadataInfo::getDataType, DataTypeEnum.DIRECTORY.getValue())
|
||||
.isNull(FileMetadataInfo::getRelatedResourceUuid)
|
||||
.list();
|
||||
@@ -216,46 +217,48 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
resultDir.addAll(dirInfos);
|
||||
|
||||
// 2、再获取节点文件夹
|
||||
FileMetadataInfo nodeDirInfo = fileMetadataInfoService.getById(fileId);
|
||||
String chooseUuid = nodeDirInfo.getRelatedResourceUuid();
|
||||
String chooseNodeType = nodeDirInfo.getRelatedResourceUuidOwnType();
|
||||
List<FileMetadataInfo> nodeDirInfos = fileMetadataInfoService.lambdaQuery().in(FileMetadataInfo::getId, fileIds).list();
|
||||
if(CollectionUtils.isNotEmpty(nodeDirInfos)) {
|
||||
String chooseNodeType = nodeDirInfos.get(0).getRelatedResourceUuidOwnType();
|
||||
List<String> chooseUuids = nodeDirInfos.stream().map(FileMetadataInfo::getRelatedResourceUuid).toList();
|
||||
|
||||
// chooseUuid和chooseNodeType不为空,并且是node节点类型,才是节点文件夹,才需要查询子节点文件夹文件
|
||||
if (ObjectUtils.isNotEmpty(chooseUuid) && ObjectUtils.isNotEmpty(chooseNodeType) && NodeTypeEnum.isNodeType(chooseNodeType)) {
|
||||
// 从dimensionNodeTyepOrderList中获取chooseNodeType下一个位置的数据,有可能chooseNodeType所在位置就是最后一层节点,SdmResponse返回空数据
|
||||
int index = dimensionNodeTyepOrderList.indexOf(chooseNodeType);
|
||||
if (index == -1) {
|
||||
return SdmResponse.failed("选中节点类型不在数据展示维度中");
|
||||
}
|
||||
|
||||
// 判断是否是最后一层节点,如果是最后一层节点,则不需要查询子节点文件
|
||||
if (index != dimensionNodeTyepOrderList.size() - 1) {
|
||||
// 获取dimensionNodeTyepOrderList的index+1位置的节点类型
|
||||
String nextNodeType = dimensionNodeTyepOrderList.get(index + 1);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> allNodeByProjectIdAndType = simuluationNodeFeignClient.getAllNodeByProjectIdAndType(chooseUuid, nextNodeType);
|
||||
if (allNodeByProjectIdAndType.isSuccess() && ObjectUtils.isNotEmpty(allNodeByProjectIdAndType.getData())) {
|
||||
uuids.addAll(allNodeByProjectIdAndType.getData().stream().map(AllNodeByProjectIdAndTypeResp::getUuid).toList());
|
||||
// chooseUuid和chooseNodeType不为空,并且是node节点类型,才是节点文件夹,才需要查询子节点文件夹文件
|
||||
if (ObjectUtils.isNotEmpty(chooseUuids) && ObjectUtils.isNotEmpty(chooseNodeType) && NodeTypeEnum.isNodeType(chooseNodeType)) {
|
||||
// 从dimensionNodeTyepOrderList中获取chooseNodeType下一个位置的数据,有可能chooseNodeType所在位置就是最后一层节点,SdmResponse返回空数据
|
||||
int index = dimensionNodeTyepOrderList.indexOf(chooseNodeType);
|
||||
if (index == -1) {
|
||||
return SdmResponse.failed("选中节点类型不在数据展示维度中");
|
||||
}
|
||||
|
||||
// 判断是否是最后一层节点,如果是最后一层节点,则不需要查询子节点文件
|
||||
if (index != dimensionNodeTyepOrderList.size() - 1) {
|
||||
// 获取dimensionNodeTyepOrderList的index+1位置的节点类型
|
||||
String nextNodeType = dimensionNodeTyepOrderList.get(index + 1);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> allNodeByProjectIdAndType = simuluationNodeFeignClient.getAllNodeByProjectIdAndType(chooseUuids, nextNodeType);
|
||||
if (allNodeByProjectIdAndType.isSuccess() && ObjectUtils.isNotEmpty(allNodeByProjectIdAndType.getData())) {
|
||||
uuids.addAll(allNodeByProjectIdAndType.getData().stream().map(AllNodeByProjectIdAndTypeResp::getUuid).toList());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3、获取当前节点下的任务、算列
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> nodeTaskList = simuluationNodeFeignClient.getNodeTaskList(chooseUuid);
|
||||
if (nodeTaskList.isSuccess()) {
|
||||
uuids.addAll(nodeTaskList.getData().stream().map(AllNodeByProjectIdAndTypeResp::getUuid).toList());
|
||||
log.info("获取节点下task的uudis:{}", uuids);
|
||||
}
|
||||
// 3、获取当前节点下的任务、算列
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> nodeTaskList = simuluationNodeFeignClient.getNodeTaskList(chooseUuids);
|
||||
if (nodeTaskList.isSuccess()) {
|
||||
uuids.addAll(nodeTaskList.getData().stream().map(AllNodeByProjectIdAndTypeResp::getUuid).toList());
|
||||
log.info("获取节点下task的uudis:{}", uuids);
|
||||
}
|
||||
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> taskRunList = simuluationNodeFeignClient.getTaskRunList(chooseUuid);
|
||||
if (taskRunList.isSuccess()) {
|
||||
uuids.addAll(taskRunList.getData().stream().map(AllNodeByProjectIdAndTypeResp::getUuid).toList());
|
||||
log.info("获取节点下taskRun的uudis:{}", uuids);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> taskRunList = simuluationNodeFeignClient.getTaskRunList(chooseUuids);
|
||||
if (taskRunList.isSuccess()) {
|
||||
uuids.addAll(taskRunList.getData().stream().map(AllNodeByProjectIdAndTypeResp::getUuid).toList());
|
||||
log.info("获取节点下taskRun的uudis:{}", uuids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(uuids)) {
|
||||
return SdmResponse.success(resultDir);
|
||||
return SdmResponse.success(Collections.emptyList());
|
||||
}
|
||||
|
||||
List<FileMetadataInfo> nodeDirInfos = fileMetadataInfoService.lambdaQuery()
|
||||
@@ -263,9 +266,58 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
.eq(FileMetadataInfo::getTenantId, tenantId)
|
||||
.orderByDesc(FileMetadataInfo::getCreateTime).list();
|
||||
resultDir.addAll(nodeDirInfos);
|
||||
return SdmResponse.success(resultDir);
|
||||
|
||||
// 对nodeDirInfos按照originalName进行合并,并处理bucketName生成totalName
|
||||
List<FileMetadataChildrenDTO> mergedResult = mergeNodeDirInfos(resultDir);
|
||||
return SdmResponse.success(mergedResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据originalName合并FileMetadataInfo列表,并处理bucketName生成totalName
|
||||
* @param nodeDirInfos 需要合并的FileMetadataInfo列表
|
||||
* @return 合并后的结果
|
||||
*/
|
||||
private List<FileMetadataChildrenDTO> mergeNodeDirInfos(List<FileMetadataInfo> nodeDirInfos) {
|
||||
// 按originalName分组
|
||||
Map<String, List<FileMetadataInfo>> groupedByOriginalName = nodeDirInfos.stream()
|
||||
.collect(Collectors.groupingBy(FileMetadataInfo::getOriginalName));
|
||||
|
||||
List<FileMetadataChildrenDTO> result = new ArrayList<>();
|
||||
|
||||
// 对每组进行处理
|
||||
for (Map.Entry<String, List<FileMetadataInfo>> entry : groupedByOriginalName.entrySet()) {
|
||||
List<FileMetadataInfo> group = entry.getValue();
|
||||
|
||||
if (!group.isEmpty()) {
|
||||
// 使用第一个作为基础对象
|
||||
FileMetadataInfo baseInfo = group.get(0);
|
||||
|
||||
// 创建包含children的DTO对象
|
||||
FileMetadataChildrenDTO dto = FileMetadataConvert.INSTANCE.convertToFileMetadataChildrenDTO(baseInfo);
|
||||
|
||||
// 转换children列表,并为每个child设置totalName
|
||||
List<FileMetadataInfoResp> children = new ArrayList<>();
|
||||
for (FileMetadataInfo fileInfo : group) {
|
||||
FileMetadataChildrenDTO childDto = FileMetadataConvert.INSTANCE.convertToFileMetadataChildrenDTO(fileInfo);
|
||||
|
||||
// 设置totalName(从bucketName中提取)
|
||||
String objectKey = fileInfo.getObjectKey();
|
||||
String baseDirPath = DirTypeEnum.PROJECT_NODE_DIR.getDirName() + "/";
|
||||
if (objectKey != null && objectKey.startsWith(baseDirPath)) {
|
||||
String totalName = objectKey.substring(baseDirPath.length());
|
||||
childDto.setTotalName(totalName);
|
||||
}
|
||||
|
||||
children.add(childDto);
|
||||
}
|
||||
|
||||
dto.setChildren(children);
|
||||
result.add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public SdmResponse listSimulationNodeFiles(ListSimulationNodeTreeReq req) {
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
@@ -274,7 +326,7 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
// 2、再查询原本的普通文件夹信息,需要isProjectDimension=true 只查询普通文件夹,不查询节点文件夹,union all 查询node的fileId 后 分页查询
|
||||
Long parentDirId;
|
||||
List<Long> dirInfos = null;
|
||||
if(ObjectUtils.isEmpty(req.getFileId())){
|
||||
if(ObjectUtils.isEmpty(req.getFileId()) && ObjectUtils.isEmpty(req.getFileIds())){
|
||||
// 第一次进入数据总览页面,右侧不展示文件和文件夹
|
||||
return SdmResponse.success();
|
||||
}
|
||||
@@ -283,10 +335,10 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
// 和前端规定 0=触发根目录按钮,相当于获取左侧文件树的根节点文件夹
|
||||
GetSimulationNodeTreeReq getSimulationNodeTreeReq = new GetSimulationNodeTreeReq();
|
||||
getSimulationNodeTreeReq.setDimensionTemplateId(req.getDimensionTemplateId());
|
||||
getSimulationNodeTreeReq.setFileId(null);
|
||||
SdmResponse<List<FileMetadataInfo>> nodeDirInfos = getSimulationNodeTree(getSimulationNodeTreeReq);
|
||||
getSimulationNodeTreeReq.setFileIds(null);
|
||||
SdmResponse<List<FileMetadataChildrenDTO>> nodeDirInfos = getSimulationNodeTree(getSimulationNodeTreeReq);
|
||||
if (nodeDirInfos.isSuccess() && ObjectUtils.isNotEmpty(nodeDirInfos.getData())) {
|
||||
dirInfos = nodeDirInfos.getData().stream().map(FileMetadataInfo::getId).toList();
|
||||
dirInfos = nodeDirInfos.getData().stream().flatMap(fileMetadataChildrenDTO -> fileMetadataChildrenDTO.getChildren().stream()).map(FileMetadataInfoResp::getId).toList();
|
||||
}
|
||||
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
@@ -297,24 +349,18 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
}
|
||||
|
||||
//fileId 不为空也不为0,是右侧点击进入文件夹下一层级查询
|
||||
parentDirId = req.getFileId();
|
||||
Optional<FileMetadataInfo> parentDirInfo = fileMetadataInfoService.lambdaQuery().eq(FileMetadataInfo::getId, parentDirId).eq(FileMetadataInfo::getTenantId, tenantId).oneOpt();
|
||||
if (!parentDirInfo.isPresent()) {
|
||||
return SdmResponse.failed("父文件夹不存在");
|
||||
}
|
||||
|
||||
// relatedResourceUuid和relatedResourceUuidOwnType不为空才是节点文件夹,才需要查询子节点文件夹文件
|
||||
GetSimulationNodeTreeReq getSimulationNodeTreeReq = new GetSimulationNodeTreeReq();
|
||||
getSimulationNodeTreeReq.setDimensionTemplateId(req.getDimensionTemplateId());
|
||||
getSimulationNodeTreeReq.setFileId(parentDirId);
|
||||
SdmResponse<List<FileMetadataInfo>> nodeDirInfos = getSimulationNodeTree(getSimulationNodeTreeReq);
|
||||
getSimulationNodeTreeReq.setFileIds(req.getFileIds());
|
||||
SdmResponse<List<FileMetadataChildrenDTO>> nodeDirInfos = getSimulationNodeTree(getSimulationNodeTreeReq);
|
||||
if (nodeDirInfos.isSuccess() && ObjectUtils.isNotEmpty(nodeDirInfos.getData())) {
|
||||
dirInfos = nodeDirInfos.getData().stream().map(FileMetadataInfo::getId).toList();
|
||||
dirInfos = nodeDirInfos.getData().stream().flatMap(fileMetadataChildrenDTO -> fileMetadataChildrenDTO.getChildren().stream()).map(FileMetadataInfoResp::getId).toList();
|
||||
}
|
||||
|
||||
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
List<FileMetadataInfo> fileMetadataInfos = fileMetadataInfoService.listSimulationNodeFiles(parentDirId, dirInfos,req.isFilterEmptyData(),tenantId);
|
||||
List<FileMetadataInfo> fileMetadataInfos = fileMetadataInfoService.listSimulationNodeFiles(req.getFileIds(), dirInfos,req.isFilterEmptyData(),tenantId);
|
||||
setCreatorNames(fileMetadataInfos);
|
||||
|
||||
PageInfo<FileMetadataInfo> page = new PageInfo<>(fileMetadataInfos);
|
||||
|
||||
@@ -24,7 +24,7 @@ public class FileMetadataInfoServiceImpl extends ServiceImpl<FileMetadataInfoMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FileMetadataInfo> listSimulationNodeFiles(Long parentId, List<Long> fileIds, boolean isFilterEmptyData,Long tenantId) {
|
||||
return this.baseMapper.listSimulationNodeFiles(parentId, fileIds, isFilterEmptyData,tenantId);
|
||||
public List<FileMetadataInfo> listSimulationNodeFiles(List<Long> parentIds, List<Long> fileIds, boolean isFilterEmptyData, Long tenantId) {
|
||||
return this.baseMapper.listSimulationNodeFiles(parentIds, fileIds, isFilterEmptyData,tenantId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,11 @@
|
||||
<!-- 第一个子查询文件(必执行) -->
|
||||
SELECT distinct file_metadata_info.*
|
||||
FROM file_metadata_info
|
||||
WHERE parentId = #{parentId}
|
||||
WHERE parentId IN (
|
||||
<foreach collection="parentIds" item="parentId" separator=",">
|
||||
#{parentId}
|
||||
</foreach>
|
||||
)
|
||||
and tenantId = #{tenantId}
|
||||
AND dataType = 2
|
||||
AND isLatest = true
|
||||
|
||||
@@ -144,14 +144,14 @@ public class SimulationNodeController implements ISimulationNodeFeignClient {
|
||||
/**
|
||||
* 根据项目ID和节点类型获取所有节点信息
|
||||
*
|
||||
* @param uuid 项目ID
|
||||
* @param uuids 项目ID
|
||||
* @param nextNodeType 下一级节点类型
|
||||
* @return SdmResponse<List<AllNodeByProjectIdAndTypeResp>> 节点信息
|
||||
*/
|
||||
@GetMapping("/getAllNodeByProjectIdAndType")
|
||||
@Operation(summary = "根据项目ID和节点类型获取所有节点信息", description = "根据项目ID和节点类型获取所有节点信息")
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(@RequestParam(value = "chooseNodeId") String uuid, @RequestParam(value = "nextNodeType") String nextNodeType) {
|
||||
return nodeService.getAllNodeByProjectIdAndType(uuid, nextNodeType);
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(@RequestParam(value = "chooseNodeIds") List<String> uuids, @RequestParam(value = "nextNodeType") String nextNodeType) {
|
||||
return nodeService.getAllNodeByProjectIdAndType(uuids, nextNodeType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,8 +159,8 @@ public class SimulationNodeController implements ISimulationNodeFeignClient {
|
||||
*/
|
||||
@GetMapping("/getNodeTaskList")
|
||||
@Operation(summary = "获取节点下的task列表", description = "获取节点下的task列表")
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(@RequestParam(value = "uuid") String uuid) {
|
||||
return nodeService.getNodeTaskList(uuid);
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(@RequestParam(value = "uuids") List<String> uuids) {
|
||||
return nodeService.getNodeTaskList(uuids);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,8 +168,8 @@ public class SimulationNodeController implements ISimulationNodeFeignClient {
|
||||
*/
|
||||
@GetMapping("/getNodeTaskRunList")
|
||||
@Operation(summary = "获取task下的run", description = "获取task下的run")
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(@RequestParam(value = "uuid") String uuid) {
|
||||
return nodeService.getTaskRunList(uuid);
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(@RequestParam(value = "uuids") List<String> uuids) {
|
||||
return nodeService.getTaskRunList(uuids);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,11 +12,9 @@ import com.sdm.common.entity.resp.project.SimulationNodeResp;
|
||||
import com.sdm.project.model.entity.SimulationNode;
|
||||
import com.sdm.project.model.req.*;
|
||||
import com.sdm.project.model.req.YA.SyncCidProjectReq;
|
||||
import com.sdm.project.model.resp.YA.BosimSaveNodeInfoRsp;
|
||||
import com.sdm.project.model.resp.YA.BosimSaveProjectTaskRsp;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -39,11 +37,11 @@ public interface INodeService extends IService<SimulationNode> {
|
||||
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByBodeType(String nodeType, Long nodeId);
|
||||
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(String uuid, String nextNodeType);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(List<String> uuids, String nextNodeType);
|
||||
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(String uuid);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(List<String> uuids);
|
||||
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(String uuid);
|
||||
SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(List<String> uuids);
|
||||
|
||||
SdmResponse getUserGroupProjectStatistics(Long userGroupId, Long userId);
|
||||
|
||||
|
||||
@@ -819,7 +819,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(String uuid, String nextNodeType) {
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getAllNodeByProjectIdAndType(List<String> uuids, String nextNodeType) {
|
||||
SdmResponse<List<DataDictionary>> tagMapList = sysConfigFeignClient.getDictionaryData(TagConstant.DICTIONARY_TAG_KEY);
|
||||
if (!tagMapList.isSuccess() || ObjectUtils.isEmpty(tagMapList.getData())) {
|
||||
log.error("字典信息查询失败");
|
||||
@@ -828,7 +828,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
// project-->tag1 phase-->tag2
|
||||
Map<String, String> TagMap = tagMapList.getData().stream().collect(Collectors.toMap(DataDictionary::getDictValue, DataDictionary::getDictName));
|
||||
|
||||
Optional<SimulationNode> simulationNodeOptional = this.lambdaQuery().eq(SimulationNode::getUuid, uuid).oneOpt();
|
||||
Optional<SimulationNode> simulationNodeOptional = this.lambdaQuery().in(SimulationNode::getUuid, uuids).list().stream().findFirst();
|
||||
if (!simulationNodeOptional.isPresent()) {
|
||||
return SdmResponse.failed("未找到节点");
|
||||
}
|
||||
@@ -838,16 +838,16 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
String currentNodeTag = TagMap.get(currentNodeType);
|
||||
|
||||
List<SimulationNode> simulationNodeList = this.lambdaQuery()
|
||||
.eq(TagConstant.TAG1.equals(currentNodeTag), SimulationNode::getTag1, uuid)
|
||||
.eq(TagConstant.TAG2.equals(currentNodeTag), SimulationNode::getTag2, uuid)
|
||||
.eq(TagConstant.TAG3.equals(currentNodeTag), SimulationNode::getTag3, uuid)
|
||||
.eq(TagConstant.TAG4.equals(currentNodeTag), SimulationNode::getTag4, uuid)
|
||||
.eq(TagConstant.TAG5.equals(currentNodeTag), SimulationNode::getTag5, uuid)
|
||||
.eq(TagConstant.TAG6.equals(currentNodeTag), SimulationNode::getTag6, uuid)
|
||||
.eq(TagConstant.TAG7.equals(currentNodeTag), SimulationNode::getTag7, uuid)
|
||||
.eq(TagConstant.TAG8.equals(currentNodeTag), SimulationNode::getTag8, uuid)
|
||||
.eq(TagConstant.TAG9.equals(currentNodeTag), SimulationNode::getTag9, uuid)
|
||||
.eq(TagConstant.TAG10.equals(currentNodeTag), SimulationNode::getTag10, uuid)
|
||||
.in(TagConstant.TAG1.equals(currentNodeTag), SimulationNode::getTag1, uuids)
|
||||
.in(TagConstant.TAG2.equals(currentNodeTag), SimulationNode::getTag2, uuids)
|
||||
.in(TagConstant.TAG3.equals(currentNodeTag), SimulationNode::getTag3, uuids)
|
||||
.in(TagConstant.TAG4.equals(currentNodeTag), SimulationNode::getTag4, uuids)
|
||||
.in(TagConstant.TAG5.equals(currentNodeTag), SimulationNode::getTag5, uuids)
|
||||
.in(TagConstant.TAG6.equals(currentNodeTag), SimulationNode::getTag6, uuids)
|
||||
.in(TagConstant.TAG7.equals(currentNodeTag), SimulationNode::getTag7, uuids)
|
||||
.in(TagConstant.TAG8.equals(currentNodeTag), SimulationNode::getTag8, uuids)
|
||||
.in(TagConstant.TAG9.equals(currentNodeTag), SimulationNode::getTag9, uuids)
|
||||
.in(TagConstant.TAG10.equals(currentNodeTag), SimulationNode::getTag10, uuids)
|
||||
.eq(SimulationNode::getNodeType, nextNodeType)
|
||||
.list();
|
||||
|
||||
@@ -866,11 +866,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(String uuid) {
|
||||
if(ObjectUtils.isEmpty(uuid)){
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getNodeTaskList(List<String> uuids) {
|
||||
if(CollectionUtils.isEmpty(uuids)){
|
||||
return SdmResponse.success();
|
||||
}
|
||||
List<SimulationTask> simulationTasks = simulationTaskService.lambdaQuery().eq(SimulationTask::getNodeId, uuid).list();
|
||||
List<SimulationTask> simulationTasks = simulationTaskService.lambdaQuery().in(SimulationTask::getNodeId, uuids).list();
|
||||
if(CollectionUtils.isEmpty(simulationTasks)){
|
||||
return SdmResponse.success();
|
||||
}
|
||||
@@ -888,11 +888,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
||||
}
|
||||
|
||||
@Override
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(String uuid) {
|
||||
if(ObjectUtils.isEmpty(uuid)){
|
||||
public SdmResponse<List<AllNodeByProjectIdAndTypeResp>> getTaskRunList(List<String> uuids) {
|
||||
if(ObjectUtils.isEmpty(uuids)){
|
||||
return SdmResponse.success();
|
||||
}
|
||||
List<SimulationRun> simulationRunList = simulationRunService.lambdaQuery().eq(SimulationRun::getTaskId, uuid).list();
|
||||
List<SimulationRun> simulationRunList = simulationRunService.lambdaQuery().eq(SimulationRun::getTaskId, uuids).list();
|
||||
if(CollectionUtils.isEmpty(simulationRunList)){
|
||||
return SdmResponse.success();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user