Commit 44ba59f4 by zhiheng.zhang

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

parents 50186f25 9ec4ab6c
......@@ -415,7 +415,6 @@ public class ActivityAdapter {
couponAvailableCartInfo.setProviderId(partnerId);
couponAvailableCartInfo.setMerchantId(partnerId);
couponAvailableCartInfo.setStoreId(storeId);
couponAvailableCartInfo.setChannelIdList(orgCodes);
couponAvailableCartInfo.setExclusion(true);
Long totalMealDiscountAmount = 0L;//套餐优惠不算在内
......
......@@ -23,6 +23,7 @@ import cn.freemud.service.thirdparty.CustomerApplicationClient;
import cn.freemud.service.thirdparty.StockClient;
import cn.freemud.utils.BeanUtil;
import cn.freemud.utils.PromotionFactory;
import com.alibaba.fastjson.JSON;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformPartnerStoreDeliveryConfig;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformPartnerStoreDeliveryConfigManager;
......@@ -123,8 +124,9 @@ public abstract class AbstractShoppingCartImpl implements ShoppingCartNewService
// }
AssortmentCustomerInfoVo customerInfoVo = customerInfoManager.getCustomerInfoByObject(sessionId);
if(customerInfoVo == null) throw new ServiceException(ResponseResult.NOT_LOGIN);;
CustomerInfoVo customerInfoVo1 = new CustomerInfoVo();
BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
String jsonObject = JSON.toJSONString(customerInfoVo);
CustomerInfoVo customerInfoVo1 = JSON.parseObject(jsonObject,CustomerInfoVo.class);
// BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
return customerInfoVo1;
}
......
......@@ -7,17 +7,10 @@ import cn.freemud.entities.dto.activity.ActivityDiscountsDto;
import cn.freemud.entities.dto.activity.ActivityQueryDto;
import cn.freemud.entities.dto.activity.ShareDiscountActivityDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.CartGoods;
import cn.freemud.entities.vo.CouponPromotionVO;
import cn.freemud.entities.vo.CreateOrderVo;
import cn.freemud.entities.vo.ShoppingCartGoodsResponseVo;
import cn.freemud.entities.vo.ShoppingCartInfoRequestVo;
import cn.freemud.entities.vo.*;
import cn.freemud.enums.ActivityTypeEnum;
import cn.freemud.enums.GoodsTypeEnum;
import cn.freemud.service.IPromotionService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -27,7 +20,6 @@ import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* All rights Reserved, Designed By www.freemud.com
......@@ -66,7 +58,20 @@ public class DefaultPromotionService implements IPromotionService {
shoppingCartGoodsResponseVo.setOriginalTotalAmount(calculationDiscountResult == null ? totalOriginalAmount : calculationDiscountResult.getOriginalTotalAmount());
shoppingCartGoodsResponseVo.setTotalAmount(calculationDiscountResult == null ? totalAmount : calculationDiscountResult.getTotalAmount());
shoppingCartGoodsResponseVo.setNewPackAmount(totalPackgeAmount);
shoppingCartGoodsResponseVo.setTotalDiscountAmount(calculationDiscountResult == null ? 0L : calculationDiscountResult.getTotalDiscountAmount());
if (calculationDiscountResult == null) {
shoppingCartGoodsResponseVo.setTotalDiscountAmount(0L);
}else {
// 需要算上配送券的优惠金额
Integer discountAmount = 0;
if (CollectionUtils.isNotEmpty(calculationDiscountResult.getCouponDiscounts())) {
// 过滤出配送券金额
ActivityCalculationDiscountResponseDto.CalculationDiscountResult.CouponResults couponResults = calculationDiscountResult.getCouponDiscounts().stream().filter(c -> c.getActivityType() != null && c.getActivityType().compareTo(ActivityTypeEnum.TYPE_34.getCode()) == 0).findFirst().orElse(null);
if (couponResults != null) {
discountAmount = couponResults.getDiscountAmount();
}
}
shoppingCartGoodsResponseVo.setTotalDiscountAmount(calculationDiscountResult.getTotalDiscountAmount() + discountAmount);
}
}
@Override
......
......@@ -14,6 +14,7 @@ import cn.freemud.service.thirdparty.CustomerApplicationClient;
import cn.freemud.utils.BeanUtil;
import cn.freemud.utils.LogUtil;
import cn.freemud.utils.ResponseUtil;
import com.alibaba.fastjson.JSON;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.log.ApiLog;
......@@ -69,9 +70,10 @@ public class OpenStoreIappWxappConfigServiceImpl implements OpenStoreIappWxappCo
// }
// return sessionUserInfo.getResult();
AssortmentCustomerInfoVo customerInfoVo = customerInfoManager.getCustomerInfoByObject(sessionId);
if(customerInfoVo == null) throw new ServiceException(ResponseResult.NOT_LOGIN);;
CustomerInfoVo customerInfoVo1 = new CustomerInfoVo();
BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
if(customerInfoVo == null) throw new ServiceException(ResponseResult.NOT_LOGIN);
String jsonObject = JSON.toJSONString(customerInfoVo);
CustomerInfoVo customerInfoVo1 = JSON.parseObject(jsonObject,CustomerInfoVo.class);
// BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
return customerInfoVo1;
}
}
......@@ -921,8 +921,9 @@ public class ShoppingCartMallServiceImpl implements ShoppingCartNewService {
// return sessionUserInfo.getResult();
AssortmentCustomerInfoVo customerInfoVo = customerInfoManager.getCustomerInfoByObject(sessionId);
if(customerInfoVo == null) throw new ServiceException(ResponseResult.NOT_LOGIN);;
CustomerInfoVo customerInfoVo1 = new CustomerInfoVo();
BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
String jsonObject = JSON.toJSONString(customerInfoVo);
CustomerInfoVo customerInfoVo1 = JSON.parseObject(jsonObject,CustomerInfoVo.class);
// BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
return customerInfoVo1;
}
......
......@@ -22,6 +22,7 @@ import cn.freemud.service.ShoppingCartNewService;
import cn.freemud.service.thirdparty.ActivityClient;
import cn.freemud.service.thirdparty.CustomerApplicationClient;
import cn.freemud.utils.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
......@@ -709,8 +710,9 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
// return sessionUserInfo.getResult();
AssortmentCustomerInfoVo customerInfoVo = customerInfoManager.getCustomerInfoByObject(sessionId);
if(customerInfoVo == null) return null;
CustomerInfoVo customerInfoVo1 = new CustomerInfoVo();
BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
String jsonObject = JSON.toJSONString(customerInfoVo);
CustomerInfoVo customerInfoVo1 = JSON.parseObject(jsonObject,CustomerInfoVo.class);
// BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
return customerInfoVo1;
}
......
......@@ -2494,8 +2494,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// return sessionUserInfo.getResult();
AssortmentCustomerInfoVo customerInfoVo = customerInfoManager.getCustomerInfoByObject(sessionId);
if(customerInfoVo == null) throw new ServiceException(ResponseResult.NOT_LOGIN);;
String jsonObject = JsonUtil.toJSONString(customerInfoVo);
CustomerInfoVo customerInfoVo1 = JsonUtil.toBean(jsonObject,CustomerInfoVo.class);
String jsonObject = JSON.toJSONString(customerInfoVo);
CustomerInfoVo customerInfoVo1 = JSON.parseObject(jsonObject,CustomerInfoVo.class);
// BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
return customerInfoVo1;
}
......
......@@ -235,6 +235,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
List<CartGoods> newCartGoods = null;
ApiLog.debug("【oldGoodsList】:{} ,【addCartGoods】:{}",JSONObject.toJSONString(oldCartGoodsList),JSONObject.toJSONString(addCartGoods));
if(StringUtils.equals("9999",skuId)) {
// 将月享卡2.0的虚拟商品保存到购物车中
oldCartGoodsList.add(addCartGoods);
......@@ -264,7 +265,6 @@ public class ShoppingCartMCoffeeServiceImpl {
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, oldCartGoodsList, null, tableNumber, this.shoppingCartBaseService);
newCartGoods = oldCartGoodsList;
} else {
ApiLog.debug("【addGoodsList】:{} ,【addGoodsRequestVo】:{}",JSONObject.toJSONString(oldCartGoodsList),JSONObject.toJSONString(addCartGoods));
// 购物车数据更新(保存商品原价)
newCartGoods = updateCartGoodsLegal(partnerId, storeId, orderType, tableNumber, menuType, userId, addCartGoods, shoppingCartGoodsResponseVo, oldCartGoodsList);
......@@ -1877,8 +1877,9 @@ public class ShoppingCartMCoffeeServiceImpl {
AssortmentCustomerInfoVo customerInfoVo = customerInfoManager.getCustomerInfoByObject(sessionId);
if (customerInfoVo == null)
throw new ServiceException(ResponseResult.NOT_LOGIN);
CustomerInfoVo customerInfoVo1 = new CustomerInfoVo();
BeanUtil.convertBean(customerInfoVo, customerInfoVo1);
String jsonObject = JSON.toJSONString(customerInfoVo);
CustomerInfoVo customerInfoVo1 = JSON.parseObject(jsonObject,CustomerInfoVo.class);
// BeanUtil.convertBean(customerInfoVo,customerInfoVo1);
return customerInfoVo1;
}
......
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