|
@@ -2,22 +2,27 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
|
|
|
-import com.ym.mec.biz.dal.dao.CourseScheduleEvaluateDao;
|
|
|
-import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
+import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
|
|
|
+import com.ym.mec.biz.dal.entity.PracticeGroup;
|
|
|
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.service.CourseScheduleEvaluateService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
+import com.ym.mec.biz.service.SysMessageService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
|
|
|
+import com.ym.mec.util.http.HttpUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Date;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
|
|
|
@Service
|
|
|
public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, CourseScheduleEvaluate> implements CourseScheduleEvaluateService {
|
|
@@ -28,6 +33,12 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
|
|
|
private ClassGroupDao classGroupDao;
|
|
|
@Autowired
|
|
|
private TeacherDao teacherDao;
|
|
|
+ @Autowired
|
|
|
+ private PracticeGroupDao practiceGroupDao;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigDao sysConfigDao;
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, CourseScheduleEvaluate> getDAO() {
|
|
@@ -51,6 +62,17 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
|
|
|
if (num <= 0) {
|
|
|
throw new BizException("报告添加失败,请重试");
|
|
|
}
|
|
|
+ long practiceGroupId = Long.parseLong(classGroup.getMusicGroupId());
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(practiceGroupId);
|
|
|
+
|
|
|
+ Map<Integer, String> push = new HashMap<>(1);
|
|
|
+ push.put(practiceGroup.getStudentId(), practiceGroup.getStudentId().toString());
|
|
|
+ String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
|
|
|
+ String memo = baseUrl + "/#/study?classGroupId=" + classGroup.getId();
|
|
|
+ BasicUserDto teacherInfo = teacherDao.findTeacherInfo(courseScheduleEvaluate.getTeacherId());
|
|
|
+
|
|
|
+ sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.PUSH_STUDY_REPORT, push, null, 0, memo, "STUDENT",
|
|
|
+ teacherInfo.getName(),HttpUtil.getSortUrl(memo));
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -62,9 +84,13 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
|
|
|
}
|
|
|
SysUser user = teacherDao.getUser(studyReport.getStudentId());
|
|
|
BasicUserDto teacherInfo = teacherDao.findTeacherInfo(studyReport.getTeacherId());
|
|
|
-
|
|
|
studyReport.setStudent(user);
|
|
|
studyReport.setTeacher(teacherInfo);
|
|
|
+ long practiceGroupId = Long.parseLong(studyReport.getMusicGroupId());
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(practiceGroupId);
|
|
|
+ ClassGroup classGroup = classGroupDao.get(studyReport.getClassGroupId());
|
|
|
+ studyReport.setTimes(classGroup.getTotalClassTimes());
|
|
|
+ studyReport.setTotalMinutes(classGroup.getTotalClassTimes() * practiceGroup.getSingleClassMinutes());
|
|
|
return studyReport;
|
|
|
|
|
|
}
|