Jelajahi Sumber

app拼团列表1

yangyb 2 minggu lalu
induk
melakukan
85634fc001

+ 1 - 1
mall-service/src/main/java/com/txz/mall/service/impl/ProductAttrValueServiceImpl.java

@@ -56,7 +56,7 @@ public class ProductAttrValueServiceImpl extends AbstractService<ProductAttrValu
         Condition condition = new Condition(ProductAttrValue.class);
         Example.Criteria criteria = condition.createCriteria();
         criteria.andEqualTo("productId", productId);
-        criteria.andEqualTo("sku", suk);
+        criteria.andEqualTo("suk", suk);
         criteria.andEqualTo("type", type);
         criteria.andEqualTo("isDelete", 0);
         List<ProductAttrValue> list = this.findByCondition(condition);

+ 6 - 6
mall-service/src/main/java/com/txz/mall/service/impl/StoreOrderServiceImpl.java

@@ -512,7 +512,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
         if (storeCombination.getStock().equals(0) || detailRequest.getProductNum() > storeCombination.getStock()) {
             throw new ServiceException("拼团商品库存不足");
         }
-        ProductAttrValue combinationAttrValue = productAttrValueService.getByIdAndProductIdAndType(detailRequest.getAttrValueId(), combinationId, Constants.PRODUCT_TYPE_PINGTUAN);
+        ProductAttrValue combinationAttrValue = productAttrValueService.getByIdAndProductIdAndType(detailRequest.getAttrValueId(), detailRequest.getProductId(), Constants.PRODUCT_TYPE_PINGTUAN);
         if (ObjectUtil.isNull(combinationAttrValue)) {
             throw new ServiceException("拼团商品规格不存在");
         }
@@ -551,11 +551,11 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
             throw new ServiceException("拼团商品已过期");
         }
         // 判断购买数量
-        if (productNum > storeCombination.getOnceNum()) {
-            throw new ServiceException("购买数量超过单次拼团购买上限");
-        }
+//        if (productNum > storeCombination.getOnceNum()) {
+//            throw new ServiceException("购买数量超过单次拼团购买上限");
+//        }
 
-        if (combinationAttrValue.getStock() <= 0 || combinationAttrValue.getQuota() <= 0 || productNum > combinationAttrValue.getStock()) {
+        if (combinationAttrValue.getStock() <= 0 || productNum > combinationAttrValue.getStock()) {
             throw new ServiceException("拼团商品规格库存不足");
         }
         // 普通商品部分判断
@@ -567,7 +567,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
             throw new ServiceException("拼团主商品库存不足");
         }
         // 主商品sku
-        ProductAttrValue productAttrValue = productAttrValueService.getByProductIdAndSkuAndType(storeCombination.getProductId(), combinationAttrValue.getSuk(), Constants.PRODUCT_TYPE_NORMAL);
+        ProductAttrValue productAttrValue = productAttrValueService.getByProductIdAndSkuAndType(storeCombination.getProductId(), combinationAttrValue.getSuk(), Constants.PRODUCT_TYPE_PINGTUAN);
         if (ObjectUtil.isNull(productAttrValue)) {
             throw new ServiceException("拼团主商品规格不存在");
         }