【缺陷修复】商城:活动的库存校验,从 > 改成 >=

This commit is contained in:
YunaiV 2024-11-01 21:22:23 +08:00
parent 8d4cc35cde
commit d97ba8d4d8
3 changed files with 3 additions and 3 deletions

View File

@ -131,7 +131,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
throw exception(COMBINATION_JOIN_ACTIVITY_PRODUCT_NOT_EXISTS);
}
// 4.3 校验库存是否充足
if (count > sku.getStock()) {
if (count >= sku.getStock()) {
throw exception(COMBINATION_ACTIVITY_UPDATE_STOCK_FAIL);
}

View File

@ -300,7 +300,7 @@ public class PointActivityServiceImpl implements PointActivityService {
throw exception(POINT_ACTIVITY_JOIN_ACTIVITY_SINGLE_LIMIT_COUNT_EXCEED);
}
// 2.2 校验库存是否充足
if (count > product.getStock()) {
if (count >= product.getStock()) {
throw exception(POINT_ACTIVITY_UPDATE_STOCK_FAIL);
}
return BeanUtils.toBean(product, PointValidateJoinRespDTO.class);

View File

@ -317,7 +317,7 @@ public class SeckillActivityServiceImpl implements SeckillActivityService {
throw exception(SECKILL_JOIN_ACTIVITY_PRODUCT_NOT_EXISTS);
}
// 2.2 校验库存是否充足
if (count > product.getStock()) {
if (count >= product.getStock()) {
throw exception(SECKILL_ACTIVITY_UPDATE_STOCK_FAIL);
}
return SeckillActivityConvert.INSTANCE.convert02(activity, product);