Joburgess 4 vuotta sitten
vanhempi
commit
134f520075

+ 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(@Param("params") Map<String, Object> params);
+    int countTeacherServeInfo(@Param("params") 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;
+    }
+}

+ 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);
+	}
+
+}

+ 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;
+    }
+}

+ 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;
+    }
+}

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

@@ -1,12 +1,15 @@
 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.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.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 +35,22 @@ 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);
+
 }

+ 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 {
+
+
+
+}

+ 91 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -1,23 +1,28 @@
 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.dto.*;
 import com.ym.mec.biz.dal.entity.StudentExtracurricularExercisesSituation;
+import com.ym.mec.biz.dal.entity.TeacherRemind;
 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.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.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 +47,10 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 	@Autowired
 	private StudentRegistrationDao studentRegistrationDao;
+	@Autowired
+	private TeacherRemindDao teacherRemindDao;
+	@Autowired
+	private SysMessageService sysMessageService;
 
 	@Override
 	public BaseDAO<Long, StudentExtracurricularExercisesSituation> getDAO() {
@@ -158,6 +167,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 +245,39 @@ 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);
+		}
+	}
 }

+ 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;
+	}
+	
+}

+ 84 - 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,80 @@
 			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==0">
+				AND sees.expect_exercises_num_>sees.actual_exercises_num_
+			</if>
+			<if test="unDone!=null and unDone==1">
+				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_=sees.monday_ 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_=sees.monday_ 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_=sees.monday_ AND type_='SERVE')
+			</if>
+		</where>
+	</sql>
+
+	<select id="queryTeacherServeInfo" resultType="com.ym.mec.biz.dal.dto.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_;
+	</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>

+ 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" resultType="com.ym.mec.biz.dal.entity.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=",">
+				#{teacherIds}
+			</foreach>
+			<if test="startDate!=null and endDate!=null">
+				AND monday_ BETWEEN #{startDate} AND #{endDate}
+			</if>
+	</select>
+</mapper>

+ 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));
 	}
 

+ 40 - 4
mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java

@@ -3,14 +3,13 @@ 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.TeacherServeQueryInfo;
+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;
@@ -55,6 +54,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 +86,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 +137,16 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
         return succeed();
     }
 
+    @ApiOperation(value = "教师作业布置提醒")
+    @GetMapping("/teacherServeRemindPush")
+    @PreAuthorize("@pcs.hasPermissions('exercisesSituation/teacherServeRemindPush')")
+    public HttpResponseResult teacherServeRemindPush(List<TeacherServeDto> teacherServes) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        studentExtracurricularExercisesSituationService.teacherServeRemindPush(teacherServes, sysUser.getId(), sysUser.getRealName());
+        return succeed();
+    }
+
 }