feat(2046) 创建超管设置product type
This commit is contained in:
parent
120d9e0952
commit
018e79b65c
@ -2,6 +2,7 @@ package cn.axzo.tyr.client.model.enums;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@ -17,22 +18,22 @@ public enum DictWorkSpaceTypeEnum {
|
|||||||
/**
|
/**
|
||||||
* 企业工作台
|
* 企业工作台
|
||||||
*/
|
*/
|
||||||
ENT("ent", "企业工作台"),
|
ENT("ent", "企业工作台", 7,1),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目部工作台
|
* 项目部工作台
|
||||||
*/
|
*/
|
||||||
PROJ("proj", "项目部工作台"),
|
PROJ("proj", "项目部工作台",1,2),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OMS工作台
|
* OMS工作台
|
||||||
*/
|
*/
|
||||||
OMS("oms", "OMS工作台"),
|
OMS("oms", "OMS工作台",6,6),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班组工作台
|
* 班组工作台
|
||||||
*/
|
*/
|
||||||
TEAM("team","班组工作台")
|
TEAM("team","班组工作台",0,0)
|
||||||
;
|
;
|
||||||
|
|
||||||
@EnumValue
|
@EnumValue
|
||||||
@ -41,6 +42,12 @@ public enum DictWorkSpaceTypeEnum {
|
|||||||
|
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final Integer superAdminProductType;
|
||||||
|
@Getter
|
||||||
|
private final Integer workspaceType;
|
||||||
|
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@ -49,9 +56,11 @@ public enum DictWorkSpaceTypeEnum {
|
|||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
DictWorkSpaceTypeEnum(String value, String description) {
|
DictWorkSpaceTypeEnum(String value, String description, Integer superAdminProductType, Integer workspaceType) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
this.superAdminProductType = superAdminProductType;
|
||||||
|
this.workspaceType = workspaceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,4 +72,13 @@ public enum DictWorkSpaceTypeEnum {
|
|||||||
public static DictWorkSpaceTypeEnum getByValue(String value) {
|
public static DictWorkSpaceTypeEnum getByValue(String value) {
|
||||||
return Arrays.stream(values()).filter(l -> l.getValue().equals(value)).findFirst().orElse(null);
|
return Arrays.stream(values()).filter(l -> l.getValue().equals(value)).findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 通过workspaceType值获取枚举类型
|
||||||
|
*
|
||||||
|
* @param workspaceType 工作台类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static DictWorkSpaceTypeEnum getByValueWorkspaceType(Integer workspaceType) {
|
||||||
|
return Arrays.stream(values()).filter(l -> l.getWorkspaceType().equals(workspaceType)).findFirst().orElse(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import cn.axzo.pokonyan.util.KeysUtil;
|
|||||||
import cn.axzo.tyr.client.common.enums.RoleResourceTypeEnum;
|
import cn.axzo.tyr.client.common.enums.RoleResourceTypeEnum;
|
||||||
import cn.axzo.tyr.client.common.enums.RoleTypeEnum;
|
import cn.axzo.tyr.client.common.enums.RoleTypeEnum;
|
||||||
import cn.axzo.tyr.client.model.BaseWorkspaceModel;
|
import cn.axzo.tyr.client.model.BaseWorkspaceModel;
|
||||||
|
import cn.axzo.tyr.client.model.enums.DictWorkSpaceTypeEnum;
|
||||||
import cn.axzo.tyr.client.model.enums.IdentityType;
|
import cn.axzo.tyr.client.model.enums.IdentityType;
|
||||||
import cn.axzo.tyr.client.model.enums.WorkerLeaderRoleEnum;
|
import cn.axzo.tyr.client.model.enums.WorkerLeaderRoleEnum;
|
||||||
import cn.axzo.tyr.client.model.roleuser.dto.IdentityInfo;
|
import cn.axzo.tyr.client.model.roleuser.dto.IdentityInfo;
|
||||||
@ -192,6 +193,7 @@ public class RoleUserService implements SaasRoleUserService {
|
|||||||
saasRole.setOwnerOuId(param.getOuId());
|
saasRole.setOwnerOuId(param.getOuId());
|
||||||
saasRole.setRoleType(RoleTypeEnum.SUPER_ADMIN.getValue());
|
saasRole.setRoleType(RoleTypeEnum.SUPER_ADMIN.getValue());
|
||||||
saasRole.setIsDelete(0L);
|
saasRole.setIsDelete(0L);
|
||||||
|
saasRole.setProductUnitType(DictWorkSpaceTypeEnum.getByValueWorkspaceType(param.getWorkspaceType()).getSuperAdminProductType());
|
||||||
|
|
||||||
checkRoleName(RoleTypeEnum.SUPER_ADMIN.getDesc(), param.getWorkspaceId(), param.getOuId());
|
checkRoleName(RoleTypeEnum.SUPER_ADMIN.getDesc(), param.getWorkspaceId(), param.getOuId());
|
||||||
saasRoleDao.save(saasRole);
|
saasRoleDao.save(saasRole);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user