|
|
|
@ -60,12 +60,12 @@ public class AccountingReportController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 账簿上传
|
|
|
|
|
* 会计报表上传
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/upload")
|
|
|
|
|
@Operation(summary = "上传会计报表")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('archives:accounting-report:create')")
|
|
|
|
|
public String uploadAccountingBook(@RequestPart("file") MultipartFile multipartFile, @RequestParam("type") String type,
|
|
|
|
|
public CommonResult<String> uploadAccountingBook(@RequestPart("file") MultipartFile multipartFile, @RequestParam("type") String type,
|
|
|
|
|
@RequestParam("companyId") Long companyId,
|
|
|
|
|
@RequestParam("company") String company,
|
|
|
|
|
@RequestParam("year") String year,
|
|
|
|
@ -74,11 +74,12 @@ public class AccountingReportController {
|
|
|
|
|
String uri = fileService.createFile(multipartFile.getOriginalFilename(), null, IoUtil.readBytes(multipartFile.getInputStream()));
|
|
|
|
|
AccountingReportCreateReqVO vo = new AccountingReportCreateReqVO();
|
|
|
|
|
vo.setCompany(company).setCompanyId(companyId).setType(type).setYear(year).setPeriod(period).setUrl(uri).setName(multipartFile.getOriginalFilename());
|
|
|
|
|
return uri;
|
|
|
|
|
this.createAccountingReport(vo);
|
|
|
|
|
return CommonResult.success("新增成功");
|
|
|
|
|
} catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return "上传失败";
|
|
|
|
|
return CommonResult.error("上传失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO minio上传函数 后续封装为公用方法
|
|
|
|
|