|
|
@ -164,7 +164,12 @@ public class InvoicesController {
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
invoicesDO.setDuplicateMark(Byte.valueOf(AccountingStatusEnum.UN_DUPLICATE_INVOICE.getValue()));
|
|
|
|
invoicesDO.setDuplicateMark(Byte.valueOf(AccountingStatusEnum.UN_DUPLICATE_INVOICE.getValue()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String url = getUrl(multipartFile);
|
|
|
|
String url="";
|
|
|
|
|
|
|
|
if (fileExtension.equalsIgnoreCase("ofd")) {
|
|
|
|
|
|
|
|
url = getUrl(multipartFile, UUID.randomUUID()+".ofd", "ofd");
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
url = getUrl(multipartFile, "other", "other");
|
|
|
|
|
|
|
|
}
|
|
|
|
invoicesDO.setFileUrl(url);
|
|
|
|
invoicesDO.setFileUrl(url);
|
|
|
|
invoicesService.createInvoices(invoicesDO);
|
|
|
|
invoicesService.createInvoices(invoicesDO);
|
|
|
|
return success(invoicesDO);
|
|
|
|
return success(invoicesDO);
|
|
|
@ -190,8 +195,12 @@ public class InvoicesController {
|
|
|
|
* @param file
|
|
|
|
* @param file
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private String getUrl(MultipartFile file) throws Exception{
|
|
|
|
private String getUrl(MultipartFile file,String name, String path) throws Exception{
|
|
|
|
String url="";
|
|
|
|
String url="";
|
|
|
|
|
|
|
|
if (path.equals("ofd")){
|
|
|
|
|
|
|
|
url = fileService.createFile(name, path, IoUtil.readBytes(file.getInputStream()));
|
|
|
|
|
|
|
|
return url;
|
|
|
|
|
|
|
|
}
|
|
|
|
url = fileService.createFile(null, null, IoUtil.readBytes(file.getInputStream()));
|
|
|
|
url = fileService.createFile(null, null, IoUtil.readBytes(file.getInputStream()));
|
|
|
|
return url;
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|