|
|
@ -608,9 +608,11 @@ public abstract class PlaceOrderTemplate { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//查询所有店铺优惠券数据 |
|
|
|
//查询所有店铺优惠券数据(改为获取所有商家优惠券。) |
|
|
|
List<Long> shopIdList = param.getShops().stream().map(OrderProductParam::getShopId).distinct().collect(Collectors.toList()); |
|
|
|
List<CereBuyerShopCoupon> list = cereBuyerShopCouponService.findByIds(shopIdList); |
|
|
|
//查询店铺所属的商家id |
|
|
|
List<Long> businessIdList = cereBuyerShopCouponService.findBusinessIdsByShops(shopIdList); |
|
|
|
List<CereBuyerShopCoupon> list = cereBuyerShopCouponService.findBuyerShopCouponsByBusinessIds(businessIdList); |
|
|
|
|
|
|
|
//计算店铺优惠券金额总和--注意订单不是根据店铺作为主键的,但是店铺优惠券是根据店铺作为主键的,要做好怎么分配--TODO pxh |
|
|
|
if (!EmptyUtils.isEmpty(list)) { |
|
|
@ -620,7 +622,7 @@ public abstract class PlaceOrderTemplate { |
|
|
|
Long shopId = param.getShops().stream().filter(o->o.getId() != null && o.getId().equals(cereBuyerShopCoupon.getId())).map(OrderProductParam::getShopId).findAny().orElse(0L); |
|
|
|
Optional<OrderProductParam> productParam = param.getShops().stream().filter(o->o.getShopId().equals(shopId)).findFirst(); |
|
|
|
int priceCount = 0; |
|
|
|
if (productParam.isPresent()){ |
|
|
|
if (productParam != null && productParam.isPresent()){ |
|
|
|
List<ProductSku> skuList = productParam.get().getSkus(); |
|
|
|
for (ProductSku sku:skuList) { |
|
|
|
if (sku.getPriceId() != null && sku.getPriceId() > 0) { |
|
|
|