Commit 9f0fb557 authored by tianbo's avatar tianbo

优化代码

parent 22b7f936
...@@ -25,6 +25,12 @@ public class ExcelDto { ...@@ -25,6 +25,12 @@ public class ExcelDto {
this.type = type; this.type = type;
} }
public ExcelDto(String fileName, String sheetName, String type) {
this.fileName = fileName;
this.sheetName = sheetName;
this.type = type;
}
public String getFileName() { public String getFileName() {
return StringUtils.isEmpty(fileName) ? DateUtils.convertDateToString(new Date(), "yyyyMMddHHmmss") : fileName; return StringUtils.isEmpty(fileName) ? DateUtils.convertDateToString(new Date(), "yyyyMMddHHmmss") : fileName;
} }
......
...@@ -73,6 +73,19 @@ public class ExcelController extends BaseController { ...@@ -73,6 +73,19 @@ public class ExcelController extends BaseController {
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类2")
@GetMapping("/export/list")
public void exportByType(HttpServletResponse response, @RequestParam(required = false) String fileName,
@RequestParam(required = false) String sheetName, @RequestParam String type) {
try {
excelService.commonExport(response, new ExcelDto(fileName, sheetName, type));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "上传文件数据-") @ApiOperation(value = "上传文件数据-")
@PostMapping("/upload") @PostMapping("/upload")
public void upload(@RequestPart("file") MultipartFile multipartFile, ExcelDto excelDto) { public void upload(@RequestPart("file") MultipartFile multipartFile, ExcelDto excelDto) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment