Przeglądaj źródła

1、服务指标

Joburgess 5 lat temu
rodzic
commit
6c10c3fe80

+ 25 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesReplyDao.java

@@ -1,7 +1,9 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto;
+import com.ym.mec.biz.dal.dto.StudentServiceDetailDto;
 import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+import com.ym.mec.biz.dal.dto.StudentServiceHomeworkDto;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
@@ -73,5 +75,28 @@ public interface ExtracurricularExercisesReplyDao extends BaseDAO<Long, Extracur
      */
     List<ExtracurricularExercisesReply> findNoPracticeStudentExercisesInWeek(@Param("monday") String monday,
                                                                              @Param("sunday") String sunday);
+
+    /**
+     * @describe 获取学员再指定时间段内的课程作业和课外训练
+     * @author Joburgess
+     * @date 2020.04.29
+     * @param monday:
+     * @param sunday:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentServiceHomeworkDto>
+     */
+    List<StudentServiceHomeworkDto> findStudentHomewarksInWeek(@Param("monday") String monday,
+                                                               @Param("sunday") String sunday);
+
+    /**
+     * @describe 获取学生在指定时间段内的作业详情
+     * @author Joburgess
+     * @date 2020.04.29
+     * @param params:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentServiceDetailDto>
+     */
+    List<StudentServiceDetailDto> findStudentHomeworkDetailsInTimeZone(Map<String, Object> params);
+    int countStudentHomeworkDetailsInTimeZone(Map<String, Object> params);
+
+
 	
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -60,4 +60,13 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * @return
      */
     List<Map<Integer,Integer>> getPracticeAndVipNums(@Param("teacherIds") String teacherIds);
+
+    /**
+     * @describe 获取服务学员列表
+     * @author Joburgess
+     * @date 2020.04.29
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Student>
+     */
+
+    List<Student> getServiceStudents();
 }

+ 182 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentServiceDetailDto.java

@@ -0,0 +1,182 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.GroupType;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.04.29
+ */
+public class StudentServiceDetailDto {
+
+    private Long homeworkId;
+
+    private Long studentHomeworkId;
+
+    private String homeworkType;
+
+    private String title;
+
+    private String content;
+
+    private Long courseScheduleId;
+
+    private String groupId;
+
+    private GroupType groupType;
+
+    private String groupName;
+
+    private Date courseStartTime;
+
+    private Integer teacherId;
+
+    private String teacherName;
+
+    private Date homeworkCreateTime;
+
+    private Date submitTime;
+
+    private Integer isSubmit;
+
+    private Integer isReplied;
+
+    private String attachments;
+
+    public Long getStudentHomeworkId() {
+        return studentHomeworkId;
+    }
+
+    public void setStudentHomeworkId(Long studentHomeworkId) {
+        this.studentHomeworkId = studentHomeworkId;
+    }
+
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    public GroupType getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(GroupType groupType) {
+        this.groupType = groupType;
+    }
+
+    public Integer getIsSubmit() {
+        return isSubmit;
+    }
+
+    public void setIsSubmit(Integer isSubmit) {
+        this.isSubmit = isSubmit;
+    }
+
+    public Long getHomeworkId() {
+        return homeworkId;
+    }
+
+    public void setHomeworkId(Long homeworkId) {
+        this.homeworkId = homeworkId;
+    }
+
+    public String getHomeworkType() {
+        return homeworkType;
+    }
+
+    public void setHomeworkType(String homeworkType) {
+        this.homeworkType = homeworkType;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Long getCourseScheduleId() {
+        return courseScheduleId;
+    }
+
+    public void setCourseScheduleId(Long courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    public Date getCourseStartTime() {
+        return courseStartTime;
+    }
+
+    public void setCourseStartTime(Date courseStartTime) {
+        this.courseStartTime = courseStartTime;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public Date getHomeworkCreateTime() {
+        return homeworkCreateTime;
+    }
+
+    public void setHomeworkCreateTime(Date homeworkCreateTime) {
+        this.homeworkCreateTime = homeworkCreateTime;
+    }
+
+    public Date getSubmitTime() {
+        return submitTime;
+    }
+
+    public void setSubmitTime(Date submitTime) {
+        this.submitTime = submitTime;
+    }
+
+    public Integer getIsReplied() {
+        return isReplied;
+    }
+
+    public void setIsReplied(Integer isReplied) {
+        this.isReplied = isReplied;
+    }
+
+    public String getAttachments() {
+        return attachments;
+    }
+
+    public void setAttachments(String attachments) {
+        this.attachments = attachments;
+    }
+}

+ 90 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentServiceHomeworkDto.java

@@ -0,0 +1,90 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.04.29
+ */
+public class StudentServiceHomeworkDto {
+
+    private Integer id;
+
+    private Integer userId;
+
+    private Integer status;
+
+    private Integer isReplied;
+
+    private Integer isRepliedTimely;
+
+    private Integer isView;
+
+    private Date submitTime;
+
+    private String type;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getIsReplied() {
+        return isReplied;
+    }
+
+    public void setIsReplied(Integer isReplied) {
+        this.isReplied = isReplied;
+    }
+
+    public Integer getIsRepliedTimely() {
+        return isRepliedTimely;
+    }
+
+    public void setIsRepliedTimely(Integer isRepliedTimely) {
+        this.isRepliedTimely = isRepliedTimely;
+    }
+
+    public Integer getIsView() {
+        return isView;
+    }
+
+    public void setIsView(Integer isView) {
+        this.isView = isView;
+    }
+
+    public Date getSubmitTime() {
+        return submitTime;
+    }
+
+    public void setSubmitTime(Date submitTime) {
+        this.submitTime = submitTime;
+    }
+}

+ 40 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentServiceDetailQueryInfo.java

@@ -0,0 +1,40 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.04.29
+ */
+public class StudentServiceDetailQueryInfo extends QueryInfo {
+
+    private Integer studentId;
+
+    private String monday;
+
+    private String sunday;
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getMonday() {
+        return monday;
+    }
+
+    public void setMonday(String monday) {
+        this.monday = monday;
+    }
+
+    public String getSunday() {
+        return sunday;
+    }
+
+    public void setSunday(String sunday) {
+        this.sunday = sunday;
+    }
+}

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ExtracurricularExercisesReplyService.java

@@ -66,4 +66,6 @@ public interface ExtracurricularExercisesReplyService extends BaseService<Long,
      * @return void
      */
     void exercisesSituationStatistics();
+
+    void exercisesSituationStatistics2();
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentExtracurricularExercisesSituationService.java

@@ -1,8 +1,10 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
+import com.ym.mec.biz.dal.dto.StudentServiceDetailDto;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
+import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
@@ -10,4 +12,22 @@ public interface StudentExtracurricularExercisesSituationService extends BaseSer
 
     PageInfo<StudentExercisesSituationDto> findStudentExtracurricularExercisesSituations(StudentExercisesSituationQueryInfo queryInfo);
 
+    /**
+     * @describe 获取学员服务信息列表
+     * @author Joburgess
+     * @date 2020.04.29
+     * @param queryInfo:
+     * @return com.ym.mec.common.page.PageInfo<com.ym.mec.biz.dal.dto.StudentExercisesSituationDto>
+     */
+    PageInfo<StudentExercisesSituationDto> findServiceStudentSituations(StudentExercisesSituationQueryInfo queryInfo);
+
+    /**
+     * @describe 获取学生服务详情
+     * @author Joburgess
+     * @date 2020.04.29
+     * @param queryInfo:
+     * @return com.ym.mec.common.page.PageInfo<com.ym.mec.biz.dal.dto.StudentServiceDetailDto>
+     */
+    PageInfo<StudentServiceDetailDto> findServiceStudentDetail(StudentServiceDetailQueryInfo queryInfo);
+
 }

+ 68 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java

@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
+import java.math.BigDecimal;
 import java.time.DayOfWeek;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -47,6 +48,8 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 	@Autowired
 	private TeacherDao teacherDao;
 	@Autowired
+	private StudentDao studentDao;
+	@Autowired
 	private CourseScheduleDao courseScheduleDao;
 
 	@Override
@@ -277,4 +280,69 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 		studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString());
 		studentExtracurricularExercisesSituationDao.batchInsert(results);
 	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void exercisesSituationStatistics2() {
+		LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
+		LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+		LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
+
+		List<Student> serviceStudents = studentDao.getServiceStudents();
+		if(CollectionUtils.isEmpty(serviceStudents)){
+			return;
+		}
+
+		List<StudentServiceHomeworkDto> studentHomeworksInWeek = extracurricularExercisesReplyDao.findStudentHomewarksInWeek(monDayDate.toString(), sunDayDate.toString());
+		Map<Integer, List<StudentServiceHomeworkDto>> studentExercisesMap = studentHomeworksInWeek.stream().collect(Collectors.groupingBy(StudentServiceHomeworkDto::getUserId));
+
+		List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
+		for (Student serviceStudent : serviceStudents) {
+			StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation();
+			studentExtracurricularExercisesSituation.setStudentId(serviceStudent.getUserId());
+			studentExtracurricularExercisesSituation.setTeacherId(serviceStudent.getTeacherId());
+			studentExtracurricularExercisesSituation.setExpectExercisesNum(1);
+			studentExtracurricularExercisesSituation.setWeekOfYear(nowDate.get(DateUtil.weekFields.weekOfYear()));
+			studentExtracurricularExercisesSituation.setMonday(DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"));
+			studentExtracurricularExercisesSituation.setSunday(DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"));
+			List<StudentServiceHomeworkDto> studentHomeworks = studentExercisesMap.get(serviceStudent.getUserId());
+			if(CollectionUtils.isEmpty(studentHomeworks)){
+				studentExtracurricularExercisesSituation.setActualExercisesNum(0);
+				studentExtracurricularExercisesSituation.setExercisesReplyNum(0);
+				studentExtracurricularExercisesSituation.setExercisesMessageNum(0);
+				studentExtracurricularExercisesSituation.setExercisesMessageTimelyNum(0);
+				results.add(studentExtracurricularExercisesSituation);
+				continue;
+			}
+			studentExtracurricularExercisesSituation.setActualExercisesNum(1);
+			long replyNum = studentHomeworks.stream().filter(e -> e.getStatus()==1).count();
+			studentExtracurricularExercisesSituation.setExercisesReplyNum(replyNum>0?1:0);
+			int exercisesMessageNum=0;
+			int exercisesMessageTimelyNum=0;
+			for (StudentServiceHomeworkDto studentHomework : studentHomeworks) {
+				if(!new Integer(1).equals(studentHomework.getStatus())){
+					continue;
+				}
+				if(!new Integer(1).equals(studentHomework.getIsReplied())){
+					continue;
+				}
+				exercisesMessageNum+=1;
+				if(new Integer(1).equals(studentHomework.getIsRepliedTimely())){
+					exercisesMessageTimelyNum+=1;
+				}
+			}
+			studentExtracurricularExercisesSituation.setExercisesMessageNum(exercisesMessageNum>0?1:0);
+			studentExtracurricularExercisesSituation.setExercisesMessageTimelyNum(exercisesMessageTimelyNum>0?1:0);
+			results.add(studentExtracurricularExercisesSituation);
+		}
+		BigDecimal currentPage=BigDecimal.ONE,
+                pageSize=new BigDecimal(10000),
+                total=new BigDecimal(results.size()),
+                totalPage=total.divide(pageSize, BigDecimal.ROUND_UP);
+        while (currentPage.compareTo(totalPage)<=0){
+            List<StudentExtracurricularExercisesSituation> rows=results.stream().skip(pageSize.multiply(currentPage.subtract(BigDecimal.ONE)).longValue()).limit(pageSize.longValue()).collect(Collectors.toList());
+            studentExtracurricularExercisesSituationDao.batchInsert(rows);
+            currentPage=currentPage.add(BigDecimal.ONE);
+        }
+	}
 }

+ 58 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -1,11 +1,14 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
+import com.ym.mec.biz.dal.dao.ExtracurricularExercisesReplyDao;
 import com.ym.mec.biz.dal.dao.StudentExtracurricularExercisesSituationDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
+import com.ym.mec.biz.dal.dto.StudentServiceDetailDto;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
+import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
 import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
@@ -23,6 +26,8 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 	@Autowired
 	private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
 	@Autowired
+	private ExtracurricularExercisesReplyDao extracurricularExercisesReplyDao;
+	@Autowired
 	private CourseScheduleDao courseScheduleDao;
 	@Autowired
 	private TeacherDao teacherDao;
@@ -64,4 +69,57 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 		pageInfo.setRows(dataList);
 		return pageInfo;
 	}
+
+	@Override
+	public PageInfo<StudentExercisesSituationDto> findServiceStudentSituations(StudentExercisesSituationQueryInfo queryInfo) {
+		PageInfo<StudentExercisesSituationDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<StudentExercisesSituationDto> dataList = null;
+		int count = studentExtracurricularExercisesSituationDao.countExercisesSituations(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = studentExtracurricularExercisesSituationDao.findExercisesSituations(params);
+			if(Objects.isNull(queryInfo.getExistVipCourse())){
+				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
+				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
+				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
+				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {
+					Long vipCourses=studentVipCourseMap.get(exercisesSituationDto.getStudentId());
+					if(Objects.isNull(vipCourses)||vipCourses<=0){
+						exercisesSituationDto.setExistVipCourse(0);
+					}else{
+						exercisesSituationDto.setExistVipCourse(1);
+					}
+				}
+			}
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
+	public PageInfo<StudentServiceDetailDto> findServiceStudentDetail(StudentServiceDetailQueryInfo queryInfo) {
+		PageInfo<StudentServiceDetailDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<StudentServiceDetailDto> dataList = null;
+		int count = extracurricularExercisesReplyDao.countStudentHomeworkDetailsInTimeZone(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = extracurricularExercisesReplyDao.findStudentHomeworkDetailsInTimeZone(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
 }

+ 130 - 0
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -341,4 +341,134 @@
 					)
 			)
 	</select>
+
+	<resultMap id="StudentServiceHomeworkDto" type="com.ym.mec.biz.dal.dto.StudentServiceHomeworkDto">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="status_" property="status" />
+		<result column="is_replied_" property="isReplied" />
+		<result column="is_replied_timely_" property="isRepliedTimely" />
+		<result column="is_view_" property="isView" />
+		<result column="submit_time_" property="submitTime" />
+		<result column="type_" property="type" />
+	</resultMap>
+
+	<select id="findStudentHomewarksInWeek" resultMap="StudentServiceHomeworkDto">
+		SELECT
+			eer.id_,
+			eer.user_id_,
+			eer.status_,
+			eer.submit_time_,
+			eer.is_replied_,
+			eer.is_replied_timely_,
+			'EXTRA' type_
+		FROM
+			extracurricular_exercises_reply eer
+		WHERE
+			DATE_FORMAT( eer.create_time_, '%Y-%m-%d' ) BETWEEN #{monday} AND #{sunday}
+		UNION ALL
+		SELECT
+			sch.id_,
+			sch.user_id_,
+			sch.status_,
+			sch.submit_time_,
+			sch.is_replied_,
+			sch.is_replied_timely_,
+			'HOMEWORK' type_
+		FROM
+			student_course_homework sch
+			LEFT JOIN course_schedule cs ON cs.id_ = sch.course_schedule_id_
+		WHERE
+			cs.group_type_='PRACTICE' AND DATE_FORMAT( sch.create_time_, '%Y-%m-%d' ) BETWEEN #{monday} AND #{sunday}
+	</select>
+
+	<resultMap id="StudentServiceDetailDto" type="com.ym.mec.biz.dal.dto.StudentServiceDetailDto">
+		<result property="homeworkId" column="homework_id_"/>
+		<result property="studentHomeworkId" column="student_homework_id_"/>
+		<result property="homeworkType" column="homework_type_"/>
+		<result property="title" column="title_"/>
+		<result property="content" column="content_"/>
+		<result property="courseScheduleId" column="course_schedule_id_"/>
+		<result property="groupId" column="group_id_"/>
+		<result property="groupType" column="group_type_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result property="groupName" column="group_name_"/>
+		<result property="courseStartTime" column="course_start_time_"/>
+		<result property="teacherId" column="teacher_id_"/>
+		<result property="teacherName" column="teacher_name_"/>
+		<result property="homeworkCreateTime" column="homework_create_time_"/>
+		<result property="submitTime" column="submit_time_"/>
+		<result property="isSubmit" column="is_submit_"/>
+		<result property="isReplied" column="is_replied_"/>
+		<result property="attachments" column="attachments_"/>
+	</resultMap>
+
+	<select id="findStudentHomeworkDetailsInTimeZone" resultMap="StudentServiceDetailDto">
+		(SELECT
+			ee.id_ homework_id_,
+			eer.id_ student_homework_id_,
+			ee.title_,
+			ee.teacher_id_,
+			tea.real_name_ teacher_name_,
+			NULL group_id_,
+			NULL group_type,
+			NULL group_name_,
+			ee.content_,
+			ee.create_time_ homework_create_time_,
+			eer.user_id_,
+			eer.attachments_,
+			eer.submit_time_,
+			eer.is_replied_,
+			'EXTRA' homework_type_
+		FROM
+			extracurricular_exercises_reply eer
+		LEFT JOIN extracurricular_exercises ee ON ee.id_=eer.extracurricular_exercises_id_
+		LEFT JOIN sys_user tea ON eer.user_id_=tea.id_
+		WHERE
+			eer.user_id_=#{studentId} AND DATE_FORMAT( eer.create_time_, '%Y-%m-%d' ) BETWEEN #{monday} AND #{sunday})
+		UNION ALL
+		(SELECT
+			ch.id_ homework_id_,
+			sch.id_ student_homework_id_,
+			NULL title_,
+			cs.actual_teacher_id_,
+			tea.real_name_ teacher_name_,
+			cs.music_group_id_ group_id_,
+			cs.group_type_ group_type,
+			cs.name_ group_name_,
+			ch.content_,
+			ch.create_time_ homework_create_time_,
+			sch.user_id_,
+			sch.attachments_,
+			sch.submit_time_,
+			sch.is_replied_,
+			'HOMEWORK' homework_type_
+		FROM
+			student_course_homework sch
+		LEFT JOIN course_homework ch ON ch.id_=sch.course_homework_id_
+		LEFT JOIN course_schedule cs ON cs.id_=ch.course_schedule_id_
+		LEFT JOIN sys_user tea ON cs.actual_teacher_id_=tea.id_
+		WHERE
+			sch.user_id_=#{studentId} AND DATE_FORMAT( sch.create_time_, '%Y-%m-%d' ) BETWEEN #{monday} AND #{sunday})
+		ORDER BY homework_create_time_ DESC
+		<include refid="global.limit"/>
+	</select>
+
+	<select id="countStudentHomeworkDetailsInTimeZone" resultType="int">
+		SELECT COUNT(t.id_) FROM (
+			(SELECT
+				eer.id_
+			FROM
+				extracurricular_exercises_reply eer
+			WHERE
+				eer.user_id_=#{studentId} AND DATE_FORMAT( eer.create_time_, '%Y-%m-%d' ) BETWEEN #{monday} AND #{sunday})
+			UNION ALL
+			(SELECT
+				sch.id_
+			FROM
+				student_course_homework sch
+			WHERE
+				sch.user_id_=#{studentId} AND DATE_FORMAT( sch.create_time_, '%Y-%m-%d' ) BETWEEN #{monday} AND #{sunday})
+		) t
+	</select>
+
 </mapper>

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -319,4 +319,9 @@
           AND pg.buy_months_ >= 1
         GROUP BY s.teacher_id_
     </select>
+    <select id="getServiceStudents" resultMap="Student">
+        SELECT su.id_ user_id_,s.teacher_id_ FROM sys_user su
+        LEFT JOIN student s ON s.user_id_=su.id_
+        WHERE s.service_tag_=1 AND FIND_IN_SET('STUDENT', su.user_type_)
+    </select>
 </mapper>

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java

@@ -5,6 +5,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
+import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
 import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -62,4 +63,11 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
         return succeed(studentExtracurricularExercisesSituationService.findStudentExtracurricularExercisesSituations(queryInfo));
     }
 
+    @ApiOperation(value = "服务指标详情")
+    @GetMapping("/findServiceStudentDetail")
+    @PreAuthorize("@pcs.hasPermissions('exercisesSituation/findServiceStudentDetail')")
+    public HttpResponseResult findServiceStudentDetail(StudentServiceDetailQueryInfo queryInfo) {
+        return succeed(studentExtracurricularExercisesSituationService.findServiceStudentDetail(queryInfo));
+    }
+
 }

+ 9 - 19
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -1,29 +1,13 @@
 package com.ym.mec.web.controller;
 
-import java.util.Date;
-
+import com.ym.mec.biz.service.*;
+import com.ym.mec.common.controller.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.ym.mec.biz.service.CourseHomeworkService;
-import com.ym.mec.biz.service.CourseReviewService;
-import com.ym.mec.biz.service.CourseScheduleEvaluateService;
-import com.ym.mec.biz.service.CourseScheduleService;
-import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
-import com.ym.mec.biz.service.CoursesGroupService;
-import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
-import com.ym.mec.biz.service.MusicGroupStudentFeeService;
-import com.ym.mec.biz.service.PracticeGroupService;
-import com.ym.mec.biz.service.StudentCourseHomeworkService;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
-import com.ym.mec.biz.service.StudentService;
-import com.ym.mec.biz.service.TeacherAttendanceService;
-import com.ym.mec.biz.service.TeacherCourseStatisticsService;
-import com.ym.mec.biz.service.TenantPaymentOrderService;
-import com.ym.mec.biz.service.VipGroupService;
-import com.ym.mec.common.controller.BaseController;
+import java.util.Date;
 
 @RequestMapping("task")
 @RestController
@@ -233,6 +217,12 @@ public class TaskController extends BaseController {
 		extracurricularExercisesReplyService.exercisesSituationStatistics();
 	}
 
+	//学生服务信息统计2
+	@GetMapping("/exercisesSituationStatistics2")
+	public void exercisesSituationStatistics2(){
+		extracurricularExercisesReplyService.exercisesSituationStatistics2();
+	}
+
 	//更新学生运营指标
 	@GetMapping("/updateStudentOperatingTag")
 	public void updateStudentOperatingTag(){