Commit a238a74c by ping.wu

Merge remote-tracking branch 'origin/develop' into develop

parents 42d0316a fd9587cd
package cn.freemud.aop;
import cn.freemud.constant.CommonRedisKeyConstant;
import cn.freemud.entities.vo.ThirdPartLogVo;
import cn.freemud.enums.CommonResponseResult;
import cn.freemud.inteceptor.CommonServiceException;
import cn.freemud.redis.RedisCache;
import cn.freemud.utils.LogUtil;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformConfig;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformConfigManager;
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.log.ThirdPartyLog;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: LogAspect
* @Package cn.freemud.aop
* @Description: 日志打印切面
* @author: zhenghuan.yang
* @date: 2018/5/26 10:13
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Slf4j
@Aspect
@Component
public class WebAspect {
@Autowired
private RedisCache redisCache;
@Autowired
private AssortmentOpenPlatformConfigManager assortmentOpenPlatformConfigManager;
@Autowired
private AssortmentCustomerInfoManager assortmentCustomerInfoManager;
/**
* 白名单key
*/
private static final String KEY = "exclude.url";
private static final String NOT_AUTHORIZED_KEY = "not.authorized.url";
/**
* 是否校验
*/
private static final int STATE = 1;
private static final String SESSION_ID_STR = "sessionId";
@Pointcut("execution(* cn.freemud.controller..*.*(..))")
public void webAspect() {
}
@Around("webAspect()")
public Object doBeforeController(ProceedingJoinPoint joinPoint) throws Throwable {
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
HttpServletRequest request = sra.getRequest();
String sessionId = request.getHeader(SESSION_ID_STR);
if(!StringUtils.isEmpty(sessionId)) {
String requestUrl = request.getRequestURI();
List<String> notFilterUrls = Arrays.asList(getNotFilterUrl(CommonRedisKeyConstant.SAAS_NOT_FILTER_URL, KEY).split(","));
// 是否授权验证
AssortmentCustomerInfoVo userInfo = assortmentCustomerInfoManager.getCustomerInfoByObject(sessionId);
if (!notFilterUrls.contains(requestUrl)) {
if(userInfo == null || StringUtils.isEmpty(userInfo.getMemberId())) {
throw new CommonServiceException(CommonResponseResult.USER_UNAUTHORIZED);
}
List<String> unauthorizedUrls = Arrays.asList(getNotFilterUrl(CommonRedisKeyConstant.SAAS_NOT_AUTHORIZED_URL, NOT_AUTHORIZED_KEY).split(","));
if (!unauthorizedUrls.contains(requestUrl) && StringUtils.isEmpty(userInfo.getUnionId())) {
throw new CommonServiceException(CommonResponseResult.USER_UNAUTHORIZED);
}
}
Object[] args = joinPoint.getArgs();
for (Object arg : args) {
if (arg instanceof Object) {
PropertyDescriptor targetPd = BeanUtils.getPropertyDescriptor(arg.getClass(), SESSION_ID_STR);
if (targetPd == null) {
continue;
}
Method writeMethod = targetPd.getWriteMethod();
if (writeMethod != null) {
writeMethod.setAccessible(true);
writeMethod.invoke(arg, sessionId);
break;
}
}
}
}
Object result = null;
try {
result = joinPoint.proceed();
} catch (Exception ex) {
throw ex;
}
return result;
}
@Pointcut("execution(* cn.freemud.service.thirdparty..*.*(..))")
public void clientLog() {
}
@Around("clientLog()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
long start = System.currentTimeMillis();
Object result = null;
try {
result = joinPoint.proceed();
} catch (Exception ex) {
ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
LogUtil.thirdPartError(start, System.currentTimeMillis(), thirdPartLogVo, null);
throw ex;
}
ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
// 打印第三方出参日志
ThirdPartyLog.infoConvertJson(LogThreadLocal.getTrackingNo(), SDKCommonBaseContextWare.getAppName(),start,System.currentTimeMillis(),
thirdPartLogVo.getUri(),thirdPartLogVo.getRequestBody(),result);
return result;
}
public String getNotFilterUrl(String redisKey, String configKey) {
String notFilterUrl;
try {
notFilterUrl = redisCache.getValue(redisKey);
} catch (Exception e) {
notFilterUrl = redisCache.getValue(redisKey);
}
if (org.apache.commons.lang.StringUtils.isBlank(notFilterUrl)) {
AssortmentOpenPlatformConfig config = assortmentOpenPlatformConfigManager.selectOpenPlatformConfigByKey(configKey, STATE);
if (config != null) {
notFilterUrl = config.getGlobalValue();
redisCache.save(redisKey, notFilterUrl);
}
}
return notFilterUrl;
}
}
package cn.freemud.constant;
public class CommonRedisKeyConstant {
/**
* 校验用户登录白名单在redis的key前缀
*/
public final static String SAAS_NOT_FILTER_URL = "saas:micro:exclude:url:";
/**
* 不需要授权得url
*/
public final static String SAAS_NOT_AUTHORIZED_URL = "saas:micro:not:authorized:url";
}
...@@ -200,25 +200,6 @@ ...@@ -200,25 +200,6 @@
</snapshotRepository> </snapshotRepository>
</distributionManagement> </distributionManagement>
<build>
<plugins>
<!--配置生成源码包-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories> <repositories>
<repository> <repository>
<id>public</id> <id>public</id>
......
...@@ -188,10 +188,10 @@ public class ShoppingCartConvertAdapter { ...@@ -188,10 +188,10 @@ public class ShoppingCartConvertAdapter {
* @param cartGoods * @param cartGoods
* @return * @return
*/ */
public List<ShoppingCartGoodsDto.CartGoodsDetailDto> convertComboxGoods2DetailGoods(CartGoods cartGoods) { public List<ShoppingCartGoodsDto.CartGoodsDetailDto> convertComboxGoods2DetailGoods(CartGoods cartGoods,Integer totalDiscountAmount) {
List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtos = new ArrayList<>(); List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtos = new ArrayList<>();
cartGoodsDetailDtos.addAll(getComboxGoods2DetailGoods(cartGoods, cartGoods.getProductComboList(), true)); cartGoodsDetailDtos.addAll(getComboxGoods2DetailGoods(cartGoods, cartGoods.getProductComboList(), true,totalDiscountAmount));
cartGoodsDetailDtos.addAll(getComboxGoods2DetailGoods(cartGoods, cartGoods.getProductGroupList(), false)); cartGoodsDetailDtos.addAll(getComboxGoods2DetailGoods(cartGoods, cartGoods.getProductGroupList(), false,totalDiscountAmount));
return cartGoodsDetailDtos; return cartGoodsDetailDtos;
} }
...@@ -200,14 +200,14 @@ public class ShoppingCartConvertAdapter { ...@@ -200,14 +200,14 @@ public class ShoppingCartConvertAdapter {
* @param cartGoods * @param cartGoods
* @return * @return
*/ */
public List<ShoppingCartGoodsDto.CartGoodsDetailDto> getComboxGoods2DetailGoods(CartGoods cartGoods, List<CartGoods.ComboxGoods> comboxGoodsList, boolean isFixed) { public List<ShoppingCartGoodsDto.CartGoodsDetailDto> getComboxGoods2DetailGoods(CartGoods cartGoods, List<CartGoods.ComboxGoods> comboxGoodsList, boolean isFixed,Integer totalDiscountAmount) {
List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtos = new ArrayList<>(); List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtos = new ArrayList<>();
if (CollectionUtils.isEmpty(comboxGoodsList)) { if (CollectionUtils.isEmpty(comboxGoodsList)) {
return cartGoodsDetailDtos; return cartGoodsDetailDtos;
} }
int size = comboxGoodsList.size(); int size = comboxGoodsList.size();
//当前套餐(固定搭配)总优惠=原总价-现总价-可选商品优惠价 //当前套餐(固定搭配)总优惠=原总价-现总价-可选商品优惠价
Long totalDiscountAmount = cartGoods.getOriginalAmount() - cartGoods.getAmount() - Long discountAmount = totalDiscountAmount -
cartGoods.getProductGroupList().stream().mapToLong(product -> (product.getOriginalPrice() - product.getFinalPrice()) * product.getQty()).sum() * cartGoods.getQty(); cartGoods.getProductGroupList().stream().mapToLong(product -> (product.getOriginalPrice() - product.getFinalPrice()) * product.getQty()).sum() * cartGoods.getQty();
// 当前套餐(固定搭配)总原价 // 当前套餐(固定搭配)总原价
Long totalOriginalPrice = cartGoods.getProductComboList().stream().mapToLong(cart -> cart.getQty() * cart.getOriginalPrice()).sum() * cartGoods.getQty(); Long totalOriginalPrice = cartGoods.getProductComboList().stream().mapToLong(cart -> cart.getQty() * cart.getOriginalPrice()).sum() * cartGoods.getQty();
...@@ -233,9 +233,9 @@ public class ShoppingCartConvertAdapter { ...@@ -233,9 +233,9 @@ public class ShoppingCartConvertAdapter {
//获取当前套餐固定商品的均摊价格 //获取当前套餐固定商品的均摊价格
if (isFixed) { if (isFixed) {
if (size-- == 1) { if (size-- == 1) {
cartGoodsDetailDto.setTotalDiscountAmount(totalDiscountAmount.intValue() - tempDiscount); cartGoodsDetailDto.setTotalDiscountAmount(discountAmount.intValue() - tempDiscount);
} else { } else {
Long currentDiscountAmount = (qty * comboxGoods.getOriginalPrice() * totalDiscountAmount) / totalOriginalPrice; Long currentDiscountAmount = (qty * comboxGoods.getOriginalPrice() * discountAmount) / totalOriginalPrice;
cartGoodsDetailDto.setTotalDiscountAmount(currentDiscountAmount.intValue()); cartGoodsDetailDto.setTotalDiscountAmount(currentDiscountAmount.intValue());
tempDiscount += currentDiscountAmount.intValue(); tempDiscount += currentDiscountAmount.intValue();
} }
......
package cn.freemud.aop;
import cn.freemud.constant.CommonRedisKeyConstant;
import cn.freemud.entities.vo.ThirdPartLogVo;
import cn.freemud.enums.CommonResponseResult;
import cn.freemud.inteceptor.CommonServiceException;
import cn.freemud.redis.RedisCache;
import cn.freemud.utils.LogUtil;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformConfig;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformConfigManager;
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.log.ThirdPartyLog;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: LogAspect
* @Package cn.freemud.aop
* @Description: 日志打印切面
* @author: zhenghuan.yang
* @date: 2018/5/26 10:13
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Slf4j
@Aspect
@Component
public class WebAspect {
@Autowired
private RedisCache redisCache;
@Autowired
private AssortmentOpenPlatformConfigManager assortmentOpenPlatformConfigManager;
@Autowired
private AssortmentCustomerInfoManager assortmentCustomerInfoManager;
/**
* 白名单key
*/
private static final String KEY = "exclude.url";
private static final String NOT_AUTHORIZED_KEY = "not.authorized.url";
/**
* 是否校验
*/
private static final int STATE = 1;
private static final String SESSION_ID_STR = "sessionId";
@Pointcut("execution(* cn.freemud.controller..*.*(..))")
public void webAspect() {
}
@Around("webAspect()")
public Object doBeforeController(ProceedingJoinPoint joinPoint) throws Throwable {
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
HttpServletRequest request = sra.getRequest();
String sessionId = request.getHeader(SESSION_ID_STR);
if(!StringUtils.isEmpty(sessionId)) {
String requestUrl = request.getRequestURI();
List<String> notFilterUrls = Arrays.asList(getNotFilterUrl(CommonRedisKeyConstant.SAAS_NOT_FILTER_URL, KEY).split(","));
// 是否授权验证
AssortmentCustomerInfoVo userInfo = assortmentCustomerInfoManager.getCustomerInfoByObject(sessionId);
if (!notFilterUrls.contains(requestUrl)) {
if(userInfo == null || StringUtils.isEmpty(userInfo.getMemberId())) {
throw new CommonServiceException(CommonResponseResult.USER_UNAUTHORIZED);
}
List<String> unauthorizedUrls = Arrays.asList(getNotFilterUrl(CommonRedisKeyConstant.SAAS_NOT_AUTHORIZED_URL, NOT_AUTHORIZED_KEY).split(","));
if (!unauthorizedUrls.contains(requestUrl) && StringUtils.isEmpty(userInfo.getUnionId())) {
throw new CommonServiceException(CommonResponseResult.USER_UNAUTHORIZED);
}
}
Object[] args = joinPoint.getArgs();
for (Object arg : args) {
if (arg instanceof Object) {
PropertyDescriptor targetPd = BeanUtils.getPropertyDescriptor(arg.getClass(), SESSION_ID_STR);
if (targetPd == null) {
continue;
}
Method writeMethod = targetPd.getWriteMethod();
if (writeMethod != null) {
writeMethod.setAccessible(true);
writeMethod.invoke(arg, sessionId);
break;
}
}
}
}
Object result = null;
try {
result = joinPoint.proceed();
} catch (Exception ex) {
throw ex;
}
return result;
}
@Pointcut("execution(* cn.freemud.service.thirdparty..*.*(..))")
public void clientLog() {
}
@Around("clientLog()")
public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
long start = System.currentTimeMillis();
Object result = null;
try {
result = joinPoint.proceed();
} catch (Exception ex) {
ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
LogUtil.thirdPartError(start, System.currentTimeMillis(), thirdPartLogVo, null);
throw ex;
}
ThirdPartLogVo thirdPartLogVo = LogUtil.createThirdPartLogVo(joinPoint);
// 打印第三方出参日志
ThirdPartyLog.infoConvertJson(LogThreadLocal.getTrackingNo(), SDKCommonBaseContextWare.getAppName(),start,System.currentTimeMillis(),
thirdPartLogVo.getUri(),thirdPartLogVo.getRequestBody(),result);
return result;
}
public String getNotFilterUrl(String redisKey, String configKey) {
String notFilterUrl;
try {
notFilterUrl = redisCache.getValue(redisKey);
} catch (Exception e) {
notFilterUrl = redisCache.getValue(redisKey);
}
if (org.apache.commons.lang.StringUtils.isBlank(notFilterUrl)) {
AssortmentOpenPlatformConfig config = assortmentOpenPlatformConfigManager.selectOpenPlatformConfigByKey(configKey, STATE);
if (config != null) {
notFilterUrl = config.getGlobalValue();
redisCache.save(redisKey, notFilterUrl);
}
}
return notFilterUrl;
}
}
package cn.freemud.constant;
public class CommonRedisKeyConstant {
/**
* 校验用户登录白名单在redis的key前缀
*/
public final static String SAAS_NOT_FILTER_URL = "saas:micro:exclude:url:";
/**
* 不需要授权得url
*/
public final static String SAAS_NOT_AUTHORIZED_URL = "saas:micro:not:authorized:url";
}
...@@ -53,12 +53,10 @@ public class CouponPromotionService implements IPromotionService { ...@@ -53,12 +53,10 @@ public class CouponPromotionService implements IPromotionService {
if (couponPromotionVO != null && ObjectUtils.equals(CouponFlag.YES.getCode(), couponPromotionVO.getFlg())) { if (couponPromotionVO != null && ObjectUtils.equals(CouponFlag.YES.getCode(), couponPromotionVO.getFlg())) {
List<CartGoods> tmpCartGoods = cartGoodsList.parallelStream().filter(k -> k.getCartGoodsUid() List<CartGoods> tmpCartGoods = cartGoodsList.parallelStream().filter(k -> k.getCartGoodsUid()
.startsWith(CommonsConstant.COUPON_PREFIX)).collect(Collectors.toList()); .startsWith(CommonsConstant.COUPON_PREFIX)).collect(Collectors.toList());
// 套餐不参与任何券
List<CartGoods> couponCartGoods = cartGoodsList.parallelStream().filter(k -> ObjectUtils.notEqual(GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType(), k.getGoodsType())).collect(Collectors.toList());
// 是否存在商品券 // 是否存在商品券
boolean hasGoodssCoupon = CollectionUtils.isNotEmpty(tmpCartGoods); boolean hasGoodssCoupon = CollectionUtils.isNotEmpty(tmpCartGoods);
// 构建可用不可用优惠券 // 构建可用不可用优惠券
ActivityClassifyCouponBean activityClassifyCouponBean = couponService.availableCoupon(couponCartGoods, couponPromotionVO.getPartnerId() ActivityClassifyCouponBean activityClassifyCouponBean = couponService.availableCoupon(cartGoodsList, couponPromotionVO.getPartnerId()
, couponPromotionVO.getUserId(), couponPromotionVO.getStoreId(), couponPromotionVO.getCouponCode(), hasGoodssCoupon, couponPromotionVO.getOrderType()); , couponPromotionVO.getUserId(), couponPromotionVO.getStoreId(), couponPromotionVO.getCouponCode(), hasGoodssCoupon, couponPromotionVO.getOrderType());
if (Objects.equals(activityClassifyCouponBean, null)) { if (Objects.equals(activityClassifyCouponBean, null)) {
// 构建一个空得订单券信息 // 构建一个空得订单券信息
......
...@@ -517,14 +517,19 @@ public class CouponServiceImpl implements CouponService { ...@@ -517,14 +517,19 @@ public class CouponServiceImpl implements CouponService {
if (StringUtils.isEmpty(cartGood.getSkuId()) && StringUtils.isEmpty(cartGood.getSpuId())) { if (StringUtils.isEmpty(cartGood.getSkuId()) && StringUtils.isEmpty(cartGood.getSpuId())) {
continue; continue;
} }
//剔除套餐的商品
if (ObjectUtils.equals(GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType(), cartGood.getGoodsType())) {
continue;
}
Product product = new Product(); Product product = new Product();
product.setProductId(StringUtils.isEmpty(cartGood.getSkuId()) ? cartGood.getSpuId() : cartGood.getSkuId()); product.setProductId(StringUtils.isEmpty(cartGood.getSkuId()) ? cartGood.getSpuId() : cartGood.getSkuId());
// 商品价格 // 商品价格
product.setAmount(Integer.valueOf(cartGood.getOriginalPrice() + "")); product.setAmount(Integer.valueOf(cartGood.getOriginalPrice() + ""));
//剔除套餐的商品
if (ObjectUtils.equals(GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType(), cartGood.getGoodsType())) {
Long finalPrice = cartGood.getFinalPrice();
if (CollectionUtils.isNotEmpty(cartGood.getProductGroupList())){
finalPrice+=cartGood.getProductGroupList().stream().mapToLong(group->group.getAmount()*group.getQty()).sum();
}
product.setAmount(finalPrice.intValue());
}
// 数量 // 数量
product.setQuantity(cartGood.getQty()); product.setQuantity(cartGood.getQty());
productList.add(product); productList.add(product);
......
...@@ -98,10 +98,10 @@ public class SetMealServiceImpl implements IPromotionService { ...@@ -98,10 +98,10 @@ public class SetMealServiceImpl implements IPromotionService {
totalDiscountAmount += discountAmount - productGroupDiscountAmount * cartGoods.getQty(); totalDiscountAmount += discountAmount - productGroupDiscountAmount * cartGoods.getQty();
// 添加套餐父商品 // 添加套餐父商品
ShoppingCartGoodsDto.CartGoodsDetailDto parentCartGoods = shoppingCartConvertAdapter.convertCartGoods2DetailGoods(cartGoods, apportionGoods,new HashMap<>()); ShoppingCartGoodsDto.CartGoodsDetailDto parentCartGoods = shoppingCartConvertAdapter.convertCartGoods2DetailGoods(cartGoods, apportionGoods,new HashMap<>());
parentCartGoods.setTotalDiscountAmount(cartGoods.getOriginalAmount().intValue() - cartGoods.getAmount().intValue()); parentCartGoods.setTotalDiscountAmount(parentCartGoods.getTotalDiscountAmount()+ cartGoods.getOriginalAmount().intValue() - cartGoods.getAmount().intValue());
parentCartGoods.getActivityDiscountsDtos().add(getActivityDiscountsDto(discountAmount - productGroupDiscountAmount * cartGoods.getQty())); parentCartGoods.getActivityDiscountsDtos().add(getActivityDiscountsDto(discountAmount - productGroupDiscountAmount * cartGoods.getQty()));
// 添加套餐固定商品&可选商品: 做均摊 // 添加套餐固定商品&可选商品: 做均摊
parentCartGoods.setComboProducts(shoppingCartConvertAdapter.convertComboxGoods2DetailGoods(cartGoods)); parentCartGoods.setComboProducts(shoppingCartConvertAdapter.convertComboxGoods2DetailGoods(cartGoods,parentCartGoods.getTotalDiscountAmount()));
cartGoodsDetailDtos.add(parentCartGoods); cartGoodsDetailDtos.add(parentCartGoods);
} }
} }
......
...@@ -364,7 +364,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService { ...@@ -364,7 +364,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
collectCartGoods.forEach(eachGoods -> { collectCartGoods.forEach(eachGoods -> {
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = shoppingCartConvertAdapter.convertCartGoods2DetailGoods(eachGoods, new ArrayList<>(), new HashMap<>()); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = shoppingCartConvertAdapter.convertCartGoods2DetailGoods(eachGoods, new ArrayList<>(), new HashMap<>());
cartGoodsDetailDto.setProductType(ProductType.SETMEAL.getCode()); cartGoodsDetailDto.setProductType(ProductType.SETMEAL.getCode());
cartGoodsDetailDto.setComboProducts(shoppingCartConvertAdapter.convertComboxGoods2DetailGoods(eachGoods)); cartGoodsDetailDto.setComboProducts(shoppingCartConvertAdapter.convertComboxGoods2DetailGoods(eachGoods,0));
products.add(cartGoodsDetailDto); products.add(cartGoodsDetailDto);
}); });
} }
......
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