Преглед изворни кода

正品联盟商品详情优化

Aslee пре 4 година
родитељ
комит
8f45663c09

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

+ 29 - 6
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,7 +9,23 @@ 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
      */
@@ -31,14 +46,22 @@ public class AuthProductVo extends CmBrandAuthProductPo {
      * 防伪链接
      */
     private String securityLink;
-    /**
-     * 代理标识:0无代理,1有代理
-     */
-    private Integer agentFlag;
     /**
      * 代理商名称
      */
     private String agentName;
+    /**
+     * 供应商类型:1品牌方,2代理商
+     */
+    private Integer shopType;
+    /**
+     * 供应商名称
+     */
+    private String shopName;
+    /**
+     * 供应商用户id
+     */
+    private Integer authUserId;
     /**
      * 声明类型:1弹窗声明,2链接声明
      */

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

@@ -1,12 +1,8 @@
 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
  */

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

@@ -102,9 +102,9 @@ public interface ProductModuleDao {
 
     BigtypeVo getBigTypeByBigTypeId(Integer bigTypeID);
 
-    AuthProductVo findAuthProductDetailsByProductId(Integer productId);
+    AuthProductVo findAuthProductByProductId(Integer productId);
 
     List<CmBrandProductParamPo> getParamsByProductId(Integer productId);
 
-    StatementFileVo findStatementFileByAuthId(Integer authId);
+    StatementFileVo findStatementFileByAuthUserId(Integer authUserId);
 }

+ 27 - 11
product/src/main/resources/com-caimei-module-product/ProductModuleMapper.xml

@@ -593,23 +593,39 @@
         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.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
-            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.certificateImage,
+               b.authLogo,
+               b.name  as brandName,
+               c.name  as productionPlace,
+               a.id    as authId,
+               a.authParty,
+               u.authUserId as authUserId,
+               u.name  as shopName,
+               i.securityLink,
+               i.type  as shopType,
+               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
+                 left join cm_brand b on i.brandId = b.id
+                 left join country c on i.countryId = c.countryId
+        where p.id = #{productId} 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="findStatementFileByAuthId" resultType="com.caimei.module.base.entity.vo.StatementFileVo">
+    <select id="findStatementFileByAuthUserId" resultType="com.caimei.module.base.entity.vo.StatementFileVo">
         select name,ossName,md5Hex,uploadTime
         from cm_brand_auth_file
-        where brandAuthId = #{authId}
+        where authUserId = #{authUserId}
         limit 1
     </select>
 </mapper>