|
|
@@ -155,9 +155,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
@Autowired
|
|
|
private SysCouponCodeService sysCouponCodeService;
|
|
|
@Autowired
|
|
|
- private ActivityUserMapperDao activityUserMapperDao;
|
|
|
- @Autowired
|
|
|
- private CloudTeacherOrderDao cloudTeacherOrderDao;
|
|
|
+ private ActivityUserMapperService activityUserMapperService;
|
|
|
@Autowired
|
|
|
private PracticeGroupService practiceGroupService;
|
|
|
|
|
|
@@ -931,7 +929,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
Boolean giveFlag = vipGroup.getGiveFlag();
|
|
|
List<Integer> studentIdList = Arrays.stream(studentIds.split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
//获取学员排课资格
|
|
|
- List<ActivityUserMapper> activityUserMappers = activityUserMapperDao.findByStudentIdList(activity.getId(),studentIds,giveFlag?"GIVE_VIP":"VIP");
|
|
|
+ List<ActivityUserMapper> activityUserMappers = activityUserMapperService.findByStudentIdList(activity.getId(),studentIds,giveFlag?"GIVE_VIP":"VIP");
|
|
|
if(studentIdList.size() != activityUserMappers.size()){
|
|
|
throw new BizException("所选学员暂无排课资格");
|
|
|
}
|
|
|
@@ -1038,6 +1036,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
vipGroupDao.insert(applyBaseInfo);
|
|
|
|
|
|
+ //消耗排课资格
|
|
|
+ List<Integer> activityUserMapperIds = activityUserMappers.stream().map(e -> e.getId()).collect(Collectors.toList());
|
|
|
+ int use = activityUserMapperService.use(StringUtils.join(activityUserMapperIds), studentIds, giveFlag?"GIVE_VIP":"VIP", applyBaseInfo.getId());
|
|
|
+ if(use != studentIdList.size()){
|
|
|
+ throw new BizException("VIP课创建失败,请联系管理员");
|
|
|
+ }
|
|
|
+
|
|
|
vscps.forEach(e->e.setVipGroupId(applyBaseInfo.getId()));
|
|
|
vipGroupStudentCoursePriceDao.batchInsert(vscps);
|
|
|
|
|
|
@@ -3116,7 +3121,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
|
|
|
}
|
|
|
//退还活动购买
|
|
|
- ActivityUserMapper activityUserMapper = activityUserMapperDao.findByStudentId(vipGroup.getId(),studentId);
|
|
|
+ ActivityUserMapper activityUserMapper = activityUserMapperService.findByStudentId(vipGroup.getId(),studentId);
|
|
|
if(activityUserMapper != null){
|
|
|
HttpResponseResult result = groupClassService.quitActivityGive(activityUserMapper.getId(), returnFeeDto.getConfirmReturnActivityGive(), studentId);
|
|
|
if(result.getCode() != 200){
|
|
|
@@ -3564,7 +3569,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if (studentApplyRefunds.getStatus() == StudentApplyRefundsStatus.DONE) {
|
|
|
//退还活动购买
|
|
|
VipGroup vipGroup = vipGroupDao.get(id);
|
|
|
- ActivityUserMapper activityUserMapper = activityUserMapperDao.findByStudentId(vipGroup.getId(), studentPaymentOrder.getUserId());
|
|
|
+ ActivityUserMapper activityUserMapper = activityUserMapperService.findByStudentId(vipGroup.getId(), studentPaymentOrder.getUserId());
|
|
|
if(activityUserMapper != null){
|
|
|
HttpResponseResult result = groupClassService.quitActivityGive(activityUserMapper.getId(),confirmReturnActivityGive, studentApplyRefunds.getUserId());
|
|
|
if(result.getCode() != 200){
|