Przeglądaj źródła

校验说明

4.1.3.A
jueyue 10 lat temu
rodzic
commit
ca935a32bc
1 zmienionych plików z 22 dodań i 0 usunięć
  1. +22
    -0
      README.md

+ 22
- 0
README.md Wyświetl plik

@@ -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<ExcelVerifyEntity> 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)));
}
```

Ładowanie…
Anuluj
Zapisz