Commit d8009b82 by chongfu.liang

积分扣减

parent f500625d
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
package cn.freemud.entities.vo; package cn.freemud.entities.vo;
import com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -417,10 +418,13 @@ public class CartGoods { ...@@ -417,10 +418,13 @@ public class CartGoods {
return true; return true;
if (o == null || getClass() != o.getClass()) if (o == null || getClass() != o.getClass())
return false; return false;
// 原始字符串 // 原始字符串
StringBuilder originalString = new StringBuilder(); StringBuilder originalString = new StringBuilder();
originalString.append(goodsId); if (StringUtils.isNotBlank(goodsId) && goodsId.startsWith(CommonsConstant.COUPON_PREFIX)){
originalString.append(spuId+skuId);
} else {
originalString.append(goodsId);
}
originalString.append(couponCode); originalString.append(couponCode);
if(StringUtils.isNotEmpty(userId)){ if(StringUtils.isNotEmpty(userId)){
...@@ -497,7 +501,11 @@ public class CartGoods { ...@@ -497,7 +501,11 @@ public class CartGoods {
@Override @Override
public int hashCode() { public int hashCode() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(goodsId); if (StringUtils.isNotBlank(goodsId) && goodsId.startsWith(CommonsConstant.COUPON_PREFIX)){
sb.append(spuId+skuId);
} else {
sb.append(goodsId);
}
if (CollectionUtils.isNotEmpty(extra)) { if (CollectionUtils.isNotEmpty(extra)) {
extra.stream().sorted(Comparator.comparing(CartGoodsExtra::getAttributeId)).forEach(e -> sb.append(e.getAttributeId())); extra.stream().sorted(Comparator.comparing(CartGoodsExtra::getAttributeId)).forEach(e -> sb.append(e.getAttributeId()));
} }
......
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