收资清单模板导出接口优化
This commit is contained in:
@ -290,7 +290,7 @@ public class DesCollectServiceImpl extends ServiceImpl<DesCollectMapper, DesColl
|
||||
// 设置响应头,指定Excel格式和下载文件名
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=utf-8''收资清单模板.xlsx");
|
||||
response.setHeader("Content-Disposition", "attachment; filename="+URLEncoder.encode("收资清单模板.xlsx", StandardCharsets.UTF_8));
|
||||
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
// 创建主 Sheet 和隐藏 Sheet
|
||||
@ -303,7 +303,7 @@ public class DesCollectServiceImpl extends ServiceImpl<DesCollectMapper, DesColl
|
||||
int rowIdx = 0;
|
||||
for (Map.Entry<Long, String> entry : userIdToNameMapByDept.entrySet()) {
|
||||
Row row = dropdownSheet.createRow(rowIdx++);
|
||||
row.createCell(0).setCellValue(entry.getKey());
|
||||
row.createCell(0).setCellValue(entry.getKey().toString());
|
||||
row.createCell(1).setCellValue(entry.getValue());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user