Watch Star Fork

ThinkGem / JeeSite 4.0Java

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

已完成
blue771  创建于

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

输入图片说明

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

输入图片说明

6732_thinkgem 共2人参与

评论 (3)

6732_thinkgem
ThinkGem 2018-07-14 00:05 拥有者

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

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 拥有者

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

登录 后才可以发表评论

负责人
标签
未设置
里程碑
关联分支
开始时间
未设置
结束时间
未设置
置顶选项
优先级

搜索帮助