Commit ec9b3af4 by ping.wu

删除无用代码

parent 8866fd31
......@@ -207,13 +207,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
@Value("${saas.cart.new.shopping.cart}")
private String newShoppingCart;
// 配送费逻辑是否使用旧的
@Value("${store.delivery.use.old:true}")
private boolean storeDeliveryUseOld;
@Value("${goods.cache.second}")
private long goodsCacheSeconds;
@Autowired
private CommonFunctionHandle commonFunctionHandle;
......@@ -414,7 +407,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
setAddAndUpdateResponse(shoppingCartGoodsResponseVo, calculationDiscountResult, allCartGoodsList, null, partnerId, storeId, userId, ShoppingCartConstant.ADD_AND_UPDATE, null);
}
//埋点添加购物车行为
this.buriedPointShoppingCart(addShoppingCartGoodsRequestVo, spuId, productName);
this.shoppingCartAddOrListCommonResponseHandle(shoppingCartGoodsResponseVo);
return ResponseUtil.success(shoppingCartGoodsResponseVo);
}
......@@ -440,31 +432,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
/**
* 埋点添加购物车行为
*
* @param addShoppingCartGoodsRequestVo
* @param spuId
* @param productName
*/
private void buriedPointShoppingCart(AddShoppingCartGoodsRequestVo addShoppingCartGoodsRequestVo, String spuId, String productName) {
if (StringUtils.isEmpty(productName)) {
return;
}
List<ShoppingCartSkuAddRequestVo.ShoppingCartSkuProductVo> productVos = Lists.newArrayList();
ShoppingCartSkuAddRequestVo.ShoppingCartSkuProductVo productVo = new ShoppingCartSkuAddRequestVo.ShoppingCartSkuProductVo();
productVo.setProductName(productName);
productVo.setProductId(spuId);
productVo.setSpuId(spuId);
productVos.add(productVo);
BuriedPointShoppingCartRequestDto shoppingCartRequestDto = BuriedPointShoppingCartRequestDto.builder()
.sessionId(addShoppingCartGoodsRequestVo.getSessionId()).partnerId(addShoppingCartGoodsRequestVo.getPartnerId())
.storeId(addShoppingCartGoodsRequestVo.getShopId()).build();
// buriedPointService.buriedPointAddShoppingCart(productVos, shoppingCartRequestDto);
}
/**
* 更新商品数量
*
......@@ -475,7 +442,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
public BaseResponse updateGoodsQty(UpdateShoppingCartGoodsQtyRequestVo updateShoppingCartGoodsQtyRequestVo) {
if (StringUtils.isEmpty(updateShoppingCartGoodsQtyRequestVo.getShopId())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
// throw new ServiceException(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
}
ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = new ShoppingCartGoodsResponseVo();
CustomerInfoVo assortmentCustomerInfoVo = getCustomerInfoVo(updateShoppingCartGoodsQtyRequestVo.getSessionId());
......@@ -497,7 +463,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
CartGoods cartGoods = assortmentSdkService.getCartGoodsBySdk(partnerId, userId, storeId, cartGoodsUid, "", shoppingCartBaseService,bizType);
if (cartGoods == null) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_UPDATE_ERROR);
// throw new ServiceException(ResponseResult.SHOPPING_CART_UPDATE_ERROR);
}
// 检查购物车商品库存数量
checkUpdateStock(updateShoppingCartGoodsQtyRequestVo, cartGoods);
......@@ -659,7 +624,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
public BaseResponse getGoodsList(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) {
if (StringUtils.isEmpty(shoppingCartInfoRequestVo.getShopId())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
// throw new ServiceException(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
}
if (StringUtils.isEmpty(shoppingCartInfoRequestVo.getVersion())) {
shoppingCartInfoRequestVo.setVersion("");
......@@ -846,7 +810,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
request.setOrderType(shoppingCartInfoRequestVo.getOrderType());
request.setSessionId(shoppingCartInfoRequestVo.getSessionId());
request.setShopId(shoppingCartInfoRequestVo.getShopId());
// request.setVersion(shoppingCartInfoRequestVo.getVersion());
if (CollectionUtils.isNotEmpty(shoppingCartInfoRequestVo.getCouponCodes())) {
List<PremiumExchangeRequestVo.couponCode> list = new ArrayList<>();
shoppingCartInfoRequestVo.getCouponCodes().forEach(code -> {
......@@ -1141,7 +1104,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
if (productService.hasRequiredProducts(partnerId, storeId, cartGoodsList, BusinessTypeEnum.getByType(shoppingCartInfoRequestVo.getMenuType()).getCode())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_REQUIRED_PRODUCT_NOT_EXIST);
// throw new ServiceException(ResponseResult.SHOPPING_CART_REQUIRED_PRODUCT_NOT_EXIST);
}
// check购物车中所有商品(商品是否存在,价格变动,券是否支持当前点餐方式)
......@@ -1162,8 +1124,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
shoppingCartGoodsResponseVo.setToastMsg(cartGoodsResponseVo.getToastMsg());
}
cartGoodsList = JSONArray.parseArray(JSONObject.toJSONString(checkCartRequest.getCartGoodsList()), CartGoods.class);
// 多规格的sku商品计算包装费
//this.checkSkuOnVersion(cartGoodsList, partnerId, storeId, shoppingCartGoodsResponseVo);
// 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, assortmentCustomerInfoVo.getSessionId(), tableNumber, this.shoppingCartBaseService,bizType);
......@@ -1598,11 +1558,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
cartGoods.setSpuName(checkSpqInfoResponseDto.getCouponName());
}
cartGoods.setStockLimit(checkSpqInfoResponseDto.isStockLimit());
//逻辑同 viewProductName
// if (GoodsTypeEnum.BUY_M_SEND_N_COUPON.getGoodsType().equals(cartGoods.getGoodsType())) {
// cartGoods.setName(checkSpqInfoResponseDto.getSkuName());
// cartGoods.setSpuName(checkSpqInfoResponseDto.getSpuName());
// }
//添加请求的优惠券信息 买M赠N券,不重复加促销券集合字段
String finalCouponCode = couponCode;
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> collect = coupons.stream().filter(calculationDiscountCoupon -> Objects.equals(calculationDiscountCoupon.getCode(), finalCouponCode)).collect(toList());
......@@ -1709,25 +1664,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
/**
* 将calculationDiscountGoods 封装后加入 calculationDiscountGoodsList
*
* @param calculationDiscountGoodsList
* @param goodsId
* @param goodsQuantity
* @param originalPrice
*/
// private void addCalculationDiscountGoods(List<ActivityCalculationDiscountRequestDto.CalculationDiscountGoods> calculationDiscountGoodsList,
// String goodsId, Integer goodsQuantity, Long originalPrice, Integer memberDiscount, String cartGoodsUid) {
// ActivityCalculationDiscountRequestDto.CalculationDiscountGoods calculationDiscountGoods = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods();
// calculationDiscountGoods.setGoodsId(goodsId);
// calculationDiscountGoods.setCartGoodsUid(cartGoodsUid);
// calculationDiscountGoods.setGoodsQuantity(goodsQuantity);
// calculationDiscountGoods.setOriginalPrice(originalPrice);
// calculationDiscountGoods.setMemberDiscount(memberDiscount);
// this.addCalculationDiscountGoods(calculationDiscountGoodsList, calculationDiscountGoods);
// }
private void addCalculationDiscountGoods(List<ActivityCalculationDiscountRequestDto.CalculationDiscountGoods> calculationDiscountGoodsList
, String goodsId
, Integer goodsQuantity
......@@ -2453,7 +2389,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
return;
}
Integer orderAmount = shoppingCartGoodsResponseVo.getTotalAmount().intValue();
String trackingNo = LogThreadLocal.getTrackingNo();
SVCCardAmountRequest request = new SVCCardAmountRequest();
request.setPartnerId(partnerId);
request.setCardCodes(Arrays.asList(cardCode));
......@@ -2478,7 +2413,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
Integer deliveryAmount = 0;
Integer svcPayAmount = 0;
if (StringUtils.isNotBlank(receiveId) && shoppingCartGoodsResponseVo.getDiscountDeliveryAmount() != null) {
//Integer deliveryAmount = getDeliveryAmount(receiveId, partnerId, storeId);
deliveryAmount = shoppingCartGoodsResponseVo.getDiscountDeliveryAmount().intValue();
orderAmount += deliveryAmount;
}
......@@ -2522,7 +2456,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
return;
}
Integer orderAmount = shoppingCartGoodsResponseVo.getTotalAmount().intValue();
String trackingNo = LogThreadLocal.getTrackingNo();
SVCCardAmountRequest request = new SVCCardAmountRequest();
request.setPartnerId(partnerId);
request.setCardCodes(Arrays.asList(cardCode));
......@@ -2579,63 +2512,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
/**
* 储值卡支付查询配送费
*
* @return
*/
private Integer getDeliveryAmount(String receiveId, String partnerId, String storeId) {
String trackingNo = LogThreadLocal.getTrackingNo();
Integer amount = 0;
if (StringUtils.isBlank(receiveId)) {
return amount;
}
QueryReceiveAddressRequest queryReceive = new QueryReceiveAddressRequest(receiveId, partnerId);
//查询会员后货地址经纬度
com.freemud.application.sdk.api.base.BaseResponse<QueryReceiveAddressResponse> queryReceiveAddressResponse = memberCenterService.queryReceiveAddressById(queryReceive, trackingNo);
if (!ResponseResult.SUCCESS.getCode().equals(queryReceiveAddressResponse.getCode()) || queryReceiveAddressResponse.getData() == null) {
throw new ServiceException(ResponseResult.USER_GETRECEIVEADDRESS_ERROR);
}
StoreInfoRequest request = new StoreInfoRequest();
request.setPartnerId(partnerId);
request.setStoreCode(storeId);
//查询门店信息,获取门店经纬度
StoreResponse storeResponse = storeCenterService.getStoreInfo(request, trackingNo);
if (storeResponse == null || storeResponse.getStatusCode() != 100 || storeResponse.getBizVO() == null) {
throw new ServiceException(ResponseResult.STORE_NOT_FOUND);
}
//查询门店外卖配送配置
AssortmentOpenPlatformPartnerStoreDeliveryConfig deliveryConfig = deliveryConfigManager.findByPartnerIdAndStoreCode(partnerId, storeId);
if (deliveryConfig == null) {
throw new ServiceException(ResponseResult.STORE_ITEM_NOT_DELIVERY);
}
StoreDeliveryInfoDto storeDeliveryInfoDto = new StoreDeliveryInfoDto();
storeDeliveryInfoDto.setPartnerId(partnerId);
storeDeliveryInfoDto.setStoreId(storeId);
storeDeliveryInfoDto.setStoreName(storeResponse.getBizVO().getStoreName());
storeDeliveryInfoDto.setDeliveryLimitAmount(deliveryConfig == null ? 0 : deliveryConfig.getDeliveryLimitAmount());
storeDeliveryInfoDto.setDeliveryAmount(deliveryConfig == null ? 0 : deliveryConfig.getDeliveryAmount());
storeDeliveryInfoDto.setDefaultDeliveryRange(deliveryConfig == null ? 0L : deliveryConfig.getDefaultDeliveryRange());
storeDeliveryInfoDto.setAddRangeAmount(deliveryConfig == null ? 0L : deliveryConfig.getAddRangeAmount());
storeDeliveryInfoDto.setAddRangeCount(deliveryConfig == null ? 0L : deliveryConfig.getAddRangeCount());
storeDeliveryInfoDto.setPoint2DList(getDeliveryPoint2DList(storeResponse.getBizVO().getDistributionScope()));
storeDeliveryInfoDto.setDeliveryHoursDay(storeResponse.getBizVO().getDeliveryHoursDay());
storeDeliveryInfoDto.setLongitude(storeResponse.getBizVO().getLongitude());
storeDeliveryInfoDto.setLatitude(storeResponse.getBizVO().getLatitude());
storeDeliveryInfoDto.setScopeConfig(storeResponse.getBizVO().getScopeConfig());
if (StringUtils.isNotEmpty(storeResponse.getBizVO().getDeliveryRadius())) {
storeDeliveryInfoDto.setDeliveryRadius(Integer.valueOf(storeResponse.getBizVO().getDeliveryRadius()));
} else {
storeDeliveryInfoDto.setDeliveryRadius(0);
}
storeDeliveryInfoDto.setEnableTakeaway(true);
String userLongitude = queryReceiveAddressResponse.getData().getLongitude();
String userLatitude = queryReceiveAddressResponse.getData().getLatitude();
amount = storeService.getUserRealDeliveryAmount(storeDeliveryInfoDto, userLongitude, userLatitude).intValue();
return amount;
}
private Long getNewDeliveryAmount(String receiveId, String partnerId, String storeId, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, Integer orderType) {
//String trackingNo = LogThreadLocal.getTrackingNo();
Long amount = 0L;
......@@ -2652,30 +2528,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
/**
* 获取配送范围内集合
*/
public List<Point2D.Double> getDeliveryPoint2DList(String distributionScope) {
if (StringUtils.isBlank(distributionScope)) {
return Collections.emptyList();
}
/**
* 如果点不为整数,返回空
*/
String[] points = distributionScope.split(",");
if (points.length % 2 != 0) {
return Collections.emptyList();
}
List<String> pointList = Arrays.asList(points);
List<Point2D.Double> point2DList = Lists.newArrayList();
for (int i = 0; i < pointList.size(); i++) {
Double pointX = Double.parseDouble(pointList.get(i));
Double pointY = Double.parseDouble(pointList.get(++i));
point2DList.add(new Point2D.Double(pointX, pointY));
}
return point2DList;
}
/**
* 获取优惠
*/
private CalculationDiscountResult getCalculationDiscountResult(String menuType
......@@ -2683,16 +2535,10 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, List<CartGoods> cartGoodsList, List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons
, List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList, String receiveId, Long deliveryAmount,Integer bizType, Integer accountFlag) {
// 获取优惠信息
CalculationDiscountResult calculationDiscountResult = null;
//外卖场景下 查询门店配送信息
if (BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)) {
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, coupons, sendGoodsList, BusinessTypeEnum.getByType(menuType).getCode(), deliveryAmount,bizType, accountFlag);
} else {
calculationDiscountResult = this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, coupons, sendGoodsList, BusinessTypeEnum.getByType(menuType).getCode(), null,bizType, accountFlag);
if (!BusinessTypeEnum.SAAS_DELIVERY.getCode().equals(menuType)) {
deliveryAmount = null;
}
return calculationDiscountResult;
return this.getActivityCalculationDiscountResponse(partnerId, storeId, userId, appId, orderType, isMember, cartGoodsList, coupons, sendGoodsList, BusinessTypeEnum.getByType(menuType).getCode(), deliveryAmount,bizType, accountFlag);
}
public Long calculateDeliveryAmount(String receiveId, String partnerId, String storeId, String wxappid, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, Integer orderType) {
......@@ -2702,12 +2548,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (StringUtils.isBlank(receiveId) && !Objects.equals(orderType, CreateOrderType.TAKE_OUT.getCode())) {
return deliveryAmount;
}
if (storeDeliveryUseOld) {
deliveryAmount = Long.parseLong(getDeliveryAmount(receiveId, partnerId, storeId).toString());
shoppingCartGoodsResponseVo.setDeliveryFeeZeroReason(0);
} else {
deliveryAmount = getNewDeliveryAmount(receiveId, partnerId, storeId, shoppingCartGoodsResponseVo, orderType);
}
return deliveryAmount;
}
......@@ -2768,7 +2609,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (StringUtils.isBlank(newSharing)) return true;
CalculateCenter center = JSON.parseObject(newSharing, CalculateCenter.class);
Boolean enable = true;
// if (!center.getEnable()) return false;
switch (center.getType()) {
case 2:
enable = true;
......@@ -2785,9 +2625,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
}
// if (center.getEnable() && enable) {
// enable = true;
// }
return enable;
}
......@@ -2858,41 +2695,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (StringUtils.isNotBlank(value)) {
return Integer.parseInt(value);
}
// String redisKey = limitCartKey + appid;
// //生态缓存获取慢
// Object value = redisCache.hashGet(redisKey, "2");
// if (value == null) {
// return qty;
// } else {
// boolean bool = value.getClass().getName().equals("java.lang.String");
// if (bool) {
// return qty;
// }
// JSONArray jsonArray = (JSONArray) value;
// int cartLimitFlag = 0;
// int cartLimitCount = 0;
// for (Object object : jsonArray) {
// JSONObject jsonObject = (JSONObject) object;
// HashMap hashMap = JSONObject.parseObject(jsonObject.toJSONString(), HashMap.class);
// if ("cartLimitFlag".equals(hashMap.get("appKey"))) {
// if (StringUtils.isBlank((String) hashMap.get("appValue"))) {
// return qty;
// }
// cartLimitFlag = Integer.parseInt((String) hashMap.get("appValue"));
// if (cartLimitFlag != 1) {
// return qty;
// }
// }
// if ("cartLimitCount".equals(hashMap.get("appKey"))) {
// if (StringUtils.isBlank((String) hashMap.get("appValue"))) {
// return qty;
// }
// cartLimitCount = Integer.parseInt((String) hashMap.get("appValue"));
// return cartLimitCount;
// }
// }
// }
return limitCount;
}
......@@ -3344,7 +3146,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (StringUtils.isEmpty(replaceGoodsRequestVo.getShopId())
|| StringUtils.isEmpty(replaceGoodsRequestVo.getOldShopId())) {
return ResponseUtil.error(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
// throw new ServiceException(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
}
if (replaceGoodsRequestVo.getShopId().equals(replaceGoodsRequestVo.getOldShopId())) {
return ResponseUtil.success();
......@@ -3427,38 +3228,38 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
return ret;
}
private void queryManyGoodsStocks(String menuType, String partnerId, String shopId, List<Long> productIds, List<ProductBean> productBeanListSpuClass, String skuId, Integer qty) {
GetProductStockRequestDto requestDto = new GetProductStockRequestDto();
requestDto.setChannel(BusinessTypeEnum.getByType(menuType).getCode());
requestDto.setPartnerId(partnerId);
requestDto.setStoreId(shopId);
requestDto.setProductIds(productIds);
GetProductStockResponseDto availableStocks = null;
if (productBeanListSpuClass.get(0).getType() == ProductType.NOSPEC.getCode()
&& productBeanListSpuClass.get(0).getStockLimit() == 1) {
availableStocks = stockClient.getAvailableStocks(requestDto);
} else {
for (SkuProductBean skuProductBean : productBeanListSpuClass.get(0).getSkuList()) {
if (skuId.equals(skuProductBean.getSkuId()) && skuProductBean.getStockLimit() == 1) {
availableStocks = stockClient.getAvailableStocks(requestDto);
break;
}
}
}
if (availableStocks != null && !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(availableStocks.getCode())) {
throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE);
}
if (availableStocks != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(availableStocks.getCode()) &&
(CollectionUtils.isEmpty(availableStocks.getResult()) || availableStocks.getResult().get(0).getQty() == null
|| availableStocks.getResult().get(0).getQty() < qty)) {
Integer stock = 0;
if (!CollectionUtils.isEmpty(availableStocks.getResult()) && (stock = availableStocks.getResult().get(0).getQty()) > 0) {
throw new BizServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE, "仅剩" + stock + "件库存了");
}
throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE);
}
}
// private void queryManyGoodsStocks(String menuType, String partnerId, String shopId, List<Long> productIds, List<ProductBean> productBeanListSpuClass, String skuId, Integer qty) {
// GetProductStockRequestDto requestDto = new GetProductStockRequestDto();
// requestDto.setChannel(BusinessTypeEnum.getByType(menuType).getCode());
// requestDto.setPartnerId(partnerId);
// requestDto.setStoreId(shopId);
// requestDto.setProductIds(productIds);
//
// GetProductStockResponseDto availableStocks = null;
// if (productBeanListSpuClass.get(0).getType() == ProductType.NOSPEC.getCode()
// && productBeanListSpuClass.get(0).getStockLimit() == 1) {
// availableStocks = stockClient.getAvailableStocks(requestDto);
// } else {
// for (SkuProductBean skuProductBean : productBeanListSpuClass.get(0).getSkuList()) {
// if (skuId.equals(skuProductBean.getSkuId()) && skuProductBean.getStockLimit() == 1) {
// availableStocks = stockClient.getAvailableStocks(requestDto);
// break;
// }
// }
// }
// if (availableStocks != null && !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(availableStocks.getCode())) {
// throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE);
// }
// if (availableStocks != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(availableStocks.getCode()) &&
// (CollectionUtils.isEmpty(availableStocks.getResult()) || availableStocks.getResult().get(0).getQty() == null
// || availableStocks.getResult().get(0).getQty() < qty)) {
// Integer stock = 0;
// if (!CollectionUtils.isEmpty(availableStocks.getResult()) && (stock = availableStocks.getResult().get(0).getQty()) > 0) {
// throw new BizServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE, "仅剩" + stock + "件库存了");
// }
// throw new ServiceException(ResponseResult.SHOPPING_CART_STOCK_NOT_HAVE);
// }
// }
private boolean updateCartGoodsLegal(List<CartGoods> excludeGoods, String userId, ShopGoodsReplaceVo replaceGoodsRequestVo, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo, boolean fullReplace) {
......
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