소스 검색

分类绑定商品处理

fubojin 1 일 전
부모
커밋
2fa8e9f5d6

+ 2 - 2
yami-shop-api/src/main/resources/application.yml

@@ -2,8 +2,8 @@
 spring:
   # 环境 dev|prod|docker
   profiles:
-#    active: dev
-    active: prod
+    active: dev
+#    active: prod
   #文件上传设置
   servlet:
     multipart:

+ 1 - 1
yami-shop-bean/src/main/java/com/yami/shop/bean/model/CategoryProd.java

@@ -31,8 +31,8 @@ public class CategoryProd implements Serializable {
     /**
      * 商品属性id即表tz_prod_prop中的prop_id
      */
-
     private Long prodId;
+
     /**
      * 商品名称
      */

+ 6 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopCategory.java

@@ -76,6 +76,7 @@ public class ShopCategory implements Serializable {
      */
     private Integer level;
 
+
     /**
      * 操作人
      */
@@ -93,6 +94,11 @@ public class ShopCategory implements Serializable {
      * 标签
      */
     private Long label;
+    /**
+     * 标签名称
+     */
+    @TableField(exist = false)
+    private String labelName;
 
     /**
      * 子类名称(导入时处理需要)

+ 4 - 13
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/CategoryPropHbController.java

@@ -1,18 +1,7 @@
-/*
- * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
- *
- * https://www.gz-yami.com/
- *
- * 未经允许,不可做商业用途!
- *
- * 版权所有,侵权必究!
- */
 
 package com.yami.shop.platform.controller;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yami.shop.bean.model.CategoryProdHb;
-import com.yami.shop.common.util.PageParam;
 import com.yami.shop.common.util.R;
 import com.yami.shop.service.CategoryProdHbService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +9,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 
 /**
  * 海博分类绑定商品管理
@@ -40,8 +31,8 @@ public class CategoryPropHbController {
      * 分页通过code查询分类绑定商品
      */
     @GetMapping("/pageByCode")
-    public R<IPage<CategoryProdHb>> pageByCode(CategoryProdHb categoryProd, PageParam<CategoryProdHb> page) {
-        IPage<CategoryProdHb> list = categoryProdHbService.pageByCode(categoryProd, page);
+    public R<List<CategoryProdHb>> pageByCode(CategoryProdHb categoryProd) {
+        List<CategoryProdHb> list = categoryProdHbService.pageByCode(categoryProd);
         return R.SUCCESS(list);
     }
 

+ 2 - 2
yami-shop-platform/src/main/resources/application.yml

@@ -1,8 +1,8 @@
 spring:
   # 环境 dev|prod|docker quartz定时任务
   profiles:
-    active: dev
-#    active: prod
+#    active: dev
+    active: prod
   #文件上传设置
   servlet:
 

+ 3 - 1
yami-shop-service/src/main/java/com/yami/shop/dao/CategoryProdHbMapper.java

@@ -17,6 +17,8 @@ import com.yami.shop.bean.model.CategoryProdHb;
 import com.yami.shop.common.util.PageParam;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface CategoryProdHbMapper extends BaseMapper<CategoryProdHb> {
-	IPage<CategoryProdHb> pageByCode(PageParam<CategoryProdHb> page, @Param("categoryProd")CategoryProdHb categoryProd);
+	List<CategoryProdHb> pageByCode(@Param("categoryProd")CategoryProdHb categoryProd);
 }

+ 3 - 1
yami-shop-service/src/main/java/com/yami/shop/service/CategoryProdHbService.java

@@ -15,10 +15,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.yami.shop.bean.model.CategoryProdHb;
 import com.yami.shop.common.util.PageParam;
 
+import java.util.List;
+
 public interface CategoryProdHbService extends IService<CategoryProdHb> {
 
     /**
      * 通过code查询分类绑定商品
      */
-    IPage<CategoryProdHb> pageByCode(CategoryProdHb categoryProd, PageParam<CategoryProdHb> page);
+    List<CategoryProdHb> pageByCode(CategoryProdHb categoryProd);
 }

+ 1 - 0
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java

@@ -615,6 +615,7 @@ public class HBGoodsService implements IHBGoodsService {
         categoryProd.setCode(ztFrontCategoryCodeLevel);
         categoryProd.setProdId(spuId);
         categoryProd.setIsDelete(0);
+        categoryProd.setCreateTime(new Date());
         CategoryProdHb integer = categoryProdHbMapper.selectOne(new LambdaQueryWrapper<CategoryProdHb>()
                 .eq(CategoryProdHb::getProdId, spuId)
                 .eq(CategoryProdHb::getIsDelete, 0)

+ 5 - 2
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBOrderService.java

@@ -441,13 +441,16 @@ public class HBOrderService implements IHBOrderService {
         //订单支付信息
         List<OrderPayment> orderPaymentList = new ArrayList<>();
         OrderPayment orderPayment = new OrderPayment();
-        if (order.getPayType() == null) {
-            orderPayment.setPaymentType(9999);
+        if (order.getPayType() == null || order.getPayType() == 0) {
+            orderPayment.setPaymentType(1301);
         } else if (order.getPayType() == 1) {
             orderPayment.setPaymentType(1002);
         } else if (order.getPayType() == 2) {
             orderPayment.setPaymentType(1001);
+        }else {
+            orderPayment.setPaymentType(9999);
         }
+
         orderPayment.setPaymentAmount(totalPrice);
         orderPayment.setPaymentNum(0);
         orderPaymentList.add(orderPayment);

+ 4 - 2
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryProdHbServiceImpl.java

@@ -10,6 +10,8 @@ import com.yami.shop.service.CategoryProdHbService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 
 @Service
 public class CategoryProdHbServiceImpl extends ServiceImpl<CategoryProdHbMapper, CategoryProdHb> implements CategoryProdHbService {
@@ -18,8 +20,8 @@ public class CategoryProdHbServiceImpl extends ServiceImpl<CategoryProdHbMapper,
     private CategoryProdHbMapper categoryPropHbMapper;
 
     @Override
-    public IPage<CategoryProdHb> pageByCode(CategoryProdHb categoryProd, PageParam<CategoryProdHb> page) {
-        return categoryPropHbMapper.pageByCode(page, categoryProd);
+    public List<CategoryProdHb> pageByCode(CategoryProdHb categoryProd) {
+        return categoryPropHbMapper.pageByCode(categoryProd);
     }
 
 }

+ 0 - 20
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProductServiceImpl.java

@@ -762,26 +762,6 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
         return productIPage;
     }
 
-    private String getDvyType(String dvyType) {
-        String[] split = dvyType.trim().split(StrUtil.COMMA);
-        Product.DeliveryModeVO mode = new Product.DeliveryModeVO();
-        mode.setHasShopDelivery(false);
-        mode.setHasUserPickUp(false);
-        mode.setHasCityDelivery(false);
-        for (String str : split) {
-            if (StrUtil.equals(str, "商家邮寄")) {
-                mode.setHasShopDelivery(true);
-            }
-            if (StrUtil.equals(str, "用户自提")) {
-                mode.setHasUserPickUp(true);
-            }
-            if (StrUtil.equals(str, "同城配送")) {
-                mode.setHasCityDelivery(true);
-            }
-        }
-        return Json.toJsonString(mode);
-    }
-
     /**
      * 创建下拉列表选项
      *

+ 2 - 2
yami-shop-service/src/main/resources/mapper/ProductMapper.xml

@@ -824,14 +824,14 @@
         WHERE
             tp.STATUS = 1 and tp.`is_delete`=0
           AND tcp.is_delete = 0
+          AND tcp.shop_id = #{prodByCategoryIdAndShopIdDTO.shopId}
           AND cp.is_delete = 0
           AND tsc.is_delete = 0
           AND cp.channel_prod_price IS NOT NULL
           AND tsc.shop_id=#{prodByCategoryIdAndShopIdDTO.shopId}
           AND tsc.id=#{prodByCategoryIdAndShopIdDTO.categoryId}
         GROUP BY tp.prod_id, tsc.shop_id
-        ORDER BY
-            MAX(tp.create_time) DESC
+        ORDER BY MAX(tp.create_time) DESC
     </select>
 
     <select id="listProdByCategoryIdAndShopId2" parameterType="com.yami.shop.bean.dto.ProdByCategoryIdAndShopIdDTO" resultType="com.yami.shop.bean.model.Product">

+ 2 - 1
yami-shop-service/src/main/resources/mapper/ShopCategoryMapper.xml

@@ -14,9 +14,10 @@
 
 
     <select id="selectListAll" resultType="com.yami.shop.bean.model.ShopCategory">
-        SELECT fc.* , count(cp.id) as prodCount
+        SELECT fc.*, count(cp.id) as prodCount,tl.name as labelName
         FROM tz_shop_category fc
         left join tz_category_prod cp on fc.code = cp.code and cp.shop_id = #{shopId}
+        left join tz_label tl on fc.label = tl.id
         WHERE fc.is_delete = 0
         <if test="shopId">and fc.shop_id = #{shopId}</if>
         <if test="name != null and name != ''">