This commit is contained in:
2026-02-03 20:29:53 +08:00
3 changed files with 58 additions and 27 deletions

View File

@@ -0,0 +1,34 @@
/*
Navicat Premium Dump SQL
Source Server : 基线版本
Source Server Type : MySQL
Source Server Version : 80043 (8.0.43)
Source Host : 192.168.65.161:3306
Source Schema : spdm_baseline
Target Server Type : MySQL
Target Server Version : 80043 (8.0.43)
File Encoding : 65001
Date: 03/02/2026 18:51:57
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for system_param_config
-- ----------------------------
DROP TABLE IF EXISTS `system_param_config`;
CREATE TABLE `system_param_config` (
`id` bigint NOT NULL AUTO_INCREMENT,
`paramName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '系统参数名称',
`paramValue` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '系统参数值',
`tenantId` bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
`creator` bigint NOT NULL DEFAULT 0 COMMENT '创建者',
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 116 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -1934,12 +1934,19 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
return SdmResponse.success();
}
/**
* 收集目录ID列表包含当前目录和所有祖先目录
* @param dirId 当前目录ID
* @return 目录ID列表当前目录 + 父目录 + ... + 根目录)
*/
private List<Long> collectAncestorDirIds(Long dirId) {
Long parentDirId = dirId;
List<Long> ancestorDirIds = new ArrayList<>();
while (parentDirId != null) {
ancestorDirIds.add(parentDirId);
parentDirId = fileMetadataInfoService.lambdaQuery().eq(FileMetadataInfo::getId, parentDirId).oneOpt()
parentDirId = fileMetadataInfoService.lambdaQuery()
.eq(FileMetadataInfo::getId, parentDirId)
.oneOpt()
.map(FileMetadataInfo::getParentId)
.orElse(null);
}
@@ -1980,6 +1987,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
Long tenantId = ThreadLocalContext.getTenantId();
Long creatorId = ThreadLocalContext.getUserId();
long fileSize = resolveFileSize(req);
Long currentDirId = dirMetadataInfo.getId();
// 从缓存获取字典标签ID已由AOP切面自动填充
Map<String, Map<String, Integer>> dictIdMap = req.getDictTagIdsCache();
@@ -1993,8 +2001,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
}
}
List<FileTagRel> directRelList = new ArrayList<>();
List<FileTagRel> derivedRelList = new ArrayList<>();
List<FileTagRel> allTagRelList = new ArrayList<>();
// 遍历查询结果,构造文件标签关系
for (Map.Entry<String, Map<String, Integer>> classEntry : dictIdMap.entrySet()) {
@@ -2006,35 +2013,23 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
continue;
}
// 创建当前目录的直接关联
FileTagRel directRel = new FileTagRel();
directRel.setFileId(fileInfo.getId());
directRel.setTagId(dictId);
directRel.setDirId(dirMetadataInfo.getId());
directRel.setTenantId(tenantId);
directRel.setCreatorId(creatorId);
directRel.setFileSize(fileSize);
directRelList.add(directRel);
// 创建祖先目录的派生关联
// 为所有目录(当前目录 + 祖先目录)创建标签关系
for (Long dirIdItem : ancestorDirIds) {
FileTagRel derivedRel = new FileTagRel();
derivedRel.setFileId(fileInfo.getId());
derivedRel.setTagId(dictId);
derivedRel.setDirId(dirIdItem);
derivedRel.setTenantId(tenantId);
derivedRel.setCreatorId(creatorId);
derivedRel.setFileSize(fileSize);
derivedRelList.add(derivedRel);
FileTagRel tagRel = new FileTagRel();
tagRel.setFileId(fileInfo.getId());
tagRel.setTagId(dictId);
tagRel.setDirId(dirIdItem);
tagRel.setTenantId(tenantId);
tagRel.setCreatorId(creatorId);
tagRel.setFileSize(fileSize);
allTagRelList.add(tagRel);
}
}
}
if (CollectionUtils.isNotEmpty(directRelList)) {
fileTagRelService.saveBatch(directRelList);
}
if (CollectionUtils.isNotEmpty(derivedRelList)) {
fileTagRelService.saveBatch(derivedRelList);
// 一次性批量插入所有标签关系
if (CollectionUtils.isNotEmpty(allTagRelList)) {
fileTagRelService.saveBatch(allTagRelList);
}
}

View File

@@ -32,6 +32,8 @@ public class TaskPoolItem extends NodeBase{
public List<TaskPoolPerformance> performances = new ArrayList<>();
public List<TaskPoolPerformance> children = new ArrayList<>();
public void addTaskExtra(TaskPoolItemExtra extra)
{
extras.add(extra);