Bläddra i källkod

Merge remote-tracking branch 'remotes/origin/developer' into developerA

chao 3 år sedan
förälder
incheckning
38e1c533d7

+ 3 - 3
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -419,9 +419,9 @@ public class PageServiceImpl implements PageService {
         PageHelper.startPage(pageNum, pageSize);
         PageHelper.startPage(pageNum, pageSize);
         List<ProductItemVo> productList = pageMapper.getBuyAgainProducts(userId);
         List<ProductItemVo> productList = pageMapper.getBuyAgainProducts(userId);
         productList.forEach(product -> {
         productList.forEach(product -> {
-            double price = product.getPrice();
-            double costPrice = product.getCostPrice();
-            double discountPrice = product.getDiscountPrice();
+            double price = product.getPrice()!=null?product.getPrice():0d;
+            double costPrice = product.getCostPrice()!=null?product.getCostPrice():0d;
+            double discountPrice = product.getDiscountPrice()!=null?product.getDiscountPrice():0d;
             Integer costFlag = product.getCostCheckFlag();
             Integer costFlag = product.getCostCheckFlag();
             // 成本大于等于复购价 或 复购价大于机构价
             // 成本大于等于复购价 或 复购价大于机构价
             boolean state = (costFlag == 1 && MathUtil.compare(costPrice, discountPrice) >=0) || MathUtil.compare(discountPrice, price) >0;
             boolean state = (costFlag == 1 && MathUtil.compare(costPrice, discountPrice) >=0) || MathUtil.compare(discountPrice, price) >0;