feat(REQ-3488): 增加获取项目班组id方法
This commit is contained in:
parent
6ab08bcc18
commit
2c83d222f4
@ -4,9 +4,12 @@ import cn.axzo.orgmanax.dto.common.PersonProfileBriefDTO;
|
|||||||
import cn.axzo.orgmanax.dto.common.WorkspaceBriefDTO;
|
import cn.axzo.orgmanax.dto.common.WorkspaceBriefDTO;
|
||||||
import cn.axzo.orgmanax.dto.cooperateship.dto.OrgCooperateShipDTO;
|
import cn.axzo.orgmanax.dto.cooperateship.dto.OrgCooperateShipDTO;
|
||||||
import cn.axzo.orgmanax.dto.job.dto.OrgJobBriefDTO;
|
import cn.axzo.orgmanax.dto.job.dto.OrgJobBriefDTO;
|
||||||
|
import cn.axzo.orgmanax.dto.node.dto.NodeProfile;
|
||||||
import cn.axzo.orgmanax.dto.node.dto.OrgNodeBriefDTO;
|
import cn.axzo.orgmanax.dto.node.dto.OrgNodeBriefDTO;
|
||||||
|
import cn.axzo.orgmanax.dto.node.enums.NodeTypeEnum;
|
||||||
import cn.axzo.orgmanax.dto.nodeuser.req.ListNodeUserReq;
|
import cn.axzo.orgmanax.dto.nodeuser.req.ListNodeUserReq;
|
||||||
import cn.axzo.orgmanax.dto.unit.dto.OrgUnitBriefDTO;
|
import cn.axzo.orgmanax.dto.unit.dto.OrgUnitBriefDTO;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -216,4 +219,29 @@ public class NodeUserDTO implements Serializable {
|
|||||||
}
|
}
|
||||||
return (T) Optional.ofNullable(profile).map(p -> JSONObject.parseObject(p.toString(), clazz)).orElse(null);
|
return (T) Optional.ofNullable(profile).map(p -> JSONObject.parseObject(p.toString(), clazz)).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getProjectWorkerId() {
|
||||||
|
if (ObjectUtil.isEmpty(profile)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return profile.getLong("projectWorkerId");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getProjectTeamId() {
|
||||||
|
if (node == null || node.getNodeType() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Integer nodeType = node.getNodeType();
|
||||||
|
if (nodeType.equals(NodeTypeEnum.PROJECT_TEAM.getValue())) {
|
||||||
|
//项目班组
|
||||||
|
NodeProfile.ProjectTeamProfile projectTeamProfile = node.resolveProfile();
|
||||||
|
return Optional.ofNullable(projectTeamProfile).orElse(new NodeProfile.ProjectTeamProfile()).getProjectTeamId();
|
||||||
|
}
|
||||||
|
if (nodeType.equals(NodeTypeEnum.PROJECT_GROUP.getValue())) {
|
||||||
|
//项目小组
|
||||||
|
NodeProfile.ProjectGroupProfile projectGroupProfile = node.resolveProfile();
|
||||||
|
return Optional.ofNullable(projectGroupProfile).orElse(new NodeProfile.ProjectGroupProfile()).getBelongProjectTeamId();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user