|  | @@ -7,8 +7,6 @@ import java.util.List;
 | 
	
		
			
				|  |  |  import java.util.Map;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import com.yonge.cooleshow.biz.dal.entity.*;
 | 
	
		
			
				|  |  | -import org.apache.commons.beanutils.BeanUtils;
 | 
	
		
			
				|  |  |  import org.apache.commons.collections.CollectionUtils;
 | 
	
		
			
				|  |  |  import org.slf4j.Logger;
 | 
	
		
			
				|  |  |  import org.slf4j.LoggerFactory;
 | 
	
	
		
			
				|  | @@ -16,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 | 
	
		
			
				|  |  |  import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
	
	
		
			
				|  | @@ -29,6 +28,12 @@ import com.yonge.cooleshow.biz.dal.dao.VideoLessonGroupDetailDao;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.dto.search.VideoGroupSearch;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonGroupSearch;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.dto.search.VideoLessonSearch;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.entity.Subject;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.entity.Teacher;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.entity.VideoLessonAuthRecord;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroup;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupDetail;
 | 
	
		
			
				|  |  | +import com.yonge.cooleshow.biz.dal.entity.VideoLessonGroupLog;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 | 
	
		
			
				|  |  |  import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
 | 
	
	
		
			
				|  | @@ -109,7 +114,7 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
 | 
	
		
			
				|  |  |              }else if(query.getAuditStatus().equals(AuthStatusEnum.PASS.getCode())){
 | 
	
		
			
				|  |  |                  query.setShelvesFlag(1);
 | 
	
		
			
				|  |  |              }else{
 | 
	
		
			
				|  |  | -            	query.setShelvesFlag(0);
 | 
	
		
			
				|  |  | +            	query.setShelvesFlag(null);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return page.setRecords(baseMapper.selectPage(page, query));
 | 
	
	
		
			
				|  | @@ -287,7 +292,7 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
 | 
	
		
			
				|  |  |          VideoLessonGroupLog  videoLessonGroupLog = new VideoLessonGroupLog();
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | -			BeanUtils.copyProperties(videoLessonGroupLog, lessonGroup);
 | 
	
		
			
				|  |  | +        	org.springframework.beans.BeanUtils.copyProperties(lessonGroup, videoLessonGroupLog);
 | 
	
		
			
				|  |  |  		} catch (Exception e) {
 | 
	
		
			
				|  |  |  			throw new BizException("属性复制失败");
 | 
	
		
			
				|  |  |  		}
 | 
	
	
		
			
				|  | @@ -376,10 +381,13 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
 | 
	
		
			
				|  |  |      public void update(VideoLessonVo lessonVo, SysUser sysUser) {
 | 
	
		
			
				|  |  |          VideoLessonGroup lessonGroup = lessonVo.getLessonGroup();
 | 
	
		
			
				|  |  |          List<VideoLessonGroupDetail> lessonList = lessonVo.getLessonList();
 | 
	
		
			
				|  |  | +        lessonGroup.setLessonCount(lessonList.size());
 | 
	
		
			
				|  |  | +        lessonGroup.setTeacherId(sysUser.getId());
 | 
	
		
			
				|  |  |          //判断是否有正在审核中
 | 
	
		
			
				|  |  | -        List<VideoLessonAuthRecord> videoLessonAuthRecords = recordDao.selectList(Wrappers.<VideoLessonAuthRecord>lambdaQuery()
 | 
	
		
			
				|  |  | -                .eq(VideoLessonAuthRecord::getVideoGroupId, lessonGroup.getId())
 | 
	
		
			
				|  |  | -                .eq(VideoLessonAuthRecord::getAuditStatus, AuthStatusEnum.DOING.getCode()));
 | 
	
		
			
				|  |  | +        QueryWrapper<VideoLessonAuthRecord> wrapper = new QueryWrapper<VideoLessonAuthRecord>();
 | 
	
		
			
				|  |  | +        wrapper.eq("video_group_id_", lessonGroup.getId()).eq("audit_status_", AuthStatusEnum.DOING.getCode());
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        List<VideoLessonAuthRecord> videoLessonAuthRecords = recordDao.selectList(wrapper);
 | 
	
		
			
				|  |  |          if(CollectionUtils.isNotEmpty(videoLessonAuthRecords)){
 | 
	
		
			
				|  |  |          	throw new BizException("正在审核中,无法修改");
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -406,7 +414,7 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
 | 
	
		
			
				|  |  |          VideoLessonGroupLog  videoLessonGroupLog = new VideoLessonGroupLog();
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | -			BeanUtils.copyProperties(videoLessonGroupLog, lessonGroup);
 | 
	
		
			
				|  |  | +        	org.springframework.beans.BeanUtils.copyProperties(lessonGroup, videoLessonGroupLog);
 | 
	
		
			
				|  |  |  		} catch (Exception e) {
 | 
	
		
			
				|  |  |  			throw new BizException("属性复制失败");
 | 
	
		
			
				|  |  |  		}
 | 
	
	
		
			
				|  | @@ -424,6 +432,17 @@ public class VideoLessonGroupServiceImpl extends ServiceImpl<VideoLessonGroupDao
 | 
	
		
			
				|  |  |          lessonGroup.setAuditStatus(AuthStatusEnum.DOING);
 | 
	
		
			
				|  |  |          lessonGroup.setUpdateTime(date);
 | 
	
		
			
				|  |  |          videoLessonGroupDao.updateById(lessonGroup);
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        videoLessonGroupDetailDao.deleteByGroupId(lessonGroup.getId());
 | 
	
		
			
				|  |  | +		if (lessonList != null && lessonList.size() > 0) {
 | 
	
		
			
				|  |  | +			for (VideoLessonGroupDetail detail : lessonList) {
 | 
	
		
			
				|  |  | +				detail.setVideoLessonGroupId(lessonGroup.getId());
 | 
	
		
			
				|  |  | +				detail.setTeacherId(sysUser.getId());
 | 
	
		
			
				|  |  | +				detail.setUpdateBy(sysUser.getId());
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			// 添加课程
 | 
	
		
			
				|  |  | +			videoLessonGroupDetailDao.insertVideoLesson(lessonList);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          //刷新统计
 | 
	
		
			
				|  |  |          VideoLessonGroupUpVo groupUpVo = new VideoLessonGroupUpVo();
 |