|
@@ -9,6 +9,7 @@ import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
import com.zhongzheng.modules.bank.mapper.QuestionMapper;
|
|
import com.zhongzheng.modules.bank.mapper.QuestionMapper;
|
|
|
|
+import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
|
|
import com.zhongzheng.modules.course.domain.CourseModule;
|
|
import com.zhongzheng.modules.course.domain.CourseModule;
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
import com.zhongzheng.modules.course.vo.CourseVo;
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
@@ -38,6 +39,7 @@ import com.zhongzheng.modules.user.domain.User;
|
|
import com.zhongzheng.modules.user.service.IUserExamGoodsService;
|
|
import com.zhongzheng.modules.user.service.IUserExamGoodsService;
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
import com.zhongzheng.modules.user.service.IUserStudyRecordService;
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserSubscribeService;
|
|
import io.swagger.models.auth.In;
|
|
import io.swagger.models.auth.In;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -90,6 +92,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
@Autowired
|
|
@Autowired
|
|
private IUserService iUserService;
|
|
private IUserService iUserService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserSubscribeService iUserSubscribeService;
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public OrderGoodsVo queryById(Long orderGoodsId) {
|
|
public OrderGoodsVo queryById(Long orderGoodsId) {
|
|
@@ -161,6 +166,12 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
if(bo.getStatus()==0){
|
|
if(bo.getStatus()==0){
|
|
GoodsVo goodsVo = iGoodsService.selectDetail(orderGoods.getGoodsId());
|
|
GoodsVo goodsVo = iGoodsService.selectDetail(orderGoods.getGoodsId());
|
|
if(goodsVo.getGoodsType()==1){
|
|
if(goodsVo.getGoodsType()==1){
|
|
|
|
+ ConsoleQueryBo consoleQueryBo = new ConsoleQueryBo();
|
|
|
|
+ consoleQueryBo.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
|
|
+ Integer usNum = iUserSubscribeService.getConsoleTestSubscribeNum(consoleQueryBo);
|
|
|
|
+ if(usNum>0){
|
|
|
|
+ throw new CustomException("已预约了考试,不符合关闭条件");
|
|
|
|
+ }
|
|
//视频商品
|
|
//视频商品
|
|
LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
objectLambdaUpdateWrapper.eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId());
|
|
objectLambdaUpdateWrapper.eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId());
|
|
@@ -179,7 +190,7 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
UserExamGoodsQueryBo examGoodsQueryBo = new UserExamGoodsQueryBo();
|
|
UserExamGoodsQueryBo examGoodsQueryBo = new UserExamGoodsQueryBo();
|
|
examGoodsQueryBo.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
examGoodsQueryBo.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
if(!iUserExamGoodsService.canRefund(examGoodsQueryBo)){
|
|
if(!iUserExamGoodsService.canRefund(examGoodsQueryBo)){
|
|
- throw new CustomException("补考次数/前培次数已经被使用,不符号关闭条件");
|
|
|
|
|
|
+ throw new CustomException("补考次数/前培次数已经被使用,不符合关闭条件");
|
|
}
|
|
}
|
|
//减去考试和前培次数
|
|
//减去考试和前培次数
|
|
UserExamGoodsQueryBo examGoodsQueryBo1 = new UserExamGoodsQueryBo();
|
|
UserExamGoodsQueryBo examGoodsQueryBo1 = new UserExamGoodsQueryBo();
|