{
"code": 1,
"msg": "Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "export"",
"data": null
}
2. 代码内实际请求方式为 POST
@Inner(value = false)
@ApiOperation(value = "导出Excel文件")
@PostMapping("/export")
public void export(HttpServletResponse response) {
// 全部导出
List structureOutputExcelList = iIotStructureService.structureOutputExcel();
log.info("structureOutputExcelList:{}",structureOutputExcelList);
try (XSSFWorkbook wb = ExcelUtil.createExcel(structureOutputExcelList, StructureOutputExcel.class, null)) {
String filename = ExcelAuxiliaryUtil.getExcelName("structureOutputExcel.xlsx");
response.setHeader("Content-Disposition", "attachment; filename="" + KeyUtil.random(16));
ExcelUtil.writeExcel(response, filename, wb);
} catch (Exception e) {
ExcelAuxiliaryUtil.sendResponseErrorMsg(response, e);
}
}
3. 修正请求方式 POST



