fix:公差分析库也需要走审批
This commit is contained in:
@@ -107,4 +107,46 @@ public enum DirTypeEnum {
|
||||
public static final List<DirTypeEnum> getInitSpmdDir() {
|
||||
return INIT_SPMD_DIR;
|
||||
}
|
||||
|
||||
/**
|
||||
* 需要走审批流程的目录类型列表
|
||||
* 目前包括:知识库、公差分析库
|
||||
*/
|
||||
private static final List<DirTypeEnum> APPROVAL_REQUIRED_DIRS = List.of(
|
||||
DirTypeEnum.KNOWLEDGE_BASE_DIR,
|
||||
DirTypeEnum.TOLERANCE_ANALYSIS_DIR
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取需要走审批流程的目录类型列表
|
||||
* @return 需要审批的目录类型列表
|
||||
*/
|
||||
public static List<DirTypeEnum> getApprovalRequiredDirs() {
|
||||
return APPROVAL_REQUIRED_DIRS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断指定目录类型是否需要走审批流程
|
||||
* @param dirType 目录类型值
|
||||
* @return true-需要审批,false-不需要审批
|
||||
*/
|
||||
public static boolean isApprovalRequired(Integer dirType) {
|
||||
if (dirType == null) {
|
||||
return false;
|
||||
}
|
||||
return APPROVAL_REQUIRED_DIRS.stream()
|
||||
.anyMatch(dir -> dir.getValue() == dirType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断指定目录类型枚举是否需要走审批流程
|
||||
* @param dirTypeEnum 目录类型枚举
|
||||
* @return true-需要审批,false-不需要审批
|
||||
*/
|
||||
public static boolean isApprovalRequired(DirTypeEnum dirTypeEnum) {
|
||||
if (dirTypeEnum == null) {
|
||||
return false;
|
||||
}
|
||||
return APPROVAL_REQUIRED_DIRS.contains(dirTypeEnum);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user