|  | @@ -2,6 +2,7 @@ package com.ym.mec.web.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.ClassGroupDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.EmployeeDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.TeacherDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 | 
	
	
		
			
				|  | @@ -10,6 +11,7 @@ import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.VipGroupStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
 | 
	
	
		
			
				|  | @@ -51,6 +53,8 @@ public class VipGroupManageController extends BaseController {
 | 
	
		
			
				|  |  |      private TeacherDao teacherDao;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private EmployeeDao employeeDao;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private ClassGroupDao classGroupDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private StudentApplyRefundsService studentApplyRefundsService;
 | 
	
	
		
			
				|  | @@ -70,8 +74,8 @@ public class VipGroupManageController extends BaseController {
 | 
	
		
			
				|  |  |      @PostMapping("/update")
 | 
	
		
			
				|  |  |      @PreAuthorize("@pcs.hasPermissions('vipGroupManage/update')")
 | 
	
		
			
				|  |  |      public HttpResponseResult update(VipGroup vipGroup){
 | 
	
		
			
				|  |  | +        VipGroup oldVipGroup = vipGroupService.get(vipGroup.getId());
 | 
	
		
			
				|  |  |          if(Objects.nonNull(vipGroup.getCoursesExpireDate())){
 | 
	
		
			
				|  |  | -            VipGroup oldVipGroup = vipGroupService.get(vipGroup.getId());
 | 
	
		
			
				|  |  |              if(Objects.isNull(oldVipGroup)){
 | 
	
		
			
				|  |  |                  throw new BizException("此课程组不存在");
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -79,6 +83,18 @@ public class VipGroupManageController extends BaseController {
 | 
	
		
			
				|  |  |                  throw new BizException("此课程组状态暂不支持修改");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        if(Objects.isNull(oldVipGroup.getVipGroupActivityId())){
 | 
	
		
			
				|  |  | +            if(VipGroupStatusEnum.PROGRESS.equals(vipGroup.getStatus())&&oldVipGroup.getStatus().getCode()>VipGroupStatusEnum.PROGRESS.getCode()){
 | 
	
		
			
				|  |  | +                throw new BizException("此课程组状态暂不支持修改");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(oldVipGroup.getId().toString(), ClassGroupTypeEnum.VIP.getCode());
 | 
	
		
			
				|  |  | +            if(Objects.isNull(classGroup)){
 | 
	
		
			
				|  |  | +                throw new BizException("课程信息错误");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if(classGroup.getStudentNum()<3){
 | 
	
		
			
				|  |  | +                throw new BizException("班级任务尚未达到3人");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          vipGroupService.update(vipGroup);
 | 
	
		
			
				|  |  |          return succeed();
 | 
	
		
			
				|  |  |      }
 |