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; }