| | |
| | | import org.sxkj.system.param.DeptExportParam; |
| | | import org.sxkj.system.param.DeptPageParam; |
| | | import org.sxkj.system.service.IDeptService; |
| | | import org.sxkj.system.util.excel.DeptSheetWriteHandler; |
| | | import org.sxkj.system.util.excel.RegionSheetWriteHandler; |
| | | import org.sxkj.system.vo.DeptVO; |
| | | import org.sxkj.system.wrapper.DeptWrapper; |
| | |
| | | |
| | | // 使用EasyExcel导出,并注册RegionSheetWriteHandler |
| | | EasyExcel.write(response.getOutputStream(), DeptImportExcel.class) |
| | | .registerWriteHandler(new RegionSheetWriteHandler()) |
| | | .registerWriteHandler(new DeptSheetWriteHandler()) |
| | | .sheet("机构表") |
| | | .doWrite(list); |
| | | } |
| | |
| | | |
| | | // 为区域列添加下拉选择 |
| | | // 假设区域列是第3列(索引为1),从第2行开始(索引为1) |
| | | addRegionValidation(workbook, sheet, 5, 1, 1000, ENABLE_DISABLE); |
| | | addRegionValidation(workbook, sheet, 3, 1, 1000, ENABLE_DISABLE); |
| | | } |
| | | |
| | | /** |
| | |
| | | * </p> |
| | | */ |
| | | |
| | | private static final String[] REGION_NAMES = { "市级", "区县级", "街道级" }; |
| | | // 启用 禁用 |
| | | private static final String[] ENABLE_DISABLE = { "启用", "禁用" }; |
| | | |
| | |
| | | |
| | | // 为区域列添加下拉选择 |
| | | // 假设区域列是第3列(索引为1),从第2行开始(索引为1) |
| | | addRegionValidation(workbook, sheet, 3, 1, 1000, ENABLE_DISABLE); |
| | | addRegionValidation(workbook, sheet, 3, 1, 1000, REGION_NAMES); |
| | | addRegionValidation(workbook, sheet, 5, 1, 1000, ENABLE_DISABLE); |
| | | } |
| | | |
| | | /** |