|
@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto;
|
|
|
import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
|
|
|
import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
|
|
|
import com.ym.mec.biz.dal.entity.StudentCourseHomework;
|
|
|
+import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
|
|
@@ -75,7 +76,8 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
detail.setStatus(extraExerciseReply.getStatus()==0?YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
detail.setIsReplied(extraExerciseReply.getIsReplied()==0?YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
detail.setTeacherId(extraExerciseReply.getTeacherId());
|
|
|
- detail.setTeacherName(extraExerciseReply.getTeacherName());
|
|
|
+ Teacher teacher = teacherDao.get(extraExerciseReply.getTeacherId());
|
|
|
+ detail.setTeacherName(teacher.getRealName());
|
|
|
detail.setStudentId(extraExerciseReply.getUserId());
|
|
|
detail.setStudentName(extraExerciseReply.getStudentName());
|
|
|
detail.setExpiryDate(extraExerciseReply.getExpireDate());
|
|
@@ -115,6 +117,7 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
if(Objects.isNull(existExtra)){
|
|
|
throw new BizException("作业不存在");
|
|
|
}
|
|
|
+ boolean push=Objects.isNull(existExtra.getAttachments());
|
|
|
ExtracurricularExercises extracurricularExercises = extracurricularExercisesDao.get(existExtra.getExtracurricularExercisesId());
|
|
|
if(Objects.isNull(extracurricularExercises)){
|
|
|
throw new BizException("作业不存在");
|
|
@@ -127,15 +130,17 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
|
|
|
extracurricularExercises.setCompletedNum(submitStudentNum);
|
|
|
extracurricularExercisesDao.update(extracurricularExercises);
|
|
|
|
|
|
- Map<Integer, String> userMap = new HashMap<>();
|
|
|
- userMap.put(extracurricularExercises.getTeacherId(), extracurricularExercises.getTeacherId().toString());
|
|
|
- SysUser user = teacherDao.getUser(existExtra.getUserId());
|
|
|
- String notifyUrl = "9?courseScheduleID=" + existExtra.getId() + "&userId=" + existExtra.getUserId() + "&studentCourseHomeworkId=" + existExtra.getId()+ "&extra=1";
|
|
|
- sysMessageService.batchSendImMessage(MessageTypeEnum.EXTRA_SUBMIT_IM,existExtra.getUserId().toString(),
|
|
|
- new String[]{extracurricularExercises.getTeacherId().toString()},
|
|
|
- null,extracurricularExercises.getTitle());
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.EXTRA_SUBMIT_PUSH,
|
|
|
- userMap, null, 0, notifyUrl, "TEACHER",
|
|
|
- extracurricularExercises.getTitle(), user.getUsername());
|
|
|
+ if(push){
|
|
|
+ Map<Integer, String> userMap = new HashMap<>();
|
|
|
+ userMap.put(extracurricularExercises.getTeacherId(), extracurricularExercises.getTeacherId().toString());
|
|
|
+ SysUser user = teacherDao.getUser(existExtra.getUserId());
|
|
|
+ String notifyUrl = "9?courseScheduleID=" + existExtra.getId() + "&userId=" + existExtra.getUserId() + "&studentCourseHomeworkId=" + existExtra.getId()+ "&extra=1";
|
|
|
+ sysMessageService.batchSendImMessage(MessageTypeEnum.EXTRA_SUBMIT_IM,existExtra.getUserId().toString(),
|
|
|
+ new String[]{extracurricularExercises.getTeacherId().toString()},
|
|
|
+ null,extracurricularExercises.getTitle());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.EXTRA_SUBMIT_PUSH,
|
|
|
+ userMap, null, 0, notifyUrl, "TEACHER",
|
|
|
+ extracurricularExercises.getTitle(), user.getUsername());
|
|
|
+ }
|
|
|
}
|
|
|
}
|