Commit df8807fb by 王世昌

fix

parent 1ef5a019
...@@ -6,17 +6,12 @@ import cn.freemud.demo.entities.dto.goods.add.MCoffeeAddGoodsVO; ...@@ -6,17 +6,12 @@ import cn.freemud.demo.entities.dto.goods.add.MCoffeeAddGoodsVO;
import cn.freemud.demo.entities.dto.goods.add.PlatformAddGoodsVO; import cn.freemud.demo.entities.dto.goods.add.PlatformAddGoodsVO;
import cn.freemud.demo.enums.BizTypeEnum; import cn.freemud.demo.enums.BizTypeEnum;
import cn.freemud.utils.BeanUtil; import cn.freemud.utils.BeanUtil;
import ma.glasnost.orika.MapperFacade;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component @Component
public class AddGoodsVOAdapter { public class AddGoodsVOAdapter {
@Resource
private MapperFacade mapperFacade;
public BaseAddGoodsVO convert2AddGoodsVO(String bizType, ShoppingCartGoodsBO baseAddGoodsBO) { public BaseAddGoodsVO convert2AddGoodsVO(String bizType, ShoppingCartGoodsBO baseAddGoodsBO) {
BaseAddGoodsVO baseAddGoodsVO; BaseAddGoodsVO baseAddGoodsVO;
if (BizTypeEnum.MCOFFEE.getCode().equals(bizType)) { if (BizTypeEnum.MCOFFEE.getCode().equals(bizType)) {
......
...@@ -108,16 +108,15 @@ public class KgdCouponServiceImpl implements CouponService { ...@@ -108,16 +108,15 @@ public class KgdCouponServiceImpl implements CouponService {
if (couponDetail == null || !couponDetail.getResult().equals(ResponseCodeConstant.RESPONSE_SUCCESS_1) || CollectionUtils.isEmpty(couponDetail.getDetails())) { if (couponDetail == null || !couponDetail.getResult().equals(ResponseCodeConstant.RESPONSE_SUCCESS_1) || CollectionUtils.isEmpty(couponDetail.getDetails())) {
return null; return null;
} }
if (CollectionUtils.isEmpty(couponDetail.getDetails())) {
return null;
}
Integer couponType = 0; Integer couponType = 0;
CouponDetailBO.Details couponActivityDetail = null; CouponDetailBO.Details couponActivityDetail = null;
// 多规格券 // 多规格券
if (StringUtils.isNotBlank(getCheckSpqBo.getSkuId())){ if (StringUtils.isNotBlank(getCheckSpqBo.getSkuId())){
for (CouponDetailBO.Details detail : couponDetail.getDetails()) { for (CouponDetailBO.Details detail : couponDetail.getDetails()) {
if (Objects.nonNull(couponActivityDetail)) break; if (Objects.nonNull(couponActivityDetail)){
if (!CouponStatus.STATUS_0.getCode().equals(detail.getStatus()) || !CouponStatus.STATUS_2.getCode().equals(detail.getStatus())){ break;
}
if (!CouponStatus.STATUS_0.getCode().equals(detail.getStatus()) && !CouponStatus.STATUS_2.getCode().equals(detail.getStatus())){
continue; continue;
} }
for (CouponDetailBO.ActiveProduct activeProduct : detail.getActiveProduct()) { for (CouponDetailBO.ActiveProduct activeProduct : detail.getActiveProduct()) {
......
...@@ -222,9 +222,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService { ...@@ -222,9 +222,7 @@ public abstract class AbstractAddGoodsService implements AddGoodsService {
if (CollectionUtils.isEmpty(allCartGoodsList)) { if (CollectionUtils.isEmpty(allCartGoodsList)) {
allCartGoodsList = new ArrayList<>(); allCartGoodsList = new ArrayList<>();
} }
bo.setCartGoods(allCartGoodsList);
List<CartGoods> oldCartGoodsList = BeanUtil.convertBeans(allCartGoodsList, CartGoods::new);
bo.setCartGoods(oldCartGoodsList);
// 转换商品券购物车添加的商品 // 转换商品券购物车添加的商品
if (Objects.nonNull(spqBO)) { if (Objects.nonNull(spqBO)) {
......
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