|
@@ -88,9 +88,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IOrderGoodsService iOrderGoodsService;
|
|
private IOrderGoodsService iOrderGoodsService;
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private IOrderBusinessService iOrderBusinessService;
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IGoodsService iGoodsService;
|
|
private IGoodsService iGoodsService;
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -102,8 +99,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IClassGradeGoodsService iClassGradeGoodsService;
|
|
private IClassGradeGoodsService iClassGradeGoodsService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private IGoodsCourseService iGoodsCourseService;
|
|
|
|
|
- @Autowired
|
|
|
|
|
private IOrderBillSheetService iOrderBillSheetService;
|
|
private IOrderBillSheetService iOrderBillSheetService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ICourseMenuService iCourseMenuService;
|
|
private ICourseMenuService iCourseMenuService;
|
|
@@ -143,8 +138,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisCache redisCache;
|
|
private RedisCache redisCache;
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private IUserMockSubscribeService iUserMockSubscribeService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ICourseEducationTypeService courseEducationTypeService;
|
|
private ICourseEducationTypeService courseEducationTypeService;
|
|
@@ -1483,6 +1476,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
lqwLock.eq(ClassGradeUserTemp::getGradeId, gradeId);
|
|
lqwLock.eq(ClassGradeUserTemp::getGradeId, gradeId);
|
|
|
lqwLock.eq(ClassGradeUserTemp::getStatus, 1);
|
|
lqwLock.eq(ClassGradeUserTemp::getStatus, 1);
|
|
|
int locakStudentNum = iClassGradeUserTempService.count(lqwLock);
|
|
int locakStudentNum = iClassGradeUserTempService.count(lqwLock);
|
|
|
|
|
+
|
|
|
//预留0空位避免超人数
|
|
//预留0空位避免超人数
|
|
|
if ((classGradeVo.getStudentUpper() - studentNum - locakStudentNum) > 0) {
|
|
if ((classGradeVo.getStudentUpper() - studentNum - locakStudentNum) > 0) {
|
|
|
ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId, gradeId)
|
|
ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId, gradeId)
|
|
@@ -1490,7 +1484,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
//不在此班级内
|
|
//不在此班级内
|
|
|
if(Validator.isEmpty(gradeUser)){
|
|
if(Validator.isEmpty(gradeUser)){
|
|
|
//班级还有剩位,直接锁定班级
|
|
//班级还有剩位,直接锁定班级
|
|
|
- return lockGrade(orderGoodsId, gradeId, userId, goodsId, orderSn);
|
|
|
|
|
|
|
+ if(iClassGradeService.checkEjjjPeopleNumLimit(businessId,gradeId)){ //判断全系统平台二建班级人数是否超300
|
|
|
|
|
+ return lockGrade(orderGoodsId, gradeId, userId, goodsId, orderSn);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1516,7 +1513,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
.eq(ClassGradeUser::getUserId, userId));
|
|
.eq(ClassGradeUser::getUserId, userId));
|
|
|
//不在此班级内
|
|
//不在此班级内
|
|
|
if(Validator.isEmpty(gradeUser)){
|
|
if(Validator.isEmpty(gradeUser)){
|
|
|
- return lockGrade(orderGoodsId, gradeId, userId, goodsId, orderSn);
|
|
|
|
|
|
|
+ if(iClassGradeService.checkEjjjPeopleNumLimit(businessId,gradeId)){ //判断全系统平台二建班级人数是否超300
|
|
|
|
|
+ return lockGrade(orderGoodsId, gradeId, userId, goodsId, orderSn);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1621,8 +1620,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
//预留0空位避免超人数
|
|
//预留0空位避免超人数
|
|
|
if ((classGradeVo.getStudentUpper() - studentNum - locakStudentNum) > 0) {
|
|
if ((classGradeVo.getStudentUpper() - studentNum - locakStudentNum) > 0) {
|
|
|
//班级还有剩位,直接加入班级
|
|
//班级还有剩位,直接加入班级
|
|
|
- joinGrade(orderGoodsId, gradeId, userId);
|
|
|
|
|
- return gradeId;
|
|
|
|
|
|
|
+ if(iClassGradeService.checkEjjjPeopleNumLimit(businessId,gradeId)) { //判断全系统平台二建班级人数是否超300
|
|
|
|
|
+ joinGrade(orderGoodsId, gradeId, userId);
|
|
|
|
|
+ return gradeId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1647,8 +1649,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,userId).eq(ClassGradeUser::getGradeId,gradeId).last("limit 1"));
|
|
ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,userId).eq(ClassGradeUser::getGradeId,gradeId).last("limit 1"));
|
|
|
if(Validator.isEmpty(gradeUser)){
|
|
if(Validator.isEmpty(gradeUser)){
|
|
|
//班级还有剩位,直接加入班级
|
|
//班级还有剩位,直接加入班级
|
|
|
- joinGrade(orderGoodsId, gradeId, userId);
|
|
|
|
|
- return gradeId;
|
|
|
|
|
|
|
+ if(iClassGradeService.checkEjjjPeopleNumLimit(businessId,gradeId)) { //判断全系统平台二建班级人数是否超300
|
|
|
|
|
+ joinGrade(orderGoodsId, gradeId, userId);
|
|
|
|
|
+ return gradeId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1723,8 +1728,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
//预留0空位避免超人数
|
|
//预留0空位避免超人数
|
|
|
if ((classGradeVo.getStudentUpper() - studentNum - locakStudentNum) > 0) {
|
|
if ((classGradeVo.getStudentUpper() - studentNum - locakStudentNum) > 0) {
|
|
|
//班级还有剩位,直接加入班级
|
|
//班级还有剩位,直接加入班级
|
|
|
- joinGrade(orderGoodsId, gradeId, userId);
|
|
|
|
|
- return gradeId;
|
|
|
|
|
|
|
+ Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, goodsId));
|
|
|
|
|
+ if(iClassGradeService.checkEjjjPeopleNumLimit(goods.getBusinessId(),gradeId)) { //判断全系统平台二建班级人数是否超300
|
|
|
|
|
+ joinGrade(orderGoodsId, gradeId, userId);
|
|
|
|
|
+ return gradeId;
|
|
|
|
|
+ }else {
|
|
|
|
|
+ throw new CustomException("该二建班级学员已满,请重新选班");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
throw new CustomException("该班级学员已满,请重新选班");
|
|
throw new CustomException("该班级学员已满,请重新选班");
|
|
|
}
|
|
}
|