浏览代码

特殊商品增加退货提示

JiangChongBo 2 年之前
父节点
当前提交
b2e1ec54a9

+ 1 - 1
src/main/java/com/caimei365/commodity/mapper/PageMapper.java

@@ -473,5 +473,5 @@ public interface PageMapper {
 
     Integer getShopid(Integer authUserId);
 
-
+    String getHelpContent(Integer helpId);
 }

+ 9 - 0
src/main/java/com/caimei365/commodity/model/vo/ProductDetailVo.java

@@ -357,4 +357,13 @@ public class ProductDetailVo implements Serializable {
      *证书有效链接
      */
     public String qualificationLink;
+
+    /**
+     * 能否退货  1 能 2不能
+     */
+    private Integer returnGoodsStutas;
+    /**
+     * 特殊商品退货须知提示  (取后台帮助中心id1040的数据)
+     */
+    private String  helpContent;
 }

+ 6 - 0
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -551,10 +551,16 @@ public class PageServiceImpl implements PageService {
     @Override
     public ResponseJson<ProductDetailVo> getProductDetails(Integer productId, Integer userId) {
         ProductDetailVo product = pageMapper.getProductDetails(productId);
+        //当该商品的“能否退货”字段的值是“不能”时,新增特殊商品退货须知提示
         if (product == null) {
             //商品不存在
             product = new ProductDetailVo();
             product.setValidFlag(0);
+        }else{
+            if(null!=product.getReturnGoodsStutas()&&2==product.getReturnGoodsStutas()){
+                String helpContent = pageMapper.getHelpContent(1040);
+                product.setHelpContent(helpContent);
+            }
         }
         String[] split = null;
         // 品牌名称

+ 5 - 1
src/main/resources/mapper/PageMapper.xml

@@ -264,7 +264,8 @@
                p.qualificationNo   as qualificationNo,
                p.productName       as productName,
                p.qualificationTime as qualificationTime,
-               p.qualificationLink as qualificationLink
+               p.qualificationLink as qualificationLink,
+               p.returnGoodsStutas
         from product p
                  left join shop s on s.shopId = p.shopId
         where p.productID = #{productId}
@@ -1310,4 +1311,7 @@
     <select id="getShopid" resultType="java.lang.Integer">
         select cmShopId from cm_brand_auth_user where authUserId=#{authUserId}
     </select>
+    <select id="getHelpContent" resultType="java.lang.String">
+        select content from helppage where helpPageID=#{helpId}
+    </select>
 </mapper>