zhijiezhao 3 tahun lalu
induk
melakukan
be0332b46a

+ 14 - 6
src/main/java/com/caimei365/commodity/components/PriceUtilService.java

@@ -31,12 +31,14 @@ public class PriceUtilService {
     private PromotionsMapper promotionsMapper;
     @Value("${caimei.wwwDomain}")
     private String domain;
+
     /**
      * 根据价格返回价格等级
+     *
      * @param price 价格
      * @return priceGrade 价格等级
      */
-    public Integer getPriceGrade(Double price){
+    public Integer getPriceGrade(Double price) {
         int grade = 1;
         price = price != null ? price : 0d;
         if (price > 50 * 10000) {
@@ -53,8 +55,9 @@ public class PriceUtilService {
 
     /**
      * 设置阶梯价展示数据
-     * @param ladderPrices  List<LadderPriceVo>
-     * @param tax           TaxVo
+     *
+     * @param ladderPrices List<LadderPriceVo>
+     * @param tax          TaxVo
      */
     public void setLadderPriceList(List<LadderPriceVo> ladderPrices, TaxVo tax) {
         IntStream.range(0, ladderPrices.size()).forEach(i -> {
@@ -63,7 +66,7 @@ public class PriceUtilService {
             //添加税费
             if (taxFlag) {
                 BigDecimal taxFee = MathUtil.div(MathUtil.mul(ladderPrices.get(i).getBuyPrice(), tax.getTaxPoint()), 100, 2);
-                ladderPrices.get(i).setBuyPrice(MathUtil.add(ladderPrices.get(i).getBuyPrice(),taxFee).doubleValue());
+                ladderPrices.get(i).setBuyPrice(MathUtil.add(ladderPrices.get(i).getBuyPrice(), taxFee).doubleValue());
             }
             if (i == ladderPrices.size() - 1) {
                 ladderPrices.get(i).setMaxNum(0);
@@ -79,7 +82,7 @@ public class PriceUtilService {
     /**
      * 根据用户id设置详细价格
      *
-     * @param price 商品价格类
+     * @param price  商品价格类
      * @param userId 用户Id
      */
     public void setPriceByUserId(PriceVo price, Integer userId) {
@@ -91,6 +94,10 @@ public class PriceUtilService {
         boolean svipUserFlag = null != svipUserId;
         // 根据商品id查询商品活动
         PromotionsVo promotions = promotionsMapper.getPromotionsByProductId(price.getProductId());
+        // 如果身份不是机构,并且促销活动不可见,直接把促销置空
+        if (promotions != null && promotions.getSeen() != null && identity != null && promotions.getSeen() == 2 && identity == 1) {
+            promotions = null;
+        }
         price.setRepurchaseFlag(0);
         price.setActStatus(0);
         if (null != identity && identity > 0) {
@@ -148,7 +155,7 @@ public class PriceUtilService {
                         if (null != lowerPrice) {
                             price.setPrice(lowerPrice.getBuyPrice());
                             price.setMaxBuyNumber(lowerPrice.getBuyNum());
-                            if (null != lowerBuyNum){
+                            if (null != lowerBuyNum) {
                                 price.setMinBuyNumber(lowerBuyNum.getBuyNum());
                             }
                         } else {
@@ -194,6 +201,7 @@ public class PriceUtilService {
 
     /**
      * 设置商品主图及价格
+     *
      * @param userId  用户Id
      * @param product ProductItemVo
      */

+ 29 - 11
src/main/java/com/caimei365/commodity/controller/ProductSellerApi.java

@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
  * @author : Charles
  * @date : 2021/4/23
  */
-@Api(tags="协销商品API")
+@Api(tags = "协销商品API")
 @RestController
 @RequiredArgsConstructor
 @RequestMapping("/commodity/seller")
@@ -33,15 +33,15 @@ public class ProductSellerApi {
      */
     @ApiOperation("协销搜索单一商品(旧:/seller/product/search)")
     @ApiImplicitParams({
-        @ApiImplicitParam(required = false, name = "searchWord", value = "搜索关键字"),
-        @ApiImplicitParam(required = false, name = "clubUserId", value = "机构用户Id"),
-        @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
-        @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
+            @ApiImplicitParam(required = false, name = "searchWord", value = "搜索关键字"),
+            @ApiImplicitParam(required = false, name = "clubUserId", value = "机构用户Id"),
+            @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
+            @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
     })
     @GetMapping("/product/single")
     public ResponseJson<PaginationVo<ProductItemVo>> searchSingleProducts(String searchWord, Integer clubUserId,
-                                                                            @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
-                                                                            @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
+                                                                          @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                          @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
         return sellerService.searchSingleProducts(searchWord, clubUserId, pageNum, pageSize);
     }
 
@@ -50,10 +50,10 @@ public class ProductSellerApi {
      */
     @ApiOperation("协销搜索组合商品(旧:/seller/combinationProduct/search)")
     @ApiImplicitParams({
-        @ApiImplicitParam(required = false, name = "searchWord", value = "搜索关键字"),
-        @ApiImplicitParam(required = false, name = "clubUserId", value = "机构用户Id"),
-        @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
-        @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
+            @ApiImplicitParam(required = false, name = "searchWord", value = "搜索关键字"),
+            @ApiImplicitParam(required = false, name = "clubUserId", value = "机构用户Id"),
+            @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
+            @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
     })
     @GetMapping("/product/combination")
     public ResponseJson<PaginationVo<CombinationVo>> searchCombinationProducts(String searchWord, Integer clubUserId,
@@ -62,4 +62,22 @@ public class ProductSellerApi {
         return sellerService.searchCombinationProducts(searchWord, clubUserId, pageNum, pageSize);
     }
 
+    /**
+     * 组合商品列表
+     */
+    @ApiOperation("组合商品列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(required = true, name = "productId", value = "本商品id"),
+            @ApiImplicitParam(required = true, name = "userId", value = "用户Id"),
+            @ApiImplicitParam(required = true, name = "source", value = "来源 : 1 网站 ; 2 小程序"),
+            @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
+            @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
+    })
+    @GetMapping("/combination/list")
+    public ResponseJson<PaginationVo<ProductItemVo>> searchCombinationList(Integer productId, Integer userId, Integer source,
+                                                                           @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                                           @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
+        return sellerService.searchCombinationList(productId, userId, source, pageNum, pageSize);
+    }
+
 }

+ 3 - 0
src/main/java/com/caimei365/commodity/mapper/PromotionsMapper.java

@@ -44,4 +44,7 @@ public interface PromotionsMapper {
      * @return
      */
     PromotionsVo getPromotionGiftsByProductId(Integer productId);
+
+    Integer findUserIdentity(Integer userId);
+
 }

+ 6 - 0
src/main/java/com/caimei365/commodity/mapper/SellerMapper.java

@@ -29,4 +29,10 @@ public interface SellerMapper {
      * @param id 组合id
      */
     List<ProductItemVo> getCombinationProductList(Integer id);
+
+    Integer findCombination(Integer productId);
+
+    List<Integer> findProductList(Integer combinationId);
+
+    List<ProductItemVo> getProductList(List<Integer> productIds);
 }

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

@@ -17,7 +17,7 @@ public class PriceVo implements Serializable {
     /**
      * 促销活动可见性 0所有人,1仅对机构
      */
-    private String promotionsSeen;
+    private Integer seen;
     /**
      * 商品productID
      */

+ 2 - 0
src/main/java/com/caimei365/commodity/model/vo/PromotionsVo.java

@@ -16,6 +16,8 @@ import java.util.List;
 @Data
 public class PromotionsVo implements Serializable {
     private static final long serialVersionUID = 1L;
+
+    private Integer seen;
     private Integer id;
     /**
      * 促销名称

+ 20 - 8
src/main/java/com/caimei365/commodity/service/SellerService.java

@@ -14,19 +14,31 @@ import com.caimei365.commodity.model.vo.ProductItemVo;
 public interface SellerService {
     /**
      * 协销搜索商品(单一)
-     * @param searchWord  搜索关键字
-     * @param clubUserId  机构用户Id
-     * @param pageNum     页码
-     * @param pageSize    每页数量
+     *
+     * @param searchWord 搜索关键字
+     * @param clubUserId 机构用户Id
+     * @param pageNum    页码
+     * @param pageSize   每页数量
      */
     ResponseJson<PaginationVo<ProductItemVo>> searchSingleProducts(String searchWord, Integer clubUserId, int pageNum, int pageSize);
 
     /**
      * 协销搜索商品(组合)
-     * @param searchWord  搜索关键字
-     * @param clubUserId  机构用户Id
-     * @param pageNum     页码
-     * @param pageSize    每页数量
+     *
+     * @param searchWord 搜索关键字
+     * @param clubUserId 机构用户Id
+     * @param pageNum    页码
+     * @param pageSize   每页数量
      */
     ResponseJson<PaginationVo<CombinationVo>> searchCombinationProducts(String searchWord, Integer clubUserId, int pageNum, int pageSize);
+
+    /**
+     * 配套商品列表
+     *
+     * @param productId
+     * @param userId
+     * @param source
+     * @return
+     */
+    ResponseJson<PaginationVo<ProductItemVo>> searchCombinationList(Integer productId, Integer userId, Integer source, int pageNum, int pageSize);
 }

+ 31 - 0
src/main/java/com/caimei365/commodity/service/impl/SellerServiceImpl.java

@@ -1,6 +1,7 @@
 package com.caimei365.commodity.service.impl;
 
 import com.caimei365.commodity.components.PriceUtilService;
+import com.caimei365.commodity.mapper.PriceMapper;
 import com.caimei365.commodity.mapper.SellerMapper;
 import com.caimei365.commodity.model.ResponseJson;
 import com.caimei365.commodity.model.vo.CombinationVo;
@@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -32,6 +34,8 @@ public class SellerServiceImpl implements SellerService {
     private PriceUtilService priceUtilService;
     @Resource
     private PageService pageService;
+    @Resource
+    private PriceMapper priceMapper;
 
     /**
      * 协销搜索商品(单一)
@@ -94,4 +98,31 @@ public class SellerServiceImpl implements SellerService {
         return ResponseJson.success(pageData);
     }
 
+    @Override
+    public ResponseJson<PaginationVo<ProductItemVo>> searchCombinationList(Integer productId, Integer userId, Integer source, int pageNum, int pageSize) {
+        Integer combinationId = sellerMapper.findCombination(productId);
+        List<ProductItemVo> productList = new ArrayList<>();
+        PaginationVo<ProductItemVo> productItemVoPaginationVo = new PaginationVo<>(productList);
+        if (combinationId != null) {
+            List<Integer> productIdList = sellerMapper.findProductList(combinationId);
+            List<Integer> p = new ArrayList<>();
+            p.add(productId);
+            List<ProductItemVo> pd = sellerMapper.getProductList(p);
+            ProductItemVo productItemVo = pd.get(0);
+            PageHelper.startPage(pageNum, pageSize);
+            productList = sellerMapper.getProductList(productIdList);
+            productList.remove(productItemVo);
+            productList.add(0, productItemVo);
+            productList.forEach(product -> {
+                // 设置商品主图及价格
+                priceUtilService.setProductDetails(userId, product);
+                //优惠券标识
+                Boolean couponsLogo = pageService.setCouponsLogo(userId, product.getProductId(), source);
+                product.setCouponsLogo(couponsLogo);
+            });
+            productItemVoPaginationVo = new PaginationVo<>(productList);
+        }
+        return ResponseJson.success(productItemVoPaginationVo);
+    }
+
 }

+ 70 - 66
src/main/resources/mapper/PromotionsMapper.xml

@@ -2,23 +2,20 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.commodity.mapper.PromotionsMapper">
     <select id="getPromotionsById" resultType="com.caimei365.commodity.model.vo.PromotionsVo">
-        select
-          id,
-          name,
-          description,
-          type,
-          mode,
-          touchPrice,
-          reducedPrice,
-          beginTime,
-          endTime,
-          status
-        from
-          cm_promotions
-        where
-          id = #{promotionsId}
+        select id,
+               name,
+               description,
+               type,
+               mode,
+               touchPrice,
+               reducedPrice,
+               beginTime,
+               endTime,
+               status
+        from cm_promotions
+        where id = #{promotionsId}
           and (status = 1 or (status = 2 and (NOW() between beginTime and endTime)))
-          and delFlag not in (1,2)
+          and delFlag not in (1, 2)
     </select>
     <select id="getPromotionsByProductId" resultType="com.caimei365.commodity.model.vo.PromotionsVo">
         select pr.id,
@@ -33,54 +30,55 @@
                pr.status,
                prp.productId,
                prp.supplierId as shopId,
-               pr.seen as promotionsSeen
+               pr.seen        as seen
         from cm_promotions pr
                  left join cm_promotions_product prp on pr.id = prp.promotionsId
         where (prp.productId = #{productId} or
                prp.supplierId = (select p.shopID from product p where p.productID = #{productId})
             )
           and (pr.status = 1 or (pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
-          and pr.delFlag not in (1,2)
+          and pr.delFlag not in (1, 2)
         order by pr.type desc
         limit 1
     </select>
     <select id="getPromotionGifts" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
-		select
-			cpg.id as id,
-			p.productID as productId,
-            p.actStatus,
-			p.shopID as shopId,
-			p.`name` as `name`,
-			p.mainImage as image,
-			cpg.number as number,
-			0 as price,
-			2 as productType,
-			p.price1 as originalPrice,
-			p.unit as unit,
-			p.validFlag as validFlag,
-			p.stock as stock
-		from product p
-		left join cm_promotions_gift cpg on cpg.productId = p.productID
-		where cpg.promotionsId = #{promotionsId}
-		order by cpg.addTime desc
+        select cpg.id      as id,
+               p.productID as productId,
+               p.actStatus,
+               p.shopID    as shopId,
+               p.`name`    as `name`,
+               p.mainImage as image,
+               cpg.number  as number,
+               0           as price,
+               2           as productType,
+               p.price1    as originalPrice,
+               p.unit      as unit,
+               p.validFlag as validFlag,
+               p.stock     as stock
+        from product p
+                 left join cm_promotions_gift cpg on cpg.productId = p.productID
+        where cpg.promotionsId = #{promotionsId}
+        order by cpg.addTime desc
     </select>
     <select id="getPromotionsList" resultType="com.caimei365.commodity.model.vo.ImageLinkVo">
-        select  a.id as id,
-                a.title as title,
-                a.link as link,
-                a.image as image,
-                a.beginTime as beginTime,
-                a.endTime as endTime,
-                a.appletsImage as crmImage,
-                a.appletsLink as crmLink,
-                (case
-                when a.beginTime>NOW() and <![CDATA[a.beginTime < a.endTime ]]> then 1
-                when <![CDATA[a.beginTime<NOW()]]> and a.endTime >NOW() and <![CDATA[a.beginTime < a.endTime ]]> then 2
-                else 3 end) as status,
-                (case
-                when a.beginTime>NOW() and <![CDATA[a.beginTime < a.endTime ]]>  then concat(DATE_FORMAT(a.beginTime,'%Y-%m-%d'),'~',DATE_FORMAT(a.endTime,'%Y-%m-%d'))
-                when <![CDATA[a.beginTime<NOW()]]> and a.endTime >NOW() and <![CDATA[a.beginTime < a.endTime ]]> then concat(DATE_FORMAT(a.beginTime,'%Y-%m-%d'),'~',DATE_FORMAT(a.endTime,'%Y-%m-%d'))
-                else null end) as detail
+        select a.id as id,
+        a.title as title,
+        a.link as link,
+        a.image as image,
+        a.beginTime as beginTime,
+        a.endTime as endTime,
+        a.appletsImage as crmImage,
+        a.appletsLink as crmLink,
+        (case
+        when a.beginTime>NOW() and <![CDATA[a.beginTime < a.endTime ]]> then 1
+        when <![CDATA[a.beginTime<NOW()]]> and a.endTime >NOW() and <![CDATA[a.beginTime < a.endTime ]]> then 2
+        else 3 end) as status,
+        (case
+        when a.beginTime>NOW() and <![CDATA[a.beginTime < a.endTime ]]>  then
+        concat(DATE_FORMAT(a.beginTime,'%Y-%m-%d'),'~',DATE_FORMAT(a.endTime,'%Y-%m-%d'))
+        when <![CDATA[a.beginTime<NOW()]]> and a.endTime >NOW() and <![CDATA[a.beginTime < a.endTime ]]> then
+        concat(DATE_FORMAT(a.beginTime,'%Y-%m-%d'),'~',DATE_FORMAT(a.endTime,'%Y-%m-%d'))
+        else null end) as detail
         from cm_page_image a
         where a.type=4
         <choose>
@@ -94,16 +92,16 @@
         order by case when <![CDATA[status<3]]> then 0 when status>=3 then 1 end asc,a.sort desc,a.createDate desc
     </select>
     <select id="getProductListByPromotions" resultType="com.caimei365.commodity.model.search.ProductListVo">
-		select
-			p.productID as productId,
-			p.`name` as `name`,
-			p.mainImage as image,
-			p.price1 as price,
-			p.unit as unit,
-			p.price1TextFlag as priceFlag,
-            IFNULL(p.visibility,3) as visibility
-		from product p
-		left join cm_promotions_product cpp on cpp.productId = p.productID
+        select
+        p.productID as productId,
+        p.`name` as `name`,
+        p.mainImage as image,
+        p.price1 as price,
+        p.unit as unit,
+        p.price1TextFlag as priceFlag,
+        IFNULL(p.visibility,3) as visibility
+        from product p
+        left join cm_promotions_product cpp on cpp.productId = p.productID
         where cpp.promotionsId = #{promotionsId}
         and p.visibility in
         <foreach collection="visibilityList" item="visibility" index="index" open="(" separator="," close=")">
@@ -125,12 +123,18 @@
                pr.status,
                cpg.productId
         from cm_promotions pr
-        left join cm_promotions_gift cpg on pr.id = cpg.promotionsId
+                 left join cm_promotions_gift cpg on pr.id = cpg.promotionsId
         where cpg.productId = #{productId}
-        and (pr.status = 1 or ( pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
-        and pr.mode = 3
-        and pr.delFlag not in (1,2)
+          and (pr.status = 1 or (pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
+          and pr.mode = 3
+          and pr.delFlag not in (1, 2)
         order by pr.type desc
         limit 1
     </select>
+
+    <select id="findUserIdentity" resultType="java.lang.Integer">
+        select userIdentity
+        from user
+        where userID = #{userId}
+    </select>
 </mapper>

+ 110 - 63
src/main/resources/mapper/SellerMapper.xml

@@ -2,39 +2,37 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.commodity.mapper.SellerMapper">
     <select id="getSingleProductList" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
-        select
-            p.productID as productId,
-            p.actStatus,
-            p.name,
-            p.aliasName,
-            p.mainImage as image,
-            p.unit,
-            p.productCode as code,
-            p.price1TextFlag as priceFlag,
-            p.price1 as price,
-            p.shopID as shopId,
-            p.searchKey as keyword,
-            p.price8Text as beautyActFlag,
-            p.minBuyNumber as minBuyNumber,
-            p.maxBuyNumber as maxBuyNumber,
-            p.ladderPriceFlag,
-            p.normalPrice,
-            p.step,
-            p.shopID as shopId,
-            p.taxPoint as taxRate,
-            p.includedTax,
-            p.invoiceType,
-            p.productCategory as productCategory,
-            p.validFlag,
-            p.featuredFlag,
-            p.commodityType,
-            p.bigTypeID as bigTypeId,
-            p.smallTypeID as smallTypeId,
-            p.tinyTypeID as tinyTypeId
+        select p.productID       as productId,
+               p.actStatus,
+               p.name,
+               p.aliasName,
+               p.mainImage       as image,
+               p.unit,
+               p.productCode     as code,
+               p.price1TextFlag  as priceFlag,
+               p.price1          as price,
+               p.shopID          as shopId,
+               p.searchKey       as keyword,
+               p.price8Text      as beautyActFlag,
+               p.minBuyNumber    as minBuyNumber,
+               p.maxBuyNumber    as maxBuyNumber,
+               p.ladderPriceFlag,
+               p.normalPrice,
+               p.step,
+               p.shopID          as shopId,
+               p.taxPoint        as taxRate,
+               p.includedTax,
+               p.invoiceType,
+               p.productCategory as productCategory,
+               p.validFlag,
+               p.featuredFlag,
+               p.commodityType,
+               p.bigTypeID       as bigTypeId,
+               p.smallTypeID     as smallTypeId,
+               p.tinyTypeID      as tinyTypeId
         from product p
-        where
-        (name LIKE CONCAT('%',#{searchWord},'%') or productCode LIKE CONCAT('%',#{searchWord},'%'))
-        and validFlag in (2,3,9)
+        where (name LIKE CONCAT('%', #{searchWord}, '%') or productCode LIKE CONCAT('%', #{searchWord}, '%'))
+          and validFlag in (2, 3, 9)
     </select>
     <select id="getCombinationList" resultType="com.caimei365.commodity.model.vo.CombinationVo">
         select c.id, c.name, c.addTime, c.updateTime
@@ -49,37 +47,86 @@
         order by c.addTime desc
     </select>
     <select id="getCombinationProductList" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
-        select
-            p.productID as productId,
-            p.actStatus,
-            p.name,
-            p.aliasName,
-            p.mainImage as image,
-            p.unit,
-            p.productCode as code,
-            p.price1TextFlag as priceFlag,
-            p.price1 as price,
-            p.shopID as shopId,
-            p.searchKey as keyword,
-            p.price8Text as beautyActFlag,
-            p.minBuyNumber as minBuyNumber,
-            p.maxBuyNumber as maxBuyNumber,
-            p.ladderPriceFlag,
-            p.normalPrice,
-            p.step,
-            p.shopID as shopId,
-            p.taxPoint as taxRate,
-            p.includedTax,
-            p.invoiceType,
-            p.productCategory as productCategory,
-            p.validFlag,
-            p.featuredFlag,
-            p.commodityType,
-            p.bigTypeID as bigTypeId,
-            p.smallTypeID as smallTypeId,
-            p.tinyTypeID as tinyTypeId
+        select p.productID       as productId,
+               p.actStatus,
+               p.name,
+               p.aliasName,
+               p.mainImage       as image,
+               p.unit,
+               p.productCode     as code,
+               p.price1TextFlag  as priceFlag,
+               p.price1          as price,
+               p.shopID          as shopId,
+               p.searchKey       as keyword,
+               p.price8Text      as beautyActFlag,
+               p.minBuyNumber    as minBuyNumber,
+               p.maxBuyNumber    as maxBuyNumber,
+               p.ladderPriceFlag,
+               p.normalPrice,
+               p.step,
+               p.shopID          as shopId,
+               p.taxPoint        as taxRate,
+               p.includedTax,
+               p.invoiceType,
+               p.productCategory as productCategory,
+               p.validFlag,
+               p.featuredFlag,
+               p.commodityType,
+               p.bigTypeID       as bigTypeId,
+               p.smallTypeID     as smallTypeId,
+               p.tinyTypeID      as tinyTypeId
         from product p
-        where p.validFlag = 2 and p.combinationID = #{id}
-        order by p.combinationSort!= 0 desc,p.combinationSort asc
+        where p.validFlag = 2
+          and p.combinationID = #{id}
+        order by p.combinationSort != 0 desc, p.combinationSort asc
+    </select>
+
+    <select id="findCombination" resultType="java.lang.Integer">
+        select c.id
+        from cm_product_combination c
+                 left join product p on p.combinationID = c.id
+        where p.productID = #{productId}
+    </select>
+    <select id="findProductList" resultType="java.lang.Integer">
+        select productID
+        from product
+        where combinationID = #{combinationId}
+    </select>
+    <select id="getProductList" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
+        select p.productID as productId,
+        p.actStatus,
+        p.name,
+        p.aliasName,
+        p.mainImage as image,
+        p.unit,
+        p.productCode as code,
+        p.price1TextFlag as priceFlag,
+        p.price1 as price,
+        p.shopID as shopId,
+        p.searchKey as keyword,
+        p.price8Text as beautyActFlag,
+        p.minBuyNumber as minBuyNumber,
+        p.maxBuyNumber as maxBuyNumber,
+        p.ladderPriceFlag,
+        p.normalPrice,
+        p.step,
+        p.shopID as shopId,
+        p.taxPoint as taxRate,
+        p.includedTax,
+        p.invoiceType,
+        p.productCategory as productCategory,
+        p.validFlag,
+        p.featuredFlag,
+        p.commodityType,
+        p.bigTypeID as bigTypeId,
+        p.smallTypeID as smallTypeId,
+        p.tinyTypeID as tinyTypeId
+        from product p
+        where
+        p.productID in
+        <foreach collection="productIds" open="(" separator="," close=")" item="productId">
+            #{productId}
+        </foreach>
+        and validFlag = '2'
     </select>
 </mapper>