|
@@ -512,7 +512,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
if (storeCombination.getStock().equals(0) || detailRequest.getProductNum() > storeCombination.getStock()) {
|
|
if (storeCombination.getStock().equals(0) || detailRequest.getProductNum() > storeCombination.getStock()) {
|
|
throw new ServiceException("拼团商品库存不足");
|
|
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)) {
|
|
if (ObjectUtil.isNull(combinationAttrValue)) {
|
|
throw new ServiceException("拼团商品规格不存在");
|
|
throw new ServiceException("拼团商品规格不存在");
|
|
}
|
|
}
|
|
@@ -551,11 +551,11 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
throw new ServiceException("拼团商品已过期");
|
|
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("拼团商品规格库存不足");
|
|
throw new ServiceException("拼团商品规格库存不足");
|
|
}
|
|
}
|
|
// 普通商品部分判断
|
|
// 普通商品部分判断
|
|
@@ -567,7 +567,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
throw new ServiceException("拼团主商品库存不足");
|
|
throw new ServiceException("拼团主商品库存不足");
|
|
}
|
|
}
|
|
// 主商品sku
|
|
// 主商品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)) {
|
|
if (ObjectUtil.isNull(productAttrValue)) {
|
|
throw new ServiceException("拼团主商品规格不存在");
|
|
throw new ServiceException("拼团主商品规格不存在");
|
|
}
|
|
}
|