功能描述: online导出数据 可以通过配置 java增强修改导出的数据 示例: 1.增强配置 ![](https://img.kancloud.cn/b3/6b/b36bb7372e8be92fab5cb6e94609860f_986x594.png) 2.编写java增强类 > 注意:java增强导出,需要实现的接口是:CgformEnhanceJavaListInter与常规的JAVA增强不同。 ``` ~~~ package org.jeecg.modules.online.cgform.enhance.impl; import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.system.vo.SysCategoryModel; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.online.cgform.enhance.CgformEnhanceJavaListInter; import org.jeecg.modules.online.cgform.entity.OnlCgformField; import org.jeecg.modules.online.cgform.service.IOnlCgformFieldService; import org.jeecg.modules.online.config.exception.BusinessException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.math.BigDecimal; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @Component("cgformEnhanceExportDemo") public class CgformEnhanceExportDemo implements CgformEnhanceJavaListInter { @Autowired ISysBaseAPI sysBaseAPI; @Autowired IOnlCgformFieldService onlCgformFieldService; @Override public void execute(String tableName, List<Map<String, Object>> data) throws BusinessException { //系统全部分类字段 List<SysCategoryModel> ls = sysBaseAPI.queryAllDSysCategory(); for (Map<String, Object> map : data) { //针对字段fen_tree,进行导出树分类字典显示转换 String val = oConvertUtils.getString(map.get("fen_tree")); if (oConvertUtils.isEmpty(val)) { continue; } List<SysCategoryModel> collect = ls.stream().filter(item -> item.getId().equals(val)).collect(Collectors.toList()); if (collect != null && collect.size() != 0) { map.put("fen_tree", collect.get(0).getName()); } //针对字段sel_search,进行导出表字典显示转换 String sel_search = oConvertUtils.getString(map.get("sel_search")); if (oConvertUtils.isEmpty(sel_search)) { continue; } //获取字典表的配置信息 OnlCgformField onlCgformField = onlCgformFieldService.queryFormFieldByTableNameAndField(tableName, "sel_search"); if (onlCgformField == null || oConvertUtils.isEmpty(onlCgformField.getDictTable())) { continue; } List<String> dictTableName = sysBaseAPI.queryTableDictByKeys(onlCgformField.getDictTable(), onlCgformField.getDictText(), onlCgformField.getDictField(), new String[]{sel_search}); if (dictTableName != null && dictTableName.size() > 0) { map.put("sel_search", dictTableName.get(0)); } } } } ~~~ ``` 3.访问online表数据 ![](https://img.kancloud.cn/67/b6/67b640b9ba77ba91381c8c97c91a1f8b_1608x357.png) 4.导出excel数据显示如下: ![](https://img.kancloud.cn/57/29/57290cad6fc9e2c7eedfe8c549d5faef_552x335.png) 注意:java增强导出需要实现的接口是 :CgformEnhanceJavaListInter