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