This commit is contained in:
2026-04-15 16:00:35 +08:00
16 changed files with 386 additions and 59 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE spdm_baseline.sys_dept_user ADD simulationType varchar(255) NULL COMMENT '仿真类型';

View File

@@ -10,7 +10,7 @@ public enum DirTypeEnum {
* 知识库文件夹
*/
@Schema(description = "知识库文件夹", example = "1")
KNOWLEDGE_BASE_DIR("knowledge", 1, "知识"),
KNOWLEDGE_BASE_DIR("knowledge", 1, "仿真标准"),
/**
* 项目节点文件夹

View File

@@ -0,0 +1,29 @@
package com.sdm.common.entity.resp.data;
import lombok.Data;
@Data
public class LocalFileNodeVO {
/** 名称 */
private String name;
/** 完整路径 */
private String fullPath;
/** 是否文件夹 1是文件夹 0 文件 */
private String directory;
/** 文件大小(字节,文件夹为 0 */
private long size;
/** 最后修改时间 */
private String lastModifiedTime;
/** 文件的md5 */
private String fileNameHash;
/** 文件的类型 */
private String contentType;
}

View File

@@ -25,6 +25,9 @@ public class SysDeptUserResp {
@Schema(description = "阶段")
private String stage;
@Schema(description = "仿真类型")
private String simulationType;
@Schema(description = "部门负责人用户ID")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long userId;

View File

@@ -1,5 +1,6 @@
package com.sdm.common.utils;
import com.sdm.common.entity.resp.data.LocalFileNodeVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.Pair;
import org.springframework.http.HttpStatus;
@@ -16,9 +17,14 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.security.MessageDigest;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@@ -26,6 +32,19 @@ import java.util.zip.ZipOutputStream;
@Slf4j
@Component
public class FilesUtil {
/**
* 时间格式化器(抽取为常量,线程安全)
*/
private static final DateTimeFormatter DATE_TIME_FORMATTER =
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
/**
* 哈希算法常量
*/
private static final String SHA256 = "SHA-256";
/**
* 在MappedByteBuffer释放后再对它进行读操作的话就会引发jvm crash在并发情况下很容易发生
* 正在释放时另一个线程正开始读取于是crash就发生了。所以为了系统稳定性释放前一般需要检 查是否还有线程在读或写
@@ -868,7 +887,203 @@ public class FilesUtil {
// ==================== 优化核心:文件列表扫描 ====================
/**
* 安全扫描文件夹下的一级文件/目录
* 增强:路径安全校验、空目录保护、流自动关闭、完整异常处理
* @param folderPath 文件夹路径
* @return 文件节点VO列表
*/
public static List<LocalFileNodeVO> listFiles(String folderPath) {
// 1. 空值校验
if (folderPath == null || folderPath.isBlank()) {
log.error("listFiles 参数异常:文件夹路径不能为空");
throw new IllegalArgumentException("文件夹路径不能为空");
}
// 2. 标准化路径(防路径穿越、相对路径混乱)
Path rootPath;
try {
rootPath = Paths.get(folderPath).normalize().toAbsolutePath();
} catch (InvalidPathException | SecurityException e) {
log.error("解析路径失败:{}", folderPath, e);
throw new IllegalArgumentException("无效的文件夹路径:" + folderPath, e);
}
// 3. 路径存在检查
if (!Files.exists(rootPath)) {
log.warn("文件夹不存在:{}", rootPath);
throw new RuntimeException("路径不存在:" + folderPath);
}
// 4. 是否是目录
if (!Files.isDirectory(rootPath)) {
log.error("指定路径不是文件夹:{}", rootPath);
throw new RuntimeException("指定路径不是文件夹:" + folderPath);
}
// 5. 可读权限
if (!Files.isReadable(rootPath)) {
log.error("无文件夹读取权限:{}", rootPath);
throw new RuntimeException("无文件夹读取权限:" + folderPath);
}
// 6. 安全遍历目录(必须 try-with-resources 关闭流)
try (Stream<Path> pathStream = Files.list(rootPath)) {
return pathStream
.map(FilesUtil::convertToFileNode) // 静态方法必须用 类名::
.sorted(fileNodeComparator())
.collect(Collectors.toList());
} catch (SecurityException se) {
log.error("遍历文件夹被安全策略阻止:{}", rootPath, se);
throw new RuntimeException("文件夹访问被拒绝:" + folderPath, se);
} catch (IOException e) {
log.error("读取目录发生IO异常{}", rootPath, e);
throw new RuntimeException("读取目录失败:" + folderPath, e);
}
}
/**
* 路径 -> LocalFileNodeVO 转换(增强健壮性、空保护、异常隔离)
* 单个文件异常不会导致整个列表失败
*/
private static LocalFileNodeVO convertToFileNode(Path path) {
LocalFileNodeVO vo = new LocalFileNodeVO();
try {
// 基础名称与路径
String fileName = path.getFileName() == null ? "未知名称" : path.getFileName().toString();
vo.setName(fileName);
vo.setFullPath(path.toAbsolutePath().toString());
// 目录/文件标记
boolean isDirectory = Files.isDirectory(path);
vo.setDirectory(isDirectory ? "1" : "0");
if (isDirectory) {
vo.setSize(0L);
vo.setContentType("directory");
} else {
// 文件大小(异常保护)
vo.setSize(Files.size(path));
// 内容类型
vo.setContentType(resolveContentTypeSafely(path));
}
// 文件名哈希(空值安全)
vo.setFileNameHash(calcFileNameHash(vo.getName()));
// 最后修改时间(异常保护)
vo.setLastModifiedTime(getLastModifiedTimeSafe(path));
} catch (Exception e) {
// 单个文件读取失败,只打警告,不中断整个列表
log.warn("读取文件信息失败,已跳过:{}", path, e);
// 设置默认值保证VO结构完整
vo.setSize(0L);
vo.setContentType("unknown");
vo.setLastModifiedTime("-");
}
return vo;
}
/**
* 安全获取最后修改时间(容错)
*/
private static String getLastModifiedTimeSafe(Path path) {
try {
FileTime fileTime = Files.getLastModifiedTime(path);
LocalDateTime time = LocalDateTime.ofInstant(fileTime.toInstant(), ZoneId.systemDefault());
return time.format(DATE_TIME_FORMATTER);
} catch (Exception e) {
log.debug("获取文件修改时间失败:{}", path, e);
return "-";
}
}
/**
* 文件排序规则(文件夹优先 > 修改时间倒序 > 名称正序)
*/
private static Comparator<LocalFileNodeVO> fileNodeComparator() {
return Comparator
.comparing(LocalFileNodeVO::getDirectory, Comparator.reverseOrder())
.thenComparing(
LocalFileNodeVO::getLastModifiedTime,
Comparator.nullsLast(Comparator.reverseOrder())
)
.thenComparing(
LocalFileNodeVO::getName,
Comparator.nullsFirst(String.CASE_INSENSITIVE_ORDER)
);
}
/**
* 安全获取文件ContentType不抛异常
*/
private static String resolveContentTypeSafely(Path path) {
try {
String type = Files.probeContentType(path);
if (type != null) {
return type;
}
} catch (Exception ignored) {
// 不打印异常,避免日志泛滥
}
return fallbackContentType(path.getFileName() == null ? "" : path.getFileName().toString());
}
/**
* 根据后缀名兜底ContentType空值安全
*/
private static String fallbackContentType(String fileName) {
if (fileName == null || fileName.isBlank()) {
return "application/octet-stream";
}
String lower = fileName.toLowerCase();
if (lower.endsWith(".txt")) return "text/plain";
if (lower.endsWith(".json")) return "application/json";
if (lower.endsWith(".xml")) return "application/xml";
if (lower.endsWith(".csv")) return "text/csv";
if (lower.endsWith(".jpg") || lower.endsWith(".jpeg")) return "image/jpeg";
if (lower.endsWith(".png")) return "image/png";
if (lower.endsWith(".gif")) return "image/gif";
if (lower.endsWith(".pdf")) return "application/pdf";
if (lower.endsWith(".zip")) return "application/zip";
if (lower.endsWith(".jar")) return "application/java-archive";
// 未知类型返回标准二进制流,避免前端解析异常
return "application/octet-stream";
}
/**
* 计算文件名SHA-256哈希线程安全、空值安全
*/
private static String calcFileNameHash(String fileName) {
if (fileName == null || fileName.isBlank()) {
return "";
}
try {
MessageDigest digest = MessageDigest.getInstance(SHA256);
byte[] hashBytes = digest.digest(fileName.getBytes(StandardCharsets.UTF_8));
return bytesToHex(hashBytes);
} catch (Exception e) {
log.warn("计算文件名Hash失败{}", fileName, e);
return "";
}
}
/**
* 字节数组转16进制健壮性增强
*/
private static String bytesToHex(byte[] bytes) {
if (bytes == null || bytes.length == 0) {
return "";
}
StringBuilder sb = new StringBuilder(bytes.length * 2);
for (byte b : bytes) {
sb.append(String.format("%02x", b));
}
return sb.toString();
}
}

View File

@@ -26,7 +26,9 @@ import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
@@ -47,6 +49,12 @@ public class DataFileController implements IDataFeignClient {
@Autowired
private IDataFileService IDataFileService;
/**
* 本地可访问的基础路径
*/
@Value("${local.file.basePath:/home/simulation}")
private String LOCAL_BASE_STORAGE_PATH ;
/**
* 创建文件夹
*
@@ -783,4 +791,14 @@ public class DataFileController implements IDataFeignClient {
return IDataFileService.getFileMinioObjectkeysByDirIds(dirIds);
}
@PostMapping("/getLocalFiles")
public SdmResponse<List<LocalFileNodeVO>> scanDir(@RequestBody LocalFileListReq req) {
String folderPath = req.getFolderPath();
if(StringUtils.isBlank(folderPath)||!folderPath.startsWith(LOCAL_BASE_STORAGE_PATH)) {
throw new RuntimeException("目录路径非法");
}
List<LocalFileNodeVO> localFiles = FilesUtil.listFiles(folderPath);
return SdmResponse.success(localFiles);
}
}

View File

@@ -0,0 +1,14 @@
package com.sdm.data.model.req;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@Data
public class LocalFileListReq {
/**
* 目录路径
*/
@NotBlank
private String folderPath;
}

View File

@@ -145,7 +145,6 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
}
PageHelper.startPage(req.getCurrent(), req.getSize());
var wrapper = fileMetadataInfoService.lambdaQuery()
.eq(FileMetadataInfo::getTenantId, ThreadLocalContext.getTenantId())
.isNull(FileMetadataInfo::getDeletedAt)
@@ -187,6 +186,7 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
wrapper.orderByDesc(FileMetadataInfo::getCreateTime);
}
PageHelper.startPage(req.getCurrent(), req.getSize());
List<FileMetadataInfo> fileMetadataInfos = wrapper.list();
PageInfo<FileMetadataInfo> page = new PageInfo<>(fileMetadataInfos);
@@ -299,6 +299,21 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
inByCurrentLevelCsv(wrapper, FileMetadataInfo::getTag9, tagReq.getTag9());
inByCurrentLevelCsv(wrapper, FileMetadataInfo::getTag10, tagReq.getTag10());
// task/run 也支持按照名称模糊查询,先获取对应的taskId集合逗号拼接后,然后设置到tagReq。taskId字段
if(ObjectUtils.isNotEmpty(tagReq.getTaskName())){
tagReq.setTaskId(fileMetadataInfoService.lambdaQuery()
.eq(FileMetadataInfo::getRelatedResourceUuidOwnType,NodeTypeEnum.TASK.getValue())
.like(FileMetadataInfo::getOriginalName,tagReq.getTaskName()).list().stream().map(FileMetadataInfo::getRelatedResourceUuid).collect(Collectors.joining( ",")));
}
if(ObjectUtils.isNotEmpty(tagReq.getRunName())){
tagReq.setRunId(fileMetadataInfoService.lambdaQuery()
.eq(FileMetadataInfo::getRelatedResourceUuidOwnType,NodeTypeEnum.RUN.getValue())
.like(FileMetadataInfo::getOriginalName,tagReq.getRunName()).list().stream().map(FileMetadataInfo::getRelatedResourceUuid).collect(Collectors.joining( ",")));
}
// task/run 按普通IN过滤
inByCsv(wrapper, FileMetadataInfo::getTaskId, tagReq.getTaskId());
inByCsv(wrapper, FileMetadataInfo::getRunId, tagReq.getRunId());

View File

@@ -113,7 +113,7 @@ import java.util.stream.Collectors;
@ConditionalOnProperty(name = "fileSystem.chose", havingValue = "minio")
public class MinioFileIDataFileServiceImpl implements IDataFileService {
// fileData 知识库文件列表可见的数据
private final List<Integer> fileDatdList = ApproveFileDataTypeEnum.getVisibleInFileList();
private final List<Integer> visibleInFileList = ApproveFileDataTypeEnum.getVisibleInFileList();
private static final String FLOWABLE_SIMULATION_BASEDIR = "/home/simulation/";
@@ -945,10 +945,7 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
queryBigFileReq.setFileSuffix(queryBigFileReq.getFileSuffix().toLowerCase());
}
if (DirTypeEnum.isApprovalRequired(dirType)) {
// 需要审批的目录类型:排除新增在审批的文件
queryBigFileReq.setApproveTypeList(fileDatdList);
}
List<Long> uploadUserId = org.apache.commons.lang3.StringUtils.isBlank(minioFileSearchReq.getUploadUserId())
? new ArrayList<>()
@@ -959,9 +956,16 @@ public class MinioFileIDataFileServiceImpl implements IDataFileService {
queryBigFileReq.setUploadUserId(uploadUserId);
Long userId =ThreadLocalContext.getUserId();
if(!Objects.isNull(userId)){
queryBigFileReq.setCurrentReqUserId(userId);
queryBigFileReq.setApproveAllTypeList(ApproveFileDataTypeEnum.getAllVisibleInFileList());
// 需要审批的目录类型 才需要设置审批类型, 如果是项目文件这种不需要审批的,可以看所有文件
if (DirTypeEnum.isApprovalRequired(dirType)) {
//文件不是 当前用户 上传的 看不到别的用户正在上传的文件
queryBigFileReq.setApproveTypeList(visibleInFileList);
// 文件是 当前用户 上传的 可以看到自己上传中的文件
if(!Objects.isNull(userId)){
queryBigFileReq.setCurrentReqUserId(userId);
queryBigFileReq.setApproveAllTypeList(ApproveFileDataTypeEnum.getAllVisibleInFileList());
}
}
SdmResponse<PageDataResp<List<FileStorage>>> searchResult = dataStorageAnalysis.listBigFile(queryBigFileReq);

View File

@@ -227,47 +227,42 @@
and file_storage.tenantId = #{tenantId}
and file_metadata_info.deletedAt IS NULL
<!-- ===================== 修复后:兼容 currentReqUserId = null 的情况 ===================== -->
<choose>
<!-- 情况1当前用户ID 不为空 → 自己看全部状态,别人看指定状态 -->
<when test="queryBigFileReq.currentReqUserId != null">
AND (
<!-- 自己创建的:使用 approveAllTypeList -->
<if test="queryBigFileReq.approveAllTypeList != null and queryBigFileReq.approveAllTypeList.size()>0">
(file_metadata_info.creatorId = #{queryBigFileReq.currentReqUserId}
AND file_metadata_info.approveType IN
<foreach collection="queryBigFileReq.approveAllTypeList" item="approveType" open="(" separator="," close=")">
#{approveType}
</foreach>)
</if>
<!-- 连接 OR -->
<if test="(queryBigFileReq.approveAllTypeList != null and !queryBigFileReq.approveAllTypeList.isEmpty())
and (queryBigFileReq.approveTypeList != null and !queryBigFileReq.approveTypeList.isEmpty())">
OR
</if>
<!-- 别人创建的:使用 approveTypeList -->
<!-- 情况1queryBigFileReq.approveTypeList不为空是需要走审批的目录的文件的场景需要满足:-->
<if test="queryBigFileReq.approveTypeList != null and queryBigFileReq.approveTypeList.size()>0">
(file_metadata_info.creatorId != #{queryBigFileReq.currentReqUserId}
AND file_metadata_info.approveType IN
<foreach collection="queryBigFileReq.approveTypeList" item="approveType" open="(" separator="," close=")">
<!-- 文件不是 当前用户 上传的 看不到别的用户正在上传的文件,但是可以看到其他审批类型状态的文件 -->
AND (
file_metadata_info.approveType IN
<foreach collection="queryBigFileReq.approveTypeList" item="approveType" open="(" separator=","
close=")">
#{approveType}
</foreach>)
</foreach>
<!-- 文件是 当前用户 上传的 可以看到自己上传中的文件 -->
<if test="queryBigFileReq.approveAllTypeList != null and !queryBigFileReq.approveAllTypeList.size()>0">
OR
(file_metadata_info.creatorId = #{queryBigFileReq.currentReqUserId}
AND file_metadata_info.approveType IN
<foreach collection="queryBigFileReq.approveAllTypeList" item="approveType" open="(" separator="," close=")">
#{approveType}
</foreach>)
</if>
)
</if>
)
</when>
<!-- 情况2当前用户ID 为空 → 统一使用 approveTypeList原来的逻辑 -->
<otherwise>
<if test="queryBigFileReq.approveTypeList != null and queryBigFileReq.approveTypeList.size()>0">
AND file_metadata_info.approveType IN
<foreach collection="queryBigFileReq.approveTypeList" item="approveType" open="(" separator="," close=")">
<foreach collection="queryBigFileReq.approveTypeList" item="approveType" open="(" separator=","
close=")">
#{approveType}
</foreach>
</if>
</otherwise>
</choose>
<!-- ===================================================================================== -->
<if test="queryBigFileReq.dirIds != null and queryBigFileReq.dirIds.size()>0">

View File

@@ -20,7 +20,7 @@ public class AppConfigureBean extends BaseBean {
public String configValue; //配置内容
public int configType;//配置类型
public String configType;//配置类型
public long creator; //创建者

View File

@@ -44,6 +44,10 @@ public class SysDeptUser implements Serializable {
@TableField("stage")
private String stage;
@Schema(description = "仿真类型")
@TableField("simulationType")
private String simulationType;
@Schema(description = "部门负责人用户ID")
@TableField("userId")
private Long userId;

View File

@@ -21,6 +21,9 @@ public class DeptOperateReq {
@Schema(description = "阶段")
private String stage;
@Schema(description = "仿真类型")
private String simulationType;
@Schema(description = "主键")
private Integer id;

View File

@@ -51,6 +51,7 @@ public class ISysDeptUserServiceImpl extends ServiceImpl<SysDeptUserMapper, SysD
deptUser.setTenantId(ThreadLocalContext.getTenantId());
deptUser.setCreator(ThreadLocalContext.getUserId());
deptUser.setDeptId(IdWorker.getId(deptUser));
deptUser.setSimulationType(deptAddReq.getSimulationType());
this.save(deptUser);
return SdmResponse.success();
}
@@ -73,6 +74,7 @@ public class ISysDeptUserServiceImpl extends ServiceImpl<SysDeptUserMapper, SysD
deptUser.setDeptName(normalizedDeptName);
deptUser.setDiscipline(normalizedSubject);
deptUser.setStage(StringUtils.isNotBlank(normalizedStage) ? normalizedStage : null);
deptUser.setSimulationType(deptEditReq.getSimulationType());
if (deptEditReq.getUserId() != null) {
deptUser.setUserId(deptEditReq.getUserId());
}

View File

@@ -18,6 +18,7 @@ import com.sdm.common.entity.req.task.BindTaskAndFlowTemplateReq;
import com.sdm.common.entity.resp.capability.FlowTemplateResp;
import com.sdm.common.entity.resp.capability.ReportTemplateResp;
import com.sdm.common.entity.resp.data.FileMetadataInfoResp;
import com.sdm.common.entity.resp.system.CIDUserResp;
import com.sdm.common.feign.impl.system.ApproveFeignClientImpl;
import com.sdm.common.feign.inter.capability.ISimulationFlowFeignClient;
import com.sdm.common.feign.inter.capability.ISimulationReportFeignClient;
@@ -726,13 +727,15 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
bindFileMap = (Map<String, Map<Integer,List<FileMetadataInfoResp>>>) feignRsp.getData();
}
Map<Long,String> userMap = getSystemAllUserMap();
JSONArray nodeArray = poolJson.getJSONArray("nodes");
if(nodeArray == null || nodeArray.isEmpty())
return contents;
for(int i=0;i<nodeArray.size();i++)
{
JSONObject node = nodeArray.getJSONObject(i);
searchNodeAndBindTasks(node, bindFileMap, bindMaps);
searchNodeAndBindTasks(node, bindFileMap, bindMaps,userMap);
}
return poolJson.toJSONString();
}
@@ -743,7 +746,7 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
* @param bindFileMap
* @param templateBindMaps
*/
private void searchNodeAndBindTasks(@NotNull JSONObject nodeObject, Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap, List<TemplateBindMap> templateBindMaps)
private void searchNodeAndBindTasks(@NotNull JSONObject nodeObject, Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap, List<TemplateBindMap> templateBindMaps, Map<Long,String> userMap)
{
JSONArray children = nodeObject.getJSONArray("children");
if(children == null || children.isEmpty())
@@ -756,11 +759,11 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
continue;
if(levelType.equalsIgnoreCase("node"))
{
searchNodeAndBindTasks(child,bindFileMap,templateBindMaps);
searchNodeAndBindTasks(child,bindFileMap,templateBindMaps,userMap);
}
else if(levelType.equalsIgnoreCase("task"))
{
bindTaskRelate(child,bindFileMap,templateBindMaps);
bindTaskRelate(child,bindFileMap,templateBindMaps,userMap);
}
}
}
@@ -771,29 +774,34 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
* @param bindFileMap
* @param bindMaps
*/
private void bindTaskRelate(JSONObject taskObject,Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap,List<TemplateBindMap> bindMaps)
private void bindTaskRelate(JSONObject taskObject,Map<String, Map<Integer,List<FileMetadataInfoResp>>> bindFileMap,List<TemplateBindMap> bindMaps, Map<Long,String> userMap)
{
String taskUuid = taskObject.getString("uuid");
if(taskUuid == null)
return;
/*String flowTemplate = taskFlowMap.get(taskUuid);
String flowTemplateNames = taskFlowNameMap.get(taskUuid);
if(flowTemplate != null)
String responsibleStr = taskObject.getString("responsible");
if(responsibleStr != null && !responsibleStr.isEmpty())
{
taskObject.put("flowTemplate",flowTemplate);
String responsibleName = "";
String[] responsibleNames = responsibleStr.split(",");
for(String responsible : responsibleNames)
{
long userId = Long.parseLong(responsible);
String userName = userMap.get(userId);
if(userName != null && !userName.isEmpty())
{
if(responsibleName.isEmpty())
{
responsibleName += userName;
}
else
{
responsibleName += ","+ userName;
}
}
}
taskObject.put("responsibleName",responsibleName);
}
else
{
taskObject.put("flowTemplate","");
}
if(flowTemplateNames != null)
{
taskObject.put("flowTemplateNames",flowTemplateNames);
}
else
{
taskObject.put("flowTemplateNames","");
}*/
for(TemplateBindMap templateMap : bindMaps)
{
Map<String,String> codeMaps = templateMap.taskCodeMap;
@@ -1317,7 +1325,6 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
}
if(response.getCode() == ResultCode.SUCCESS.getCode())
{
SdmResponse treeRespond = getCurrentPoolTree(poolName);
@@ -3044,6 +3051,23 @@ public class SimulationTaskPoolServiceImpl extends BaseService implements ISimul
SdmResponse response = SdmResponse.success();
return response;
}
/**
* 获取系统所有用户ID与用户名映射
* @return
*/
protected Map<Long,String> getSystemAllUserMap()
{
List<CIDUserResp> userResps = userNameCacheService.getAllUsers();
Map<Long,String> userMap = new HashMap<>();
for(CIDUserResp userResp : userResps)
{
long userId = userResp.getUserId();
String userName = userResp.getNickname();
userMap.put(userId,userName);
}
return userMap;
}
}