|
|
@@ -292,6 +292,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())) {
|
|
|
@@ -301,8 +303,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) {
|
|
|
@@ -424,6 +424,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())) {
|
|
|
@@ -433,8 +435,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) {
|
|
|
@@ -601,6 +601,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())) {
|
|
|
@@ -609,8 +611,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) {
|
|
|
@@ -744,6 +744,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())) {
|
|
|
@@ -752,8 +754,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) {
|
|
|
@@ -1022,14 +1022,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) {
|