Переглянути джерело

fix:完成图片上传功能

qingwudarao 5 місяців тому
батько
коміт
1663a63e75

+ 3 - 2
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/domain/Attachment.java

@@ -100,11 +100,12 @@ public class Attachment {
     /**
      * 存储位置
      */
-    private String storage;
+    @TableField("storage")
+    private String ossId;
 
     /**
      * ossId
      */
     @TableField("sha1")
-    private String ossId;
+    private String sha1;
 }

+ 5 - 6
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/domain/bo/AttachmentBo.java

@@ -15,7 +15,7 @@ import java.util.Date;
 @AutoMapper(target = Attachment.class, reverseConvertGenerate = false)
 public class AttachmentBo {
 
-    public AttachmentBo(String category, Long userId, String url, String imageType, String fileName, Date createTime, Date updateTime, Date uploadTime, String storage, String ossId) {
+    public AttachmentBo(String category, Long userId, String url, String imageType, String fileName, Date createTime, Date updateTime, Date uploadTime, String ossId) {
         this.category = category;
         this.userId = userId;
         this.url = url;
@@ -24,7 +24,6 @@ public class AttachmentBo {
         this.createTime = createTime;
         this.updateTime = updateTime;
         this.uploadTime = uploadTime;
-        this.storage = storage;
         this.ossId = ossId;
     }
 
@@ -104,12 +103,12 @@ public class AttachmentBo {
     private Date uploadTime;
 
     /**
-     * 存储位置
+     * ossId
      */
-    private String storage;
+    private String ossId;
 
     /**
-     * ossId
+     * sha1
      */
-    private String ossId;
+    private String sha1;
 }

+ 4 - 4
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/domain/vo/AttachmentVo.java

@@ -89,12 +89,12 @@ public class AttachmentVo {
     private Date uploadTime;
 
     /**
-     * 存储位置
+     * ossId
      */
-    private String storage;
+    private String ossId;
 
     /**
-     * ossId
+     * sha1
      */
-    private String ossId;
+    private String sha1;
 }

+ 2 - 2
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/service/impl/BulkOrderManagementServiceImpl.java

@@ -126,7 +126,8 @@ public class BulkOrderManagementServiceImpl implements BulkOrderManagementServic
                 }
 
                 // 处理图片关联性
-                attachmentMapper.insert(MapstructUtils.convert(new AttachmentBo("image",
+                attachmentMapper.insert(MapstructUtils.convert(new AttachmentBo(
+                    "image",
                     newBulkOrderBo.getUserId(),
                     sysOssVo.getUrl(),
                     sysOssVo.getFileSuffix(),
@@ -134,7 +135,6 @@ public class BulkOrderManagementServiceImpl implements BulkOrderManagementServic
                     newBulkOrderBo.getCreateTime(),
                     newBulkOrderBo.getUpdateTime(),
                     sysOssVo.getCreateTime(),
-                    sysOssVo.getUrl(),
                     sysOssVo.getOssId().toString()), Attachment.class));
             }
             return 1;