|
@@ -2395,41 +2395,27 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
if (ObjectUtil.isNull(examApply)){
|
|
if (ObjectUtil.isNull(examApply)){
|
|
throw new CustomException("考场信息查询不到!请检查");
|
|
throw new CustomException("考场信息查询不到!请检查");
|
|
}
|
|
}
|
|
- List<Long> goodsIds = iExamApplyService.getApplyGoodsId(examApply.getApplyId(),bo.getMajorName());
|
|
|
|
- if (CollectionUtils.isEmpty(goodsIds)){
|
|
|
|
- throw new CustomException("该专业下找不到考试对应的课程!请检查");
|
|
|
|
- }
|
|
|
|
|
|
|
|
//是否存在订单
|
|
//是否存在订单
|
|
- List<OrderGoods> orderGoodsList = iOrderGoodsService.getApplyOrderGoods(goodsIds,user.getUserId());
|
|
|
|
- if (CollectionUtils.isEmpty(orderGoodsList)){
|
|
|
|
- throw new CustomException("当前学员没有购买该专业下的课程!请检查");
|
|
|
|
- }
|
|
|
|
- OrderGoods applyOrder = null;
|
|
|
|
- for (OrderGoods orderGoods : orderGoodsList) {
|
|
|
|
- ClassGradeUser gradeUser = iClassGradeUserService
|
|
|
|
- .getOne(new LambdaQueryWrapper<ClassGradeUser>()
|
|
|
|
- .eq(ClassGradeUser::getUserId, user.getUserId())
|
|
|
|
- .eq(ClassGradeUser::getGradeId, orderGoods.getGradeId())
|
|
|
|
- .eq(ClassGradeUser::getOrderGoodsId, orderGoods.getOrderGoodsId())
|
|
|
|
- .last("limit 1"));
|
|
|
|
- if (ObjectUtil.isNotNull(gradeUser)){
|
|
|
|
- //学时是否通过审核
|
|
|
|
- if (ObjectUtils.isNotNull(gradeUser.getPeriodStatus()) && gradeUser.getPeriodStatus() == 1){
|
|
|
|
- applyOrder = orderGoods;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(Validator.isEmpty(applyOrder)){
|
|
|
|
|
|
+ OrderGoods orderGoods = iOrderGoodsService.getById(bo.getOrderGoodsId());
|
|
|
|
+
|
|
|
|
+ //学时是否通过审核
|
|
|
|
+ ClassGradeUser gradeUser = iClassGradeUserService
|
|
|
|
+ .getOne(new LambdaQueryWrapper<ClassGradeUser>()
|
|
|
|
+ .eq(ClassGradeUser::getUserId, user.getUserId())
|
|
|
|
+ .eq(ClassGradeUser::getGradeId, orderGoods.getGradeId())
|
|
|
|
+ .eq(ClassGradeUser::getOrderGoodsId, orderGoods.getOrderGoodsId())
|
|
|
|
+ .ge(ClassGradeUser::getPeriodStatus,1)
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ if (ObjectUtil.isNull(gradeUser)){
|
|
throw new CustomException("该学员未学完,不能预约考试!");
|
|
throw new CustomException("该学员未学完,不能预约考试!");
|
|
}
|
|
}
|
|
|
|
|
|
//查询是否已预约考试
|
|
//查询是否已预约考试
|
|
ExamApplyQueryBo queryBo = new ExamApplyQueryBo();
|
|
ExamApplyQueryBo queryBo = new ExamApplyQueryBo();
|
|
queryBo.setUserId(user.getUserId());
|
|
queryBo.setUserId(user.getUserId());
|
|
- queryBo.setGoodsId(applyOrder.getGoodsId());
|
|
|
|
- queryBo.setOrderGoodsId(applyOrder.getOrderGoodsId());
|
|
|
|
|
|
+ queryBo.setGoodsId(orderGoods.getGoodsId());
|
|
|
|
+ queryBo.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
Integer countHaveSubscribe = examApplyMapper.countHaveSubscribe(queryBo);
|
|
Integer countHaveSubscribe = examApplyMapper.countHaveSubscribe(queryBo);
|
|
if (countHaveSubscribe > 0) {
|
|
if (countHaveSubscribe > 0) {
|
|
throw new CustomException("您所报考的专业,已经预约成功,您可在“我的-我的考试预约”中查询详情");
|
|
throw new CustomException("您所报考的专业,已经预约成功,您可在“我的-我的考试预约”中查询详情");
|
|
@@ -2474,8 +2460,8 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
|
|
|
//考场信息
|
|
//考场信息
|
|
UserSubscribe add = new UserSubscribe();
|
|
UserSubscribe add = new UserSubscribe();
|
|
- add.setOrderGoodsId(applyOrder.getOrderGoodsId());
|
|
|
|
- add.setGoodsId(applyOrder.getGoodsId());
|
|
|
|
|
|
+ add.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
|
|
+ add.setGoodsId(orderGoods.getGoodsId());
|
|
add.setUserId(user.getUserId());
|
|
add.setUserId(user.getUserId());
|
|
add.setSeatNumber(tNum.toString());
|
|
add.setSeatNumber(tNum.toString());
|
|
add.setApplyId(examApply.getApplyId());
|
|
add.setApplyId(examApply.getApplyId());
|
|
@@ -2512,41 +2498,27 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
if (ObjectUtil.isNull(examApply)){
|
|
if (ObjectUtil.isNull(examApply)){
|
|
throw new CustomException("考场信息查询不到!请检查");
|
|
throw new CustomException("考场信息查询不到!请检查");
|
|
}
|
|
}
|
|
- List<Long> goodsIds = iExamApplyService.getApplyGoodsId(examApply.getApplyId(),bo.getMajorName());
|
|
|
|
- if (CollectionUtils.isEmpty(goodsIds)){
|
|
|
|
- throw new CustomException("该专业下找不到考试对应的课程!请检查");
|
|
|
|
- }
|
|
|
|
|
|
|
|
//是否存在订单
|
|
//是否存在订单
|
|
- List<OrderGoods> orderGoodsList = iOrderGoodsService.getApplyOrderGoods(goodsIds,user.getUserId());
|
|
|
|
- if (CollectionUtils.isEmpty(orderGoodsList)){
|
|
|
|
- throw new CustomException("当前学员没有购买该专业下的课程!请检查");
|
|
|
|
- }
|
|
|
|
- OrderGoods applyOrder = null;
|
|
|
|
- for (OrderGoods orderGoods : orderGoodsList) {
|
|
|
|
- ClassGradeUser gradeUser = iClassGradeUserService
|
|
|
|
- .getOne(new LambdaQueryWrapper<ClassGradeUser>()
|
|
|
|
- .eq(ClassGradeUser::getUserId, user.getUserId())
|
|
|
|
- .eq(ClassGradeUser::getGradeId, orderGoods.getGradeId())
|
|
|
|
- .eq(ClassGradeUser::getOrderGoodsId, orderGoods.getOrderGoodsId())
|
|
|
|
- .last("limit 1"));
|
|
|
|
- if (ObjectUtil.isNotNull(gradeUser)){
|
|
|
|
- //学时是否通过审核
|
|
|
|
- if (ObjectUtils.isNotNull(gradeUser.getPeriodStatus()) && gradeUser.getPeriodStatus() == 1){
|
|
|
|
- applyOrder = orderGoods;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(Validator.isEmpty(applyOrder)){
|
|
|
|
|
|
+ OrderGoods orderGoods = iOrderGoodsService.getById(bo.getOrderGoodsId());
|
|
|
|
+
|
|
|
|
+ //学时是否通过审核
|
|
|
|
+ ClassGradeUser gradeUser = iClassGradeUserService
|
|
|
|
+ .getOne(new LambdaQueryWrapper<ClassGradeUser>()
|
|
|
|
+ .eq(ClassGradeUser::getUserId, user.getUserId())
|
|
|
|
+ .eq(ClassGradeUser::getGradeId, orderGoods.getGradeId())
|
|
|
|
+ .eq(ClassGradeUser::getOrderGoodsId, orderGoods.getOrderGoodsId())
|
|
|
|
+ .ge(ClassGradeUser::getPeriodStatus,1)
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ if (ObjectUtil.isNull(gradeUser)){
|
|
throw new CustomException("该学员未预约考试!");
|
|
throw new CustomException("该学员未预约考试!");
|
|
}
|
|
}
|
|
|
|
|
|
//查询是否已预约考试
|
|
//查询是否已预约考试
|
|
ExamApplyQueryBo queryBo = new ExamApplyQueryBo();
|
|
ExamApplyQueryBo queryBo = new ExamApplyQueryBo();
|
|
queryBo.setUserId(user.getUserId());
|
|
queryBo.setUserId(user.getUserId());
|
|
- queryBo.setGoodsId(applyOrder.getGoodsId());
|
|
|
|
- queryBo.setOrderGoodsId(applyOrder.getOrderGoodsId());
|
|
|
|
|
|
+ queryBo.setGoodsId(orderGoods.getGoodsId());
|
|
|
|
+ queryBo.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
UserSubscribe subscribe = examApplyMapper.getHaveSubscribe(queryBo);
|
|
UserSubscribe subscribe = examApplyMapper.getHaveSubscribe(queryBo);
|
|
if (ObjectUtils.isNull(subscribe)) {
|
|
if (ObjectUtils.isNull(subscribe)) {
|
|
throw new CustomException("该学员未预约考试,请检查数据!");
|
|
throw new CustomException("该学员未预约考试,请检查数据!");
|