docs(product): 删除产品管理SQL口径和业务设计文档
- 移除02-产品管理SQL已确认口径文档 - 移除02-产品管理业务设计文档 - 清理产品管理模块的详细设计说明 - 删除产品需求状态字段口径定义 - 移除来源承接与需求拆分口径说明 - 清理需求终态原因承接口径内容 - 删除产品生命周期管理设计 - 移除产品团队权限管理规范 - 清理产品与项目关系约束说明 - 删除轻量需求管理业务规则 - 移除产品状态机与流程设计 - 清理权限与动作矩阵定义
This commit is contained in:
@@ -10,6 +10,8 @@ import java.util.List;
|
||||
|
||||
public class InDictCollectionValidator implements ConstraintValidator<InDict, Collection<?>> {
|
||||
|
||||
private static final String MISSING_DICT_DATA_MESSAGE = "字典数据缺失,请联系管理员维护";
|
||||
|
||||
private String dictType;
|
||||
|
||||
@Override
|
||||
@@ -25,6 +27,12 @@ public class InDictCollectionValidator implements ConstraintValidator<InDict, Co
|
||||
}
|
||||
// 校验全部通过
|
||||
List<String> dbValues = DictFrameworkUtils.getDictDataValueList(dictType);
|
||||
if (dbValues.isEmpty()) {
|
||||
context.disableDefaultConstraintViolation();
|
||||
context.buildConstraintViolationWithTemplate(MISSING_DICT_DATA_MESSAGE)
|
||||
.addConstraintViolation();
|
||||
return false;
|
||||
}
|
||||
boolean match = list.stream().allMatch(v -> dbValues.stream()
|
||||
.anyMatch(dbValue -> dbValue.equalsIgnoreCase(v.toString())));
|
||||
if (match) {
|
||||
@@ -40,4 +48,3 @@ public class InDictCollectionValidator implements ConstraintValidator<InDict, Co
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import java.util.List;
|
||||
|
||||
public class InDictValidator implements ConstraintValidator<InDict, Object> {
|
||||
|
||||
private static final String MISSING_DICT_DATA_MESSAGE = "字典数据缺失,请联系管理员维护";
|
||||
|
||||
private String dictType;
|
||||
|
||||
@Override
|
||||
@@ -24,6 +26,12 @@ public class InDictValidator implements ConstraintValidator<InDict, Object> {
|
||||
}
|
||||
// 校验通过
|
||||
final List<String> values = DictFrameworkUtils.getDictDataValueList(dictType);
|
||||
if (values.isEmpty()) {
|
||||
context.disableDefaultConstraintViolation();
|
||||
context.buildConstraintViolationWithTemplate(MISSING_DICT_DATA_MESSAGE)
|
||||
.addConstraintViolation();
|
||||
return false;
|
||||
}
|
||||
boolean match = values.stream().anyMatch(v -> StrUtil.equalsIgnoreCase(v, value.toString()));
|
||||
if (match) {
|
||||
return true;
|
||||
@@ -38,4 +46,3 @@ public class InDictValidator implements ConstraintValidator<InDict, Object> {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user