瀏覽代碼

Merge remote-tracking branch 'origin/master'

zouxuan 4 年之前
父節點
當前提交
ef5a681085
共有 29 個文件被更改,包括 1180 次插入63 次删除
  1. 1 1
      mec-auth/mec-auth-server/src/main/resources/bootstrap-test.properties
  2. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseHomeworkDao.java
  3. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  4. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  5. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentExtracurricularExercisesSituationDao.java
  6. 19 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherRemindDao.java
  7. 110 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherServeDto.java
  8. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherServeExtraDto.java
  9. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherServeHomeworkDto.java
  10. 104 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherRemind.java
  11. 5 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexErrorType.java
  12. 37 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TeacherRemindTypeEnum.java
  13. 42 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherServeHomeworkQueryInfo.java
  14. 93 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherServeQueryInfo.java
  15. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentExtracurricularExercisesSituationService.java
  16. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherRemindService.java
  17. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherServeService.java
  18. 60 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  19. 253 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java
  20. 24 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherRemindServiceImpl.java
  21. 10 0
      mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml
  22. 23 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  23. 85 6
      mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml
  24. 17 0
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  25. 103 0
      mec-biz/src/main/resources/config/mybatis/TeacherRemindMapper.xml
  26. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java
  27. 10 10
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java
  28. 10 10
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  29. 63 10
      mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java

+ 1 - 1
mec-auth/mec-auth-server/src/main/resources/bootstrap-test.properties

@@ -3,7 +3,7 @@
 #\u670d\u52a1\u5668\u5730\u5740
 spring.cloud.nacos.config.server-addr=47.114.1.200:8848
 #\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
-spring.cloud.nacos.config.namespace=f9d46b0a-9847-48ae-8e4b-216c7a3eb466
+spring.cloud.nacos.config.namespace=f753d9d9-4bb2-4df6-a483-da9e169617c4
 #\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
 spring.cloud.nacos.config.group=DEFAULT_GROUP
 #\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseHomeworkDao.java

@@ -42,6 +42,8 @@ public interface CourseHomeworkDao extends BaseDAO<Long, CourseHomework> {
 	 */
 	CourseHomework findByCourseSchedule(@Param("courseScheduleId") Long courseScheduleId);
 
+	List<CourseHomework> findByCourseSchedules(@Param("courseIds") List<Long> courseIds);
+
 	/**
 	 * 查询老师未回复作业的数量
 	 * @return

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1791,4 +1791,7 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      * @return
      */
     List<Integer> findHasCourseStudent(@Param("userIds") List<Integer> userIds, @Param("groupType") String groupType);
+
+    List<CourseSchedule> queryByCourseScheduleIds(Map<String, Object> params);
+    int countByCourseScheduleIds(Map<String, Object> params);
 }

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

@@ -185,4 +185,7 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * @return java.util.List<com.ym.mec.biz.dal.entity.Subject>
      */
     List<Subject> getStudentSubjects(@Param("studentIds") Set<Integer> studentIds);
+
+    List<Student> queryByIds(Map<String, Object> params);
+    int countByIds(Map<String, Object> params);
 }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentExtracurricularExercisesSituationDao.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
 import com.ym.mec.biz.dal.dto.TeacherExercisesServiceDto;
+import com.ym.mec.biz.dal.dto.TeacherServeDto;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
@@ -113,4 +114,7 @@ public interface StudentExtracurricularExercisesSituationDao extends BaseDAO<Lon
     List<StudentExtracurricularExercisesSituation> findServiceWithCourse(@Param("monday") String monday,
                                                                          @Param("courseId") Long courseId);
 
+    List<TeacherServeDto> queryTeacherServeInfo(Map<String, Object> params);
+    int countTeacherServeInfo(Map<String, Object> params);
+
 }

+ 19 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherRemindDao.java

@@ -0,0 +1,19 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.TeacherRemind;
+import com.ym.mec.biz.dal.enums.TeacherRemindTypeEnum;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface TeacherRemindDao extends BaseDAO<Long, TeacherRemind> {
+
+    int batchInsert(@Param("reminds") List<TeacherRemind> reminds);
+
+    List<TeacherRemind> findTeachersRemindWithType(@Param("remindType")TeacherRemindTypeEnum teacherRemindType,
+                                                   @Param("teacherIds") List<Integer> teacherIds,
+                                                   @Param("startDate") String startDate,
+                                                   @Param("endDate") String endDate);
+	
+}

+ 110 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherServeDto.java

@@ -0,0 +1,110 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/3/9 0009
+ */
+public class TeacherServeDto {
+
+    private Date monday;
+
+    private Date sunday;
+
+    private Integer teacherId;
+
+    private String teacherName;
+
+    private String organName;
+
+    private int homeworkNum;
+
+    private int exerciseNum;
+
+    private int unDone;
+
+    private Date remindDate;
+
+    private String operatorName;
+
+    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 String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public int getHomeworkNum() {
+        return homeworkNum;
+    }
+
+    public void setHomeworkNum(int homeworkNum) {
+        this.homeworkNum = homeworkNum;
+    }
+
+    public int getExerciseNum() {
+        return exerciseNum;
+    }
+
+    public void setExerciseNum(int exerciseNum) {
+        this.exerciseNum = exerciseNum;
+    }
+
+    public int getUnDone() {
+        return unDone;
+    }
+
+    public void setUnDone(int unDone) {
+        this.unDone = unDone;
+    }
+
+    public Date getRemindDate() {
+        return remindDate;
+    }
+
+    public void setRemindDate(Date remindDate) {
+        this.remindDate = remindDate;
+    }
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    public Date getMonday() {
+        return monday;
+    }
+
+    public void setMonday(Date monday) {
+        this.monday = monday;
+    }
+
+    public Date getSunday() {
+        return sunday;
+    }
+
+    public void setSunday(Date sunday) {
+        this.sunday = sunday;
+    }
+}

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherServeExtraDto.java

@@ -0,0 +1,20 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.Student;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/3/10 0010
+ */
+public class TeacherServeExtraDto extends Student {
+
+    private int homeworkExist;
+
+    public int getHomeworkExist() {
+        return homeworkExist;
+    }
+
+    public void setHomeworkExist(int homeworkExist) {
+        this.homeworkExist = homeworkExist;
+    }
+}

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherServeHomeworkDto.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/3/10 0010
+ */
+public class TeacherServeHomeworkDto extends CourseSchedule {
+
+    private String subjectName;
+
+    private int homeworkExist;
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public int getHomeworkExist() {
+        return homeworkExist;
+    }
+
+    public void setHomeworkExist(int homeworkExist) {
+        this.homeworkExist = homeworkExist;
+    }
+}

+ 104 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherRemind.java

@@ -0,0 +1,104 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.dal.enums.TeacherRemindTypeEnum;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import java.util.Date;
+
+/**
+ * 对应数据库表(teacher_remind):
+ */
+public class TeacherRemind {
+
+	/**  */
+	private Long id;
+	
+	/** 操作人 */
+	private Integer operatorId;
+
+	private String operatorName;
+	
+	/** 教师编号 */
+	private Integer teacherId;
+
+	private Date monday;
+	
+	/** 内容 */
+	private String content;
+	
+	/** 类型 */
+	private TeacherRemindTypeEnum type;
+	
+	/** 创建时间 */
+	private java.util.Date createTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setOperatorId(Integer operatorId){
+		this.operatorId = operatorId;
+	}
+	
+	public Integer getOperatorId(){
+		return this.operatorId;
+	}
+
+	public String getOperatorName() {
+		return operatorName;
+	}
+
+	public void setOperatorName(String operatorName) {
+		this.operatorName = operatorName;
+	}
+
+	public void setTeacherId(Integer teacherId){
+		this.teacherId = teacherId;
+	}
+	
+	public Integer getTeacherId(){
+		return this.teacherId;
+	}
+
+	public Date getMonday() {
+		return monday;
+	}
+
+	public void setMonday(Date monday) {
+		this.monday = monday;
+	}
+
+	public void setContent(String content){
+		this.content = content;
+	}
+	
+	public String getContent(){
+		return this.content;
+	}
+
+	public TeacherRemindTypeEnum getType() {
+		return type;
+	}
+
+	public void setType(TeacherRemindTypeEnum type) {
+		this.type = type;
+	}
+
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 5 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexErrorType.java

@@ -20,13 +20,16 @@ public enum IndexErrorType implements BaseEnum<String, IndexErrorType> {
     COURSE_LEAVE_STUDENT_NUM("COURSE_LEAVE_STUDENT_NUM", "学员请假"),
 
     TEACHER_INFO("TEACHER_INFO", "日常行政"),
-    TEACHER_EXCEPTION_ATTENDANCE("TEACHER_EXCEPTION_ATTENDANCE", "课程考勤异常"),
-    TEACHER_NOT_A_CLASS("TEACHER_NOT_A_CLASS", "课程异常"),
     TEACHER_LEAVE("TEACHER_LEAVE", "老师请假"),
     TEACHER_EXPECT_SALARY_BE_LOW("TEACHER_EXPECT_SALARY_BE_LOW", "预计课酬较低"),
     INSPECTION_ITEM("INSPECTION_ITEM", "乐团巡查任务未计划"),
     INSPECTION_ITEM_PLAN("INSPECTION_ITEM_PLAN", "乐团巡查任务未提交"),
     STUDENT_VISIT("STUDENT_VISIT", "回访任务未完成"),
+
+    ATTENDANCE_SERVE("ATTENDANCE_SERVE", "考勤及服务"),
+    TEACHER_EXCEPTION_ATTENDANCE("TEACHER_EXCEPTION_ATTENDANCE", "课程考勤异常"),
+    TEACHER_NOT_A_CLASS("TEACHER_NOT_A_CLASS", "课程异常"),
+    TEACHER_SERVE_ERROR("TEACHER_SERVE_ERROR", "服务指标异常"),
     ;
 
     private String code;

+ 37 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TeacherRemindTypeEnum.java

@@ -0,0 +1,37 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/3/9 0009
+ **/
+public enum TeacherRemindTypeEnum implements BaseEnum<String, TeachTypeEnum> {
+    SERVICE("SERVICE", "服务提醒");
+
+    private String code;
+
+    private String msg;
+
+    TeacherRemindTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 42 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherServeHomeworkQueryInfo.java

@@ -0,0 +1,42 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/3/10 0010
+ */
+public class TeacherServeHomeworkQueryInfo extends QueryInfo {
+
+    private Date monday;
+
+    private Date sunday;
+
+    private Integer teacherId;
+
+    public Date getMonday() {
+        return monday;
+    }
+
+    public void setMonday(Date monday) {
+        this.monday = monday;
+    }
+
+    public Date getSunday() {
+        return sunday;
+    }
+
+    public void setSunday(Date sunday) {
+        this.sunday = sunday;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+}

+ 93 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherServeQueryInfo.java

@@ -0,0 +1,93 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/3/9 0009
+ */
+public class TeacherServeQueryInfo extends QueryInfo {
+
+    private String organId;
+
+    private List<Integer> organIds;
+
+    private Integer teacherId;
+
+    private Integer unDone;
+
+    private Integer reminded;
+
+    private Integer operatorId;
+
+    private String monday;
+
+    private String sunday;
+
+    public String getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(String organId) {
+        this.organId = organId;
+    }
+
+    public List<Integer> getOrganIds() {
+        return organIds;
+    }
+
+    public void setOrganIds(List<Integer> organIds) {
+        this.organIds = organIds;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Integer getUnDone() {
+        return unDone;
+    }
+
+    public void setUnDone(Integer unDone) {
+        this.unDone = unDone;
+    }
+
+    public Integer getReminded() {
+        return reminded;
+    }
+
+    public void setReminded(Integer reminded) {
+        this.reminded = reminded;
+    }
+
+    public Integer getOperatorId() {
+        return operatorId;
+    }
+
+    public void setOperatorId(Integer operatorId) {
+        this.operatorId = operatorId;
+    }
+
+    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;
+    }
+}

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

@@ -1,12 +1,18 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
+import com.ym.mec.biz.dal.dto.TeacherServeDto;
+import com.ym.mec.biz.dal.dto.TeacherServeExtraDto;
+import com.ym.mec.biz.dal.dto.TeacherServeHomeworkDto;
 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.dal.page.TeacherServeHomeworkQueryInfo;
+import com.ym.mec.biz.dal.page.TeacherServeQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -32,4 +38,26 @@ public interface StudentExtracurricularExercisesSituationService extends BaseSer
      */
     List<Map<String, Object>> findServiceStudentDetail(StudentServiceDetailQueryInfo queryInfo);
 
+    /**
+     * @describe 获取教师服务指标明细
+     * @author Joburgess
+     * @date 2021/3/9 0009
+     * @param queryInfo:
+     * @return com.ym.mec.common.page.PageInfo<com.ym.mec.biz.dal.dto.TeacherServeDto>
+     */
+    PageInfo<TeacherServeDto> queryTeacherServeInfo(TeacherServeQueryInfo queryInfo);
+
+    /**
+     * @describe 教师作业布置提醒
+     * @author Joburgess
+     * @date 2021/3/9 0009
+     * @param teacherServes:
+     * @return void
+     */
+    void teacherServeRemindPush(List<TeacherServeDto> teacherServes, Integer operatorId, String operatorName);
+
+    PageInfo<TeacherServeHomeworkDto> queryTeacherServeHomeworkDetail(TeacherServeHomeworkQueryInfo queryInfo);
+
+    PageInfo<TeacherServeExtraDto> queryTeacherServeExtraDetail(TeacherServeHomeworkQueryInfo queryInfo);
+
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherRemindService.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.service;
+
+import java.util.List;
+import com.ym.mec.biz.dal.entity.TeacherRemind;
+import com.ym.mec.common.service.BaseService;
+
+public interface TeacherRemindService extends BaseService<Long, TeacherRemind> {
+
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherServeService.java

@@ -0,0 +1,11 @@
+package com.ym.mec.biz.service;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/3/9 0009
+ **/
+public interface TeacherServeService {
+
+
+
+}

+ 60 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -51,6 +51,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
 	private SysMessageDao sysMessageDao;
+	@Autowired
+	private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
 
 	private static ThreadLocal<Set<Integer>> organIds = new ThreadLocal<Set<Integer>>(){
 		@Override
@@ -323,12 +325,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			three.setDesc(IndexErrorType.TEACHER_INFO.getMsg());
 			List<IndexErrInfoDto> threeChild = new ArrayList<>();
 
-			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
-			threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError, null));
-
-			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime);
-			threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance, null));
-
 //			int teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr,startTime);
 //			threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_LEAVE, IndexErrorType.TEACHER_LEAVE.getMsg(),teacherLeave, null));
 
@@ -351,6 +347,34 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			all.add(three);
 		}
 
+		if(IndexErrorType.ATTENDANCE_SERVE.equals(errorType)){
+			IndexErrInfoDto<IndexErrInfoDto> four = new IndexErrInfoDto<>();
+			four.setErrorType(IndexErrorType.ATTENDANCE_SERVE);
+			four.setDesc(IndexErrorType.ATTENDANCE_SERVE.getMsg());
+			List<IndexErrInfoDto> fourChild = new ArrayList<>();
+
+			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
+			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError, null));
+
+			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime);
+			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance, null));
+
+			Map<String, Object> params = new HashMap<>();
+			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());
+			params.put("organIds", organIds);
+			params.put("monday",monDayDate.toString());
+			params.put("sunday",sunDayDate.toString());
+			params.put("unDone",1);
+			int serveErrTeacherNum = studentExtracurricularExercisesSituationDao.countTeacherServeInfo(params);
+			fourChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_SERVE_ERROR, IndexErrorType.TEACHER_SERVE_ERROR.getMsg(), serveErrTeacherNum, null));
+
+			four.setNum(fourChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
+			four.setResult(fourChild);
+			all.add(four);
+		}
+
 		Map<String, Object> result = new HashMap<>(2);
 		result.put("totalNum", all.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 		result.put("data", all);
@@ -424,18 +448,6 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		resultMap.put("studentInfo",flag2);
 		boolean flag3 = false;
 		if(!flag3){
-			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
-			if(attendanceError > 0){
-				flag3 = true;
-			}
-		}
-		if(!flag3){
-			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime);
-			if(noAttendance > 0){
-				flag3 = true;
-			}
-		}
-		if(!flag3){
 			int teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr,startTime);
 			if(teacherLeave > 0){
 				flag3 = true;
@@ -467,6 +479,36 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 		}
 		resultMap.put("teacherInfo",flag3);
+
+		boolean flag4 = false;
+		if(!flag4){
+			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
+			if(attendanceError > 0){
+				flag4 = true;
+			}
+		}
+		if(!flag4){
+			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime);
+			if(noAttendance > 0){
+				flag4 = true;
+			}
+		}
+		if(!flag4){
+			Map<String, Object> params = new HashMap<>();
+			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());
+			params.put("organIds", organIds);
+			params.put("monday",monDayDate.toString());
+			params.put("sunday",sunDayDate.toString());
+			params.put("unDone",1);
+			int serveErrTeacherNum = studentExtracurricularExercisesSituationDao.countTeacherServeInfo(params);
+			if(serveErrTeacherNum > 0){
+				flag4 = true;
+			}
+		}
+		resultMap.put("attendanceServe",flag4);
+
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			throw new BizException("用户信息获取失败");

+ 253 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -1,23 +1,29 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.StudentEduTeacherDto;
-import com.ym.mec.biz.dal.dto.StudentExercisesSituationDto;
-import com.ym.mec.biz.dal.dto.StudentServiceDetailDto;
-import com.ym.mec.biz.dal.dto.UserGroupDto;
-import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
+import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
+import com.ym.mec.biz.dal.enums.TeacherRemindTypeEnum;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
+import com.ym.mec.biz.dal.page.TeacherServeHomeworkQueryInfo;
+import com.ym.mec.biz.dal.page.TeacherServeQueryInfo;
 import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
+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.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.time.DayOfWeek;
@@ -42,6 +48,18 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 	@Autowired
 	private StudentRegistrationDao studentRegistrationDao;
+	@Autowired
+	private TeacherRemindDao teacherRemindDao;
+	@Autowired
+	private SysMessageService sysMessageService;
+	@Autowired
+	private StudentDao studentDao;
+	@Autowired
+	private SubjectDao subjectDao;
+	@Autowired
+	private CourseHomeworkDao courseHomeworkDao;
+	@Autowired
+	private ClassGroupDao classGroupDao;
 
 	@Override
 	public BaseDAO<Long, StudentExtracurricularExercisesSituation> getDAO() {
@@ -158,6 +176,49 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 	}
 
 	@Override
+	public PageInfo<TeacherServeDto> queryTeacherServeInfo(TeacherServeQueryInfo queryInfo) {
+		if(StringUtils.isNotBlank(queryInfo.getOrganId())){
+			List<Integer> organIds = Arrays.stream(queryInfo.getOrganId().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+			queryInfo.setOrganIds(organIds);
+		}
+		PageInfo<TeacherServeDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<TeacherServeDto> dataList = null;
+		int count = studentExtracurricularExercisesSituationDao.countTeacherServeInfo(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = studentExtracurricularExercisesSituationDao.queryTeacherServeInfo(params);
+			List<Integer> teacherIds = dataList.stream().map(TeacherServeDto::getTeacherId).collect(Collectors.toList());
+			List<TeacherRemind> teacherReminds = teacherRemindDao.findTeachersRemindWithType(TeacherRemindTypeEnum.SERVICE, teacherIds, queryInfo.getMonday(), queryInfo.getSunday());
+			Map<String, Map<Integer, List<TeacherRemind>>> mondayTeacherRemindMap = new HashMap<>();
+			if(!CollectionUtils.isEmpty(teacherReminds)){
+				mondayTeacherRemindMap = teacherReminds.stream().collect(Collectors.groupingBy(e -> DateUtil.dateToString(e.getMonday(), "yyyy-MM-dd"), Collectors.groupingBy(TeacherRemind::getTeacherId)));
+			}
+			for (TeacherServeDto teacherServeDto : dataList) {
+				String mondayStr = DateUtil.dateToString(teacherServeDto.getMonday(), "yyyy-MM-dd");
+				if(!mondayTeacherRemindMap.containsKey(mondayStr)){
+					continue;
+				}
+				Map<Integer, List<TeacherRemind>> teacherRemindMap = mondayTeacherRemindMap.get(mondayStr);
+				if(!teacherRemindMap.containsKey(teacherServeDto.getTeacherId())){
+					continue;
+				}
+				TeacherRemind lastTeacherRemind = teacherRemindMap.get(teacherServeDto.getTeacherId()).stream().max(Comparator.comparing(TeacherRemind::getCreateTime)).get();
+				teacherServeDto.setOperatorName(lastTeacherRemind.getOperatorName());
+				teacherServeDto.setRemindDate(lastTeacherRemind.getCreateTime());
+			}
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
 	public List<Map<String, Object>> findServiceStudentDetail(StudentServiceDetailQueryInfo queryInfo) {
 		PageInfo<StudentServiceDetailDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<>();
@@ -193,4 +254,191 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			return null;
 		}
 	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void teacherServeRemindPush(List<TeacherServeDto> teacherServes, Integer operatorId, String operatorName) {
+		if(CollectionUtils.isEmpty(teacherServes)){
+			return;
+		}
+		List<TeacherRemind> reminds = new ArrayList<>();
+		for (TeacherServeDto teacherServe : teacherServes) {
+			if(Objects.isNull(teacherServe.getMonday())||Objects.isNull(teacherServe.getSunday())||Objects.isNull(teacherServe.getTeacherId())){
+				continue;
+			}
+			String mondayStr = DateUtil.dateToString(teacherServe.getMonday(), "yyyy-MM-dd");
+			List<StudentExtracurricularExercisesSituation> serves = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(mondayStr, teacherServe.getTeacherId(), null);
+			if(CollectionUtils.isEmpty(serves)){
+				continue;
+			}
+			TeacherRemind remind = new TeacherRemind();
+			remind.setOperatorId(operatorId);
+			remind.setOperatorName(operatorName);
+			remind.setMonday(teacherServe.getMonday());
+			remind.setTeacherId(teacherServe.getTeacherId());
+			remind.setType(TeacherRemindTypeEnum.SERVICE);
+			remind.setContent("作业布置提醒");
+			reminds.add(remind);
+
+			Map<Integer, String> userMap = new HashMap<>();
+			userMap.put(teacherServe.getTeacherId(), teacherServe.getTeacherId().toString());
+			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.HOMEWORK_REMIND,
+					userMap, null, 0, null, "TEACHER", null);
+		}
+		if(!CollectionUtils.isEmpty(reminds)){
+			teacherRemindDao.batchInsert(reminds);
+		}
+	}
+
+	@Override
+	public PageInfo<TeacherServeHomeworkDto> queryTeacherServeHomeworkDetail(TeacherServeHomeworkQueryInfo queryInfo) {
+		if(Objects.isNull(queryInfo.getMonday())||Objects.isNull(queryInfo.getSunday())||Objects.isNull(queryInfo.getTeacherId())){
+			throw new BizException("请指定教师");
+		}
+		PageInfo<TeacherServeHomeworkDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		String mondayStr = DateUtil.dateToString(queryInfo.getMonday(), "yyyy-MM-dd");
+		List<StudentExtracurricularExercisesSituation> serves = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(mondayStr, queryInfo.getTeacherId(), null);
+		if(CollectionUtils.isEmpty(serves)){
+			return pageInfo;
+		}
+		List<StudentExtracurricularExercisesSituation> homeworkServes = serves.stream().filter(s -> "HOMEWORK".equals(s.getServeType())).collect(Collectors.toList());
+		if(CollectionUtils.isEmpty(homeworkServes)){
+			return pageInfo;
+		}
+		List<Long> courseIdsArr = new ArrayList<>();
+		for (StudentExtracurricularExercisesSituation homeworkServe : homeworkServes) {
+			if(StringUtils.isBlank(homeworkServe.getCourseIds())){
+				continue;
+			}
+			List<Long> ids = Arrays.stream(homeworkServe.getCourseIds().split(",")).map(id -> Long.valueOf(id)).collect(Collectors.toList());
+			courseIdsArr.addAll(ids);
+		}
+		if(CollectionUtils.isEmpty(courseIdsArr)){
+			return pageInfo;
+		}
+
+		Map<Long, Long> courseNumMap = courseIdsArr.stream().collect(Collectors.groupingBy(id -> id, Collectors.counting()));
+		Set<Long> courseIds = new HashSet<>(courseIdsArr);
+
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+		params.put("courseIds", courseIds);
+
+		List<TeacherServeHomeworkDto> dataList = new ArrayList<>();
+		int count = courseScheduleDao.countByCourseScheduleIds(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			List<CourseSchedule> courseSchedules = courseScheduleDao.queryByCourseScheduleIds(params);
+			List<Integer> classGroupIds = courseSchedules.stream().map(CourseSchedule::getClassGroupId).collect(Collectors.toList());
+			List<ClassGroup> classGroups = classGroupDao.findByClassGroupIds(classGroupIds, null);
+			Map<Integer, ClassGroup> idClassGroupMap = classGroups.stream().collect(Collectors.toMap(ClassGroup::getId, c -> c, (c1, c2) -> c1));
+
+			List<CourseHomework> courseHomeworks = courseHomeworkDao.findByCourseSchedules(new ArrayList<>(courseIds));
+			Map<Long, Long> courseHomeworkMap = new HashMap<>();
+			if(!CollectionUtils.isEmpty(courseHomeworks)){
+				courseHomeworkMap = courseHomeworks.stream().collect(Collectors.groupingBy(CourseHomework::getCourseScheduleId, Collectors.counting()));
+			}
+			List<Integer> subjectIds = new ArrayList<>();
+			for (CourseSchedule courseSchedule : courseSchedules) {
+				if(idClassGroupMap.containsKey(courseSchedule.getClassGroupId())){
+					List<Integer> ids = Arrays.stream(idClassGroupMap.get(courseSchedule.getClassGroupId()).getSubjectIdList().split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
+					subjectIds.addAll(ids);
+				}
+				TeacherServeHomeworkDto tshd = new TeacherServeHomeworkDto();
+				BeanUtils.copyProperties(courseSchedule,tshd);
+				tshd.setStudentNum(courseNumMap.get(courseSchedule.getId()).intValue());
+				if(courseHomeworkMap.containsKey(courseSchedule.getId())){
+					tshd.setHomeworkExist(1);
+				}
+				dataList.add(tshd);
+			}
+			List<Subject> subjects = subjectDao.findBySubjectIds(new ArrayList<>(subjectIds));
+			for (TeacherServeHomeworkDto teacherServeHomeworkDto : dataList) {
+				if(idClassGroupMap.containsKey(teacherServeHomeworkDto.getClassGroupId())){
+					ClassGroup classGroup = idClassGroupMap.get(teacherServeHomeworkDto.getClassGroupId());
+					if(StringUtils.isNotBlank(classGroup.getSubjectIdList())){
+						Set<Integer> sids = Arrays.stream(classGroup.getSubjectIdList().split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toSet());
+						List<String> subjectNames = subjects.stream().filter(s -> sids.contains(s.getId())).map(Subject::getName).collect(Collectors.toList());
+						teacherServeHomeworkDto.setSubjectName(StringUtils.join(subjectNames, ","));
+					}
+				}
+			}
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
+	public PageInfo<TeacherServeExtraDto> queryTeacherServeExtraDetail(TeacherServeHomeworkQueryInfo queryInfo) {
+		if(Objects.isNull(queryInfo.getMonday())||Objects.isNull(queryInfo.getSunday())||Objects.isNull(queryInfo.getTeacherId())){
+			throw new BizException("请指定教师");
+		}
+		PageInfo<TeacherServeExtraDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		String mondayStr = DateUtil.dateToString(queryInfo.getMonday(), "yyyy-MM-dd");
+		List<StudentExtracurricularExercisesSituation> serves = studentExtracurricularExercisesSituationDao.findWeekServiceWithStudents(mondayStr, queryInfo.getTeacherId(), null);
+		if(CollectionUtils.isEmpty(serves)){
+			return pageInfo;
+		}
+		List<StudentExtracurricularExercisesSituation> homeworkServes = serves.stream().filter(s -> "EXERCISE".equals(s.getServeType())).collect(Collectors.toList());
+		if(CollectionUtils.isEmpty(homeworkServes)){
+			return pageInfo;
+		}
+
+		Set<Integer> studentIds = homeworkServes.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toSet());
+		Map<Integer, List<StudentExtracurricularExercisesSituation>> studentServeMap = homeworkServes.stream().collect(Collectors.groupingBy(StudentExtracurricularExercisesSituation::getStudentId));
+
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+		params.put("studentIds", studentIds);
+
+		List<TeacherServeExtraDto> dataList = new ArrayList<>();
+		int count = studentDao.countByIds(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			List<Student> students = studentDao.queryByIds(params);
+			List<SimpleUserDto> usersSimpleInfo = teacherDao.getUsersSimpleInfo(new ArrayList<>(studentIds));
+			Map<Integer, String> idNameMap = new HashMap<>();
+			if(!CollectionUtils.isEmpty(usersSimpleInfo)){
+				idNameMap = usersSimpleInfo.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, s -> s.getNickName(), (s1, s2) -> s1));
+			}
+			Set<Integer> subjectIds = new HashSet<>();
+			for (Student student : students) {
+				if(StringUtils.isNotBlank(student.getSubjectIdList())){
+					Set<Integer> ids = Arrays.stream(student.getSubjectIdList().split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toSet());
+					subjectIds.addAll(ids);
+				}
+				TeacherServeExtraDto tsed = new TeacherServeExtraDto();
+				BeanUtils.copyProperties(student,tsed);
+				if(studentServeMap.containsKey(student.getUserId())){
+					List<StudentExtracurricularExercisesSituation> studentServes = studentServeMap.get(student.getUserId());
+					int num = studentServes.stream().mapToInt(StudentExtracurricularExercisesSituation::getActualExercisesNum).reduce(0, Integer::sum);
+					if(num>0){
+						tsed.setHomeworkExist(1);
+					}
+				}
+				dataList.add(tsed);
+			}
+			List<Subject> subjects = subjectDao.findBySubjectIds(new ArrayList<>(subjectIds));
+			for (TeacherServeExtraDto teacherServeExtraDto : dataList) {
+				if(idNameMap.containsKey(teacherServeExtraDto.getUserId())){
+					teacherServeExtraDto.setUsername(idNameMap.get(teacherServeExtraDto.getUserId()));
+				}
+				if(StringUtils.isNotBlank(teacherServeExtraDto.getSubjectIdList())){
+					Set<Integer> sids = Arrays.stream(teacherServeExtraDto.getSubjectIdList().split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toSet());
+					List<String> subjectNames = subjects.stream().filter(s -> sids.contains(s.getId())).map(Subject::getName).collect(Collectors.toList());
+					teacherServeExtraDto.setSubjectNames(StringUtils.join(subjectNames, ","));
+				}
+			}
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
 }

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherRemindServiceImpl.java

@@ -0,0 +1,24 @@
+package com.ym.mec.biz.service.impl;
+
+import java.util.List;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.ym.mec.biz.dal.entity.TeacherRemind;
+import com.ym.mec.biz.service.TeacherRemindService;
+import com.ym.mec.biz.dal.dao.TeacherRemindDao;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TeacherRemindServiceImpl extends BaseServiceImpl<Long, TeacherRemind> implements TeacherRemindService {
+	
+	@Autowired
+	private TeacherRemindDao teacherRemindDao;
+
+	@Override
+	public BaseDAO<Long, TeacherRemind> getDAO() {
+		return teacherRemindDao;
+	}
+	
+}

+ 10 - 0
mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml

@@ -231,6 +231,16 @@
 			course_homework ch
 			WHERE ch.course_schedule_id_=#{courseScheduleId}
 	</select>
+	<select id="findByCourseSchedules" resultMap="CourseHomework">
+		SELECT
+			ch.*
+		FROM
+			course_homework ch
+		WHERE ch.course_schedule_id_ IN
+			<foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
+				#{courseId}
+			</foreach>
+	</select>
 	
 	<select id="queryTeacerNoReplyNum" resultMap="Mapper">
 		select cs.actual_teacher_id_ key_,count(1) value_ from student_course_homework sch

+ 23 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -3629,4 +3629,27 @@
         AND FIND_IN_SET(cs.group_type_,#{groupType})
         GROUP BY cssp.user_id_
     </select>
+
+    <select id="queryByCourseScheduleIds" resultMap="CourseSchedule">
+        SELECT
+        <include refid="resultSql" />
+        FROM course_schedule cs
+        WHERE cs.id_ IN
+        <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
+            #{courseId}
+        </foreach>
+        ORDER BY cs.class_date_,cs.start_class_time_,cs.id_
+        <include refid="global.limit"></include>
+    </select>
+    <select id="countByCourseScheduleIds" resultType="int">
+        SELECT
+        COUNT(cs.id_)
+        FROM course_schedule cs
+        WHERE cs.id_ IN
+        <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
+            #{courseId}
+        </foreach>
+    </select>
+
+
 </mapper>

+ 85 - 6
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -45,8 +45,8 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		<selectKey resultClass="int" keyProperty="id" >
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
 		</selectKey>
 		-->
 		INSERT INTO student_extracurricular_exercises_situation_ (id_,student_id_,week_of_year_,monday_,sunday_,teacher_id_,expect_exercises_num_,
@@ -454,10 +454,12 @@
 		  <if test="teacherId!=null">
 			  AND teacher_id_=#{teacherId}
 		  </if>
-		  AND student_id_ IN
-		<foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
-			#{studentId}
-		</foreach>
+		  <if test="studentIds!=null and studentIds.size()>0">
+			  AND student_id_ IN
+			  <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+				  #{studentId}
+			  </foreach>
+		  </if>
 	</select>
     <select id="findTeacherNoStartServices" resultMap="StudentExtracurricularExercisesSituation">
 		SELECT * FROM student_extracurricular_exercises_situation_ WHERE teacher_id_=#{teacherId} AND actual_exercises_num_&lt;=0 AND serve_type_='HOMEWORK';
@@ -467,4 +469,81 @@
 			resultMap="StudentExtracurricularExercisesSituation">
 		SELECT * FROM student_extracurricular_exercises_situation_ WHERE monday_=#{monday} AND FIND_IN_SET(#{courseId}, course_ids_)
 	</select>
+
+	<resultMap id="TeacherServeDto" type="com.ym.mec.biz.dal.dto.TeacherServeDto">
+		<result column="organ_name_" property="organName"/>
+		<result column="monday_" property="monday"/>
+		<result column="sunday_" property="sunday"/>
+		<result column="teacher_id_" property="teacherId"/>
+		<result column="teacher_name_" property="teacherName"/>
+		<result column="homework_num_" property="homeworkNum"/>
+		<result column="exercise_num_" property="exerciseNum"/>
+		<result column="un_done_" property="unDone"/>
+		<result column="remind_time_" property="remindDate"/>
+		<result column="operator_name_" property="operatorName"/>
+	</resultMap>
+
+	<sql id="queryTeacherServeInfoCondition">
+		<where>
+			<if test="organIds!=null and organIds.size()>0">
+				AND tea.organ_id_ IN
+				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
+			<if test="monday!=null and monday!='' and sunday!=null and sunday!=''">
+				AND sees.monday_ BETWEEN #{monday} AND #{sunday}
+			</if>
+			<if test="teacherId!=null">
+				AND sees.teacher_id_ = #{teacherId}
+			</if>
+			<if test="unDone!=null and unDone==1">
+				AND sees.expect_exercises_num_>sees.actual_exercises_num_
+			</if>
+			<if test="unDone!=null and unDone==0">
+				AND sees.expect_exercises_num_=sees.actual_exercises_num_
+			</if>
+			<if test="reminded!=null and reminded==0">
+				AND NOT EXISTS (SELECT id_ FROM teacher_remind WHERE teacher_id_=sees.teacher_id_ AND monday_ BETWEEN #{monday} AND #{sunday} AND type_='SERVE')
+			</if>
+			<if test="reminded!=null and reminded==1">
+				AND EXISTS (SELECT id_ FROM teacher_remind WHERE teacher_id_=sees.teacher_id_ AND monday_ BETWEEN #{monday} AND #{sunday} AND type_='SERVE')
+			</if>
+			<if test="operatorId!=null">
+				AND EXISTS (SELECT id_ FROM teacher_remind WHERE operator_id_=#{operatorId} AND teacher_id_=sees.teacher_id_ AND monday_ BETWEEN #{monday} AND #{sunday} AND type_='SERVE')
+			</if>
+		</where>
+	</sql>
+
+	<select id="queryTeacherServeInfo" resultMap="TeacherServeDto">
+		SELECT
+			organ.name_ organ_name_,
+			sees.monday_,
+			sees.sunday_,
+			sees.teacher_id_,
+			su.real_name_ teacher_name_,
+			SUM(CASE sees.serve_type_ WHEN 'HOMEWORK' THEN sees.expect_exercises_num_ ELSE 0 END) homework_num_,
+			SUM(CASE sees.serve_type_ WHEN 'EXERCISE' THEN sees.expect_exercises_num_ ELSE 0 END) exercise_num_,
+			SUM(sees.expect_exercises_num_)>SUM(sees.actual_exercises_num_) un_done_
+		FROM
+			student_extracurricular_exercises_situation_ sees
+			LEFT JOIN teacher tea ON tea.id_=sees.teacher_id_
+			LEFT JOIN organization organ ON organ.id_=tea.organ_id_
+			LEFT JOIN sys_user su ON tea.id_=su.id_
+		<include refid="queryTeacherServeInfoCondition" />
+		GROUP BY sees.monday_,sees.sunday_,sees.teacher_id_ ORDER BY sees.monday_,sees.sunday_,sees.teacher_id_
+		<include refid="global.limit"></include>
+	</select>
+
+	<select id="countTeacherServeInfo" resultType="int">
+		SELECT COUNT(1) FROM (
+			SELECT
+				sees.id_
+			FROM
+				student_extracurricular_exercises_situation_ sees
+				LEFT JOIN teacher tea ON tea.id_=sees.teacher_id_
+			<include refid="queryTeacherServeInfoCondition" />
+			GROUP BY sees.monday_,sees.sunday_,sees.teacher_id_ ORDER BY sees.monday_,sees.sunday_,sees.teacher_id_
+		) e
+	</select>
 </mapper>

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

@@ -644,4 +644,21 @@
             AND sub.id_ IS NOT NULL
         ORDER BY sub.id_ DESC
     </select>
+
+    <select id="queryByIds" resultMap="Student">
+        SELECT * FROM student
+        WHERE user_id_ IN
+        <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+            #{studentId}
+        </foreach>
+        ORDER BY user_id_
+        <include refid="global.limit"></include>
+    </select>
+    <select id="countByIds" resultType="int">
+        SELECT count(user_id_) FROM student
+        WHERE user_id_ IN
+        <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+            #{studentId}
+        </foreach>
+    </select>
 </mapper>

+ 103 - 0
mec-biz/src/main/resources/config/mybatis/TeacherRemindMapper.xml

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.TeacherRemindDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.TeacherRemind" id="TeacherRemind">
+		<result column="id_" property="id" />
+		<result column="operator_id_" property="operatorId" />
+		<result column="operator_name_" property="operatorName" />
+		<result column="teacher_id_" property="teacherId" />
+		<result column="monday_" property="monday"/>
+		<result column="content_" property="content" />
+		<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="TeacherRemind" >
+		SELECT * FROM teacher_remind WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="TeacherRemind">
+		SELECT * FROM teacher_remind ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.TeacherRemind" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO teacher_remind (operator_id_,operator_name_,teacher_id_,monday_,content_,type_,create_time_)
+		VALUES(#{operatorId},#{operatorName},#{teacherId},#{monday},#{content},#{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},NOW())
+	</insert>
+
+	<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.TeacherRemind" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO teacher_remind (operator_id_,operator_name_,teacher_id_,monday_,content_,type_,create_time_)
+		VALUE
+		<foreach collection="reminds" item="remind" separator=",">
+			(#{remind.operatorId},#{remind.operatorName},#{remind.teacherId},#{remind.monday},#{remind.content},#{remind.type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},NOW())
+		</foreach>
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.TeacherRemind">
+		UPDATE teacher_remind <set>
+		<if test="operatorId != null">
+			operator_id_ = #{operatorId},
+		</if>
+		<if test="operatorName != null">
+			operator_name_ = #{operatorName},
+		</if>
+		<if test="id != null">
+			id_ = #{id},
+		</if>
+		<if test="teacherId != null">
+			teacher_id_ = #{teacherId},
+		</if>
+		<if test="monday != null">
+			monday_ = #{monday},
+		</if>
+		<if test="content != null">
+			content_ = #{content},
+		</if>
+		<if test="type != null">
+			type_ = #{type, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		</if>
+	</set> WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM teacher_remind WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="TeacherRemind" parameterType="map">
+		SELECT * FROM teacher_remind ORDER BY id_ <include refid="global.limit"/>
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM teacher_remind
+	</select>
+
+	<select id="findTeachersRemindWithType" resultMap="TeacherRemind">
+		SELECT *
+		FROM teacher_remind
+		WHERE type_=#{remindType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+		    AND teacher_id_ IN
+			<foreach collection="teacherIds" item="teacherId" open="(" close=")" separator=",">
+				#{teacherId}
+			</foreach>
+			<if test="startDate!=null and endDate!=null">
+				AND monday_ BETWEEN #{startDate} AND #{endDate}
+			</if>
+	</select>
+</mapper>

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java

@@ -67,7 +67,7 @@ public class MusicGroupRegisterController extends BaseController {
 
         StudentRegistration hasReg = studentRegistrationService.getByPhoneAndMusicGroupId(studentRegistration.getMusicGroupId(), studentRegistration.getParentsPhone());
         if (hasReg != null && hasReg.getMusicGroupStatus() != StudentMusicGroupStatusEnum.QUIT && MusicGroupStatusEnum.PAY.equals(musicGroup.getStatus())) {
-            return failed(HttpStatus.CONTINUE,"该乐团您已报名");
+            return succeed(hasReg);
         }
 
         if (musicGroup.getStatus().equals(MusicGroupStatusEnum.PAY)) {

+ 10 - 10
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -53,17 +53,17 @@ public class EmployeeController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeService.get(sysUser.getId());
-			if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-				queryInfo.setOrganId(employee.getOrganIdList());
-			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-                return failed("用户所在分部异常");
-            }else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                    return failed("非法请求");
-                }
+        Employee employee = employeeService.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+            return failed("用户所在分部异常");
+        }else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                return failed("非法请求");
             }
+        }
         return succeed(employeeService.queryEmployByOrganId(queryInfo));
     }
 

+ 10 - 10
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -123,17 +123,17 @@ public class IndexController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
-			Employee employee = employeeService.get(sysUser.getId());
-			if (StringUtils.isBlank(indexDataQueryInfo.getOrganId())) {
-				indexDataQueryInfo.setOrganId(employee.getOrganIdList());
-			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
-				return failed("用户所在分部异常");
-			}else {
-				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-				if(!list.containsAll(Arrays.asList(indexDataQueryInfo.getOrganId().split(",")))){
-					return failed("非法请求");
-				}
+		Employee employee = employeeService.get(sysUser.getId());
+		if (StringUtils.isBlank(indexDataQueryInfo.getOrganId())) {
+			indexDataQueryInfo.setOrganId(employee.getOrganIdList());
+		}else if(StringUtils.isEmpty(employee.getOrganIdList())){
+			return failed("用户所在分部异常");
+		}else {
+			List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+			if(!list.containsAll(Arrays.asList(indexDataQueryInfo.getOrganId().split(",")))){
+				return failed("非法请求");
 			}
+		}
 		return succeed(indexService.getIndexBaseData(indexDataQueryInfo));
 	}
 

+ 63 - 10
mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java

@@ -3,14 +3,10 @@ package com.ym.mec.web.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dto.TeacherServeDto;
 import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.page.StudentCourseHomeworkReplyQueryInfo;
-import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
-import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
-import com.ym.mec.biz.service.ExtracurricularExercisesMessageService;
-import com.ym.mec.biz.service.StudentCourseHomeworkReplyService;
-import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
-import com.ym.mec.biz.service.StudentServeService;
+import com.ym.mec.biz.dal.page.*;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.util.date.DateUtil;
@@ -19,9 +15,7 @@ import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.time.DayOfWeek;
 import java.time.LocalDate;
@@ -55,6 +49,9 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
     @Autowired
     private EmployeeDao employeeDao;
 
+    @Autowired
+    private EmployeeService employeeService;
+
     @ApiOperation(value = "课外训练-教学")
     @GetMapping("/findStudentExtracurricularExercisesSituations")
     @PreAuthorize("@pcs.hasPermissions('exercisesSituation/findStudentExtracurricularExercisesSituations')")
@@ -84,6 +81,28 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
         return succeed(studentExtracurricularExercisesSituationService.findServiceStudentDetail(queryInfo));
     }
 
+    @ApiOperation(value = "教师服务指标明细")
+    @GetMapping("/queryTeacherServeInfo")
+    @PreAuthorize("@pcs.hasPermissions('exercisesSituation/queryTeacherServeInfo')")
+    public HttpResponseResult queryTeacherServeInfo(TeacherServeQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        Employee employee = employeeService.get(sysUser.getId());
+        if (StringUtils.isBlank(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+            return failed("用户所在分部异常");
+        }else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                return failed("非法请求");
+            }
+        }
+        return succeed(studentExtracurricularExercisesSituationService.queryTeacherServeInfo(queryInfo));
+    }
+
     @ApiOperation(value = "回复查询")
     @GetMapping("/findStudentHomeworkComments")
     public Object findStudentHomeworkComments(StudentCourseHomeworkReplyQueryInfo queryInfo){
@@ -113,4 +132,38 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
         return succeed();
     }
 
+    @ApiOperation(value = "教师作业布置提醒")
+    @PostMapping("/teacherServeRemindPush")
+    @PreAuthorize("@pcs.hasPermissions('exercisesSituation/teacherServeRemindPush')")
+    public HttpResponseResult teacherServeRemindPush(@RequestBody List<TeacherServeDto> teacherServes) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        studentExtracurricularExercisesSituationService.teacherServeRemindPush(teacherServes, sysUser.getId(), sysUser.getRealName());
+        return succeed();
+    }
+
+    @ApiOperation(value = "教师服务课后作业")
+    @GetMapping("/queryTeacherServeHomeworkDetail")
+    @PreAuthorize("@pcs.hasPermissions('exercisesSituation/queryTeacherServeHomeworkDetail')")
+    public HttpResponseResult queryTeacherServeHomeworkDetail(TeacherServeHomeworkQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        return succeed(studentExtracurricularExercisesSituationService.queryTeacherServeHomeworkDetail(queryInfo));
+    }
+
+    @ApiOperation(value = "教师服务课外作业")
+    @GetMapping("/queryTeacherServeExtraDetail")
+    @PreAuthorize("@pcs.hasPermissions('exercisesSituation/queryTeacherServeExtraDetail')")
+    public HttpResponseResult queryTeacherServeExtraDetail(TeacherServeHomeworkQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        return succeed(studentExtracurricularExercisesSituationService.queryTeacherServeExtraDetail(queryInfo));
+    }
+
 }