From ca935a32bc3a1bcffe2d3478f58b5d30b7c618ca Mon Sep 17 00:00:00 2001 From: jueyue Date: Thu, 26 Feb 2015 15:02:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index cef5738..bd03d2f 100644 --- a/README.md +++ b/README.md @@ -185,4 +185,26 @@ EasyPoi导出实例 return NormalExcelConstants.JEECG_EXCEL_VIEW; } +``` + +8.Excel导入校验,过滤不符合规则的数据,追加错误信息到Excel,提供常用的校验规则,已经通用的校验接口 +```Java + /** + * Email校验 + */ + @Excel(name = "Email", width = 25) + @ExcelVerify(isEmail = true, notNull = true) + private String email; + /** + * 手机号校验 + */ + @Excel(name = "Mobile", width = 20) + @ExcelVerify(isMobile = true, notNull = true) + private String mobile; + + ExcelImportResult result = ExcelImportUtil.importExcelVerify(new File( + "d:/tt.xls"), ExcelVerifyEntity.class, params); + for (int i = 0; i < result.getList().size(); i++) { + System.out.println(ReflectionToStringBuilder.toString(result.getList().get(i))); + } ```