修复一下bug

This commit is contained in:
wangjinlei
2024-04-22 16:10:17 +08:00
parent 311dd6ed70
commit 3cbd29de4b
2 changed files with 6 additions and 3 deletions

View File

@@ -789,7 +789,7 @@ public class BuyOrderController {
*/
private BigDecimal useCouponAmount(BuyOrder buyOrder) {
Integer couponId = buyOrder.getCouponId();
if (couponId != null) {
if (couponId != null&&couponId!=0) {
CouponHistoryEntity couponHistory = couponHistoryService.getById(couponId);
couponHistory.setUseStatus(1);
couponHistory.setUseTime(new Date());

View File

@@ -129,10 +129,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
if(shopProductCourseDao.selectCount(new LambdaQueryWrapper<ShopProductCourseEntity>().eq(ShopProductCourseEntity::getCatalogueId,c.getId()))>0){
continue;
}
CourseEntity one = this.getOne(new LambdaQueryWrapper<CourseEntity>().eq(CourseEntity::getId, c.getCourseId()));
ShopProduct shopProduct = new ShopProduct();
shopProduct.setProductName(c.getTitle()+"."+c.getTitle()+"(半年)");
shopProduct.setProductName(one.getTitle()+"."+c.getTitle()+"(半年)");
shopProduct.setPrice(c.getHalfFee());
shopProduct.setGoodsType("05");
shopProduct.setProductStock(2000);
shopProductDao.insert(shopProduct);
//添加半年期的商品课程对应关系
ShopProductCourseEntity shopProductCourseEntity = new ShopProductCourseEntity();
@@ -144,9 +146,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
//添加一年期商品
ShopProduct shopProduct1 = new ShopProduct();
shopProduct1.setProductName(c.getTitle()+"."+c.getTitle()+"(一年)");
shopProduct1.setProductName(one.getTitle()+"."+c.getTitle()+"(一年)");
shopProduct1.setPrice(c.getFee());
shopProduct1.setGoodsType("05");
shopProduct1.setProductStock(2000);
shopProductDao.insert(shopProduct1);
//添加一年期的商品课程对应关系
ShopProductCourseEntity shopProductCourseEntity1 = new ShopProductCourseEntity();