Commit e26883dc by 周晓航

维护 加价购商品的 pos编码

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent ba6117ef
......@@ -62,6 +62,7 @@ public class ShoppingCartConvertAdapter {
cartGoodsDetailDto.setSkuId(goodsId);
// fisherman 加价购商品类型设置
cartGoodsDetailDto.setOriginalProductType(getProductsVo.getType());
cartGoodsDetailDto.setLinkedId(getProductsVo.getLinkedId());
cartGoodsDetailDto.setProductType(sendGoods.getProductType());
cartGoodsDetailDto.setQty(product.getQty());
cartGoodsDetailDto.setSpuName(getProductsVo != null ? getProductsVo.getSpuName() : "");
......
......@@ -7,13 +7,13 @@ import cn.freemud.entities.dto.activity.ActivityQueryDto;
import cn.freemud.entities.dto.calculate.CalculationDiscountResult;
import cn.freemud.entities.dto.calculate.SendActivity;
import cn.freemud.entities.dto.calculate.SendGoods;
import cn.freemud.entities.dto.product.info.ProductBean;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.*;
import cn.freemud.enums.ActivityTypeEnum;
import cn.freemud.enums.ResponseResult;
import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.IPromotionService;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
......@@ -281,19 +281,20 @@ public class BuySendPromotionService implements IPromotionService {
*/
private void updateSendGooodsInfo(List<CartGoods> newCartGoodsList,ActivityQueryDto activityQueryDto,ShoppingCartInfoRequestVo shoppingCartInfoRequestVo){
List<String> goodsIds = newCartGoodsList.stream().map(CartGoods::getGoodsId).collect(Collectors.toList());
List<ProductBeanDTO> productBeanList = assortmentSdkService.getProductsInfoSdk(activityQueryDto.getPartnerId()
List<ProductBean> productBeanList = assortmentSdkService.getProductsInfo(activityQueryDto.getPartnerId()
, activityQueryDto.getStoreId(), goodsIds, shoppingCartInfoRequestVo==null?null:shoppingCartInfoRequestVo.getMenuType() ,shoppingCartBaseService);
if (CollectionUtils.isEmpty(productBeanList)) {
throw new ServiceException(ResponseResult.SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST);
}
for (CartGoods cartGoods : newCartGoodsList) {
Optional<ProductBeanDTO> productBeanDTO = productBeanList.stream().filter(productBean -> ObjectUtils.equals(productBean.getPid(), cartGoods.getGoodsId())).findFirst();
Optional<ProductBean> productBeanDTO = productBeanList.stream().filter(productBean -> ObjectUtils.equals(productBean.getPid(), cartGoods.getGoodsId())).findFirst();
if (!productBeanDTO.isPresent()) {
continue;
}
cartGoods.setUnit(productBeanDTO.get().getUnit());
cartGoods.setWeight(productBeanDTO.get().getWeight());
cartGoods.setLinkedId(productBeanDTO.get().getLinkedId());
}
}
......
......@@ -117,7 +117,7 @@ public class ShoppingCartMealServiceImpl implements ShoppingCartNewService {
String appType = customerInfo.getIappId();
requestVo.setAppType(appType);
requestVo.setTableNumber(tableNumber);
CartGoods cartGoods = shoppingCartConvertAdapter.convent2CartGoods(requestVo);
CartGoods cartGoods = ShoppingCartConvertAdapter.convent2CartGoods(requestVo);
List<Long> productIds = new ArrayList<>();
//商品skuId或者商品券的商品id
String spuId2 = spuId;
......
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