|
@@ -316,6 +316,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
boolean orderGoodsRs = iOrderGoodsService.save(orderGoods);
|
|
|
boolean canRepeatBuy = false;
|
|
|
validUserBeforeBuy(goods,bo.getUserId());
|
|
|
+ //判断视频/题库商品是否有购买过,服务期是否过期
|
|
|
+ Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
|
|
|
//视频商品安排班级
|
|
|
if (goods.getGoodsType() == 1) {
|
|
|
if (Validator.isNotEmpty(goods.getStudyCount())) {
|
|
@@ -325,8 +327,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
}
|
|
|
|
|
|
Long gradeId = null;
|
|
|
- //判断是否有购买过,服务期是否过期
|
|
|
- Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
|
|
|
//判断是否购买历史班级都过期
|
|
|
canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
|
|
|
if (g.getGoodsInputData() != null) {
|
|
@@ -448,6 +448,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
boolean orderGoodsRs = iOrderGoodsService.save(orderGoods);
|
|
|
boolean canRepeatBuy = false;
|
|
|
validUserBeforeBuy(goods,bo.getUserId());
|
|
|
+ //判断是否有购买过
|
|
|
+ Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
|
|
|
//视频商品安排班级
|
|
|
if (goods.getGoodsType() == 1) {
|
|
|
if (Validator.isNotEmpty(goods.getStudyCount())) {
|
|
@@ -457,8 +459,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
}
|
|
|
|
|
|
Long gradeId = null;
|
|
|
- //判断是否有购买过
|
|
|
- Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
|
|
|
//判断是否购买历史班级都过期
|
|
|
canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
|
|
|
if (g.getGoodsInputData() != null) {
|
|
@@ -625,6 +625,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
|
|
|
boolean canRepeatBuy = false;
|
|
|
validUserBeforeBuy(goods,bo.getUserId());
|
|
|
+ //判断是否有购买过
|
|
|
+ Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
|
|
|
//视频商品安排班级
|
|
|
if (goods.getGoodsType() == 1) {
|
|
|
if (Validator.isNotEmpty(goods.getStudyCount())) {
|
|
@@ -633,8 +635,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
orderGoods.setStudyCount(0L);//没配置则为0
|
|
|
}
|
|
|
Long gradeId = null;
|
|
|
- //判断是否有购买过
|
|
|
- Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
|
|
|
//判断是否购买历史班级都过期
|
|
|
canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
|
|
|
if (g.getGoodsInputData() != null) {
|
|
@@ -768,6 +768,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
|
|
|
boolean canRepeatBuy = false;
|
|
|
validUserBeforeBuy(goods,bo.getUserId());
|
|
|
+ //判断是否有购买过
|
|
|
+ Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
|
|
|
//视频商品安排班级
|
|
|
if (goods.getGoodsType() == 1) {
|
|
|
if (Validator.isNotEmpty(goods.getStudyCount())) {
|
|
@@ -776,8 +778,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
orderGoods.setStudyCount(0L);//没配置则为0
|
|
|
}
|
|
|
Long gradeId = null;
|
|
|
- //判断是否有购买过
|
|
|
- Long oldOrderGoodsId = getHaveBuyGoods(g.getGoodsId(), bo.getUserId());
|
|
|
//判断是否购买历史班级都过期
|
|
|
canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
|
|
|
if (g.getGoodsInputData() != null) {
|
|
@@ -1051,14 +1051,19 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
List<OrderGoodsVo> list1 = iOrderGoodsService.selectList(orderGoodsQueryBo);
|
|
|
for(OrderGoodsVo goodsVo : list1){
|
|
|
if(Validator.isNotEmpty(goodsVo.getServiceEndTime())&&(goodsVo.getServiceEndTime().longValue()>(System.currentTimeMillis()/1000))){
|
|
|
- if(Validator.isNotEmpty(goodsVo.getGradeId())){
|
|
|
- ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
|
|
|
- .eq(ClassGrade::getGradeId, goodsVo.getGradeId()));
|
|
|
- //不存在班级有效期才校验服务期是否过期
|
|
|
- if(Validator.isEmpty(grade.getClassEndTime())){
|
|
|
- throw new CustomException("存在已购买【学习服务期未过期】的商品,不可以重复购买商品", 511);
|
|
|
+ if(goodsVo.getGoodsType()==1){
|
|
|
+ if(Validator.isNotEmpty(goodsVo.getGradeId())){
|
|
|
+ ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
|
|
|
+ .eq(ClassGrade::getGradeId, goodsVo.getGradeId()));
|
|
|
+ //不存在班级有效期才校验服务期是否过期
|
|
|
+ if(Validator.isEmpty(grade.getClassEndTime())){
|
|
|
+ throw new CustomException("存在已购买【学习服务期未过期】的视频商品,不可以重复购买商品", 511);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ if(goodsVo.getGoodsType()==2){
|
|
|
+ throw new CustomException("存在已购买【学习服务期未过期】的题库商品,不可以重复购买商品", 511);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (list1 != null && list1.size() > 0) {
|