Merge branch 'feature/REQ-3714-zhh' into 'feature/REQ-3714'
feat(REQ-3714): 单位操作人权限判断 See merge request universal/infrastructure/backend/orgmanax!215
This commit is contained in:
commit
cedc2b1d95
@ -21,6 +21,7 @@ public class CheckUserOperateParam {
|
||||
private Long operatorId;
|
||||
private Set<Long> personIds;
|
||||
private Long workspaceId;
|
||||
private boolean isWorkspace;
|
||||
|
||||
public void check() {
|
||||
if (ObjectUtils.anyNull(personIds, workspaceId, operatorId)) {
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.axzo.orgmanax.server.nodeuser.foundation.req;
|
||||
|
||||
import cn.axzo.foundation.exception.Axssert;
|
||||
import cn.axzo.orgmanax.infra.dao.nodeuser.entity.OrganizationalNodeUser;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@SuperBuilder
|
||||
public class NodeUserUnitDelete {
|
||||
|
||||
private Long ouId;
|
||||
|
||||
private Long operatorId;
|
||||
|
||||
private List<Long> personIds;
|
||||
|
||||
public void check() {
|
||||
Axssert.checkNonNull(operatorId, "操作人不能为空");
|
||||
Axssert.checkNonNull(ouId, "单位不能为空");
|
||||
Axssert.checkNonNull(personIds, "用户id列表不能都为空");
|
||||
}
|
||||
|
||||
public OrganizationalNodeUser toEntity() {
|
||||
return BeanUtil.toBean(this, OrganizationalNodeUser.class);
|
||||
}
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
package cn.axzo.orgmanax.server.nodeuser.foundation.req;
|
||||
|
||||
import cn.axzo.foundation.exception.Axssert;
|
||||
import cn.axzo.orgmanax.infra.dao.nodeuser.entity.OrganizationalNodeUser;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@SuperBuilder
|
||||
public class NodeUserWorkspaceDelete {
|
||||
|
||||
private Long ouId;
|
||||
|
||||
private Long workspaceId;
|
||||
|
||||
private Long operatorId;
|
||||
|
||||
private List<Long> personIds;
|
||||
|
||||
public void check() {
|
||||
Axssert.checkNonNull(operatorId, "操作人不能为空");
|
||||
Axssert.checkNonNull(workspaceId, "项目不能为空");
|
||||
Axssert.checkNonNull(personIds, "用户id列表不能都为空");
|
||||
}
|
||||
|
||||
public OrganizationalNodeUser toEntity() {
|
||||
return BeanUtil.toBean(this, OrganizationalNodeUser.class);
|
||||
}
|
||||
}
|
||||
@ -148,10 +148,12 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
|
||||
addFailInfo(failInfoMap, e, checkFailInfo);
|
||||
});
|
||||
}
|
||||
//判断当前人是否有操作权限
|
||||
if (NumberUtil.isPositiveNumber(req.getOperatorId())) {
|
||||
|
||||
}
|
||||
// 检查节点权限
|
||||
checkUserOperate(CheckUserOperateParam.builder()
|
||||
.operatorId(req.getOperatorId())
|
||||
.personIds(req.getPersonIds())
|
||||
.workspaceId(req.getWorkspaceId())
|
||||
.build(), failInfoMap);
|
||||
transformFailMap(failInfoMap, resultList);
|
||||
return resultList;
|
||||
}
|
||||
@ -248,11 +250,12 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
|
||||
addFailInfo(failInfoMap, e.getPersonId(), checkFailInfo);
|
||||
}
|
||||
});
|
||||
// 检查班组节点权限
|
||||
// 检查节点权限
|
||||
checkUserOperate(CheckUserOperateParam.builder()
|
||||
.operatorId(req.getOperatorId())
|
||||
.personIds(req.getPersonIds())
|
||||
.workspaceId(req.getWorkspaceId())
|
||||
.isWorkspace(true)
|
||||
.build(), failInfoMap);
|
||||
// 三方阻断校验
|
||||
thirdApiCheckPerson(req.getWorkspaceId(), req.getPersonIds(), failInfoMap);
|
||||
@ -365,7 +368,7 @@ public class NodeUserCheckServiceImpl implements NodeUserCheckService {
|
||||
}
|
||||
|
||||
// 如果只有工人身份,则直接提示无权限
|
||||
if (isProjectWorker(operator)) {
|
||||
if (isProjectWorker(operator) && param.isWorkspace()) {
|
||||
throw ResultCode.INVALID_PARAMS.toException("操作失败,您暂无权限!");
|
||||
}
|
||||
if (param.getPersonIds().size() == 1 && param.getPersonIds().contains(param.getOperatorId())) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user