Commit af6002f0 by xiaoer.li@freemud.com

Merge branch 'feature/2.1.15-pos-prospectiveAmount' into develop

# Conflicts:
#	assortment-ordercenter-sdk/pom.xml
#	assortment-ordercenter-sdk/readme.md
#	order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
#	ordercenter-sdk/pom.xml
#	ordercenter-sdk/readme.md
#	shopping-cart-application-service/src/main/java/cn/freemud/enums/ResponseResult.java
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CalculationServiceImpl.java
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
parents a9f09ed0 f45c8193
...@@ -1224,6 +1224,7 @@ public class OrderSdkAdapter { ...@@ -1224,6 +1224,7 @@ public class OrderSdkAdapter {
if (orderInfoReqs.getMarketingType() != null) { if (orderInfoReqs.getMarketingType() != null) {
data.setMarketingType(ClassUtils.toByte(orderInfoReqs.getMarketingType())); data.setMarketingType(ClassUtils.toByte(orderInfoReqs.getMarketingType()));
} }
data.setExpressType(orderInfoReqs.getExpressType() == null ? 0 : orderInfoReqs.getExpressType());
data.setPickUpGoodsNo(orderInfoReqs.getPickUpGoodsNo()); data.setPickUpGoodsNo(orderInfoReqs.getPickUpGoodsNo());
......
...@@ -186,6 +186,8 @@ public class OrderAdapter { ...@@ -186,6 +186,8 @@ public class OrderAdapter {
if (CollectionUtils.isNotEmpty(cartGoodsDetailDto.getActivityDiscountsDtos())) { if (CollectionUtils.isNotEmpty(cartGoodsDetailDto.getActivityDiscountsDtos())) {
if(mcCafePartnerId.equals(createOrderDto.getCompanyId())) { if(mcCafePartnerId.equals(createOrderDto.getCompanyId())) {
createOrderProductDto.setAccounts(getMCCafeAccounts(createOrderProductDto, cartGoodsDetailDto.getActivityDiscountsDtos())); createOrderProductDto.setAccounts(getMCCafeAccounts(createOrderProductDto, cartGoodsDetailDto.getActivityDiscountsDtos()));
}else if(cocoPartnerId.contains(createOrderDto.getCompanyId())){
createOrderProductDto.setAccounts(getCocoAccounts(createOrderProductDto, cartGoodsDetailDto.getActivityDiscountsDtos()));
} else { } else {
createOrderProductDto.setAccounts(getAccounts(createOrderProductDto, cartGoodsDetailDto.getActivityDiscountsDtos())); createOrderProductDto.setAccounts(getAccounts(createOrderProductDto, cartGoodsDetailDto.getActivityDiscountsDtos()));
} }
...@@ -450,6 +452,23 @@ public class OrderAdapter { ...@@ -450,6 +452,23 @@ public class OrderAdapter {
return orderAccountDtos; return orderAccountDtos;
} }
public List<CreateOrderAccountRequest> getCocoAccounts(CreateOrderProductRequest createOrderProductDto, List<ActivityDiscountsDto> activityDiscountsDtos) {
List<CreateOrderAccountRequest> orderAccountDtos = new ArrayList<>();
for (ActivityDiscountsDto activityDiscountsDto : activityDiscountsDtos) {
CreateOrderAccountRequest createOrderAccountDto = CreateOrderAccountRequest.builder()
.accountId(activityDiscountsDto.getActivityCode())
.name(activityDiscountsDto.getActivityName())
.price(activityDiscountsDto.getDiscountAmount().longValue())
.accountType(getQueryOrderAccountType(getOrderAccountType(activityDiscountsDto.getActivityType())))
.sequence(createOrderProductDto.getSequence())
.productId(createOrderProductDto.getSpecification())
.discountQty(activityDiscountsDto.getActualActivityGoodsNumber())
.build();
orderAccountDtos.add(createOrderAccountDto);
}
return orderAccountDtos;
}
/** /**
* 计算用户收货地址实际配送费 * 计算用户收货地址实际配送费
......
...@@ -294,7 +294,7 @@ public class CheckOrder { ...@@ -294,7 +294,7 @@ public class CheckOrder {
} }
} }
//订单金额小于起送费提示 //订单金额小于起送费提示
else if (2 == storeDeliveryInfoDto.getDeliveryCondition() && storeDeliveryInfoDto.getDeliveryLimitAmount() > shoppingCartGoodsDto.getTotalAmount()) { else if ((2 == storeDeliveryInfoDto.getDeliveryCondition() && storeDeliveryInfoDto.getDeliveryLimitAmount() > shoppingCartGoodsDto.getTotalAmount()) && !cocoPartnerId.contains(createOrderVo.getPartnerId())) {
throw new ServiceException(ResponseResult.STORE_DISCONTENT_DELIVERY_FEE); throw new ServiceException(ResponseResult.STORE_DISCONTENT_DELIVERY_FEE);
} }
......
...@@ -136,8 +136,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -136,8 +136,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
giftMap.put(giftProduct.getOcid(),giftProduct.getQty()); giftMap.put(giftProduct.getOcid(),giftProduct.getQty());
}); });
} }
Long itemAmount = 0L;
List<ProductVo> productVos = new ArrayList<>(); List<ProductVo> productVos = new ArrayList<>();
if(null != masterProducts && !masterProducts.isEmpty()){ if(null != masterProducts && !masterProducts.isEmpty()){
for(ProductVo product : masterProducts){ for(ProductVo product : masterProducts){
...@@ -155,8 +154,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -155,8 +154,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
// 商品现单价 = 商品现单价+小料现单价 // 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal = smallMaterialOriTotal == null ? 0 : smallMaterialOriTotal; smallMaterialOriTotal = smallMaterialOriTotal == null ? 0 : smallMaterialOriTotal;
product.setOriginalPrice(smallMaterialOriTotal + (product.getOriginalPrice() == null ? 0L : product.getOriginalPrice())); product.setOriginalPrice(smallMaterialOriTotal + (product.getOriginalPrice() == null ? 0L : product.getOriginalPrice()));
itemAmount = itemAmount + product.getOriginalPrice() * product.getQty();
// 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行 // 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行
QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = productMap.get(product.getCid()); QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = productMap.get(product.getCid());
...@@ -190,6 +188,9 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -190,6 +188,9 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
masterProducts.addAll(productVos); masterProducts.addAll(productVos);
queryOrderResponseVo.setProducts(masterProducts); queryOrderResponseVo.setProducts(masterProducts);
// 商品总价
queryOrderResponseVo.setItemAmount(itemAmount);
} }
} }
...@@ -66,4 +66,6 @@ public class OrderSettlementResp { ...@@ -66,4 +66,6 @@ public class OrderSettlementResp {
//结算信息扩展字段映射对象 //结算信息扩展字段映射对象
private String extInfo; private String extInfo;
//商家预计收入
private BigDecimal prospectiveAmount;
} }
...@@ -801,18 +801,20 @@ public class ShoppingCartConvertAdapter { ...@@ -801,18 +801,20 @@ public class ShoppingCartConvertAdapter {
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<>();
Long materialAmount = 0L; Long materialAmount = 0L;
if (CollectionUtils.isNotEmpty(materialList)){ if (CollectionUtils.isNotEmpty(materialList)){
for (ProductTypeBeanDTO.ProductGroupType.GroupDetailType detailType : materialList) { for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods productMaterial :comboxGoods.getProductMaterialList()) {
com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods materialGoods = new com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods(); for (ProductTypeBeanDTO.ProductGroupType.GroupDetailType detailType : materialList) {
materialGoods.setCustomerCode(StringUtils.isNotEmpty(detailType.getCustomerCode()) ? detailType.getCustomerCode() : ""); // productMaterial.setCustomerCode(StringUtils.isNotEmpty(detailType.getCustomerCode()) ? detailType.getCustomerCode() : "");
materialGoods.setAmount(null != detailType.getMarkUpPrice() ? detailType.getMarkUpPrice().longValue() : 0); if (detailType.getProductId().equals(productMaterial.getSpuId())) {
materialGoods.setFinalPrice(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() : 0); productMaterial.setAmount(null != detailType.getMarkUpPrice() ? detailType.getMarkUpPrice().longValue() : 0);
materialGoods.setSpuName(StringUtils.isNotEmpty(detailType.getProductName()) ? detailType.getProductName() : ""); productMaterial.setFinalPrice(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() : 0);
materialGoods.setSpuId(StringUtils.isNotEmpty(detailType.getProductId()) ? detailType.getProductId() : ""); productMaterial.setSpuName(StringUtils.isNotEmpty(detailType.getProductName()) ? detailType.getProductName() : "");
materialGoods.setOriginalPrice(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() : 0); productMaterial.setSpuId(StringUtils.isNotEmpty(detailType.getProductId()) ? detailType.getProductId() : "");
materialGoods.setOriginalAmount(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() * comboxGoods.getQty() : 0); productMaterial.setOriginalPrice(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() : 0);
productMaterial.setOriginalAmount(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() * comboxGoods.getQty() : 0);
productMaterialList.add(materialGoods); productMaterialList.add(productMaterial);
materialAmount += detailType.getProductFinalPrice().longValue() * comboxGoods.getQty(); materialAmount += detailType.getProductFinalPrice().longValue() * comboxGoods.getQty();
}
}
} }
} }
comboxGoods.setMaterialAmount(materialAmount); comboxGoods.setMaterialAmount(materialAmount);
......
...@@ -12,6 +12,8 @@ import cn.freemud.enums.ActivityTypeEnum; ...@@ -12,6 +12,8 @@ import cn.freemud.enums.ActivityTypeEnum;
import cn.freemud.enums.GoodsTypeEnum; import cn.freemud.enums.GoodsTypeEnum;
import cn.freemud.enums.ResponseResult; import cn.freemud.enums.ResponseResult;
import cn.freemud.interceptor.ServiceException; import cn.freemud.interceptor.ServiceException;
import cn.freemud.utils.LogUtil;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare; import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO; import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
import com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant; import com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant;
...@@ -155,6 +157,7 @@ public interface ShoppingCartNewService { ...@@ -155,6 +157,7 @@ public interface ShoppingCartNewService {
CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, spuId.substring(CommonsConstant.COUPON_PREFIX.length()), menuType); CheckSpqInfoRequestDto checkSpqInfoRequestDto = new CheckSpqInfoRequestDto(partnerId, storeId, spuId.substring(CommonsConstant.COUPON_PREFIX.length()), menuType);
CouponService couponService = SDKCommonBaseContextWare.getBean(CouponService.class); CouponService couponService = SDKCommonBaseContextWare.getBean(CouponService.class);
CheckSpqInfoResponseDto checkSpqInfoResponseDto = couponService.checkSpqInfo(checkSpqInfoRequestDto, goodsId); CheckSpqInfoResponseDto checkSpqInfoResponseDto = couponService.checkSpqInfo(checkSpqInfoRequestDto, goodsId);
LogUtil.info("validCoupon.CheckSpqInfoResponseDto", JSON.toJSONString(checkSpqInfoRequestDto),JSON.toJSONString(checkSpqInfoResponseDto));
if (checkSpqInfoResponseDto == null) { if (checkSpqInfoResponseDto == null) {
throw new ServiceException(ResponseResult.SHOPPING_CART_COUPON_MIX_NOT_EXIST); throw new ServiceException(ResponseResult.SHOPPING_CART_COUPON_MIX_NOT_EXIST);
} }
......
...@@ -794,7 +794,7 @@ public class CouponServiceImpl implements CouponService { ...@@ -794,7 +794,7 @@ public class CouponServiceImpl implements CouponService {
if (goodsId.equals(activeProduct.getProductIdPartner())) { if (goodsId.equals(activeProduct.getProductIdPartner())) {
productValid = true; productValid = true;
couponActivityDetail = detail; couponActivityDetail = detail;
couponType = detail.getType(); couponType = CouponTypeEnum.TYPE_4.getCode();
break; break;
} }
} }
......
...@@ -45,10 +45,7 @@ import cn.freemud.service.impl.calculate.*; ...@@ -45,10 +45,7 @@ import cn.freemud.service.impl.calculate.*;
import cn.freemud.service.shoppingCart.ShoppingCartRelationFactory; import cn.freemud.service.shoppingCart.ShoppingCartRelationFactory;
import cn.freemud.service.shoppingCart.ShoppingCartRelationService; import cn.freemud.service.shoppingCart.ShoppingCartRelationService;
import cn.freemud.service.thirdparty.*; import cn.freemud.service.thirdparty.*;
import cn.freemud.utils.BeanUtil; import cn.freemud.utils.*;
import cn.freemud.utils.PromotionFactory;
import cn.freemud.utils.PropertyConvertUtil;
import cn.freemud.utils.ResponseUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -310,6 +307,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -310,6 +307,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 获取商品详细信息 // 获取商品详细信息
List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId
, Collections.singletonList(spuId2),addShoppingCartGoodsRequestVo.getMenuType(), this.shoppingCartBaseService); , Collections.singletonList(spuId2),addShoppingCartGoodsRequestVo.getMenuType(), this.shoppingCartBaseService);
LogUtil.info("productBeanListSpuClass", spuId2,JSON.toJSONString(productBeanListSpuClass));
//缓存中获取购物车商品信息 //缓存中获取购物车商品信息
// 注意,围餐和点餐redis数据结构不一样 // 注意,围餐和点餐redis数据结构不一样
...@@ -1721,6 +1719,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1721,6 +1719,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
setToastMsgIfNotExist(shoppingCartGoodsResponseVo, ShoppingCartConstant.HAS_OTHER_ACTIVITY_WHEN_ADD_GOODS_COUPON); setToastMsgIfNotExist(shoppingCartGoodsResponseVo, ShoppingCartConstant.HAS_OTHER_ACTIVITY_WHEN_ADD_GOODS_COUPON);
} }
//校验合法性,更新缓存中购物车信息 //校验合法性,更新缓存中购物车信息
LogUtil.info("updateCartGoodsLegal", JSON.toJSONString(cartGoods),JSON.toJSONString(allCartGoodsList));
updateCartGoodsLegal(cartGoods, userId, shoppingCartGoodsResponseVo, addShoppingCartGoodsRequestVo, allCartGoodsList); updateCartGoodsLegal(cartGoods, userId, shoppingCartGoodsResponseVo, addShoppingCartGoodsRequestVo, allCartGoodsList);
} }
} }
......
...@@ -21,6 +21,7 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -21,6 +21,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
...@@ -44,6 +45,12 @@ import static cn.freemud.constant.ShoppingCartConstant.SHOPPING_CART_INVALIAD_GO ...@@ -44,6 +45,12 @@ import static cn.freemud.constant.ShoppingCartConstant.SHOPPING_CART_INVALIAD_GO
@Slf4j @Slf4j
public class CalculationCommonService { public class CalculationCommonService {
/**
* coco商户
*/
@Value("#{'${coco.partnerId}'.split(',')}")
private List<String> cocoPartnerId;
@Autowired @Autowired
private CustomerApplicationClient customerApplicationClient; private CustomerApplicationClient customerApplicationClient;
...@@ -160,9 +167,10 @@ public class CalculationCommonService { ...@@ -160,9 +167,10 @@ public class CalculationCommonService {
* @return * @return
*/ */
public ShoppingCartGoodsDto.CartGoodsDetailDto convertCartGoods2DetailGoodsList(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods calculationGoods public ShoppingCartGoodsDto.CartGoodsDetailDto convertCartGoods2DetailGoodsList(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods calculationGoods
, CartGoods cartGoods) { , CartGoods cartGoods
, String partnerId) {
log.debug("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", calculationGoods, cartGoods); log.debug("convertCartGoods2DetailGoodsList ->calculationGoods:{},cartGoods:{}", calculationGoods, cartGoods);
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.convertCartGoods2DetailGoods(calculationGoods, cartGoods); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = this.convertCartGoods2DetailGoods(calculationGoods, cartGoods,partnerId);
return cartGoodsDetailDto; return cartGoodsDetailDto;
} }
...@@ -305,7 +313,8 @@ public class CalculationCommonService { ...@@ -305,7 +313,8 @@ public class CalculationCommonService {
* @param calculationGoods * @param calculationGoods
*/ */
private ShoppingCartGoodsDto.CartGoodsDetailDto convertCartGoods2DetailGoods(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods calculationGoods private ShoppingCartGoodsDto.CartGoodsDetailDto convertCartGoods2DetailGoods(CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods calculationGoods
, CartGoods cartGoods) { , CartGoods cartGoods
, String partnerId) {
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = new ShoppingCartGoodsDto.CartGoodsDetailDto(); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = new ShoppingCartGoodsDto.CartGoodsDetailDto();
cartGoodsDetailDto.setCartGoodsUid(cartGoods.getCartGoodsUid()); cartGoodsDetailDto.setCartGoodsUid(cartGoods.getCartGoodsUid());
...@@ -356,6 +365,9 @@ public class CalculationCommonService { ...@@ -356,6 +365,9 @@ public class CalculationCommonService {
activityDiscountsDto.setActivityName(this.convertName(discount.getType(), discount.getActivityName())); activityDiscountsDto.setActivityName(this.convertName(discount.getType(), discount.getActivityName()));
activityDiscountsDto.setActivityType(this.convertType(discount.getType())); activityDiscountsDto.setActivityType(this.convertType(discount.getType()));
activityDiscountsDto.setDiscountAmount(discount.getDiscount().intValue()); activityDiscountsDto.setDiscountAmount(discount.getDiscount().intValue());
if(cocoPartnerId.contains(partnerId)){
activityDiscountsDto.setActualActivityGoodsNumber(discount.getActualGoodsNumber());
}
activityDiscountsDtoList.add(activityDiscountsDto); activityDiscountsDtoList.add(activityDiscountsDto);
} }
} }
......
...@@ -115,7 +115,7 @@ public class CalculationSharingEquallyService { ...@@ -115,7 +115,7 @@ public class CalculationSharingEquallyService {
if (goods!=null) { if (goods!=null) {
find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get(); find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get();
} }
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product,shoppingCartInfoRequestVo.getPartnerId());
cartGoodsDetailDtoList.add(cartGoodsDetailDto); cartGoodsDetailDtoList.add(cartGoodsDetailDto);
} }
......
...@@ -1492,6 +1492,19 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1492,6 +1492,19 @@ public class ShoppingCartMCoffeeServiceImpl {
cartGoods.setTax(productBeanListSpuClass.get(0).getTax()); cartGoods.setTax(productBeanListSpuClass.get(0).getTax());
cartGoods.setTaxId(productBeanListSpuClass.get(0).getTaxId()); cartGoods.setTaxId(productBeanListSpuClass.get(0).getTaxId());
//套餐固定商品赋值
if (CollectionUtils.isNotEmpty(productBeanListSpuClass.get(0).getProductComboList())){
if (CollectionUtils.isNotEmpty(cartGoods.getProductComboList())){
for (CartGoods.ComboxGoods comboxGoods : cartGoods.getProductComboList()) {
for (ProductBeanDTO.ProductComboType comboType: productBeanListSpuClass.get(0).getProductComboList()){
if (comboxGoods.getGoodsId().equals(comboType.getProductId()) && comboType.getQuantity()>0){
comboxGoods.setQty(comboType.getQuantity());
}
}
}
}
}
//套餐可选商品赋值 //套餐可选商品赋值
if (CollectionUtils.isNotEmpty(productBeanListSpuClass.get(0).getProductGroupList())){ if (CollectionUtils.isNotEmpty(productBeanListSpuClass.get(0).getProductGroupList())){
for (ProductBeanDTO.ProductGroupType groupType : productBeanListSpuClass.get(0).getProductGroupList()) { for (ProductBeanDTO.ProductGroupType groupType : productBeanListSpuClass.get(0).getProductGroupList()) {
......
...@@ -13,6 +13,7 @@ import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto; ...@@ -13,6 +13,7 @@ import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.*; import cn.freemud.entities.vo.*;
import cn.freemud.enums.ActivityChannelEnum; import cn.freemud.enums.ActivityChannelEnum;
import cn.freemud.enums.ActivityTypeEnum; import cn.freemud.enums.ActivityTypeEnum;
import cn.freemud.enums.GoodsTypeEnum;
import cn.freemud.enums.ResponseResult; import cn.freemud.enums.ResponseResult;
import cn.freemud.interceptor.ServiceException; import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.CommonService; import cn.freemud.service.CommonService;
...@@ -24,7 +25,9 @@ import com.freemud.application.sdk.api.log.LogThreadLocal; ...@@ -24,7 +25,9 @@ import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.membercenter.request.QueryReceiveAddressRequest; import com.freemud.application.sdk.api.membercenter.request.QueryReceiveAddressRequest;
import com.freemud.application.sdk.api.membercenter.response.QueryReceiveAddressResponse; import com.freemud.application.sdk.api.membercenter.response.QueryReceiveAddressResponse;
import com.freemud.application.sdk.api.membercenter.service.MemberCenterService; import com.freemud.application.sdk.api.membercenter.service.MemberCenterService;
import com.freemud.application.sdk.api.storecenter.request.QueryDeliveryRequest;
import com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest; import com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest;
import com.freemud.application.sdk.api.storecenter.response.QueryDeliverDetailResponse;
import com.freemud.application.sdk.api.storecenter.response.StoreResponse; import com.freemud.application.sdk.api.storecenter.response.StoreResponse;
import com.freemud.application.sdk.api.storecenter.service.StoreCenterService; import com.freemud.application.sdk.api.storecenter.service.StoreCenterService;
import com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum; import com.freemud.sdk.api.assortment.shoppingcart.enums.BusinessTypeEnum;
......
...@@ -92,6 +92,12 @@ public class SetMealCalculation { ...@@ -92,6 +92,12 @@ public class SetMealCalculation {
} }
} }
//如果是商品券商品,不重新计算套餐价格
if (StringUtils.isEmpty(cartGoods.getCouponCode())) {
Long amount = null != cartGoods.getFinalPrice() ? cartGoods.getFinalPrice() * cartGoods.getQty() + productGroupTotalAmount + materialPrice :
productGroupTotalAmount + productComboTotalAmount + materialPrice;
cartGoods.setAmount(amount);
}
//套餐可选商品加料 //套餐可选商品加料
if(CollectionUtils.isNotEmpty(cartGoods.getProductGroupList())){ if(CollectionUtils.isNotEmpty(cartGoods.getProductGroupList())){
for (CartGoods.ComboxGoods comboxGoods : cartGoods.getProductGroupList()){ for (CartGoods.ComboxGoods comboxGoods : cartGoods.getProductGroupList()){
......
...@@ -124,6 +124,13 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation ...@@ -124,6 +124,13 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
shoppingCartGoodsResponseVo.setActivityTip(activityTip); shoppingCartGoodsResponseVo.setActivityTip(activityTip);
} }
// 将配送费放到一个字段去
if(shoppingCartGoodsResponseVo.getIsDiscountDelivery() && ( shoppingCartGoodsResponseVo.getDiscountDeliveryAmount() < shoppingCartGoodsResponseVo.getDeliveryAmount())){
shoppingCartGoodsResponseVo.setDeliveryAmount(shoppingCartGoodsResponseVo.getDiscountDeliveryAmount());
}
} }
@Override @Override
......
...@@ -93,7 +93,7 @@ public class CartTest { ...@@ -93,7 +93,7 @@ public class CartTest {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) { for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get(); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get();
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product,"");
cartGoodsDetailDtoList.add(cartGoodsDetailDto); cartGoodsDetailDtoList.add(cartGoodsDetailDto);
} }
} }
...@@ -130,7 +130,7 @@ public class CartTest { ...@@ -130,7 +130,7 @@ public class CartTest {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) { for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get(); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get();
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product,"");
cartGoodsDetailDtoList.add(cartGoodsDetailDto); cartGoodsDetailDtoList.add(cartGoodsDetailDto);
} }
//ShoppingCartInfoRequestVo //ShoppingCartInfoRequestVo
...@@ -169,7 +169,7 @@ public class CartTest { ...@@ -169,7 +169,7 @@ public class CartTest {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) { for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get(); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get();
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product,"");
cartGoodsDetailDtoList.add(cartGoodsDetailDto); cartGoodsDetailDtoList.add(cartGoodsDetailDto);
} }
/** /**
......
...@@ -282,7 +282,7 @@ public class CouponTest { ...@@ -282,7 +282,7 @@ public class CouponTest {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) { for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get(); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get();
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product,"");
cartGoodsDetailDtoList.add(cartGoodsDetailDto); cartGoodsDetailDtoList.add(cartGoodsDetailDto);
} }
} }
...@@ -317,7 +317,7 @@ public class CouponTest { ...@@ -317,7 +317,7 @@ public class CouponTest {
shoppingCartGoodsResponseVo.setProducts(cartGoodsList); shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) { for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get(); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get();
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product,"");
cartGoodsDetailDtoList.add(cartGoodsDetailDto); cartGoodsDetailDtoList.add(cartGoodsDetailDto);
} }
//ShoppingCartInfoRequestVo //ShoppingCartInfoRequestVo
......
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