zouxuan 4 лет назад
Родитель
Сommit
f50590693f

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -405,4 +405,13 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * 标记进行中乐团在读学员+VIP、网管有课的学员
      */
     void remarkCountFlag();
+
+    /**
+    * @description: 更新会员信息
+     * @param student
+    * @return void
+    * @author zx
+    * @date 2021/10/13 13:34
+    */
+    void updateStudentMember(@Param("student") Student student);
 }

+ 63 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ReturnFeeDto.java

@@ -0,0 +1,63 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.GroupType;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+public class ReturnFeeDto {
+
+    @ApiModelProperty(value = "课程组编号",required = false)
+    private Long groupId;
+
+    @ApiModelProperty(value = "退费学员",required = false)
+    private Integer studentId;
+
+    @ApiModelProperty(value = "退费金额",required = false)
+    private BigDecimal amount;
+
+    @ApiModelProperty(value = "是否确认退还活动赠送",required = false)
+    private Boolean confirmReturnActivityGive = false;
+
+    private GroupType groupType;
+
+    public GroupType getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(GroupType groupType) {
+        this.groupType = groupType;
+    }
+
+    public Long getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Long groupId) {
+        this.groupId = groupId;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Boolean getConfirmReturnActivityGive() {
+        return confirmReturnActivityGive;
+    }
+
+    public void setConfirmReturnActivityGive(Boolean confirmReturnActivityGive) {
+        this.confirmReturnActivityGive = confirmReturnActivityGive;
+    }
+}

+ 52 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ActivityUserMapper.java

@@ -28,15 +28,27 @@ public class ActivityUserMapper {
 	/**  */
 	private Integer givePracticeFlag = 0;
 
+	/**  */
+	private Integer memberFlag = 0;
+
+	/**  */
+	private Integer giveMemberFlag = 0;
+
 	private Long paymentOrderId;
 
 	private Long vipGroupId;
 
 	private Long giveVipGroupId;
 
+	private Long memberOrderId;
+
+	private Long giveMemberOrderId;
+
 	private Long practiceGroupId;
 
 	private Long givePracticeGroupId;
+
+	private Boolean returnFee = false;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -44,6 +56,46 @@ public class ActivityUserMapper {
 	/**  */
 	private java.util.Date updateTime;
 
+	public Long getMemberOrderId() {
+		return memberOrderId;
+	}
+
+	public void setMemberOrderId(Long memberOrderId) {
+		this.memberOrderId = memberOrderId;
+	}
+
+	public Long getGiveMemberOrderId() {
+		return giveMemberOrderId;
+	}
+
+	public void setGiveMemberOrderId(Long giveMemberOrderId) {
+		this.giveMemberOrderId = giveMemberOrderId;
+	}
+
+	public Integer getMemberFlag() {
+		return memberFlag;
+	}
+
+	public void setMemberFlag(Integer memberFlag) {
+		this.memberFlag = memberFlag;
+	}
+
+	public Integer getGiveMemberFlag() {
+		return giveMemberFlag;
+	}
+
+	public void setGiveMemberFlag(Integer giveMemberFlag) {
+		this.giveMemberFlag = giveMemberFlag;
+	}
+
+	public Boolean getReturnFee() {
+		return returnFee;
+	}
+
+	public void setReturnFee(Boolean returnFee) {
+		this.returnFee = returnFee;
+	}
+
 	public Long getVipGroupId() {
 		return vipGroupId;
 	}

+ 13 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/GroupClassService.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dto.ReturnFeeDto;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.common.entity.HttpResponseResult;
 
 import java.math.BigDecimal;
 
@@ -59,6 +61,16 @@ public interface GroupClassService {
      * @param refundAmount: 退款金额
      * @return void
      */
-    void cancelGroup(Long groupId, GroupType groupType, BigDecimal refundAmount);
+    HttpResponseResult cancelGroup(ReturnFeeDto returnFeeDto);
 
+    /**
+    * @description: 退还活动相关赠送
+     * @param activityUserMapperId
+     * @param confirmReturnActivityGive
+     * @param studentId
+    * @return com.ym.mec.common.entity.HttpResponseResult
+    * @author zx
+    * @date 2021/10/13 13:59
+    */
+    HttpResponseResult quitActivityGive(Integer activityUserMapperId,Boolean confirmReturnActivityGive,Integer studentId);
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java

@@ -131,6 +131,15 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	PageInfo<PracticeGroupDto> findPracticeGroups(PracticeGroupQueryInfo queryInfo);
 
 	/**
+	 * @description: 获取学员可购买的网管课列表
+	 * @param params
+	 * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipGroupShowListDto>
+	 * @author zx
+	 * @date 2021/10/12 14:56
+	 */
+	List<StudentVipGroupShowListDto> findPracticeGroups(Map<String, Object> params);
+
+	/**
 	 * 获取陪练课课程计划
 	 * @param queryInfo
 	 * @return

+ 3 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java

@@ -5,18 +5,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
-import com.ym.mec.biz.dal.dto.StudentRecoverInfoDto;
-import com.ym.mec.biz.dal.dto.StudentVipGroupDetailDto;
-import com.ym.mec.biz.dal.dto.TeacherBasicDto;
-import com.ym.mec.biz.dal.dto.TeachingRecordBaseInfo;
-import com.ym.mec.biz.dal.dto.VipBuyResultDto;
-import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
-import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
-import com.ym.mec.biz.dal.dto.VipGroupBuyParamsDto;
-import com.ym.mec.biz.dal.dto.VipGroupCostCountDto;
-import com.ym.mec.biz.dal.dto.VipGroupCostCountParamsDto;
-import com.ym.mec.biz.dal.dto.VipGroupManageDetailDto;
-import com.ym.mec.biz.dal.dto.VipGroupPayInfoDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
@@ -309,7 +298,7 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
      * @param studentId: 学生编号
      * @return void
      */
-    void applyRefundForStudent(Long vipGroupId, Integer studentId, BigDecimal amount);
+    HttpResponseResult applyRefundForStudent(ReturnFeeDto returnFeeDto);
 
     /**
      * @describe 对某个学生进行休学
@@ -357,7 +346,7 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
      * @return void
      * @describe 退课申请审核
      */
-    void applyRefundAudit(Long id,StudentApplyRefundsStatus status,String remark,BigDecimal amount);
+    HttpResponseResult applyRefundAudit(Long id,StudentApplyRefundsStatus status,String remark,BigDecimal amount,boolean confirmReturnActivityGive);
 
     /**
      * @Author: Joburgess

+ 171 - 49
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java

@@ -1,16 +1,16 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.ReturnFeeDto;
 import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
-import com.ym.mec.biz.dal.enums.GroupStatusEnum;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
-import com.ym.mec.biz.service.GroupClassService;
-import com.ym.mec.biz.service.SysTenantAccountService;
-import com.ym.mec.biz.service.SysUserCashAccountService;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.service.*;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.util.date.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +42,8 @@ public class GroupClassServiceImpl implements GroupClassService {
     @Autowired
     private CourseScheduleDao courseScheduleDao;
     @Autowired
+    private CourseScheduleService courseScheduleService;
+    @Autowired
     private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
     @Autowired
     private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
@@ -59,45 +61,63 @@ public class GroupClassServiceImpl implements GroupClassService {
     private CoursesGroupDao coursesGroupDao;
     @Autowired
     private SysTenantAccountService sysTenantAccountService;
+    @Autowired
+    private ActivityUserMapperDao activityUserMapperDao;
+    @Autowired
+    private CloudTeacherOrderDao cloudTeacherOrderDao;
+    @Autowired
+    private VipGroupActivityDao vipGroupActivityDao;
+    @Autowired
+    private StudentDao studentDao;
+    @Autowired
+    private VipGroupDao vipGroupDao;
+    @Autowired
+    private VipGroupCategoryDao vipGroupCategoryDao;
+    @Autowired
+    private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
+    @Autowired
+    private ImGroupMemberService imGroupMemberService;
+    @Autowired
+    private PracticeGroupService practiceGroupService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean deleteAllGroupInfo(String groupId, GroupType groupType) {
-        groupDao.deleteGroup(groupId,groupType.getCode());
-        classGroupDao.deleteByGroup(groupId,groupType);
-        classGroupTeacherMapperDao.deleteByGroup(groupId,groupType);
-        classGroupTeacherSalaryDao.deleteByGroup(groupId,groupType);
-        classGroupStudentMapperDao.deleteByGroup(groupId,groupType);
-        courseScheduleDao.deleteByGroup(groupId,groupType);
-        courseScheduleTeacherSalaryDao.deleteByGroup(groupId,groupType);
-        courseScheduleStudentPaymentDao.deleteByGroup(groupId,groupType);
-        teacherAttendanceDao.deleteByGroup(groupId,groupType);
-        studentAttendanceDao.deleteByGroup(groupId,groupType);
+        groupDao.deleteGroup(groupId, groupType.getCode());
+        classGroupDao.deleteByGroup(groupId, groupType);
+        classGroupTeacherMapperDao.deleteByGroup(groupId, groupType);
+        classGroupTeacherSalaryDao.deleteByGroup(groupId, groupType);
+        classGroupStudentMapperDao.deleteByGroup(groupId, groupType);
+        courseScheduleDao.deleteByGroup(groupId, groupType);
+        courseScheduleTeacherSalaryDao.deleteByGroup(groupId, groupType);
+        courseScheduleStudentPaymentDao.deleteByGroup(groupId, groupType);
+        teacherAttendanceDao.deleteByGroup(groupId, groupType);
+        studentAttendanceDao.deleteByGroup(groupId, groupType);
         return true;
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean deleteGroupOtherInfo(String groupId, GroupType groupType) {
-        classGroupDao.deleteByGroup(groupId,groupType);
-        classGroupTeacherMapperDao.deleteByGroup(groupId,groupType);
-        classGroupTeacherSalaryDao.deleteByGroup(groupId,groupType);
-        classGroupStudentMapperDao.deleteByGroup(groupId,groupType);
-        courseScheduleDao.deleteByGroup(groupId,groupType);
-        courseScheduleTeacherSalaryDao.deleteByGroup(groupId,groupType);
-        courseScheduleStudentPaymentDao.deleteByGroup(groupId,groupType);
-        teacherAttendanceDao.deleteByGroup(groupId,groupType);
-        studentAttendanceDao.deleteByGroup(groupId,groupType);
+        classGroupDao.deleteByGroup(groupId, groupType);
+        classGroupTeacherMapperDao.deleteByGroup(groupId, groupType);
+        classGroupTeacherSalaryDao.deleteByGroup(groupId, groupType);
+        classGroupStudentMapperDao.deleteByGroup(groupId, groupType);
+        courseScheduleDao.deleteByGroup(groupId, groupType);
+        courseScheduleTeacherSalaryDao.deleteByGroup(groupId, groupType);
+        courseScheduleStudentPaymentDao.deleteByGroup(groupId, groupType);
+        teacherAttendanceDao.deleteByGroup(groupId, groupType);
+        studentAttendanceDao.deleteByGroup(groupId, groupType);
         return true;
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean cleanGroupInfo(String groupId, GroupType groupType) {
-        classGroupDao.deleteByGroupWithLogic(groupId,groupType);
-        classGroupStudentMapperDao.deleteByGroupWithLogic(groupId,groupType);
+        classGroupDao.deleteByGroupWithLogic(groupId, groupType);
+        classGroupStudentMapperDao.deleteByGroupWithLogic(groupId, groupType);
         List<CourseSchedule> groupNotStartCourses = courseScheduleDao.findGroupNotStartCourses(groupId, groupType);
-        if(CollectionUtils.isEmpty(groupNotStartCourses)){
+        if (CollectionUtils.isEmpty(groupNotStartCourses)) {
             return true;
         }
         List<Long> courseIds = groupNotStartCourses.stream().map(CourseSchedule::getId).collect(Collectors.toList());
@@ -112,10 +132,10 @@ public class GroupClassServiceImpl implements GroupClassService {
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean hideGroupInfo(String groupId, GroupType groupType) {
-        classGroupDao.deleteByGroupWithLogic(groupId,groupType);
-        classGroupStudentMapperDao.deleteByGroupWithLogic(groupId,groupType);
+        classGroupDao.deleteByGroupWithLogic(groupId, groupType);
+        classGroupStudentMapperDao.deleteByGroupWithLogic(groupId, groupType);
         List<CourseSchedule> groupNotStartCourses = courseScheduleDao.findGroupNotStartCourses(groupId, groupType);
-        if(CollectionUtils.isEmpty(groupNotStartCourses)){
+        if (CollectionUtils.isEmpty(groupNotStartCourses)) {
             return true;
         }
         List<Long> courseIds = groupNotStartCourses.stream().map(CourseSchedule::getId).collect(Collectors.toList());
@@ -129,28 +149,35 @@ public class GroupClassServiceImpl implements GroupClassService {
 
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-    public void cancelGroup(Long groupId, GroupType groupType, BigDecimal refundAmount) {
-        if(Objects.isNull(groupId)){
+    public HttpResponseResult cancelGroup(ReturnFeeDto returnFeeDto) {
+        Long groupId = returnFeeDto.getGroupId();
+        if (Objects.isNull(groupId)) {
             throw new BizException("请指定课程组");
         }
-        if(Objects.isNull(groupType)){
+        GroupType groupType = returnFeeDto.getGroupType();
+        if (Objects.isNull(groupType)) {
             throw new BizException("请指定课程组类型");
         }
-        Date now=new Date();
-        if(groupType.equals(GroupType.PRACTICE)){
+        Date now = new Date();
+        if (groupType.equals(GroupType.PRACTICE)) {
+            BigDecimal refundAmount = returnFeeDto.getAmount();
             PracticeGroup practiceGroup = practiceGroupDao.get(groupId);
-            if(Objects.isNull(practiceGroup)){
+            if (Objects.isNull(practiceGroup)) {
                 throw new BizException("指定的课程组不存在");
             }
             List<StudentPaymentOrder> orders = studentPaymentOrderDao.findOrderByGroup(practiceGroup.getId().toString(), GroupType.PRACTICE, DealStatusEnum.SUCCESS);
-            if(CollectionUtils.isEmpty(orders)&&Objects.nonNull(refundAmount)){
+            if (CollectionUtils.isEmpty(orders) && Objects.nonNull(refundAmount)) {
                 throw new BizException("未获取到订单");
             }
-            if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL)||practiceGroup.getCoursesExpireDate().before(now)){
+            if (!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL) || practiceGroup.getCoursesExpireDate().before(now)) {
                 throw new BizException("当前课程组不可关闭");
             }
-            if(Objects.nonNull(refundAmount)&&refundAmount.compareTo(BigDecimal.ZERO)>0){
-                if(refundAmount.compareTo(orders.get(0).getExpectAmount())>0){
+            HttpResponseResult result = quitActivityGive(practiceGroup.getActivityUserMapperId(), returnFeeDto.getConfirmReturnActivityGive(), practiceGroup.getStudentId());
+            if(result.getCode() != 200){
+                return result;
+            }
+            if (Objects.nonNull(refundAmount) && refundAmount.compareTo(BigDecimal.ZERO) > 0) {
+                if (refundAmount.compareTo(orders.get(0).getExpectAmount()) > 0) {
                     throw new BizException("退款不可大于购买金额");
                 }
                 sysUserCashAccountService.updateBalance(practiceGroup.getStudentId(), refundAmount, PlatformCashAccountDetailTypeEnum.REFUNDS, "后台关闭网管课");
@@ -160,20 +187,20 @@ public class GroupClassServiceImpl implements GroupClassService {
             practiceGroup.setGroupStatus(GroupStatusEnum.CANCEL);
             practiceGroup.setUpdateTime(now);
             practiceGroupDao.update(practiceGroup);
-        }else if(groupType.equals(GroupType.COMM)){
+        } else if (groupType.equals(GroupType.COMM)) {
             CoursesGroup coursesGroup = coursesGroupDao.get(groupId);
-            if(Objects.isNull(coursesGroup)){
+            if (Objects.isNull(coursesGroup)) {
                 throw new BizException("指定的课程组不存在");
             }
-            if(coursesGroup.getStatus().equals(GroupStatusEnum.CANCEL)){
+            if (coursesGroup.getStatus().equals(GroupStatusEnum.CANCEL)) {
                 throw new BizException("此课程组已关闭");
             }
             List<CourseSchedule> groupNotStartCourses = courseScheduleDao.findGroupNotStartCourses(groupId.toString(), groupType);
-            if(!CollectionUtils.isEmpty(groupNotStartCourses)){
+            if (!CollectionUtils.isEmpty(groupNotStartCourses)) {
                 //剩余课程时长
-                Integer totalCourseTime=groupNotStartCourses.size()*coursesGroup.getSingleClassMinutes();
-                sysTenantAccountService.update(coursesGroup.getTeacherId(), totalCourseTime, "", SysTenantAccountDetail.TransType.RETURN, "",BigDecimal.ZERO,"关闭课程组");
-            }else{
+                Integer totalCourseTime = groupNotStartCourses.size() * coursesGroup.getSingleClassMinutes();
+                sysTenantAccountService.update(coursesGroup.getTeacherId(), totalCourseTime, "", SysTenantAccountDetail.TransType.RETURN, "", BigDecimal.ZERO, "关闭课程组");
+            } else {
                 throw new BizException("此课程组已结束");
             }
             cleanGroupInfo(groupId.toString(), GroupType.COMM);
@@ -181,5 +208,100 @@ public class GroupClassServiceImpl implements GroupClassService {
             coursesGroup.setStatus(GroupStatusEnum.CANCEL);
             coursesGroupDao.update(coursesGroup);
         }
+        return BaseController.succeed();
+    }
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public HttpResponseResult quitActivityGive(Integer activityUserMapperId,Boolean confirmReturnActivityGive,Integer studentId){
+        if(activityUserMapperId != null){
+            ActivityUserMapper activityUserMapper = activityUserMapperDao.get(activityUserMapperId);
+            if(activityUserMapper != null){
+                if(activityUserMapper.getReturnFee()){
+                    throw new BizException("当前课程组无法退费,请联系管理员");
+                }
+                if(!confirmReturnActivityGive && activityUserMapper.getGiveMemberFlag() != 0 && activityUserMapper.getGiveVipFlag() != 0 && activityUserMapper.getGivePracticeFlag() != 0){
+                    return BaseController.failed(HttpStatus.PARTIAL_CONTENT,"当前课程组为活动购买,退费会退还活动相关所有赠送,是否继续退费?");
+                }
+                Date now = new Date();
+                if(activityUserMapper.getGiveMemberFlag() == 2){
+                    VipGroupActivity activity = vipGroupActivityDao.get(activityUserMapper.getActivityId());
+                    //只退还赠送的时间
+                    Integer giveMemberTime = activity.getGiveMemberTime();
+                    PeriodEnum givePeriodEnum = activity.getGivePeriodEnum();
+                    switch (givePeriodEnum){
+                        case DAY:
+                            break;
+                        case MONTH:
+                            giveMemberTime = giveMemberTime * 30;
+                            break;
+                        case QUARTERLY:
+                            giveMemberTime = giveMemberTime * 30 * 3;
+                            break;
+                        case YEAR_HALF:
+                            giveMemberTime = giveMemberTime * 30 * 6;
+                            break;
+                        case YEAR:
+                            giveMemberTime = giveMemberTime * 30 * 12;
+                            break;
+                        default:
+                            throw new BizException("错误的会员周期类型");
+                    }
+                    Student student = studentDao.get(studentId);
+                    Date membershipEndTime = student.getMembershipEndTime();
+                    if(membershipEndTime.compareTo(now) > 0){
+                        membershipEndTime = DateUtil.addDays(membershipEndTime, -giveMemberTime);
+                        student.setMembershipEndTime(membershipEndTime);
+                        if(membershipEndTime.compareTo(now) < 0){
+                            student.setMemberRankSettingId(null);
+                            student.setExperienceMemberRankSettingId(null);
+                        }
+                        student.setUpdateTime(now);
+                        studentDao.updateStudentMember(student);
+                    }
+                    CloudTeacherOrder cloudTeacherOrder = cloudTeacherOrderDao.get(activityUserMapper.getGiveMemberOrderId());
+                    cloudTeacherOrder.setStatus(3);
+                    cloudTeacherOrder.setRemark("退还活动赠送");
+                    cloudTeacherOrderDao.update(cloudTeacherOrder);
+                }
+                if(activityUserMapper.getGiveVipFlag() == 2){
+                    Long giveVipGroupId = activityUserMapper.getGiveVipGroupId();
+                    VipGroup giveVipGroup = vipGroupDao.get(giveVipGroupId);
+                    ClassGroupStudentMapper giveClassGroupStudentMapper = classGroupStudentMapperDao.query(giveVipGroupId.intValue(),studentId);
+                    giveClassGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.QUIT);
+                    classGroupStudentMapperDao.update(giveClassGroupStudentMapper);
+
+                    courseScheduleService.batchDeleteMusicGroupCourseWithStudent(giveVipGroupId.toString(),studentId,GroupType.VIP);
+
+                    ClassGroup giveClassGroup = classGroupDao.findByVipGroup(giveVipGroupId, null);
+                    List<Integer> studentPaymentIds = courseScheduleStudentPaymentDao.findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(giveClassGroup.getId(), studentId);
+                    if(!CollectionUtils.isEmpty(studentPaymentIds)){
+                        courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
+                    }
+                    VipGroupCategory giveVipGroupCategory = vipGroupCategoryDao.get(giveVipGroup.getVipGroupCategoryId());
+
+                    if(!giveVipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING) || (Objects.nonNull(giveVipGroupCategory) && giveVipGroupCategory.getMusicTheory())){
+                        courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(giveVipGroupId.intValue(), giveVipGroup.getUserId());
+                    }
+
+                    giveClassGroup.setStudentNum(giveClassGroup.getStudentNum() - 1);
+                    classGroupDao.update(giveClassGroup);
+
+                    //学员退出班级群
+                    imGroupMemberService.quit(giveClassGroup.getId().longValue(), studentId);
+                }
+                if(activityUserMapper.getGivePracticeFlag() == 2){
+                    Long givePracticeGroupId = activityUserMapper.getGivePracticeGroupId();
+                    PracticeGroup practiceGroup = practiceGroupService.get(givePracticeGroupId);
+                    cleanGroupInfo(givePracticeGroupId.toString(), GroupType.PRACTICE);
+                    practiceGroup.setMemo("关闭活动赠送网管课");
+                    practiceGroup.setGroupStatus(GroupStatusEnum.CANCEL);
+                    practiceGroup.setUpdateTime(now);
+                    practiceGroupService.update(practiceGroup);
+                }
+            }
+        }
+        return BaseController.succeed();
     }
 }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -2251,6 +2251,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     }
 
     @Override
+    public List<StudentVipGroupShowListDto> findPracticeGroups(Map<String, Object> params){
+        return practiceGroupDao.findPracticeGroups(params);
+    }
+
+    @Override
     public Object findPracticeGroupCourseSchedules(PracticeGroupQueryInfo queryInfo) {
         PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         if (Objects.isNull(queryInfo.getPracticeId())) {

+ 50 - 29
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -47,6 +47,9 @@ 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 {
@@ -157,7 +160,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	@Autowired
 	private ActivityUserMapperDao activityUserMapperDao;
 	@Autowired
-	private PracticeGroupDao practiceGroupDao;
+	private CloudTeacherOrderDao cloudTeacherOrderDao;
+	@Autowired
+	private PracticeGroupService practiceGroupService;
 
 	private static final Logger LOGGER = LoggerFactory
 			.getLogger(VipGroup.class);
@@ -926,9 +931,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(StringUtils.isBlank(studentIds)){
 			throw new BizException("请选择学员");
 		}
+		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,"GIVE_VIP");
+		List<ActivityUserMapper> activityUserMappers = activityUserMapperDao.findByStudentIdList(activity.getId(),studentIds,giveFlag?"GIVE_VIP":"VIP");
 		if(studentIdList.size() != activityUserMappers.size()){
 			throw new BizException("所选学员暂无排课资格");
 		}
@@ -2974,11 +2980,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void applyRefundForStudent(Long vipGroupId, Integer studentId, BigDecimal amount) {
-		if(Objects.isNull(vipGroupId)||Objects.isNull(studentId)){
+	public HttpResponseResult applyRefundForStudent(ReturnFeeDto returnFeeDto) {
+		Long vipGroupId = returnFeeDto.getGroupId();
+		Integer studentId = returnFeeDto.getStudentId();
+		if(Objects.isNull(vipGroupId) || Objects.isNull(studentId)){
 			throw new BizException("请指定小课与学生");
 		}
-		VipGroup vipGroup=vipGroupDao.get(vipGroupId);
+		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
 		if(Objects.isNull(vipGroup)){
 			throw new BizException("指定的课程不存在");
 		}
@@ -3016,17 +3024,23 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 			classGroup.setStudentNum(classGroup.getStudentNum()-1);
 			classGroupDao.update(classGroup);
-			return;
+			return BaseController.succeed();
         }
+		BigDecimal amount = returnFeeDto.getAmount();
 		if(Objects.isNull(amount)){
 			throw new BizException("请确定退费金额");
 		}
 
 		Map<String, BigDecimal> studentSurplusCourseFee = getStudentSurplusCourseFee(vipGroupId, studentId);
 		BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseOriginalFee");
-		if(amount.compareTo(suplusCourseFee)>0){
+		if(amount.compareTo(suplusCourseFee) > 0){
 			throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
 		}
+		//退还活动购买
+		HttpResponseResult result = groupClassService.quitActivityGive(vipGroup.getActivityUserMapperId(), returnFeeDto.getConfirmReturnActivityGive(), studentId);
+		if(result.getCode() != 200){
+			return result;
+		}
 
 		sysUserCashAccountService.updateBalance(studentId, amount);
 		SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentId);
@@ -3049,7 +3063,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
         }
 
-        if(!vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)||(Objects.nonNull(vipGroupCategory)&&vipGroupCategory.getMusicTheory())){
+        if(!vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING) || (Objects.nonNull(vipGroupCategory) && vipGroupCategory.getMusicTheory())){
 			courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(vipGroupId.intValue(), vipGroup.getUserId());
 		}
 
@@ -3059,6 +3073,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		//学员退出班级群
 		imGroupMemberService.quit(classGroup.getId().longValue(), studentId);
+		return BaseController.succeed();
 	}
 
 	@Override
@@ -3382,35 +3397,34 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
 			throw new BizException("不能对已停止的课程进行退课操作");
 		}
-		Map<String,BigDecimal> result=new HashMap<>();
+		Map<String,BigDecimal> result = new HashMap<>();
 		Date now = new Date();
         BigDecimal bigDecimal;
         List<StudentCourseInfoDto> userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.VIP, vipGroupId.toString(), studentId, null);
-		if(CollectionUtils.isEmpty(userCourseInfos)&&vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
+		if(CollectionUtils.isEmpty(userCourseInfos) && vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
             StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
             if(Objects.isNull(studentPaymentOrder)){
-                bigDecimal=new BigDecimal(0);
+                bigDecimal = new BigDecimal(0);
             }else{
-                bigDecimal=studentPaymentOrder.getActualAmount();
+                bigDecimal = studentPaymentOrder.getActualAmount().add(studentPaymentOrder.getBalancePaymentAmount());
             }
-
 			result.put("suplusCourseOriginalFee", bigDecimal);
         }else if(!CollectionUtils.isEmpty(userCourseInfos)){
-            BigDecimal historyPrice=new BigDecimal(0);
-            BigDecimal allPrice=new BigDecimal(0);
+            BigDecimal historyPrice = new BigDecimal(0);
+            BigDecimal allPrice = new BigDecimal(0);
             for (StudentCourseInfoDto userCourseInfo : userCourseInfos) {
-                allPrice=allPrice.add(userCourseInfo.getExpectPrice());
+                allPrice = allPrice.add(userCourseInfo.getExpectPrice());
                 if(now.after(userCourseInfo.getStartClassTime())){
-                    historyPrice=historyPrice.add(userCourseInfo.getTeachMode().equals(TeachModeEnum.ONLINE)?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice());
+                    historyPrice = historyPrice.add(userCourseInfo.getTeachMode().equals(TeachModeEnum.ONLINE)?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice());
                 }
             }
-            bigDecimal=allPrice.subtract(historyPrice);
-            if(bigDecimal.longValue()<0){
-                bigDecimal=new BigDecimal(0);
+            bigDecimal = allPrice.subtract(historyPrice);
+            if(bigDecimal.longValue() < 0){
+                bigDecimal = new BigDecimal(0);
             }
 			result.put("suplusCourseOriginalFee", allPrice);
         }else{
-		    bigDecimal=new BigDecimal(0);
+		    bigDecimal = new BigDecimal(0);
 			result.put("suplusCourseOriginalFee", bigDecimal);
         }
 		ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
@@ -3423,7 +3437,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
         VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId().intValue());
 
-		if(vipGroupCategory.getStudentNum()<=1){
+		if(vipGroupCategory.getStudentNum() <= 1){
             bigDecimal = bigDecimal.multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
         }else{
             bigDecimal = bigDecimal.multiply(new BigDecimal(0.7)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
@@ -3434,21 +3448,21 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(VipGroupStatusEnum.APPLYING.equals(vipGroup.getStatus())){
 			StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
 			if(Objects.nonNull(studentPaymentOrder)){
-				result.put("suplusCourseOriginalFee", studentPaymentOrder.getExpectAmount());
-				if(vipGroupCategory.getStudentNum()<=1){
-					result.put("suplusCourseFee", studentPaymentOrder.getExpectAmount().multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
+				BigDecimal suplusCourseOriginalFee = studentPaymentOrder.getActualAmount().add(studentPaymentOrder.getBalancePaymentAmount());
+				result.put("suplusCourseOriginalFee", suplusCourseOriginalFee);
+				if(vipGroupCategory.getStudentNum() <= 1){
+					result.put("suplusCourseFee", suplusCourseOriginalFee.multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
 				}else{
-					result.put("suplusCourseFee", studentPaymentOrder.getExpectAmount().multiply(new BigDecimal(0.7)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
+					result.put("suplusCourseFee", suplusCourseOriginalFee.multiply(new BigDecimal(0.7)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
 				}
 			}
 		}
-
 		return result;
 	}
 
 	@Transactional(rollbackFor = Exception.class)
 	@Override
-	public void applyRefundAudit(Long id, StudentApplyRefundsStatus status, String remark,BigDecimal amount) {
+	public HttpResponseResult applyRefundAudit(Long id, StudentApplyRefundsStatus status, String remark,BigDecimal amount,boolean confirmReturnActivityGive) {
 
 		StudentApplyRefunds studentApplyRefunds = studentApplyRefundsDao.get(id);
 		if (studentApplyRefunds == null) {
@@ -3466,6 +3480,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		studentApplyRefunds.setStatus(status);
 		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;
+			}
 			studentApplyRefunds.setActualAmount(amount);
 		}else{
 			studentApplyRefunds.setActualAmount(new BigDecimal(0));
@@ -3521,6 +3541,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			default:
 				throw new BizException("审核状态错误!");
 		}
+		return BaseController.succeed();
 	}
 
 	@Override
@@ -4485,7 +4506,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
 		List<StudentVipGroupShowListDto> vipGroups = vipGroupDao.findVipGroups(params);
-		vipGroups.addAll(practiceGroupDao.findPracticeGroups(params));
+		vipGroups.addAll(practiceGroupService.findPracticeGroups(params));
 		vipGroups.removeAll(Collections.singleton(null));
 		List<StudentVipGroupShowListDto> collect = vipGroups.stream().sorted(Comparator.comparing(StudentVipGroupShowListDto::getCreateTime).reversed()).collect(Collectors.toList());
 		return collect;

+ 24 - 4
mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml

@@ -14,11 +14,16 @@
 		<result column="give_vip_flag_" property="giveVipFlag" />
 		<result column="practice_flag_" property="practiceFlag" />
 		<result column="give_practice_flag_" property="givePracticeFlag" />
+		<result column="member_flag_" property="memberFlag" />
+		<result column="give_member_flag_" property="giveMemberFlag" />
 		<result column="payment_order_id_" property="paymentOrderId" />
 		<result column="vip_group_id_" property="vipGroupId" />
 		<result column="give_vip_group_id_" property="giveVipGroupId" />
+		<result column="member_order_id_" property="memberOrderId" />
+		<result column="give_member_order_id_" property="giveMemberOrderId" />
 		<result column="practice_group_id_" property="practiceGroupId" />
 		<result column="give_practice_group_id_" property="givePracticeGroupId" />
+		<result column="return_fee_" property="returnFee" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
@@ -36,17 +41,26 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ActivityUserMapper" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO activity_user_mapper (activity_id_,user_id_,vip_flag_,give_vip_flag_,
-		                                  practice_flag_,give_practice_flag_,create_time_,update_time_,payment_order_id_,
-										  vip_group_id_,give_vip_group_id_,practice_group_id_,give_practice_group_id_)
+		                                  practice_flag_,give_practice_flag_,member_flag_,give_member_flag_,create_time_,update_time_,payment_order_id_,
+										  vip_group_id_,give_vip_group_id_,practice_group_id_,give_practice_group_id_,return_fee_,member_order_id_,give_member_order_id_)
 		                                  VALUES(#{activityId},#{userId},#{vipFlag},#{giveVipFlag},#{practiceFlag},
-		                                         #{givePracticeFlag},NOW(),NOW(),#{paymentOrderId},#{vipGroupId},
-		                                         #{giveVipGroupId},#{practiceGroupId},#{givePracticeGroupId})
+		                                         #{givePracticeFlag},#{memberFlag},#{giveMemberFlag},NOW(),NOW(),#{paymentOrderId},#{vipGroupId},
+		                                         #{giveVipGroupId},#{practiceGroupId},#{givePracticeGroupId},#{returnFee},#{memberOrderId},#{giveMemberOrderId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.ActivityUserMapper">
 		UPDATE activity_user_mapper
 		<set>
+			<if test="memberOrderId != null">
+				member_order_id_ = #{memberOrderId},
+			</if>
+			<if test="giveMemberOrderId != null">
+				give_member_order_id_ = #{giveMemberOrderId},
+			</if>
+			<if test="returnFee != null">
+				return_fee_ = #{returnFee},
+			</if>
 			<if test="vipGroupId != null">
 				vip_group_id_ = #{vipGroupId},
 			</if>
@@ -80,6 +94,12 @@
 			<if test="practiceFlag != null">
 				practice_flag_ = #{practiceFlag},
 			</if>
+			<if test="memberFlag != null">
+				member_flag_ = #{memberFlag},
+			</if>
+			<if test="giveMemberFlag != null">
+				give_member_flag_ = #{giveMemberFlag},
+			</if>
 			update_time_ = NOW()
 		</set>WHERE id_ = #{id}
 	</update>

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -252,11 +252,11 @@
 			cssp.id_
 		FROM
 			course_schedule_student_payment cssp
-			LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_
+			LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
 		WHERE
 			cssp.class_group_id_ = #{classGroupId}
-			AND cssp.user_id_=#{userId}
-			AND CONCAT(cs.class_date_,' ',cs.start_class_time_)>NOW() AND cs.pre_course_flag_ = 0
+			AND cssp.user_id_ = #{userId}
+			AND CONCAT(cs.class_date_,' ',cs.start_class_time_) > NOW() AND cs.pre_course_flag_ = 0
 	</select>
 
     <select id="findVipGroupCoursePrice" resultType="java.math.BigDecimal">

+ 12 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -158,6 +158,18 @@
         WHERE user_id_ = #{userId}
     </update>
 
+    <update id="updateStudentMember" parameterType="com.ym.mec.biz.dal.entity.Student">
+        UPDATE student SET
+                member_rank_setting_id_ = #{memberRankSettingId},
+                membership_start_time_ = #{membershipStartTime},
+                membership_end_time_ = #{membershipEndTime},
+                experience_member_rank_setting_id_ = #{experienceMemberRankSettingId},
+                experience_membership_start_time_ = #{experienceMembershipStartTime},
+                experience_membership_end_time_ = #{experienceMembershipEndTime},
+                update_time_ = NOW()
+        WHERE user_id_ = #{userId}
+    </update>
+
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="Student" parameterType="map">
         SELECT s.*,su.username_,su.phone_,o.name_ organ_name_ FROM student s

+ 3 - 7
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -5,10 +5,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.PracticeGroupSellPriceDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
-import com.ym.mec.biz.dal.dto.PracticeGroupApplyBaseInfoDto;
-import com.ym.mec.biz.dal.dto.PracticeGroupApplyDto;
-import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
-import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
 import com.ym.mec.biz.dal.entity.Teacher;
@@ -106,9 +103,8 @@ public class PracticeGroupManageController extends BaseController {
     @ApiOperation(value = "关闭课程组")
     @PostMapping(value = "/cancelGroup")
     @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/cancelGroup')")
-    public HttpResponseResult cancelGroup(Long groupId, GroupType groupType, BigDecimal refundAmount) {
-        groupService.cancelGroup(groupId, groupType, refundAmount);
-        return succeed();
+    public HttpResponseResult cancelGroup(ReturnFeeDto returnFeeDto) {
+        return groupService.cancelGroup(returnFeeDto);
     }
 
     @ApiOperation(value = "评论管理")

+ 5 - 5
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -4,6 +4,7 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
+import com.ym.mec.biz.dal.dto.ReturnFeeDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.entity.*;
@@ -307,17 +308,16 @@ public class VipGroupManageController extends BaseController {
     @ApiOperation(value = "退课申请")
     @PostMapping("/applyRefundForStudent")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/applyRefundForStudent')")
-    public Object applyRefundForStudent(Long vipGroupId,Integer studentId, BigDecimal amount){
-        vipGroupService.applyRefundForStudent(vipGroupId,studentId,amount);
+    public Object applyRefundForStudent(ReturnFeeDto returnFeeDto){
+        vipGroupService.applyRefundForStudent(returnFeeDto);
         return succeed();
     }
 
     @ApiOperation(value = "退课申请审核")
     @PostMapping("/applyRefundAudit")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/applyRefundAudit')")
-	public Object applyRefundAudit(Long id, StudentApplyRefundsStatus status, String remark, BigDecimal amount) {
-		vipGroupService.applyRefundAudit(id, status, remark, amount);
-		return succeed();
+	public Object applyRefundAudit(Long id, StudentApplyRefundsStatus status, String remark, BigDecimal amount,boolean confirmReturnActivityGive) {
+		return vipGroupService.applyRefundAudit(id, status, remark, amount,confirmReturnActivityGive);
 	}
 
     @ApiOperation(value = "查询退费详情")