开源中国 2018 年度最后一场技术盛会邀你来约~错过就要等明年啦!点此立即预约

ThinkGem / JeeSite 4.xJava

Watch 1.8k Star 3.7k Fork 1.8k

导入excel的功能,是不是有问题

Closed
blue771  Created at

参考【用户管理】中的导入功能,自己实现导入。我的实体类如下:

输入图片说明

其中我的实体类的属性有DictData类型,当我的Service层类中实现调用List list = e.getDataList(CleanPartyPunish.class, new String[0]);这一句代码的时候,会抛出以下异常。不知怎么解决?

输入图片说明

6732_thinkgem total 2 participants

Comments (3)

6732_thinkgem
ThinkGem 2018-07-14 00:05 owner

吧你的导入配置注解贴出来

blue771 2018-07-18 15:50
@Valid
	@ExcelFields({
			@ExcelField(
					title = "编号",
					attrName = "empId",
					align = ExcelField.Align.CENTER,
					sort = 10
			),
			@ExcelField(
					title = "姓名",
					attrName = "empName",
					align = ExcelField.Align.CENTER,
					sort = 20
			),
			@ExcelField(
					title = "数据来源Id",
					attrName = "dataSource.dictValue",
					align = ExcelField.Align.CENTER,
					sort = 30,
					fieldType = DictData.class
			),
			@ExcelField(
					title = "数据来源",
					attrName = "dataSource.dictLabelOrig",
					align = ExcelField.Align.CENTER,
					sort = 30,
					fieldType = DictData.class
			),
			@ExcelField(
					title = "工作单位及职务",
					attrName = "empOffice",
					align = ExcelField.Align.CENTER,
					sort = 40
			),
			@ExcelField(
					title = "XX类型Id",
					attrName = "cleanPunishType.treeCode",
					align = ExcelField.Align.CENTER,
					sort = 50,
					fieldType = CleanPunishType.class
			),
			@ExcelField(
					title = "XX类型名称",
					attrName = "cleanPunishType.treeName",
					align = ExcelField.Align.CENTER,
					sort = 50,
					fieldType = CleanPunishType.class
			),

			@ExcelField(
					title = "经办部门",
					attrName = "punishOffice",
					align = ExcelField.Align.CENTER,
					sort = 70
			),
			@ExcelField(
					title = "文号",
					attrName = "punishFileNo",
					align = ExcelField.Align.CENTER,
					sort = 80
			),
			@ExcelField(
					title = "开始时间",
					attrName = "startTime",
					align = ExcelField.Align.CENTER,
					sort = 90
			),
			@ExcelField(
					title = "终止时间",
					attrName = "endTime",
					align = ExcelField.Align.CENTER,
					sort = 100
			),
			@ExcelField(
					title = "描述",
					attrName = "illegalEvent",
					align = ExcelField.Align.CENTER,
					sort = 110
			),
			@ExcelField(
					title = "处理结果",
					attrName = "processResult",
					align = ExcelField.Align.CENTER,
					sort = 120
			),

	})
6732_thinkgem
ThinkGem 2018-07-18 21:50 owner

删掉 fieldType 属性试试,或者 fieldType 的格式参照 OfficeType 谢谢

Sign in and comment

Assignee
Labels
Not set
Milestone
Branch
Scheduled start
Not set
Scheduled end
Not set
Top level
Priority

Help Search