|
|
@ -11,12 +11,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.teaching.backend.common.ErrorCode; |
|
|
|
import com.teaching.backend.common.ErrorCode; |
|
|
|
import com.teaching.backend.exception.BusinessException; |
|
|
|
import com.teaching.backend.exception.BusinessException; |
|
|
|
import com.teaching.backend.mapper.courses.*; |
|
|
|
import com.teaching.backend.mapper.courses.*; |
|
|
|
|
|
|
|
import com.teaching.backend.mapper.records.LearningRecordsMapper; |
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsAdminMapper; |
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsAdminMapper; |
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsAdminRoleRelationMapper; |
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsAdminRoleRelationMapper; |
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsTeacherMapper; |
|
|
|
import com.teaching.backend.mapper.umsAdmin.UmsTeacherMapper; |
|
|
|
import com.teaching.backend.model.dto.courses.CoursesDTO; |
|
|
|
import com.teaching.backend.model.dto.courses.CoursesDTO; |
|
|
|
import com.teaching.backend.model.dto.courses.PageDTO; |
|
|
|
import com.teaching.backend.model.dto.courses.PageDTO; |
|
|
|
import com.teaching.backend.model.entity.courses.*; |
|
|
|
import com.teaching.backend.model.entity.courses.*; |
|
|
|
|
|
|
|
import com.teaching.backend.model.entity.records.LearningRecords; |
|
|
|
import com.teaching.backend.model.entity.umsAdmin.UmsAdmin; |
|
|
|
import com.teaching.backend.model.entity.umsAdmin.UmsAdmin; |
|
|
|
import com.teaching.backend.model.entity.umsAdmin.UmsAdminRoleRelation; |
|
|
|
import com.teaching.backend.model.entity.umsAdmin.UmsAdminRoleRelation; |
|
|
|
import com.teaching.backend.model.entity.umsAdmin.UmsTeacher; |
|
|
|
import com.teaching.backend.model.entity.umsAdmin.UmsTeacher; |
|
|
@ -79,6 +81,8 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
StudentCoursesMapper studentCoursesMapper; |
|
|
|
StudentCoursesMapper studentCoursesMapper; |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
ObjectiveContentKnowMapper objectiveContentKnowMapper; |
|
|
|
ObjectiveContentKnowMapper objectiveContentKnowMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private LearningRecordsMapper learningRecordsMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -264,6 +268,13 @@ public class CoursesServiceImpl extends ServiceImpl<CoursesMapper, Courses> impl |
|
|
|
courseObjectivesMapper.deleteBatchIds(objectiveIds); |
|
|
|
courseObjectivesMapper.deleteBatchIds(objectiveIds); |
|
|
|
coursesMapper.deleteById(id); |
|
|
|
coursesMapper.deleteById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除课程的同时删除对应的记录
|
|
|
|
|
|
|
|
//先通过id查出对应的记录
|
|
|
|
|
|
|
|
LambdaQueryWrapper<LearningRecords> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
System.out.println("id:"+id); |
|
|
|
|
|
|
|
lambdaQueryWrapper.eq(LearningRecords::getCoursesId, id).eq(LearningRecords::getType, 1);//课程的type为1
|
|
|
|
|
|
|
|
System.out.println("学习记录删除:"+learningRecordsMapper.selectList(lambdaQueryWrapper)); |
|
|
|
|
|
|
|
learningRecordsMapper.delete(lambdaQueryWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|