Jelajahi Sumber

商品字段优化

chao 4 tahun lalu
induk
melakukan
18713158fa

+ 8 - 4
src/main/java/com/caimei365/commodity/components/PriceUtilService.java

@@ -86,6 +86,7 @@ public class PriceUtilService {
             price.setActStatus(0);
             price.setActStatus(0);
             // 设置划线价
             // 设置划线价
             price.setOriginalPrice(price.getPrice());
             price.setOriginalPrice(price.getPrice());
+            price.setRetailPrice(price.getPrice());
             //税费标志
             //税费标志
             boolean taxFlag = "0".equals(price.getIncludedTax()) && ("1".equals(price.getInvoiceType()) || "2".equals(price.getInvoiceType()));
             boolean taxFlag = "0".equals(price.getIncludedTax()) && ("1".equals(price.getInvoiceType()) || "2".equals(price.getInvoiceType()));
             // 根据商品id查询商品活动
             // 根据商品id查询商品活动
@@ -141,6 +142,7 @@ public class PriceUtilService {
             price.setPrice(0d);
             price.setPrice(0d);
             price.setOriginalPrice(0d);
             price.setOriginalPrice(0d);
             price.setUserIdentity(0);
             price.setUserIdentity(0);
+            price.setRetailPrice(0d);
         }
         }
         // 屏蔽成本价
         // 屏蔽成本价
         price.setCostProportional(0d);
         price.setCostProportional(0d);
@@ -156,6 +158,7 @@ public class PriceUtilService {
     public void setItemPriceByUserId(ProductItemVo product, Integer userId) {
     public void setItemPriceByUserId(ProductItemVo product, Integer userId) {
         // 设置价格等级
         // 设置价格等级
         product.setPriceGrade(getPriceGrade(product.getPrice()));
         product.setPriceGrade(getPriceGrade(product.getPrice()));
+        product.setRetailPrice(product.getPrice());
         // 根据用户Id查询用户身份
         // 根据用户Id查询用户身份
         Integer identity = priceMapper.getIdentityByUserId(userId);
         Integer identity = priceMapper.getIdentityByUserId(userId);
         if (null != identity && identity > 0) {
         if (null != identity && identity > 0) {
@@ -172,7 +175,7 @@ public class PriceUtilService {
             if (null != promotions) {
             if (null != promotions) {
                 // 促销活动
                 // 促销活动
                 product.setActStatus(1);
                 product.setActStatus(1);
-                product.setLadderFlag(0);
+                product.setLadderPriceFlag(0);
                 if (promotions.getMode() == 3) {
                 if (promotions.getMode() == 3) {
                     // 获取赠品
                     // 获取赠品
                     List<ProductItemVo> giftList = promotionsMapper.getPromotionGifts(promotions.getId());
                     List<ProductItemVo> giftList = promotionsMapper.getPromotionGifts(promotions.getId());
@@ -189,7 +192,7 @@ public class PriceUtilService {
                 product.setPromotions(promotions);
                 product.setPromotions(promotions);
             } else {
             } else {
                 if (null != userId) {
                 if (null != userId) {
-                    if (1 == product.getLadderFlag()) {
+                    if (1 == product.getLadderPriceFlag()) {
                         // 阶梯价
                         // 阶梯价
                         LadderPriceVo lowerPrice = priceMapper.findLowerLadderPrice(product.getProductId());
                         LadderPriceVo lowerPrice = priceMapper.findLowerLadderPrice(product.getProductId());
                         LadderPriceVo lowerBuyNum = priceMapper.findMaxLadderPrice(product.getProductId());
                         LadderPriceVo lowerBuyNum = priceMapper.findMaxLadderPrice(product.getProductId());
@@ -199,14 +202,14 @@ public class PriceUtilService {
                                 product.setMin(lowerBuyNum.getBuyNum());
                                 product.setMin(lowerBuyNum.getBuyNum());
                             }
                             }
                         } else {
                         } else {
-                            product.setLadderFlag(0);
+                            product.setLadderPriceFlag(0);
                         }
                         }
                     } else {
                     } else {
                         // 复购价
                         // 复购价
                         Double repurchase = priceMapper.getRepurchasePrice(product.getProductId(), userId);
                         Double repurchase = priceMapper.getRepurchasePrice(product.getProductId(), userId);
                         if (null != repurchase && repurchase > 0) {
                         if (null != repurchase && repurchase > 0) {
                             product.setPrice(repurchase);
                             product.setPrice(repurchase);
-                            product.setLadderFlag(0);
+                            product.setLadderPriceFlag(0);
                         }
                         }
                     }
                     }
                 }
                 }
@@ -220,6 +223,7 @@ public class PriceUtilService {
             product.setPrice(0d);
             product.setPrice(0d);
             product.setOriginalPrice(0d);
             product.setOriginalPrice(0d);
             product.setUserIdentity(0);
             product.setUserIdentity(0);
+            product.setRetailPrice(0d);
         }
         }
     }
     }
 }
 }

+ 2 - 0
src/main/java/com/caimei365/commodity/controller/ProductShopApi.java

@@ -67,4 +67,6 @@ public class ProductShopApi {
         return shopService.getShopProducts(shopId, name, productCode, validFlag, featuredFlag, typeSort, bigTypeId, smallTypeId, tinyTypeId, pageNum, pageSize);
         return shopService.getShopProducts(shopId, name, productCode, validFlag, featuredFlag, typeSort, bigTypeId, smallTypeId, tinyTypeId, pageNum, pageSize);
     }
     }
 
 
+
+
 }
 }

+ 1 - 1
src/main/java/com/caimei365/commodity/model/search/ProductListVo.java

@@ -37,7 +37,7 @@ public class ProductListVo implements Serializable {
     /** 搜索关键词searchKey */
     /** 搜索关键词searchKey */
     private String keyword;
     private String keyword;
     /** 美博会商品活动状态 */
     /** 美博会商品活动状态 */
-    private Integer actFlag;
+    private Integer beautyActFlag;
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 

+ 1 - 0
src/main/java/com/caimei365/commodity/model/vo/PriceVo.java

@@ -26,6 +26,7 @@ public class PriceVo implements Serializable {
      * 价格(计算后)
      * 价格(计算后)
      */
      */
     private Double price;
     private Double price;
+    private Double retailPrice;
     /**
     /**
      * 划线价格
      * 划线价格
      */
      */

+ 3 - 6
src/main/java/com/caimei365/commodity/model/vo/ProductItemVo.java

@@ -31,6 +31,7 @@ public class ProductItemVo implements Serializable {
     private String code;
     private String code;
     /** 机构价 */
     /** 机构价 */
     private Double price;
     private Double price;
+    private Double retailPrice;
     /** 是否公开机构价 0公开价格 1不公开价格 */
     /** 是否公开机构价 0公开价格 1不公开价格 */
     private Integer priceFlag;
     private Integer priceFlag;
     /** 计算后价格等级 */
     /** 计算后价格等级 */
@@ -42,7 +43,7 @@ public class ProductItemVo implements Serializable {
     /** 搜索关键词searchKey */
     /** 搜索关键词searchKey */
     private String keyword;
     private String keyword;
     /** 美博会商品活动状态 */
     /** 美博会商品活动状态 */
-    private Integer actFlag;
+    private Integer beautyActFlag;
     /** 商品原价 */
     /** 商品原价 */
     private Double originalPrice;
     private Double originalPrice;
     /** 购买数量 */
     /** 购买数量 */
@@ -58,7 +59,7 @@ public class ProductItemVo implements Serializable {
     /** 活动状态:1有效,0失效 */
     /** 活动状态:1有效,0失效 */
     private Integer actStatus;
     private Integer actStatus;
     /** 启用阶梯价格标识:1是,0否 */
     /** 启用阶梯价格标识:1是,0否 */
-    private Integer ladderFlag;
+    private Integer ladderPriceFlag;
     /** 库存 */
     /** 库存 */
     private Integer stock;
     private Integer stock;
     /** 购物车失效状态:0有效,1后台删除的,2冻结的,3下架,4售罄 >7库存不足,5价格仅会员可见,6未公开价格 */
     /** 购物车失效状态:0有效,1后台删除的,2冻结的,3下架,4售罄 >7库存不足,5价格仅会员可见,6未公开价格 */
@@ -91,10 +92,6 @@ public class ProductItemVo implements Serializable {
      * 市场价
      * 市场价
      */
      */
     private Double normalPrice;
     private Double normalPrice;
-    /**
-     * 主图
-     */
-    private String mainImage;
     /**
     /**
      * 所在分类名称
      * 所在分类名称
      */
      */

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

@@ -105,6 +105,7 @@ public class PageServiceImpl implements PageService {
      * @param userId 用户id
      * @param userId 用户id
      * @param source 来源:1网站,2小程序
      * @param source 来源:1网站,2小程序
      */
      */
+    //@Cacheable(value = "getHomeFloorData", key = "#userId +'-'+ #source", unless = "#result == null")
     @Override
     @Override
     public ResponseJson<Map<String, Object>> getHomeData(Integer userId, Integer source) {
     public ResponseJson<Map<String, Object>> getHomeData(Integer userId, Integer source) {
         Map<String, Object> map = new HashMap<>(2);
         Map<String, Object> map = new HashMap<>(2);

+ 1 - 3
src/main/java/com/caimei365/commodity/service/impl/ShopServiceImpl.java

@@ -6,11 +6,9 @@ import com.caimei365.commodity.model.ResponseJson;
 import com.caimei365.commodity.model.search.ProductListVo;
 import com.caimei365.commodity.model.search.ProductListVo;
 import com.caimei365.commodity.model.vo.PaginationVo;
 import com.caimei365.commodity.model.vo.PaginationVo;
 import com.caimei365.commodity.model.vo.ProductItemVo;
 import com.caimei365.commodity.model.vo.ProductItemVo;
-import com.caimei365.commodity.model.vo.PromotionsVo;
 import com.caimei365.commodity.service.ShopService;
 import com.caimei365.commodity.service.ShopService;
 import com.caimei365.commodity.utils.ImageUtils;
 import com.caimei365.commodity.utils.ImageUtils;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -94,7 +92,7 @@ public class ShopServiceImpl implements ShopService {
         List<ProductItemVo> productList = shopMapper.getShopProductsSelect(shopId, name, productCode, validFlag, featuredFlag, typeSort, bigTypeId, smallTypeId, tinyTypeId);
         List<ProductItemVo> productList = shopMapper.getShopProductsSelect(shopId, name, productCode, validFlag, featuredFlag, typeSort, bigTypeId, smallTypeId, tinyTypeId);
         if (null != productList && productList.size() > 0) {
         if (null != productList && productList.size() > 0) {
             for (ProductItemVo product : productList) {
             for (ProductItemVo product : productList) {
-                product.setMainImage(ImageUtils.getImageURL("product", product.getMainImage(), 0, domain));
+                product.setImage(ImageUtils.getImageURL("product", product.getImage(), 0, domain));
                 String typeName = shopMapper.getTypeName(product.getBigTypeId(), product.getSmallTypeId(), product.getTinyTypeId());
                 String typeName = shopMapper.getTypeName(product.getBigTypeId(), product.getSmallTypeId(), product.getTinyTypeId());
                 product.setTypeName(typeName);
                 product.setTypeName(typeName);
                 // 设置商品价格
                 // 设置商品价格

+ 1 - 1
src/main/java/com/caimei365/commodity/utils/Json2PojoUtil.java

@@ -50,7 +50,7 @@ public class Json2PojoUtil {
             /* 所属供应商Id,关联供应商表 */
             /* 所属供应商Id,关联供应商表 */
             product.setShopId(json.getInt("p_supplier_id"));
             product.setShopId(json.getInt("p_supplier_id"));
             /* 美博会商品活动状态 */
             /* 美博会商品活动状态 */
-            product.setActFlag(json.getInt("p_act_flag"));
+            product.setBeautyActFlag(json.getInt("p_act_flag"));
 
 
             productList.add(product);
             productList.add(product);
         }
         }

+ 2 - 2
src/main/resources/bootstrap.yml

@@ -9,7 +9,7 @@ spring:
     config:                             # Config客户端配置
     config:                             # Config客户端配置
       profile: @activatedProperties@    # 启用配置后缀名称
       profile: @activatedProperties@    # 启用配置后缀名称
       label: master                     # 分支名称
       label: master                     # 分支名称
-      uri: http://localhost:18001
+      # uri: http://localhost:18001
       # uri: http://47.119.112.46:18001          # 配置中心地址
       # uri: http://47.119.112.46:18001          # 配置中心地址
-      # uri: http://120.79.162.1:18001          # 配置中心地址(正式环境)
+      uri: http://120.79.162.1:18001          # 配置中心地址(正式环境)
       name: commodity                   # 配置文件名称
       name: commodity                   # 配置文件名称

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

@@ -88,13 +88,13 @@
         select
         select
          id, floorId, centreId, templateType, pcAdsImage1, pcAdsImage2, pcAdsImage3,
          id, floorId, centreId, templateType, pcAdsImage1, pcAdsImage2, pcAdsImage3,
          appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, adsLink1, adsLink2, adsLink3
          appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, adsLink1, adsLink2, adsLink3
-         from new_page_floor_content where centreId = #{id}
+         from new_page_floor_content where floorId = #{id}
     </select>
     </select>
     <select id="getFloorImageById" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
     <select id="getFloorImageById" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
         select
         select
             id, floorId, centreId, productId, name, link, image, label, pcStatus, appletsStatus, sort, createDate
             id, floorId, centreId, productId, name, link, image, label, pcStatus, appletsStatus, sort, createDate
         from new_page_floor_image
         from new_page_floor_image
-        where centreId = #{id}
+        where floorId = #{id}
         <if test="source == 1">
         <if test="source == 1">
             and pcStatus = 1
             and pcStatus = 1
         </if>
         </if>
@@ -114,16 +114,17 @@
             p.price1 as price,
             p.price1 as price,
             p.shopID as shopId,
             p.shopID as shopId,
             p.searchKey as keyword,
             p.searchKey as keyword,
-            p.price8Text as actFlag,
+            p.price8Text as beautyActFlag,
             p.minBuyNumber as min,
             p.minBuyNumber as min,
-            p.ladderPriceFlag as ladderFlag,
+            p.ladderPriceFlag as ladderPriceFlag,
             p.normalPrice as normalPrice,
             p.normalPrice as normalPrice,
             p.step as step,
             p.step as step,
             p.shopID as shopId,
             p.shopID as shopId,
             p.taxPoint as taxRate,
             p.taxPoint as taxRate,
             p.includedTax as includedTax,
             p.includedTax as includedTax,
             p.invoiceType as invoiceType,
             p.invoiceType as invoiceType,
-            cshd.detailTalkFlag
+            p.productCategory as productCategory,
+            cshd.detailTalkFlag as detailTalkFlag
         from product p
         from product p
         left join cm_second_hand_detail cshd on p.productID = cshd.productID
         left join cm_second_hand_detail cshd on p.productID = cshd.productID
         where p.productID = #{productId}
         where p.productID = #{productId}

+ 1 - 1
src/main/resources/mapper/SearchMapper.xml

@@ -279,7 +279,7 @@
             p.price1 as price,
             p.price1 as price,
             p.shopID as shopId,
             p.shopID as shopId,
             p.searchKey as keyword,
             p.searchKey as keyword,
-            p.price8Text as actFlag
+            p.price8Text as beautyActFlag
         from product p
         from product p
         left join cm_brand as br on p.brandID = br.id
         left join cm_brand as br on p.brandID = br.id
         where p.productCategory = 1
         where p.productCategory = 1