问答
nutz 整合 easypoi 咋弄呢 http://git.oschina.net/jueyue/easypoi
标签:
无
5 回复
在easypoi的实体注解中,例如如下的注解,要怎样才能在nutz的model上生效了?
@ExcelTarget("courseEntity")
public class CourseEntity implements java.io.Serializable {
/** 主键 */
private String id;
/** 课程名称 */
@Excel(name = "课程名称", orderNum = "1", needMerge = true)
private String name;
/** 老师主键 */
@ExcelEntity(id = "yuwen")
@ExcelVerify()
private TeacherEntity teacher;
/** 老师主键 */
@ExcelEntity(id = "shuxue")
private TeacherEntity shuxueteacher;
@ExcelCollection(name = "选课学生", orderNum = "4")
private List<StudentEntity> students;
因为导入后的内容是直接和实体类映射的,例如:
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(2);
//params.setSheetNum(9);
params.setNeedSave(true);
long start = new Date().getTime();
List<CourseEntity> list = ExcelImportUtil.importExcel(new File(
"d:/tt.xls"), CourseEntity.class, params);
@wendal 嗯,是我导入文件弄错了,还想为啥没生效!
添加回复
请先登陆