|
|
@@ -47,9 +47,6 @@ import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.ym.mec.biz.dal.enums.GroupType.VIP;
|
|
|
-import static com.ym.mec.biz.dal.enums.PeriodEnum.QUARTERLY;
|
|
|
-import static jdk.nashorn.internal.parser.DateParser.DAY;
|
|
|
-import static jdk.nashorn.internal.parser.DateParser.MONTH;
|
|
|
|
|
|
@Service
|
|
|
public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> implements VipGroupService {
|
|
|
@@ -2720,10 +2717,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
List<CourseSchedule> courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(),CourseSchedule.class);
|
|
|
courseScheduleService.checkNewCourseSchedules(courseSchedules,false,false);
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder=sysCouponCodeService.use(vipGroupBuyParams.getCouponIdList(),vipGroup.getTotalPrice(),true);
|
|
|
+ StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(vipGroupBuyParams.getCouponIdList(),vipGroup.getTotalPrice(),true);
|
|
|
studentPaymentOrder.setUserId(user.getId());
|
|
|
studentPaymentOrder.setGroupType(GroupType.VIP);
|
|
|
- String orderNo=idGeneratorService.generatorId("payment") + "";
|
|
|
+ String orderNo = idGeneratorService.generatorId("payment") + "";
|
|
|
studentPaymentOrder.setOrderNo(orderNo);
|
|
|
studentPaymentOrder.setStatus(DealStatusEnum.ING);
|
|
|
studentPaymentOrder.setType(OrderTypeEnum.SMALL_CLASS_TO_BUY);
|
|
|
@@ -2732,6 +2729,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
studentPaymentOrder.setClassGroupId(classGroup.getId());
|
|
|
studentPaymentOrder.setOrganId(vipGroup.getOrganId());
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
+ studentPaymentOrder.setActivityId(vipGroup.getVipGroupActivityId());
|
|
|
studentPaymentOrderDao.insert(studentPaymentOrder);
|
|
|
|
|
|
BigDecimal amount=studentPaymentOrder.getActualAmount();
|
|
|
@@ -2863,7 +2861,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
VipGroup vipGroup = vipGroupDao.get(vipGroupId);
|
|
|
try {
|
|
|
Integer activityUserMapperId = studentPaymentOrderService.activityGive(vipGroup.getVipGroupActivityId(), userId, studentPaymentOrder.getId(), vipGroupId, null);
|
|
|
- vipGroup.setActivityUserMapperId(activityUserMapperId);
|
|
|
if(classGroup.getDelFlag() == 1){
|
|
|
updateVipGroupStudentNumAndStatus(vipGroupId, classGroup,0,true);
|
|
|
}
|
|
|
@@ -3064,9 +3061,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
|
|
|
}
|
|
|
//退还活动购买
|
|
|
- HttpResponseResult result = groupClassService.quitActivityGive(vipGroup.getActivityUserMapperId(), returnFeeDto.getConfirmReturnActivityGive(), studentId);
|
|
|
- if(result.getCode() != 200){
|
|
|
- return result;
|
|
|
+ ActivityUserMapper activityUserMapper = activityUserMapperDao.findByStudentId(vipGroup.getId(),studentId);
|
|
|
+ if(activityUserMapper != null){
|
|
|
+ HttpResponseResult result = groupClassService.quitActivityGive(activityUserMapper.getId(), returnFeeDto.getConfirmReturnActivityGive(), studentId);
|
|
|
+ if(result.getCode() != 200){
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
sysUserCashAccountService.updateBalance(studentId, amount);
|
|
|
@@ -3509,9 +3509,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if (studentApplyRefunds.getStatus() == StudentApplyRefundsStatus.DONE) {
|
|
|
//退还活动购买
|
|
|
VipGroup vipGroup = vipGroupDao.get(id);
|
|
|
- HttpResponseResult result = groupClassService.quitActivityGive(vipGroup.getActivityUserMapperId(),confirmReturnActivityGive, studentApplyRefunds.getUserId());
|
|
|
- if(result.getCode() != 200){
|
|
|
- return result;
|
|
|
+ ActivityUserMapper activityUserMapper = activityUserMapperDao.findByStudentId(vipGroup.getId(), studentPaymentOrder.getUserId());
|
|
|
+ if(activityUserMapper != null){
|
|
|
+ HttpResponseResult result = groupClassService.quitActivityGive(activityUserMapper.getId(),confirmReturnActivityGive, studentApplyRefunds.getUserId());
|
|
|
+ if(result.getCode() != 200){
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
studentApplyRefunds.setActualAmount(amount);
|
|
|
}else{
|