Commit f30c9505 by 刘鹏飞

小料多数量时行比较要考虑数量

parent 4803152b
...@@ -451,7 +451,8 @@ public class CartGoods { ...@@ -451,7 +451,8 @@ public class CartGoods {
} }
} }
if (CollectionUtils.isNotEmpty(productMaterialList)) { if (CollectionUtils.isNotEmpty(productMaterialList)) {
productMaterialList.stream().sorted(Comparator.comparing(MaterialGoods::getSpuId)).forEach(e -> originalString.append(e.getSpuId())); // 小料的数量也要比较
productMaterialList.stream().sorted(Comparator.comparing(MaterialGoods::getSpuId)).forEach(e -> {originalString.append(e.getSpuId());originalString.append(e.getQty());});
} }
if (CollectionUtils.isNotEmpty(specialExtra)) { if (CollectionUtils.isNotEmpty(specialExtra)) {
specialExtra.stream().sorted(Comparator.comparing(SpecialExtra::getAttributeId)).forEach(e -> originalString.append(e.getAttributeId())); specialExtra.stream().sorted(Comparator.comparing(SpecialExtra::getAttributeId)).forEach(e -> originalString.append(e.getAttributeId()));
...@@ -487,7 +488,7 @@ public class CartGoods { ...@@ -487,7 +488,7 @@ public class CartGoods {
} }
} }
if (CollectionUtils.isNotEmpty(cartGoods.getProductMaterialList())) { if (CollectionUtils.isNotEmpty(cartGoods.getProductMaterialList())) {
cartGoods.getProductMaterialList().stream().sorted(Comparator.comparing(MaterialGoods::getSpuId)).forEach(e -> currentString.append(e.getSpuId())); cartGoods.getProductMaterialList().stream().sorted(Comparator.comparing(MaterialGoods::getSpuId)).forEach(e -> {currentString.append(e.getSpuId());currentString.append(e.getQty());});
} }
if (CollectionUtils.isNotEmpty(cartGoods.getSpecialExtra())) { if (CollectionUtils.isNotEmpty(cartGoods.getSpecialExtra())) {
cartGoods.getSpecialExtra().stream().sorted(Comparator.comparing(SpecialExtra::getAttributeId)).forEach(e -> currentString.append(e.getAttributeId())); cartGoods.getSpecialExtra().stream().sorted(Comparator.comparing(SpecialExtra::getAttributeId)).forEach(e -> currentString.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