Aslee 4 роки тому
батько
коміт
9591ecd483

+ 37 - 0
base-module/src/main/java/com/caimei/module/base/entity/po/CmBrandAuthFilePo.java

@@ -0,0 +1,37 @@
+package com.caimei.module.base.entity.po;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author Aslee
+ */
+@Data
+public class CmBrandAuthFilePo {
+    private Integer id;
+    /**
+     * 对应cm_brand_auth表id
+     */
+    private Integer brandAuthId;
+
+    /**
+     * 声明文件名称
+     */
+    private String name;
+
+    /**
+     * oss存储名
+     */
+    private String ossName;
+
+    /**
+     * 文件唯一标识
+     */
+    private String md5Hex;
+
+    /**
+     * 上传时间
+     */
+    private Date uploadTime;
+}

+ 12 - 1
base-module/src/main/java/com/caimei/module/base/entity/vo/AuthProductVo.java

@@ -11,7 +11,10 @@ import java.util.List;
  */
 @Data
 public class AuthProductVo extends CmBrandAuthProductPo {
-
+    /**
+     * 品牌授权Id
+     */
+    private Integer authId;
     /**
      * 品牌授权logo
      */
@@ -48,6 +51,14 @@ public class AuthProductVo extends CmBrandAuthProductPo {
      * 声明链接
      */
     private String statementLink;
+    /**
+     * 声明图片
+     */
+    private String statementImage;
+    /**
+     * 声明文件
+     */
+    private StatementFileVo statementFile;
     /**
      * 被授权方
      */

+ 19 - 0
base-module/src/main/java/com/caimei/module/base/entity/vo/StatementFileVo.java

@@ -0,0 +1,19 @@
+package com.caimei.module.base.entity.vo;
+
+import com.caimei.module.base.entity.po.CmBrandAuthFilePo;
+import com.caimei.module.base.entity.po.CmBrandAuthProductPo;
+import com.caimei.module.base.entity.po.CmBrandProductParamPo;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author Aslee
+ */
+@Data
+public class StatementFileVo extends CmBrandAuthFilePo {
+    /**
+     * 访问声明文件链接
+     */
+    private String url;
+}

+ 2 - 0
product/src/main/java/com/caimei/module/product/dao/ProductModuleDao.java

@@ -105,4 +105,6 @@ public interface ProductModuleDao {
     AuthProductVo findAuthProductDetailsByProductId(Integer productId);
 
     List<CmBrandProductParamPo> getParamsByProductId(Integer productId);
+
+    StatementFileVo findStatementFileByAuthId(Integer authId);
 }

+ 8 - 2
product/src/main/resources/com-caimei-module-product/ProductModuleMapper.xml

@@ -595,8 +595,8 @@
     </select>
     <select id="findAuthProductDetailsByProductId" resultType="com.caimei.module.base.entity.vo.AuthProductVo">
         select bap.name,bap.snCode,bap.image,bap.certificateImage,cb.authLogo,cb.name as brandName,c.name as productionPlace,
-               ba.securityLink,ba.agentFlag,ba.agentName,ba.statementType,ba.statementContent,
-               ba.statementLink,ba.authParty
+               ba.id as authId,ba.securityLink,ba.agentFlag,ba.agentName,ba.statementType,ba.statementContent,
+               ba.statementLink,ba.statementImage,ba.authParty
            from cm_brand_auth_product bap
             left join cm_brand_auth ba on bap.authId = ba.id
             left join cm_brand cb on ba.brandId = cb.id
@@ -606,4 +606,10 @@
     <select id="getParamsByProductId" resultType="com.caimei.module.base.entity.po.CmBrandProductParamPo">
         select name,content from cm_brand_product_param where productId = #{productId}
     </select>
+    <select id="findStatementFileByAuthId" resultType="com.caimei.module.base.entity.vo.StatementFileVo">
+        select name,ossName,md5Hex,uploadTime
+        from cm_brand_auth_file
+        where brandAuthId = #{authId}
+        limit 1
+    </select>
 </mapper>