Commit d97ba8d4d8fdc095c9a41290f33a83875165c515
1 parent
8d4cc35c
【缺陷修复】商城:活动的库存校验,从 > 改成 >=
Showing
3 changed files
with
3 additions
and
3 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java
| ... | ... | @@ -131,7 +131,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 131 | 131 | throw exception(COMBINATION_JOIN_ACTIVITY_PRODUCT_NOT_EXISTS); |
| 132 | 132 | } |
| 133 | 133 | // 4.3 校验库存是否充足 |
| 134 | - if (count > sku.getStock()) { | |
| 134 | + if (count >= sku.getStock()) { | |
| 135 | 135 | throw exception(COMBINATION_ACTIVITY_UPDATE_STOCK_FAIL); |
| 136 | 136 | } |
| 137 | 137 | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/point/PointActivityServiceImpl.java
| ... | ... | @@ -300,7 +300,7 @@ public class PointActivityServiceImpl implements PointActivityService { |
| 300 | 300 | throw exception(POINT_ACTIVITY_JOIN_ACTIVITY_SINGLE_LIMIT_COUNT_EXCEED); |
| 301 | 301 | } |
| 302 | 302 | // 2.2 校验库存是否充足 |
| 303 | - if (count > product.getStock()) { | |
| 303 | + if (count >= product.getStock()) { | |
| 304 | 304 | throw exception(POINT_ACTIVITY_UPDATE_STOCK_FAIL); |
| 305 | 305 | } |
| 306 | 306 | return BeanUtils.toBean(product, PointValidateJoinRespDTO.class); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/seckill/SeckillActivityServiceImpl.java
| ... | ... | @@ -317,7 +317,7 @@ public class SeckillActivityServiceImpl implements SeckillActivityService { |
| 317 | 317 | throw exception(SECKILL_JOIN_ACTIVITY_PRODUCT_NOT_EXISTS); |
| 318 | 318 | } |
| 319 | 319 | // 2.2 校验库存是否充足 |
| 320 | - if (count > product.getStock()) { | |
| 320 | + if (count >= product.getStock()) { | |
| 321 | 321 | throw exception(SECKILL_ACTIVITY_UPDATE_STOCK_FAIL); |
| 322 | 322 | } |
| 323 | 323 | return SeckillActivityConvert.INSTANCE.convert02(activity, product); | ... | ... |