Pārlūkot izejas kodu

Merge remote-tracking branch 'remotes/origin/developer' into developerC

plf 4 gadi atpakaļ
vecāks
revīzija
294384d9c8

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

+ 0 - 28
base-module/src/main/java/com/caimei/module/base/entity/po/CmBrandAuthProductPo.java

@@ -1,28 +0,0 @@
-package com.caimei.module.base.entity.po;
-
-import lombok.Data;
-
-import java.util.Date;
-
-/**
- * @author Aslee
- */
-@Data
-public class CmBrandAuthProductPo {
-    /**
-     * 商品名称
-     */
-    private String name;
-    /**
-     * 商品SN码
-     */
-    private String snCode;
-    /**
-     * 商品图片
-     */
-    private String image;
-    /**
-     * 授权牌照
-     */
-    private String certificateImage;
-}

+ 57 - 7
base-module/src/main/java/com/caimei/module/base/entity/vo/AuthProductVo.java

@@ -1,6 +1,5 @@
 package com.caimei.module.base.entity.vo;
 
-import com.caimei.module.base.entity.po.CmBrandAuthProductPo;
 import com.caimei.module.base.entity.po.CmBrandProductParamPo;
 import lombok.Data;
 
@@ -10,12 +9,35 @@ import java.util.List;
  * @author Aslee
  */
 @Data
-public class AuthProductVo extends CmBrandAuthProductPo {
-
+public class AuthProductVo {
+    /**
+     * 商品名称
+     */
+    private String productName;
+    /**
+     * 商品SN码
+     */
+    private String snCode;
+    /**
+     * 商品图片
+     */
+    private String productImage;
+    /**
+     * 授权牌照
+     */
+    private String certificateImage;
+    /**
+     * 品牌授权Id
+     */
+    private Integer authId;
     /**
      * 品牌授权logo
      */
     private String authLogo;
+    /**
+     * 品牌Id
+     */
+    private Integer brandId;
     /**
      * 品牌名称
      */
@@ -29,13 +51,17 @@ public class AuthProductVo extends CmBrandAuthProductPo {
      */
     private String securityLink;
     /**
-     * 代理标识:0无代理,1有代理
+     * 供应商类型:1品牌方,2代理商
      */
-    private Integer agentFlag;
+    private Integer shopType;
     /**
-     * 代理商名称
+     * 供应商名称
      */
-    private String agentName;
+    private String shopName;
+    /**
+     * 供应商用户id
+     */
+    private Integer authUserId;
     /**
      * 声明类型:1弹窗声明,2链接声明
      */
@@ -48,6 +74,14 @@ public class AuthProductVo extends CmBrandAuthProductPo {
      * 声明链接
      */
     private String statementLink;
+    /**
+     * 声明图片
+     */
+    private String statementImage;
+    /**
+     * 声明文件
+     */
+    private StatementFileVo statementFile;
     /**
      * 被授权方
      */
@@ -56,4 +90,20 @@ public class AuthProductVo extends CmBrandAuthProductPo {
      * 商品参数
      */
     private List<CmBrandProductParamPo> paramList;
+    /**
+     * pc商品图片(含水印)
+     */
+    private String pcImage;
+    /**
+     * 小程序商品图片(含水印)
+     */
+    private String appletsImage;
+    /**
+     * pc授权牌照图片(含水印)
+     */
+    private String pcCertificateImage;
+    /**
+     * 小程序授权牌照图片(含水印)
+     */
+    private String appletsCertificateImage;
 }

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

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

+ 3 - 1
product/src/main/java/com/caimei/module/product/dao/ProductModuleDao.java

@@ -102,7 +102,9 @@ public interface ProductModuleDao {
 
     BigtypeVo getBigTypeByBigTypeId(Integer bigTypeID);
 
-    AuthProductVo findAuthProductDetailsByProductId(Integer productId);
+    AuthProductVo findAuthProductByProductId(Integer productId);
 
     List<CmBrandProductParamPo> getParamsByProductId(Integer productId);
+
+    StatementFileVo findStatementFile(@Param("authUserId") Integer authUserId, @Param("brandId") Integer brandId);
 }

+ 37 - 9
product/src/main/resources/com-caimei-module-product/ProductModuleMapper.xml

@@ -593,17 +593,45 @@
         from bigtype
         where bigTypeID = #{bigTypeID}
     </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
-           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
-            left join country c on ba.countryId = c.countryId
-        where bap.id = #{productId}
+    <select id="findAuthProductByProductId" resultType="com.caimei.module.base.entity.vo.AuthProductVo">
+        select p.name  as productName,
+               p.snCode,
+               p.image as productImage,
+               p.pcImage,
+               p.appletsImage,
+               p.certificateImage,
+               p.pcCertificateImage,
+               p.appletsCertificateImage,
+               p.brandId,
+               b.authLogo,
+               b.name  as brandName,
+               c.name  as productionPlace,
+               a.id    as authId,
+               a.authParty,
+               u.authUserId as authUserId,
+               u.name  as shopName,
+               u.shopType,
+               i.securityLink,
+               i.statementType,
+               i.statementContent,
+               i.statementLink,
+               i.statementImage
+        from cm_brand_auth_product p
+                 left join cm_brand_auth a on p.authId = a.id
+                 left join cm_brand_auth_user u on a.authUserId = u.authUserId
+                 left join cm_brand_auth_shop_info i on u.authUserId = i.authUserId and p.brandId = i.brandId
+                 left join cm_brand b on i.brandId = b.id
+                 left join country c on i.countryId = c.countryId
+        where p.id = #{productId} and u.status = 1 and a.status = 1 and p.status = 1
     </select>
     <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="findStatementFile" resultType="com.caimei.module.base.entity.vo.StatementFileVo">
+        select name,ossName,md5Hex,uploadTime
+        from cm_brand_auth_file
+        where authUserId = #{authUserId}
+        and brandId = #{brandId}
+        limit 1
+    </select>
 </mapper>