Sfoglia il codice sorgente

Merge branch 'ljc_mallCart_20220721' into ljc_1.1

liujunchi 3 anni fa
parent
commit
a3e7a17316

+ 5 - 1
cooleshow-mall/mall-portal/src/main/java/com/yonge/cooleshow/portal/service/impl/OmsCartItemServiceImpl.java

@@ -90,8 +90,12 @@ public class OmsCartItemServiceImpl implements OmsCartItemService {
             if (pmsSkuStock.getStock() - pmsSkuStock.getLockStock() < existCartItem.getQuantity() + cartItem.getQuantity()) {
                 throw new BizException("库存不足");
             }
+            if(existCartItem.getQuantity() + cartItem.getQuantity() > 200) {
+                existCartItem.setQuantity(200);
+            } else {
+                existCartItem.setQuantity(cartItem.getQuantity() + existCartItem.getQuantity());
+            }
             cartItem.setModifyDate(new Date());
-            existCartItem.setQuantity(cartItem.getQuantity());
             cartItemMapper.updateByPrimaryKey(existCartItem);
         }
         return existCartItem;