提交 5b8015a6 编写于 作者: zhouweidong's avatar zhouweidong

优化错误信息

上级 9011e277
......@@ -74,7 +74,6 @@ public class DupCheckAspect {
Map<String, DEField> deFields = DEFieldCacheMap.getDEFields(entity.getClass());
for (Map.Entry<String, DEField> deField : deFields.entrySet()) {
String fieldName = deField.getKey();
try {
DEField fieldAnnotation = deField.getValue();
DupCheck dupCheck = fieldAnnotation.dupCheck();
String dupCheckField=fieldAnnotation.dupCheckField();
......@@ -103,12 +102,9 @@ 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), "DupCheckAspect", "check");
throw new BadRequestAlertException(String.format("数据保存失败,属性[%s]:值[%s]已存在!", fieldName, newValue), "DupCheckAspect", "check");
}
}
} catch (Exception e) {
throw new BadRequestAlertException(String.format("实体属性[%s]重复值检查失败,%s",fieldName,e),"DupCheckAspect","check");
}
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册