This commit is contained in:
wangjinlei
2024-05-31 10:18:14 +08:00
parent a4b26fbade
commit ad2c24564a

View File

@@ -91,6 +91,11 @@ public class CourseCatalogueServiceImpl extends ServiceImpl<CourseCatalogueDao,
if(byId.getFee().compareTo(BigDecimal.ZERO)==0||byId.getHalfFee().compareTo(BigDecimal.ZERO)==0){
return R.error("价格异常");
}
Integer integer = shopProductCourseDao.selectCount(new LambdaQueryWrapper<ShopProductCourseEntity>()
.eq(ShopProductCourseEntity::getCatalogueId, byId.getId()));
if(integer>1){
return R.error("生成失败已存在商品数量大于等于2快捷生成商品不可用");
}
createProduct(byId);
return R.ok();
}