Commit d6e507d3 by 徐康

Merge branch 'feature-yu.sun-material-20201030' into 2020/10/29-fabu-huiyang

# Conflicts:
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/ShoppingCartMCoffeeServiceImpl.java
parents 8a7a2977 37088832
...@@ -380,5 +380,9 @@ public class CartGoods { ...@@ -380,5 +380,9 @@ public class CartGoods {
* 购物车一行商品的总现价 * 购物车一行商品的总现价
*/ */
private Long amount; private Long amount;
/**
* 麦咖啡入机键位
*/
private String customerCode;
} }
} }
...@@ -133,6 +133,8 @@ public class ShoppingCartConvertAdapter { ...@@ -133,6 +133,8 @@ public class ShoppingCartConvertAdapter {
goods.setSpuName(materialGoods.getSpuName()); goods.setSpuName(materialGoods.getSpuName());
goods.setOriginalPrice(materialGoods.getOriginalPrice()); goods.setOriginalPrice(materialGoods.getOriginalPrice());
goods.setSalePrice(materialGoods.getFinalPrice()); goods.setSalePrice(materialGoods.getFinalPrice());
goods.setCustomerCode(materialGoods.getCustomerCode());
goods.setProductCode(materialGoods.getCustomerCode());
goods.setQty(cartGoods.getQty()); goods.setQty(cartGoods.getQty());
goods.setTotalDiscountAmount(0); goods.setTotalDiscountAmount(0);
materialList.add(goods); materialList.add(goods);
...@@ -265,7 +267,7 @@ public class ShoppingCartConvertAdapter { ...@@ -265,7 +267,7 @@ public class ShoppingCartConvertAdapter {
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = new ShoppingCartGoodsDto.CartGoodsDetailDto(); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = new ShoppingCartGoodsDto.CartGoodsDetailDto();
cartGoodsDetailDto.setTaxId(cartGoods.getTaxId()); cartGoodsDetailDto.setTaxId(cartGoods.getTaxId());
cartGoodsDetailDto.setTax(cartGoods.getTax()); cartGoodsDetailDto.setTax(cartGoods.getTax());
cartGoodsDetailDto.setSpuId(comboxGoods.getGoodsId()); cartGoodsDetailDto.setSpuId(comboxGoods.getSpuId());
cartGoodsDetailDto.setSpuName(comboxGoods.getSpuName()); cartGoodsDetailDto.setSpuName(comboxGoods.getSpuName());
cartGoodsDetailDto.setSkuId(comboxGoods.getGoodsId()); cartGoodsDetailDto.setSkuId(comboxGoods.getGoodsId());
cartGoodsDetailDto.setSkuName(StringUtils.isEmpty(comboxGoods.getSkuName()) ? comboxGoods.getSpuName() : comboxGoods.getSkuName()); cartGoodsDetailDto.setSkuName(StringUtils.isEmpty(comboxGoods.getSkuName()) ? comboxGoods.getSpuName() : comboxGoods.getSkuName());
...@@ -294,6 +296,8 @@ public class ShoppingCartConvertAdapter { ...@@ -294,6 +296,8 @@ public class ShoppingCartConvertAdapter {
goods.setSalePrice(materialGoods.getFinalPrice()); goods.setSalePrice(materialGoods.getFinalPrice());
goods.setQty(cartGoods.getQty()); goods.setQty(cartGoods.getQty());
goods.setTotalDiscountAmount(0); goods.setTotalDiscountAmount(0);
goods.setProductCode(materialGoods.getCustomerCode());
goods.setCustomerCode(materialGoods.getCustomerCode());
materialList.add(goods); materialList.add(goods);
} }
cartGoodsDetailDto.setMaterialList(materialList); cartGoodsDetailDto.setMaterialList(materialList);
...@@ -699,7 +703,7 @@ public class ShoppingCartConvertAdapter { ...@@ -699,7 +703,7 @@ public class ShoppingCartConvertAdapter {
comboxGoods.setTax(isComboxGoods ? productComboType.getTax() : groupDetailType.getTax()); comboxGoods.setTax(isComboxGoods ? productComboType.getTax() : groupDetailType.getTax());
comboxGoods.setTaxId(isComboxGoods ? productComboType.getTaxId() : groupDetailType.getTaxId()); comboxGoods.setTaxId(isComboxGoods ? productComboType.getTaxId() : groupDetailType.getTaxId());
//套餐内商品加料 // TODO: 2020/10/22 套餐内可选商品加料,暂无
if(CollectionUtils.isNotEmpty(comboxGoods.getProductMaterialList())){ if(CollectionUtils.isNotEmpty(comboxGoods.getProductMaterialList())){
List<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods> productMaterialList = new ArrayList<>(); List<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods> productMaterialList = new ArrayList<>();
com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods materialGoods = new com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods(); com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods materialGoods = new com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods();
...@@ -731,7 +735,10 @@ public class ShoppingCartConvertAdapter { ...@@ -731,7 +735,10 @@ public class ShoppingCartConvertAdapter {
} }
//提取加料信息 //提取加料信息
List<String> materialSpu = new ArrayList<>(); List<String> materialSpu = new ArrayList<>();
List<ProductBeanDTO.ProductGroupType.GroupDetailType> groupDetail = spuProduct.getAdditionalGroupList().get(0).getGroupDetail(); List<ProductBeanDTO.ProductGroupType.GroupDetailType> groupDetail = new ArrayList<>();
for (ProductBeanDTO.ProductGroupType productGroupType : spuProduct.getAdditionalGroupList()){
groupDetail.addAll(productGroupType.getGroupDetail());
}
HashMap<String, ProductBeanDTO.ProductGroupType.GroupDetailType> materialHash = new HashMap<>(); HashMap<String, ProductBeanDTO.ProductGroupType.GroupDetailType> materialHash = new HashMap<>();
for (ProductBeanDTO.ProductGroupType.GroupDetailType groupDetailType : groupDetail) { for (ProductBeanDTO.ProductGroupType.GroupDetailType groupDetailType : groupDetail) {
materialHash.put(groupDetailType.getProductId(), groupDetailType); materialHash.put(groupDetailType.getProductId(), groupDetailType);
...@@ -759,6 +766,7 @@ public class ShoppingCartConvertAdapter { ...@@ -759,6 +766,7 @@ public class ShoppingCartConvertAdapter {
//原行单价*数量 //原行单价*数量
material.setOriginalAmount(detail.getProductFinalPrice().longValue() * cartGoods.getQty()); material.setOriginalAmount(detail.getProductFinalPrice().longValue() * cartGoods.getQty());
material.setOriginalPrice(detail.getProductFinalPrice().longValue()); material.setOriginalPrice(detail.getProductFinalPrice().longValue());
material.setCustomerCode(materialGoods.getCustomerCode());
materialGoodsList.add(material); materialGoodsList.add(material);
materialAmount += detail.getProductFinalPrice().longValue() * cartGoods.getQty(); materialAmount += detail.getProductFinalPrice().longValue() * cartGoods.getQty();
originalMaterAmount += detail.getProductFinalPrice().longValue() * cartGoods.getQty(); originalMaterAmount += detail.getProductFinalPrice().longValue() * cartGoods.getQty();
...@@ -912,29 +920,22 @@ public class ShoppingCartConvertAdapter { ...@@ -912,29 +920,22 @@ public class ShoppingCartConvertAdapter {
//套餐内商品加料 //套餐内商品加料
if(CollectionUtils.isNotEmpty(comboxGoods.getProductMaterialList())){ if(CollectionUtils.isNotEmpty(comboxGoods.getProductMaterialList())){
if (CollectionUtils.isNotEmpty(productBeanDTO.getAdditionalGroupList())) { if (CollectionUtils.isNotEmpty(productBeanDTO.getAdditionalGroupList())) {
List<ProductBeanDTO.ProductGroupType.GroupDetailType> groupDetail = productBeanDTO.getAdditionalGroupList().get(0).getGroupDetail(); List<ProductBeanDTO.ProductGroupType.GroupDetailType> groupDetail = new ArrayList<>();
ProductBeanDTO.ProductGroupType.GroupDetailType groupDetailType1 = null; for (ProductBeanDTO.ProductGroupType productGroupType : productBeanDTO.getAdditionalGroupList()){
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods productMaterialList :comboxGoods.getProductMaterialList()){ groupDetail.addAll(productGroupType.getGroupDetail());
for (ProductBeanDTO.ProductGroupType.GroupDetailType groupDetailType : groupDetail){
if(groupDetailType.getProductId().equals(productMaterialList.getSpuId())){
groupDetailType1 = groupDetailType;
break;
} }
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods productMaterial :comboxGoods.getProductMaterialList()){
for (ProductBeanDTO.ProductGroupType.GroupDetailType groupDetailType : groupDetail){
if(groupDetailType.getProductId().equals(productMaterial.getSpuId())){
productMaterial.setSpuId(groupDetailType.getProductId());
productMaterial.setAmount(groupDetailType.getProductFinalPrice().longValue());
productMaterial.setFinalPrice(groupDetailType.getProductFinalPrice().longValue());
productMaterial.setOriginalAmount(groupDetailType.getProductFinalPrice().longValue());
productMaterial.setOriginalPrice(groupDetailType.getProductFinalPrice().longValue());
productMaterial.setSpuName(groupDetailType.getProductName());
} }
} }
if(groupDetailType1 == null){
return;
} }
List<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods> productMaterialList = new ArrayList<>();
com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods materialGoods = new com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods();
materialGoods.setSpuId(groupDetailType1.getProductId());
materialGoods.setAmount(groupDetailType1.getProductPrice().longValue());
materialGoods.setFinalPrice(groupDetailType1.getProductFinalPrice().longValue());
materialGoods.setOriginalAmount(groupDetailType1.getProductPrice().longValue());
materialGoods.setOriginalPrice(groupDetailType1.getProductPrice().longValue());
materialGoods.setSpuName(groupDetailType1.getProductName());
productMaterialList.add(materialGoods);
comboxGoods.setProductMaterialList(productMaterialList);
} }
} }
} }
......
...@@ -156,10 +156,14 @@ public class ActivityCalculationDiscountRequestDto { ...@@ -156,10 +156,14 @@ public class ActivityCalculationDiscountRequestDto {
*/ */
private Integer goodsQuantity; private Integer goodsQuantity;
/** /**
* 加料 * 加料
*/ */
private Long originalPrice; private Long originalPrice;
/** /**
* 加料现价
*/
private Integer nowPrice;
/**
* 1 :小料、2:可选搭配 * 1 :小料、2:可选搭配
*/ */
private int type; private int type;
......
...@@ -229,6 +229,10 @@ public class ActivityCalculationDiscountResponseDto { ...@@ -229,6 +229,10 @@ public class ActivityCalculationDiscountResponseDto {
*/ */
private String artNo; private String artNo;
/**
* 小料节点
*/
private List<GoodsMaterial> smallMaterial;
@Data @Data
public static class GoodsDiscount { public static class GoodsDiscount {
...@@ -263,6 +267,38 @@ public class ActivityCalculationDiscountResponseDto { ...@@ -263,6 +267,38 @@ public class ActivityCalculationDiscountResponseDto {
*/ */
private Integer actualGoodsNumber; private Integer actualGoodsNumber;
} }
@Data
public static class GoodsMaterial{
/**
* 子商品类型:1-小料;2-可选商品
*/
private Integer type;
/**
* 小料商品ID
*/
private String goodsId;
/**
* 小料数量
*/
private Integer goodsQuantity;
/**
* 商品原价(单位:分)
*/
private Integer originalPrice;
/**
* 商品现价(单位:分)
*/
private Integer nowPrice;
/**
* 分摊到商品上的优惠总金额
*/
private Integer discountAmount;
/**
* 商品实付金额
*/
private Integer realAmount;
}
} }
@Data @Data
......
...@@ -307,6 +307,10 @@ public class ShoppingCartGoodsDto { ...@@ -307,6 +307,10 @@ public class ShoppingCartGoodsDto {
* 商品行优惠总金额=数量*单个商品优惠金额 * 商品行优惠总金额=数量*单个商品优惠金额
*/ */
private Integer totalDiscountAmount; private Integer totalDiscountAmount;
private String productCode;
private String customerCode;
/** /**
* 当前商品享受的促销活动 * 当前商品享受的促销活动
*/ */
......
...@@ -376,6 +376,9 @@ public class CartGoods { ...@@ -376,6 +376,9 @@ public class CartGoods {
if (CollectionUtils.isNotEmpty(goods.getSpecialExtra())) { if (CollectionUtils.isNotEmpty(goods.getSpecialExtra())) {
goods.getSpecialExtra().stream().sorted(Comparator.comparing(SpecialExtra::getAttributeId)).forEach(e -> originalString.append(e.getAttributeId())); goods.getSpecialExtra().stream().sorted(Comparator.comparing(SpecialExtra::getAttributeId)).forEach(e -> originalString.append(e.getAttributeId()));
} }
if (CollectionUtils.isNotEmpty(goods.getProductMaterialList())) {
goods.getProductMaterialList().stream().sorted(Comparator.comparing(MaterialGoods::getSpuId)).forEach(e -> originalString.append(e.getSpuId()));
}
} }
} }
if (CollectionUtils.isNotEmpty(productGroupList)) { if (CollectionUtils.isNotEmpty(productGroupList)) {
...@@ -404,6 +407,9 @@ public class CartGoods { ...@@ -404,6 +407,9 @@ public class CartGoods {
if (CollectionUtils.isNotEmpty(goods.getSpecialExtra())) { if (CollectionUtils.isNotEmpty(goods.getSpecialExtra())) {
goods.getSpecialExtra().stream().sorted(Comparator.comparing(SpecialExtra::getAttributeId)).forEach(e -> currentString.append(e.getAttributeId())); goods.getSpecialExtra().stream().sorted(Comparator.comparing(SpecialExtra::getAttributeId)).forEach(e -> currentString.append(e.getAttributeId()));
} }
if (CollectionUtils.isNotEmpty(goods.getProductMaterialList())) {
goods.getProductMaterialList().stream().sorted(Comparator.comparing(MaterialGoods::getSpuId)).forEach(e -> currentString.append(e.getSpuId()));
}
} }
} }
if (CollectionUtils.isNotEmpty(cartGoods.getProductGroupList())) { if (CollectionUtils.isNotEmpty(cartGoods.getProductGroupList())) {
...@@ -467,6 +473,10 @@ public class CartGoods { ...@@ -467,6 +473,10 @@ public class CartGoods {
*/ */
private String spuId; private String spuId;
/** /**
* 加料组id(对应入机键位)
*/
private String groupId;
/**
* 加料名称 * 加料名称
*/ */
private String spuName; private String spuName;
...@@ -486,5 +496,10 @@ public class CartGoods { ...@@ -486,5 +496,10 @@ public class CartGoods {
* 购物车一行商品的现价*数量 * 购物车一行商品的现价*数量
*/ */
private Long amount; private Long amount;
/**
* 麦咖啡入机键位
*/
private String customerCode;
} }
} }
...@@ -20,4 +20,13 @@ public class MaterialRequestVo { ...@@ -20,4 +20,13 @@ public class MaterialRequestVo {
* 加料商品ID * 加料商品ID
*/ */
private String spuId; private String spuId;
/**
* 加料商品组ID
*/
private String groupId;
/**
* 麦咖啡入机键位
*/
private String customerCode;
} }
...@@ -755,7 +755,6 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -755,7 +755,6 @@ public class ShoppingCartMCoffeeServiceImpl {
if(!ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(storeCheckResponse.getCode())) { if(!ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(storeCheckResponse.getCode())) {
shoppingCartGoodsResponseVo.setChanged(true); shoppingCartGoodsResponseVo.setChanged(true);
shoppingCartGoodsResponseVo.setToastMsg(storeCheckResponse.getMessage()); shoppingCartGoodsResponseVo.setToastMsg(storeCheckResponse.getMessage());
// return storeCheckResponse;
} }
List<CartGoods> cartGoodsList = getOrderGoods(orderInfo.getResult()); List<CartGoods> cartGoodsList = getOrderGoods(orderInfo.getResult());
...@@ -822,7 +821,10 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -822,7 +821,10 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods.setQty(orderItem.getProductQuantity()); cartGoods.setQty(orderItem.getProductQuantity());
cartGoods.setSpuId(orderItem.getProductId()); cartGoods.setSpuId(orderItem.getProductId());
cartGoods.setSkuId(orderItem.getProductSpec()); cartGoods.setSkuId(orderItem.getProductSpec());
cartGoods.setOriginalPrice(orderItem.getProductPrice().longValue());
cartGoods.setFinalPrice(orderItem.getProductPrice().longValue()); cartGoods.setFinalPrice(orderItem.getProductPrice().longValue());
cartGoods.setOriginalAmount(cartGoods.getOriginalPrice() * cartGoods.getQty());
cartGoods.setAmount(cartGoods.getFinalPrice() * cartGoods.getQty());
cartGoods.setPic(orderItem.getProductPicUrl()); cartGoods.setPic(orderItem.getProductPicUrl());
if(6 == orderItem.getProductType()) { if(6 == orderItem.getProductType()) {
cartGoods.setGoodsType(com.freemud.sdk.api.assortment.shoppingcart.constant.GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType()); cartGoods.setGoodsType(com.freemud.sdk.api.assortment.shoppingcart.constant.GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType());
...@@ -833,14 +835,6 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -833,14 +835,6 @@ public class ShoppingCartMCoffeeServiceImpl {
}else { }else {
cartGoods.setGoodsType(com.freemud.sdk.api.assortment.shoppingcart.constant.GoodsTypeEnum.COMMON_GOODS.getGoodsType()); cartGoods.setGoodsType(com.freemud.sdk.api.assortment.shoppingcart.constant.GoodsTypeEnum.COMMON_GOODS.getGoodsType());
} }
if (ObjectUtils.equals(ProductTypeEnum.SETMEAL_PRODUCT.getCode(), orderItem.getProductType()) || ObjectUtils.equals(ProductTypeEnum.SETMEAL_UPPRICE_PRODUCT.getCode(), orderItem.getProductType())) {
// 获取套餐子商品列表
cartGoods.setProductComboList(new ArrayList<>());
cartGoods.setProductGroupList(new ArrayList<>());
String partnerProductId = orderItem.getProductId() + "_" + orderItem.getProductSeq();
List<OrderItemResp> comboProducts = orderItemList.stream().filter(item -> ObjectUtils.equals(partnerProductId, item.getParentProductId())).collect(Collectors.toList());
comboProducts.forEach(combo -> getComboxGoods(cartGoods, combo));
}
if(("早餐啡常搭".equals(orderItem.getProductName()) && "早餐啡常搭".equals(orderItem.getProductSpecName())) if(("早餐啡常搭".equals(orderItem.getProductName()) && "早餐啡常搭".equals(orderItem.getProductSpecName()))
|| ("啡常搭".equals(orderItem.getProductName()) && "啡常搭".equals(orderItem.getProductSpecName()))) { || ("啡常搭".equals(orderItem.getProductName()) && "啡常搭".equals(orderItem.getProductSpecName()))) {
cartGoods.setName(orderItem.getProductName()); cartGoods.setName(orderItem.getProductName());
...@@ -851,6 +845,34 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -851,6 +845,34 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods.setSkuName(orderItem.getProductSpecName()); cartGoods.setSkuName(orderItem.getProductSpecName());
cartGoods.setSpuName(orderItem.getProductName()); cartGoods.setSpuName(orderItem.getProductName());
} }
if (ObjectUtils.equals(ProductTypeEnum.SETMEAL_PRODUCT.getCode(), orderItem.getProductType())
|| ObjectUtils.equals(ProductTypeEnum.SETMEAL_UPPRICE_PRODUCT.getCode(), orderItem.getProductType())) {
// 获取套餐子商品列表
cartGoods.setProductComboList(new ArrayList<>());
cartGoods.setProductGroupList(new ArrayList<>());
String partnerProductId = orderItem.getProductId() + "_" + orderItem.getProductSeq();
List<OrderItemResp> comboProducts = orderItemList.stream().filter(item -> ObjectUtils.equals(partnerProductId, item.getParentProductId())).collect(Collectors.toList());
comboProducts.forEach(combo -> {
getComboxGoods(cartGoods, combo, orderItemList);
});
}
//特制
if (StringUtils.isNotEmpty(orderItem.getExtInfo())){
JSONObject extJson = JSONObject.parseObject(orderItem.getExtInfo());
CartGoods.SpecialExtra specialExtra = new CartGoods.SpecialExtra();
specialExtra.setAttributeId(extJson.containsKey("attributeId") ? extJson.getString("attributeId") : "");
specialExtra.setAttributeName(extJson.containsKey("attributeName") ? extJson.getString("attributeName") : "");
specialExtra.setAttributeId(extJson.containsKey("specialCode") ? extJson.getString("specialCode") : "");
cartGoods.setSpecialExtra(Arrays.asList(specialExtra));
}
if (ObjectUtils.equals(88, orderItem.getProductType())) {
// 获取套餐子商品列表
cartGoods.setProductMaterialList(new ArrayList<>());
String partnerProductId = orderItem.getProductId() + "_" + orderItem.getProductSeq();
List<OrderItemResp> materialProducts = orderItemList.stream().filter(item -> ObjectUtils.equals(partnerProductId, item.getParentProductId())).collect(Collectors.toList());
materialProducts.forEach(material -> getMaterialGoods(cartGoods, material));
}
cartGoodsList.add(cartGoods); cartGoodsList.add(cartGoods);
} }
...@@ -858,7 +880,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -858,7 +880,7 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
private CartGoods.ComboxGoods getComboxGoods(CartGoods cartGoods, OrderItemResp orderItemResp) { private CartGoods.ComboxGoods getComboxGoods(CartGoods cartGoods, OrderItemResp orderItemResp, List<OrderItemResp> orderItemList) {
CartGoods.ComboxGoods comboxGoods = new CartGoods.ComboxGoods(); CartGoods.ComboxGoods comboxGoods = new CartGoods.ComboxGoods();
comboxGoods.setSkuId(orderItemResp.getProductSpec()); comboxGoods.setSkuId(orderItemResp.getProductSpec());
comboxGoods.setGoodsId(orderItemResp.getProductId()); comboxGoods.setGoodsId(orderItemResp.getProductId());
...@@ -870,7 +892,9 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -870,7 +892,9 @@ public class ShoppingCartMCoffeeServiceImpl {
comboxGoods.setSpuName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :""); comboxGoods.setSpuName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :"");
comboxGoods.setSkuName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() :""); comboxGoods.setSkuName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() :"");
comboxGoods.setSubName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() : ""); comboxGoods.setSubName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() : "");
if (!"".equals(orderItemResp.getProductProperty())) { comboxGoods.setOriginalAmount(comboxGoods.getOriginalPrice() * comboxGoods.getQty());
comboxGoods.setAmount(comboxGoods.getFinalPrice() * comboxGoods.getQty());
if (StringUtils.isNotBlank(orderItemResp.getProductProperty())) {
List<CartGoods.CartGoodsExtra> extra = new ArrayList<>(); List<CartGoods.CartGoodsExtra> extra = new ArrayList<>();
String[] split = orderItemResp.getProductProperty().split("/"); String[] split = orderItemResp.getProductProperty().split("/");
for (int i = 0; i < split.length; i++) { for (int i = 0; i < split.length; i++) {
...@@ -880,6 +904,18 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -880,6 +904,18 @@ public class ShoppingCartMCoffeeServiceImpl {
} }
comboxGoods.setExtra(extra); comboxGoods.setExtra(extra);
} }
for (OrderItemResp itemResp : orderItemList) {
//特制
if (StringUtils.isNotEmpty(itemResp.getExtInfo())){
JSONObject extJson = JSONObject.parseObject(itemResp.getExtInfo());
CartGoods.SpecialExtra specialExtra = new CartGoods.SpecialExtra();
specialExtra.setAttributeId(extJson.containsKey("attributeId") ? extJson.getString("attributeId") : "");
specialExtra.setAttributeName(extJson.containsKey("attributeName") ? extJson.getString("attributeName") : "");
specialExtra.setAttributeId(extJson.containsKey("specialCode") ? extJson.getString("specialCode") : "");
comboxGoods.setSpecialExtra(Arrays.asList(specialExtra));
}
}
Map<String, Object> map = JSONObject.parseObject(orderItemResp.getExtInfo(), Map.class); Map<String, Object> map = JSONObject.parseObject(orderItemResp.getExtInfo(), Map.class);
if (map.containsKey("isFixedProduct") && (boolean) map.get("isFixedProduct")) { if (map.containsKey("isFixedProduct") && (boolean) map.get("isFixedProduct")) {
cartGoods.getProductComboList().add(comboxGoods); cartGoods.getProductComboList().add(comboxGoods);
...@@ -887,10 +923,44 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -887,10 +923,44 @@ public class ShoppingCartMCoffeeServiceImpl {
if (map.containsKey("isFixedProduct") && !(boolean) map.get("isFixedProduct")) { if (map.containsKey("isFixedProduct") && !(boolean) map.get("isFixedProduct")) {
cartGoods.getProductGroupList().add(comboxGoods); cartGoods.getProductGroupList().add(comboxGoods);
} }
if (ObjectUtils.equals(88, orderItemResp.getProductType())) {
comboxGoods.setProductMaterialList(new ArrayList<>());
String partnerProductId = orderItemResp.getProductId() + "_" + orderItemResp.getProductSeq();
List<OrderItemResp> materialProducts = orderItemList.stream().filter(item -> ObjectUtils.equals(partnerProductId, item.getParentProductId())).collect(Collectors.toList());
materialProducts.forEach(material -> getMaterialGoods(comboxGoods, material));
}
return comboxGoods; return comboxGoods;
} }
private CartGoods.MaterialGoods getMaterialGoods(CartGoods cartGoods, OrderItemResp orderItemResp) {
CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods();
materialGoods.setSpuId(orderItemResp.getProductId());
materialGoods.setCustomerCode(orderItemResp.getThirdProductId());
materialGoods.setFinalPrice(orderItemResp.getSalePrice().longValue());
materialGoods.setOriginalPrice(orderItemResp.getProductPrice().longValue());
materialGoods.setOriginalAmount(materialGoods.getOriginalPrice());
materialGoods.setAmount(materialGoods.getFinalPrice());
materialGoods.setSpuName(orderItemResp.getProductName());
cartGoods.getProductMaterialList().add(materialGoods);
return materialGoods;
}
private CartGoods.MaterialGoods getMaterialGoods(CartGoods.ComboxGoods comboGoods, OrderItemResp orderItemResp) {
CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods();
materialGoods.setSpuId(orderItemResp.getProductId());
materialGoods.setCustomerCode(orderItemResp.getThirdProductId());
materialGoods.setFinalPrice(orderItemResp.getSalePrice().longValue());
materialGoods.setOriginalPrice(orderItemResp.getProductPrice().longValue());
materialGoods.setOriginalAmount(materialGoods.getOriginalPrice());
materialGoods.setAmount(materialGoods.getFinalPrice());
materialGoods.setSpuName(orderItemResp.getProductName());
comboGoods.getProductMaterialList().add(materialGoods);
return materialGoods;
}
private void packgeAdditional(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity) { private void packgeAdditional(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity) {
ArrayList<ShoppingCartInfoRequestVo.SendGoods> senGoods = new ArrayList<>(); ArrayList<ShoppingCartInfoRequestVo.SendGoods> senGoods = new ArrayList<>();
...@@ -1178,6 +1248,8 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1178,6 +1248,8 @@ public class ShoppingCartMCoffeeServiceImpl {
for (MaterialRequestVo materialRequestVo : vo.getProductMaterialList()) { for (MaterialRequestVo materialRequestVo : vo.getProductMaterialList()) {
CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods(); CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods();
materialGoods.setSpuId(materialRequestVo.getSpuId()); materialGoods.setSpuId(materialRequestVo.getSpuId());
materialGoods.setCustomerCode(materialRequestVo.getCustomerCode());
// materialGoods.setGroupId(materialRequestVo.getGroupId());
comboxMaterialGoodsList.add(materialGoods); comboxMaterialGoodsList.add(materialGoods);
} }
productCombox.setProductMaterialList(comboxMaterialGoodsList); productCombox.setProductMaterialList(comboxMaterialGoodsList);
...@@ -1215,6 +1287,7 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1215,6 +1287,7 @@ public class ShoppingCartMCoffeeServiceImpl {
for (MaterialRequestVo materialRequestVo : vo.getProductMaterialList()) { for (MaterialRequestVo materialRequestVo : vo.getProductMaterialList()) {
CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods(); CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods();
materialGoods.setSpuId(materialRequestVo.getSpuId()); materialGoods.setSpuId(materialRequestVo.getSpuId());
materialGoods.setGroupId(materialRequestVo.getGroupId());
comboxMaterialGoodsList.add(materialGoods); comboxMaterialGoodsList.add(materialGoods);
} }
productCombox.setProductMaterialList(comboxMaterialGoodsList); productCombox.setProductMaterialList(comboxMaterialGoodsList);
...@@ -1229,6 +1302,8 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1229,6 +1302,8 @@ public class ShoppingCartMCoffeeServiceImpl {
for (MaterialRequestVo materialRequestVo : addShoppingCartGoodsRequestVo.getProductMaterialList()) { for (MaterialRequestVo materialRequestVo : addShoppingCartGoodsRequestVo.getProductMaterialList()) {
CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods(); CartGoods.MaterialGoods materialGoods = new CartGoods.MaterialGoods();
materialGoods.setSpuId(materialRequestVo.getSpuId()); materialGoods.setSpuId(materialRequestVo.getSpuId());
materialGoods.setGroupId(materialRequestVo.getGroupId());
materialGoods.setCustomerCode(materialRequestVo.getCustomerCode());
materialGoodsList.add(materialGoods); materialGoodsList.add(materialGoods);
} }
cartGoods.setProductMaterialList(materialGoodsList); cartGoods.setProductMaterialList(materialGoodsList);
......
...@@ -80,6 +80,8 @@ public class CalculationServiceImpl { ...@@ -80,6 +80,8 @@ public class CalculationServiceImpl {
private SetMealCalculation setMealCalculation; private SetMealCalculation setMealCalculation;
@Autowired @Autowired
private MaterialCalculation materialCalculation;
@Autowired
private ShoppingCartConvertAdapter shoppingCartConvertAdapter; private ShoppingCartConvertAdapter shoppingCartConvertAdapter;
/** /**
...@@ -110,6 +112,8 @@ public class CalculationServiceImpl { ...@@ -110,6 +112,8 @@ public class CalculationServiceImpl {
//套餐 //套餐
setMealCalculation.updateShoppingCartGoodsDiscount(calculationDiscount,cartGoodsList,shoppingCartGoodsResponseVo); setMealCalculation.updateShoppingCartGoodsDiscount(calculationDiscount,cartGoodsList,shoppingCartGoodsResponseVo);
//加料
materialCalculation.updateShoppingCartGoodsApportion(calculationDiscount,cartGoodsList);
return calculationDiscount; return calculationDiscount;
} }
...@@ -422,7 +426,7 @@ public class CalculationServiceImpl { ...@@ -422,7 +426,7 @@ public class CalculationServiceImpl {
ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material material = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material(); ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material material = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material();
material.setType(1); material.setType(1);
material.setGoodsId(materialGoods2.getSpuId()); material.setGoodsId(materialGoods2.getSpuId());
material.setGoodsQuantity(cartGoods.getQty()); material.setGoodsQuantity(1);
material.setOriginalPrice(materialGoods2.getFinalPrice()); material.setOriginalPrice(materialGoods2.getFinalPrice());
materials.add(material); materials.add(material);
} }
...@@ -436,8 +440,9 @@ public class CalculationServiceImpl { ...@@ -436,8 +440,9 @@ public class CalculationServiceImpl {
ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material material = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material(); ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material material = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material();
material.setType(1); material.setType(1);
material.setGoodsId(materialGoods.getSpuId()); material.setGoodsId(materialGoods.getSpuId());
material.setGoodsQuantity(cartGoods.getQty()); material.setGoodsQuantity(1);
material.setOriginalPrice(materialGoods.getFinalPrice()); material.setOriginalPrice(materialGoods.getOriginalPrice());
material.setNowPrice(materialGoods.getFinalPrice().intValue());
materials.add(material); materials.add(material);
} }
} }
...@@ -462,14 +467,15 @@ public class CalculationServiceImpl { ...@@ -462,14 +467,15 @@ public class CalculationServiceImpl {
long totalPackgeAmount = 0L; long totalPackgeAmount = 0L;
for (CartGoods cartGoods : cartGoodsList) { for (CartGoods cartGoods : cartGoodsList) {
// 设置商品原价与商品现价的初始值 // 设置商品原价与商品现价的初始值
long originalAmount = null != cartGoods.getOriginalPrice() ? cartGoods.getOriginalPrice() : 0; long originalAmount = null != cartGoods.getOriginalPrice() ? cartGoods.getOriginalPrice()* cartGoods.getQty() : 0;
long amount = null != cartGoods.getOriginalPrice() ? cartGoods.getOriginalPrice() : 0; long amount = null != cartGoods.getOriginalPrice() ? cartGoods.getOriginalPrice()* cartGoods.getQty() : 0;
long packAmount = null != cartGoods.getPackPrice() ? cartGoods.getPackPrice() : 0; long packAmount = null != cartGoods.getPackPrice() ? cartGoods.getPackPrice()* cartGoods.getQty() : 0;
totalOriginalAmount += originalAmount; totalOriginalAmount += originalAmount;
totalAmount += amount; totalAmount += amount;
totalPackgeAmount += packAmount; totalPackgeAmount += packAmount;
cartGoods.setOriginalAmount(originalAmount); long materialPrice = getMaterialPrice(cartGoods);
cartGoods.setAmount(amount); cartGoods.setOriginalAmount(originalAmount + materialPrice);
cartGoods.setAmount(amount + materialPrice);
cartGoods.setPackPrice(packAmount); cartGoods.setPackPrice(packAmount);
} }
shoppingCartGoodsResponseVo.setOriginalTotalAmount(calculationDiscount == null ? totalOriginalAmount : calculationDiscount.getOriginalTotalAmount()); shoppingCartGoodsResponseVo.setOriginalTotalAmount(calculationDiscount == null ? totalOriginalAmount : calculationDiscount.getOriginalTotalAmount());
...@@ -484,4 +490,17 @@ public class CalculationServiceImpl { ...@@ -484,4 +490,17 @@ public class CalculationServiceImpl {
shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(calculationDiscount == null ? 0L :calculationDiscount.getDistributionFee()); shoppingCartGoodsResponseVo.setDiscountDeliveryAmount(calculationDiscount == null ? 0L :calculationDiscount.getDistributionFee());
} }
private Long getMaterialPrice(CartGoods cartGoods){
Long materialPrice = 0L;
//单品、多规格加料
if(CollectionUtils.isNotEmpty(cartGoods.getProductMaterialList())){
for (CartGoods.MaterialGoods materialGoods : cartGoods.getProductMaterialList()){
materialPrice+= materialGoods.getFinalPrice() * cartGoods.getQty();
}
}
return materialPrice;
}
} }
package cn.freemud.service.impl.mcoffee.calculation;
import cn.freemud.adapter.ShoppingCartConvertAdapter;
import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto;
import cn.freemud.entities.dto.activity.ActivityDiscountsDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.CartGoods;
import cn.freemud.entities.vo.CreateOrderVo;
import cn.freemud.entities.vo.ShoppingCartGoodsResponseVo;
import cn.freemud.entities.vo.ShoppingCartInfoRequestVo;
import cn.freemud.enums.GoodsTypeEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* All rights Reserved, Designed By sunary.site
*
* @version v1.0
* @Title: IntelliJ IDEA
* @Package cn.freemud.service.impl.mcoffee.calculation
* @Description: 请简单描述下这个类是做什么用的
* @author: yu.sun
* @date: 2020-10-21 00:56:45
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
*/
@Service
@Slf4j
public class MaterialCalculation {
@Autowired
private ShoppingCartConvertAdapter shoppingCartConvertAdapter;
public void updateShoppingCartGoodsApportion(ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, List<CartGoods> cartGoodsList) {
HashMap<String, MaterialApportion> map = getApportionGoodsDetail(calculationDiscountResult);
if (map.size() > 0) {
String pk = "";
// for (CartGoods product : cartGoodsList) {
// if (CollectionUtils.isEmpty(product.getProductMaterialList())) {
// continue;
// }
// for (CartGoods.MaterialGoods materialGoods : product.getProductMaterialList()) {
// pk = shoppingCartConvertAdapter.jointPk(product.getCartGoodsUid(), materialGoods.getSpuId());
// MaterialApportion material = map.get(pk);
// if ((material == null) || (material != null && material.getTotalDiscountAmount().intValue() == 0)) {
// continue;
// }
// List<ActivityDiscountsDto> activityDiscountsDtos = materialGoods.getActivityDiscountsDtos();
// if (CollectionUtils.isEmpty(activityDiscountsDtos)) {
// activityDiscountsDtos = new ArrayList<>();
// }
// //设置行记录参加的活动及总优惠
// if (CollectionUtils.isNotEmpty(material.getDetails())) {
// for (ApportionDetails detail : material.getDetails()) {
// ActivityDiscountsDto activityDiscountsDto = new ActivityDiscountsDto();
// activityDiscountsDto.setActivityCode(detail.getActivityCode());
// activityDiscountsDto.setActivityName(detail.getActivityName());
// activityDiscountsDto.setActivityType(detail.getActivityType());
// activityDiscountsDto.setDiscountAmount(detail.getAmount().intValue());
// activityDiscountsDtos.add(activityDiscountsDto);
// }
// }
// materialGoods.setActivityDiscountsDtos(activityDiscountsDtos);
// materialGoods.setTotalDiscountAmount(material.getTotalDiscountAmount());
// product.setProductType(GoodsTypeEnum.MATERIAL.getGoodsType());
// }
// }
}
// //将小料的价格累加到商品行上
// for (ShoppingCartGoodsDto.CartGoodsDetailDto product : products) {
// if (CollectionUtils.isEmpty(product.getMaterialList())) {
// continue;
// }
// for (ShoppingCartGoodsDto.CartGoodsDetailDto.MaterialGoods materialGoods : product.getMaterialList()) {
// product.setSalePrice(product.getSalePrice() + materialGoods.getSalePrice());//现金
// product.setOriginalPrice(product.getOriginalPrice() + materialGoods.getOriginalPrice());
// product.setTotalDiscountAmount(product.getTotalDiscountAmount() + materialGoods.getTotalDiscountAmount());
// product.setProductType(GoodsTypeEnum.MATERIAL.getGoodsType());
// }
// }
}
/**
* 提取促销均摊
*
* @param calculationDiscountResult
* @return
*/
private HashMap<String, MaterialApportion> getApportionGoodsDetail(ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult) {
HashMap<String, MaterialApportion> mApportion = new HashMap<>();
// 遍历促销
if (calculationDiscountResult == null || CollectionUtils.isEmpty(calculationDiscountResult.getApportionGoods())) {
return mApportion;
}
String pk = "";
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods apportionGood : calculationDiscountResult.getApportionGoods()) {
if (CollectionUtils.isEmpty(apportionGood.getSmallMaterial())) {
continue;
}
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods.Material material : apportionGood.getSmallMaterial()) {
if (material.getApportionAmount() == 0) {
continue;
}
pk = shoppingCartConvertAdapter.jointPk(apportionGood.getCartGoodsUid(), material.getGoodsId());
if (mApportion.get(pk) == null) {
MaterialApportion materialApportion = new MaterialApportion();
materialApportion.setGoodsId(material.getGoodsId());
materialApportion.setTotalDiscountAmount(material.getApportionAmount() * apportionGood.getGoodsQuantity());
materialApportion.setPk(pk);
ArrayList<ApportionDetails> apportionDetailsList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(material.getApportionDetails())) {
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods.ApportionDetails apportionDetail : material.getApportionDetails()) {
ApportionDetails apportionDetails = new ApportionDetails();
apportionDetails.setActivityName(apportionDetail.getActivityName());
apportionDetails.setActivityCode(apportionDetail.getActivityCode());
apportionDetails.setActivityType(apportionDetail.getActivityType());
apportionDetails.setAmount(apportionDetail.getActivityApportionAmount()*apportionGood.getGoodsQuantity());
apportionDetailsList.add(apportionDetails);
}
materialApportion.setDetails(apportionDetailsList);
}
mApportion.put(pk, materialApportion);
continue;
}
MaterialApportion apportion = mApportion.get(pk);
apportion.setTotalDiscountAmount(apportion.getTotalDiscountAmount() + material.getApportionAmount() * apportionGood.getGoodsQuantity());
List<ApportionDetails> details = apportion.getDetails();
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods.ApportionDetails apportionDetail : material.getApportionDetails()) {
//累加不同的均摊活动
if (apportion.getDetails().stream().filter(e -> e.getActivityCode().equals(apportionDetail.getActivityCode())).count() == 0) {
ApportionDetails apportionDetails = new ApportionDetails();
apportionDetails.setActivityName(apportionDetail.getActivityName());
apportionDetails.setActivityCode(apportionDetail.getActivityCode());
apportionDetails.setActivityType(apportionDetail.getActivityType());
apportionDetails.setAmount(apportionDetail.getActivityApportionAmount()*apportionGood.getGoodsQuantity());
details.add(apportionDetails);
}
//相同的均摊累加金额
else {
for (ApportionDetails detail : apportion.getDetails()) {
if (detail.getActivityCode().equals(apportionDetail.getActivityCode())) {
detail.setAmount(detail.getAmount()+apportionDetail.getActivityApportionAmount()*apportionGood.getGoodsQuantity());
}
}
}
apportion.setDetails(details);
}
mApportion.put(pk, apportion);
}
}
return mApportion;
}
@Data
private class MaterialApportion {
private String goodsId;
//优惠金额
private Integer totalDiscountAmount;
private List<ApportionDetails> details;
private String pk;
}
@Data
public class ApportionDetails {
private String activityCode;
private String activityName;
private Integer activityType;
private Long amount;
}
@Data
@NoArgsConstructor
public static class Material {
/**
* 均摊金额
*/
private Integer apportionAmount;
/**
* 购物车行记录
*/
private String cartGoodsUid;
/**
* 商品id
*/
private String goodsId;
/**
* 商品数量
*/
private Integer goodsQuantity;
/**
* 赠送商品现价(单位:分)(加价换购时表示需要加的价格)
*/
private Long nowPrice;
/**
* 商品原价(分)
*/
private Long originalPrice;
private List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.ApportionGoods.ApportionDetails> apportionDetails;
}
}
...@@ -69,9 +69,24 @@ public class SetMealCalculation { ...@@ -69,9 +69,24 @@ public class SetMealCalculation {
long productComboAmount = cartGoods.getProductComboList().stream().mapToLong(t -> t.getFinalPrice() * t.getQty()).sum(); long productComboAmount = cartGoods.getProductComboList().stream().mapToLong(t -> t.getFinalPrice() * t.getQty()).sum();
long productComboTotalAmount = productComboAmount * cartGoods.getQty(); long productComboTotalAmount = productComboAmount * cartGoods.getQty();
cartGoods.setOriginalAmount(productGroupTotalAmount + productComboTotalAmount); long materialPrice = 0l;
//套餐固定商品加料
if(CollectionUtils.isNotEmpty(cartGoods.getProductComboList())){
for (CartGoods.ComboxGoods comboxGoods : cartGoods.getProductComboList()){
Long comboxmaterialPrice = 0L;
if(CollectionUtils.isNotEmpty(comboxGoods.getProductMaterialList())){
for (CartGoods.MaterialGoods materialGoods : comboxGoods.getProductMaterialList()){
comboxmaterialPrice+= materialGoods.getFinalPrice() * cartGoods.getQty();
}
}
comboxGoods.setAmount(comboxGoods.getAmount()+comboxmaterialPrice);
materialPrice = materialPrice + comboxmaterialPrice;
}
}
cartGoods.setOriginalAmount(productGroupTotalAmount + productComboTotalAmount + materialPrice);
cartGoods.setOriginalPrice(productComboTotalAmount); cartGoods.setOriginalPrice(productComboTotalAmount);
cartGoods.setAmount(productGroupTotalAmount + productComboTotalAmount); cartGoods.setAmount(productGroupTotalAmount + productComboTotalAmount + materialPrice);
cartGoods.setFinalPrice(productComboTotalAmount); cartGoods.setFinalPrice(productComboTotalAmount);
// 套餐(固定商品)现价 // 套餐(固定商品)现价
......
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