修复一下bug
This commit is contained in:
@@ -789,7 +789,7 @@ public class BuyOrderController {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal useCouponAmount(BuyOrder buyOrder) {
|
private BigDecimal useCouponAmount(BuyOrder buyOrder) {
|
||||||
Integer couponId = buyOrder.getCouponId();
|
Integer couponId = buyOrder.getCouponId();
|
||||||
if (couponId != null) {
|
if (couponId != null&&couponId!=0) {
|
||||||
CouponHistoryEntity couponHistory = couponHistoryService.getById(couponId);
|
CouponHistoryEntity couponHistory = couponHistoryService.getById(couponId);
|
||||||
couponHistory.setUseStatus(1);
|
couponHistory.setUseStatus(1);
|
||||||
couponHistory.setUseTime(new Date());
|
couponHistory.setUseTime(new Date());
|
||||||
|
|||||||
@@ -129,10 +129,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
if(shopProductCourseDao.selectCount(new LambdaQueryWrapper<ShopProductCourseEntity>().eq(ShopProductCourseEntity::getCatalogueId,c.getId()))>0){
|
if(shopProductCourseDao.selectCount(new LambdaQueryWrapper<ShopProductCourseEntity>().eq(ShopProductCourseEntity::getCatalogueId,c.getId()))>0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
CourseEntity one = this.getOne(new LambdaQueryWrapper<CourseEntity>().eq(CourseEntity::getId, c.getCourseId()));
|
||||||
ShopProduct shopProduct = new ShopProduct();
|
ShopProduct shopProduct = new ShopProduct();
|
||||||
shopProduct.setProductName(c.getTitle()+"."+c.getTitle()+"(半年)");
|
shopProduct.setProductName(one.getTitle()+"."+c.getTitle()+"(半年)");
|
||||||
shopProduct.setPrice(c.getHalfFee());
|
shopProduct.setPrice(c.getHalfFee());
|
||||||
shopProduct.setGoodsType("05");
|
shopProduct.setGoodsType("05");
|
||||||
|
shopProduct.setProductStock(2000);
|
||||||
shopProductDao.insert(shopProduct);
|
shopProductDao.insert(shopProduct);
|
||||||
//添加半年期的商品课程对应关系
|
//添加半年期的商品课程对应关系
|
||||||
ShopProductCourseEntity shopProductCourseEntity = new ShopProductCourseEntity();
|
ShopProductCourseEntity shopProductCourseEntity = new ShopProductCourseEntity();
|
||||||
@@ -144,9 +146,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
|
|
||||||
//添加一年期商品
|
//添加一年期商品
|
||||||
ShopProduct shopProduct1 = new ShopProduct();
|
ShopProduct shopProduct1 = new ShopProduct();
|
||||||
shopProduct1.setProductName(c.getTitle()+"."+c.getTitle()+"(一年)");
|
shopProduct1.setProductName(one.getTitle()+"."+c.getTitle()+"(一年)");
|
||||||
shopProduct1.setPrice(c.getFee());
|
shopProduct1.setPrice(c.getFee());
|
||||||
shopProduct1.setGoodsType("05");
|
shopProduct1.setGoodsType("05");
|
||||||
|
shopProduct1.setProductStock(2000);
|
||||||
shopProductDao.insert(shopProduct1);
|
shopProductDao.insert(shopProduct1);
|
||||||
//添加一年期的商品课程对应关系
|
//添加一年期的商品课程对应关系
|
||||||
ShopProductCourseEntity shopProductCourseEntity1 = new ShopProductCourseEntity();
|
ShopProductCourseEntity shopProductCourseEntity1 = new ShopProductCourseEntity();
|
||||||
|
|||||||
Reference in New Issue
Block a user