From 2a362c326475dcd1584df4810e39107182b1098e Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Tue, 1 Mar 2022 19:24:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=87=E4=BB=B6=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E4=BC=A0=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xkrs/controller/PictureController.java | 2 +- .../java/com/xkrs/controller/SpecController.java | 2 +- src/main/java/com/xkrs/model/entity/FileEntity.java | 4 ++-- .../java/com/xkrs/model/entity/PictureEntity.java | 2 +- src/main/java/com/xkrs/util/ExcelUploadUtil.java | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/xkrs/controller/PictureController.java b/src/main/java/com/xkrs/controller/PictureController.java index b7480f7..b179102 100644 --- a/src/main/java/com/xkrs/controller/PictureController.java +++ b/src/main/java/com/xkrs/controller/PictureController.java @@ -54,6 +54,6 @@ public class PictureController { if (pictureEntities.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该零件的图片!", locale); } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, pictureEntities.get(0), locale); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, pictureEntities, locale); } } diff --git a/src/main/java/com/xkrs/controller/SpecController.java b/src/main/java/com/xkrs/controller/SpecController.java index 1ac5126..b441fba 100644 --- a/src/main/java/com/xkrs/controller/SpecController.java +++ b/src/main/java/com/xkrs/controller/SpecController.java @@ -48,7 +48,7 @@ public class SpecController { if (specEntities.isEmpty()) { return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "暂时没有该零件的规格信息!", locale); } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, specEntities.get(0), locale); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, specEntities, locale); } } diff --git a/src/main/java/com/xkrs/model/entity/FileEntity.java b/src/main/java/com/xkrs/model/entity/FileEntity.java index 21273c3..f89079a 100644 --- a/src/main/java/com/xkrs/model/entity/FileEntity.java +++ b/src/main/java/com/xkrs/model/entity/FileEntity.java @@ -50,13 +50,13 @@ public class FileEntity { /** * 上传模板的路径 */ - @Column(length = 1024, columnDefinition = "varchar(1024)") + @Column(length = 2048, columnDefinition = "varchar(2048)") private String fileUploadPath; /** * 下载路径 */ - @Column(length = 1024, columnDefinition = "varchar(1024)") + @Column(length = 2048, columnDefinition = "varchar(2048)") private String fileDownloadPath; public FileEntity() { diff --git a/src/main/java/com/xkrs/model/entity/PictureEntity.java b/src/main/java/com/xkrs/model/entity/PictureEntity.java index 1db0cdc..6ed0a8b 100644 --- a/src/main/java/com/xkrs/model/entity/PictureEntity.java +++ b/src/main/java/com/xkrs/model/entity/PictureEntity.java @@ -46,7 +46,7 @@ public class PictureEntity { /** * 图片路径 */ - @Column(length = 85, columnDefinition = "varchar(85)") + @Column(length = 2048, columnDefinition = "varchar(2048)") private String picturePath; public PictureEntity() { diff --git a/src/main/java/com/xkrs/util/ExcelUploadUtil.java b/src/main/java/com/xkrs/util/ExcelUploadUtil.java index 918fddf..d2c1bc8 100644 --- a/src/main/java/com/xkrs/util/ExcelUploadUtil.java +++ b/src/main/java/com/xkrs/util/ExcelUploadUtil.java @@ -29,7 +29,7 @@ public class ExcelUploadUtil { * @throws IOException */ public static String memoryFile(MultipartFile fileInput, int subDirType) throws IOException { - String subDir = subDirType == 1 ? "excel/" : "picture/"; + String subDir = subDirType == 1 ? "/excel/" : "/picture/"; //String uploadPath = "http://139.199.98.175:2088/wfTaskImage/"; // String uploadPath = "http://192.168.2.9:2088/"; String uploadPath = "http://118.24.27.47:4096/"; @@ -44,17 +44,17 @@ public class ExcelUploadUtil { String newName = UUID.randomUUID().toString() + suffix; //将图片保存到本地/usr/etc/images/Folder - File file = new File("/Users/liuchengqian/Desktop/DaJiang/"); -// File file = new File("/home/sxy/server/industrial_measurement/" + subDir); +// File file = new File("/Users/liuchengqian/Desktop/DaJiang/"); + File file = new File("/home/sxy/server/industrial_measurement" + subDir); if (!file.exists()) { file.mkdirs(); } - String path = "/Users/liuchengqian/Desktop/DaJiang/"+newName; -// String path = "/home/sxy/server/industrial_measurement/" + subDir + newName; +// String path = "/Users/liuchengqian/Desktop/DaJiang/"+newName; + String path = "/home/sxy/server/industrial_measurement" + subDir + newName; String uploadsImage = uploadPath + newName; //实现上传 fileInput.transferTo(new File(path)); - return path; + return subDir + newName; } return null; }