Commit 2305568b by yu.sun

sunyu::update::fix bug about productGroupList add Material

parent 37c0fe31
......@@ -794,18 +794,18 @@ public class ShoppingCartConvertAdapter {
List<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods> productMaterialList = new ArrayList<>();
Long materialAmount = 0L;
if (CollectionUtils.isNotEmpty(materialList)){
for (ProductTypeBeanDTO.ProductGroupType.GroupDetailType detailType : materialList) {
com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods materialGoods = new com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods();
materialGoods.setCustomerCode(StringUtils.isNotEmpty(detailType.getCustomerCode()) ? detailType.getCustomerCode() : "");
materialGoods.setAmount(null != detailType.getMarkUpPrice() ? detailType.getMarkUpPrice().longValue() : 0);
materialGoods.setFinalPrice(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() : 0);
materialGoods.setSpuName(StringUtils.isNotEmpty(detailType.getProductName()) ? detailType.getProductName() : "");
materialGoods.setSpuId(StringUtils.isNotEmpty(detailType.getProductId()) ? detailType.getProductId() : "");
materialGoods.setOriginalPrice(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() : 0);
materialGoods.setOriginalAmount(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() * comboxGoods.getQty() : 0);
productMaterialList.add(materialGoods);
materialAmount += detailType.getProductFinalPrice().longValue() * comboxGoods.getQty();
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods productMaterial :comboxGoods.getProductMaterialList()) {
for (ProductTypeBeanDTO.ProductGroupType.GroupDetailType detailType : materialList) {
// productMaterial.setCustomerCode(StringUtils.isNotEmpty(detailType.getCustomerCode()) ? detailType.getCustomerCode() : "");
productMaterial.setAmount(null != detailType.getMarkUpPrice() ? detailType.getMarkUpPrice().longValue() : 0);
productMaterial.setFinalPrice(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() : 0);
productMaterial.setSpuName(StringUtils.isNotEmpty(detailType.getProductName()) ? detailType.getProductName() : "");
productMaterial.setSpuId(StringUtils.isNotEmpty(detailType.getProductId()) ? detailType.getProductId() : "");
productMaterial.setOriginalPrice(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() : 0);
productMaterial.setOriginalAmount(null != detailType.getProductFinalPrice() ? detailType.getProductFinalPrice().longValue() * comboxGoods.getQty() : 0);
productMaterialList.add(productMaterial);
materialAmount += detailType.getProductFinalPrice().longValue() * comboxGoods.getQty();
}
}
}
comboxGoods.setMaterialAmount(materialAmount);
......
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