|
@@ -1,6 +1,7 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.CourseHomeworkDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentCourseHomeworkDao;
|
|
|
import com.ym.mec.biz.dal.dto.Mapper;
|
|
|
import com.ym.mec.biz.dal.dto.TeacherHomeworkListDto;
|
|
|
import com.ym.mec.biz.dal.entity.CourseHomework;
|
|
@@ -12,8 +13,11 @@ import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
@@ -26,6 +30,10 @@ public class CourseHomeworkServiceImpl extends BaseServiceImpl<Long, CourseHomew
|
|
|
|
|
|
@Autowired
|
|
|
private CourseHomeworkDao courseHomeworkDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StudentCourseHomeworkDao studentCourseHomeworkDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
private SysMessageService sysMessageService;
|
|
|
|
|
@@ -84,4 +92,16 @@ public class CourseHomeworkServiceImpl extends BaseServiceImpl<Long, CourseHomew
|
|
|
sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.TEACHER_PUSH_JOB_WAIT_REPLY, receivers, null, 0, "6?", "TEACHER", mapper.getValue());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
+ public boolean delHomwworkByCourseScheduleId(Long courseScheduleId) {
|
|
|
+ //删除作业
|
|
|
+ courseHomeworkDao.delByCourseScheduleId(courseScheduleId);
|
|
|
+ //删除学生作业
|
|
|
+ studentCourseHomeworkDao.delByCourseScheduleId(courseScheduleId);
|
|
|
+ //删除学生回复的作业
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|