Commit 9fc28325 by huvchao@126.com

商品组

parent e078b7f9
......@@ -35,7 +35,7 @@
<dependency>
<groupId>cn.freemud</groupId>
<artifactId>assortment-ordercenter-sdk</artifactId>
<version>1.1.5.RELEASE</version>
<version>1.1.6.SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
......
......@@ -21,4 +21,7 @@ public class ProductGroup {
private String name;
private List<GroupDetail> groupDetail;
/** 第三方商品组的编号 */
private String groupCode;
}
package cn.freemud.entities.vo;
import cn.freemud.entities.dto.product.ProductAttributeGroup;
import cn.freemud.entities.dto.product.ProductGroup;
import lombok.Data;
import java.util.List;
......@@ -48,4 +49,7 @@ public class GetProductsVo {
*/
private List<ProductAttributeGroup> productAttributeGroupList;
/** 商品组 */
private List<ProductGroup> productGroupList;
}
......@@ -148,6 +148,12 @@ public class ItemServiceImpl implements ItemService{
}
}
spuProductsVo.setProductAttributeGroupList(productBean.getProductAttributeGroupList());
// todo 商品组信息
if(CollectionUtils.isNotEmpty(productBean.getProductGroupList())){
spuProductsVo.setProductGroupList(productBean.getProductGroupList());
}
resultMap.put(productBean.getPid(), spuProductsVo);
//多规格商品
......
......@@ -34,6 +34,7 @@ import cn.freemud.entities.dto.order.FacePayRequestDto;
import cn.freemud.entities.dto.order.FacePayResponseDto;
import cn.freemud.entities.dto.product.AttributeValue;
import cn.freemud.entities.dto.product.ProductAttributeGroup;
import cn.freemud.entities.dto.product.ProductGroup;
import cn.freemud.entities.dto.shoppingCart.NewShoppingCartClearDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.*;
......@@ -1620,6 +1621,9 @@ public class OrderServiceImpl implements Orderservice {
productDto.setProductCode(products.get(skuId).getProductCode());
productDto.setThirdProductSpecId(products.get(productDto.getSpecification()).getThirdProductSpecId());
productDto.setThirdProductPropertyId(getThirdPropertyId(products.get(productDto.getSpecification()).getProductAttributeGroupList(),productDto.getAddInfo()));
// todo 商品组信息
setProductGroupInfo(products.get(skuId).getProductGroupList(), productDto);
} else {
productDto.setCustomerCode("");
productDto.setProductCode("");
......@@ -1634,6 +1638,9 @@ public class OrderServiceImpl implements Orderservice {
comboProduct.setProductCode(products.get(comboSkuId).getProductCode());
comboProduct.setThirdProductSpecId(products.get(comboSkuId).getThirdProductSpecId());
comboProduct.setThirdProductPropertyId(getThirdPropertyId(products.get(comboSkuId).getProductAttributeGroupList(),comboProduct.getAddInfo()));
// todo 套餐商品的商品组信息
setProductGroupInfo(products.get(comboSkuId).getProductGroupList(), comboProduct);
} else {
comboProduct.setCustomerCode("");
comboProduct.setProductCode("");
......@@ -1646,6 +1653,21 @@ public class OrderServiceImpl implements Orderservice {
return createOrderDto;
}
/**
* 设置商品组信息
* @param productGroupList
* @param product
*/
private void setProductGroupInfo(List<ProductGroup> productGroupList, CreateOrderProductRequest product) {
if (CollectionUtils.isEmpty(productGroupList)) return;
// try{}catch (Exception e){e.printStackTrace();}
if (CollectionUtils.isNotEmpty(productGroupList.get(0).getGroupDetail())) {
product.setGroupId(productGroupList.get(0).getGroupDetail().get(0).getGroupId());
}
product.setGroupName(productGroupList.get(0).getName());
product.setThirdGroupCode(productGroupList.get(0).getGroupCode());
}
private String getThirdPropertyId(List<ProductAttributeGroup> productAttributeGroups, String addInfo) {
String thirdProductPropertyId = "";
if(StringUtils.isBlank(addInfo) || CollectionUtils.isEmpty(productAttributeGroups) ){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment