提交 2d0c4d35 编写于 作者: zhouweidong's avatar zhouweidong

属性重复值检查

上级 a479acf7
......@@ -100,11 +100,11 @@ public class DupCheckAspect {
Expression oldValueMappingExp = parser.parseExpression(String.format("#service.%s(#searchContext)",defaultDS));
Page oldData = oldValueMappingExp.getValue(oldValueMappingCtx, Page.class);
if (!ObjectUtils.isEmpty(oldData) && !ObjectUtils.isEmpty(oldData.getContent()) && oldData.getContent().size() > 1) {
throw new BadRequestAlertException(String.format("属性[%s]已存在[%s]值!", fieldName, newValue), "ValueRuleAspect", "repeatCheck");
throw new BadRequestAlertException(String.format("属性[%s]已存在[%s]值!", fieldName, newValue), "DupCheckAspect", "check");
}
}
} catch (Exception e) {
throw new BadRequestAlertException(String.format("实体属性[%s]重复值检查失败,%s",fieldName,e),"ValueRuleAspect","repeatCheck");
throw new BadRequestAlertException(String.format("实体属性[%s]重复值检查失败,%s",fieldName,e),"DupCheckAspect","check");
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册