fix[project]: 查询团队成员时,返回值新增用户类型作为区分

This commit is contained in:
2026-04-17 15:33:45 +08:00
parent 5592c19145
commit 9be0f1a320
4 changed files with 15 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ public interface SimulationNodeMapper extends BaseMapper<SimulationNode> {
List<SpdmNodeMemberVo> getNodeMemberListByNodeIdList(@Param("nodeIdList") List<String> nodeIdList); List<SpdmNodeMemberVo> getNodeMemberListByNodeIdList(@Param("nodeIdList") List<String> nodeIdList);
List<SpdmNodeMemberVo> getOnlyNodeMemberListByNodeIdList(@Param("nodeIdList") List<String> nodeIdList); List<SpdmNodeMemberVo> getOnlyNodeMemberListByNodeIdList(@Param("nodeIdList") List<String> nodeIdList,@Param("userType") Integer userType);
List<ProjectNodePo> allList(@Param("nodeIdList") List<String> deleteNodeList); List<ProjectNodePo> allList(@Param("nodeIdList") List<String> deleteNodeList);

View File

@@ -1,5 +1,6 @@
package com.sdm.project.model.req; package com.sdm.project.model.req;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
@@ -16,4 +17,10 @@ public class GetProjectListReq {
private String phaseNodeId; private String phaseNodeId;
/**
* 用户类型0团队成员3项目参与人员
*/
@Schema(description = "用户类型0团队成员3项目参与人员")
private Integer userType = 0;
} }

View File

@@ -2026,6 +2026,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
Long tenantId = ThreadLocalContext.getTenantId(); Long tenantId = ThreadLocalContext.getTenantId();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String projectNodeId = req.getProjectNodeId(); String projectNodeId = req.getProjectNodeId();
Integer userType = req.getUserType();
SpdmNodeVo spdmNodeVo = nodeMapper.getNodeById(projectNodeId); SpdmNodeVo spdmNodeVo = nodeMapper.getNodeById(projectNodeId);
if (ObjectUtils.isEmpty(spdmNodeVo)) { if (ObjectUtils.isEmpty(spdmNodeVo)) {
log.error("根据projectNodeId{},未查询到团队成员", projectNodeId); log.error("根据projectNodeId{},未查询到团队成员", projectNodeId);
@@ -2035,7 +2036,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
List<String> allNodeIdList = new ArrayList<>(); List<String> allNodeIdList = new ArrayList<>();
allNodeIdList.add(spdmNodeVo.getUuid()); allNodeIdList.add(spdmNodeVo.getUuid());
recursionAllNodeIdList(Collections.singletonList(spdmNodeVo.getUuid()), allNodeIdList); recursionAllNodeIdList(Collections.singletonList(spdmNodeVo.getUuid()), allNodeIdList);
List<SpdmNodeMemberVo> spdmNodeMemberVoList = nodeMapper.getNodeMemberListByNodeIdList(allNodeIdList); List<SpdmNodeMemberVo> spdmNodeMemberVoList = nodeMapper.getOnlyNodeMemberListByNodeIdList(allNodeIdList,userType);
if (CollectionUtils.isEmpty(spdmNodeMemberVoList)) { if (CollectionUtils.isEmpty(spdmNodeMemberVoList)) {
log.error("allNodeIdList{},未查询到团队成员", allNodeIdList); log.error("allNodeIdList{},未查询到团队成员", allNodeIdList);
jsonObject.put("data", new ArrayList<CIDUserResp>()); jsonObject.put("data", new ArrayList<CIDUserResp>());
@@ -5250,7 +5251,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
return SdmResponse.failed("参数不能为空"); return SdmResponse.failed("参数不能为空");
} }
// 查询当前项目的团队成员,如果是团队成员,则不允许添加 // 查询当前项目的团队成员,如果是团队成员,则不允许添加
List<SpdmNodeMemberVo> spdmNodeMemberVoList = nodeMapper.getOnlyNodeMemberListByNodeIdList(Collections.singletonList(projectId)); List<SpdmNodeMemberVo> spdmNodeMemberVoList = nodeMapper.getOnlyNodeMemberListByNodeIdList(Collections.singletonList(projectId),NodeMemberTypeEnum.MANAGER.getCode());
List<Long> expUserIdList = new ArrayList<>(); List<Long> expUserIdList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(spdmNodeMemberVoList)) { if (CollectionUtils.isNotEmpty(spdmNodeMemberVoList)) {
List<Long> existUserIdList = spdmNodeMemberVoList.stream().map(SpdmNodeMemberVo::getUserId).toList(); List<Long> existUserIdList = spdmNodeMemberVoList.stream().map(SpdmNodeMemberVo::getUserId).toList();

View File

@@ -401,7 +401,10 @@
<foreach collection='nodeIdList' item='nodeId' index='index' separator=','> <foreach collection='nodeIdList' item='nodeId' index='index' separator=','>
#{nodeId} #{nodeId}
</foreach> </foreach>
) and type = 0 )
<if test="userType != null and userType !='' ">
and type = #{userType}
</if>
group by user_id, type,nodeId group by user_id, type,nodeId
</select> </select>