Browse Source

1、课外训练

Joburgess 5 years ago
parent
commit
49da659a37
21 changed files with 1436 additions and 0 deletions
  1. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesDao.java
  2. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesMessageDao.java
  3. 54 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesReplyDao.java
  4. 40 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExtraExerciseStudentsDto.java
  5. 147 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercises.java
  6. 92 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercisesMessage.java
  7. 125 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercisesReply.java
  8. 42 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExtraExercilseQueryInfo.java
  9. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ExtracurricularExercisesMessageService.java
  10. 49 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ExtracurricularExercisesReplyService.java
  11. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ExtracurricularExercisesService.java
  12. 50 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesMessageServiceImpl.java
  13. 93 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java
  14. 89 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java
  15. 119 0
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMapper.xml
  16. 79 0
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMessageMapper.xml
  17. 161 0
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml
  18. 44 0
      mec-student/src/main/java/com/ym/mec/student/controller/ExtracurricularExercisesMessageController.java
  19. 62 0
      mec-student/src/main/java/com/ym/mec/student/controller/ExtracurricularExercisesReplyController.java
  20. 78 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/ExtracurricularExercisesController.java
  21. 44 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/ExtracurricularExercisesMessageController.java

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesDao.java

@@ -0,0 +1,14 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
+import com.ym.mec.common.dal.BaseDAO;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ExtracurricularExercisesDao extends BaseDAO<Long, ExtracurricularExercises> {
+
+    int countExtraExercises(Map<String, Object> params);
+    List<ExtracurricularExercises> findExtraExercises(Map<String, Object> params);
+
+}

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

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface ExtracurricularExercisesMessageDao extends BaseDAO<Long, ExtracurricularExercisesMessage> {
+
+	
+}

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

@@ -0,0 +1,54 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ExtracurricularExercisesReplyDao extends BaseDAO<Long, ExtracurricularExercisesReply> {
+
+    /**
+     * @describe 批量插入
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param replies:
+     * @return int
+     */
+    int batchInsert(@Param("replies")List<ExtracurricularExercisesReply> replies);
+
+    /**
+     * @describe 获取课外训练的学生列表
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param extraExerciseId: 课外训练编号
+     * @param studentName: 学生名称
+     * @return java.util.List<com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto>
+     */
+    List<ExtraExerciseStudentsDto> findExtraExerciseStudents(@Param("extraExerciseId") Long extraExerciseId,
+                                                             @Param("studentName") String studentName);
+
+    /**
+     * @describe 获取学生课外训练详情
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param extraExerciseReplyId:
+     * @return com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto
+     */
+    ExtraExerciseStudentsDto findExtraExerciseReply(@Param("extraExerciseReplyId") Long extraExerciseReplyId);
+
+    int countStudentExtraExercises(Map<String, Object> params);
+    List<ExtraExerciseStudentsDto> findStudentExtraExercises(Map<String, Object> params);
+
+    /**
+     * @describe 统计已经提交的学生数量
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param extraExerciseId:
+     * @return int
+     */
+    int countIsSubmitStudents(@Param("extraExerciseId") Long extraExerciseId);
+	
+}

+ 40 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExtraExerciseStudentsDto.java

@@ -0,0 +1,40 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/26
+ */
+public class ExtraExerciseStudentsDto extends ExtracurricularExercisesReply {
+
+    private String studentName;
+
+    private Integer teacherId;
+
+    private String teacherName;
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+}

+ 147 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercises.java

@@ -0,0 +1,147 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(extracurricular_exercises):
+ */
+public class ExtracurricularExercises {
+
+	/**  */
+	private Long id;
+	
+	/** 老师编号 */
+	private Integer teacherId;
+	
+	/** 学生列表 */
+	private String studentIdList;
+	
+	/** 批次号 */
+	private String batchNo;
+	
+	/** 标题 */
+	private String title;
+	
+	/** 附件地址(多个用逗号分隔) */
+	private String attachments;
+	
+	/** 作业内容 */
+	private String content;
+	
+	/** 截止日期 */
+	private java.util.Date expireDate;
+	
+	/** 完成人数 */
+	private Integer completedNum;
+	
+	/** 预计人数 */
+	private Integer expectNum;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setTeacherId(Integer teacherId){
+		this.teacherId = teacherId;
+	}
+	
+	public Integer getTeacherId(){
+		return this.teacherId;
+	}
+			
+	public void setStudentIdList(String studentIdList){
+		this.studentIdList = studentIdList;
+	}
+	
+	public String getStudentIdList(){
+		return this.studentIdList;
+	}
+			
+	public void setBatchNo(String batchNo){
+		this.batchNo = batchNo;
+	}
+	
+	public String getBatchNo(){
+		return this.batchNo;
+	}
+			
+	public void setTitle(String title){
+		this.title = title;
+	}
+	
+	public String getTitle(){
+		return this.title;
+	}
+			
+	public void setAttachments(String attachments){
+		this.attachments = attachments;
+	}
+	
+	public String getAttachments(){
+		return this.attachments;
+	}
+			
+	public void setContent(String content){
+		this.content = content;
+	}
+	
+	public String getContent(){
+		return this.content;
+	}
+			
+	public void setExpireDate(java.util.Date expireDate){
+		this.expireDate = expireDate;
+	}
+	
+	public java.util.Date getExpireDate(){
+		return this.expireDate;
+	}
+			
+	public void setCompletedNum(Integer completedNum){
+		this.completedNum = completedNum;
+	}
+	
+	public Integer getCompletedNum(){
+		return this.completedNum;
+	}
+			
+	public void setExpectNum(Integer expectNum){
+		this.expectNum = expectNum;
+	}
+	
+	public Integer getExpectNum(){
+		return this.expectNum;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 92 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercisesMessage.java

@@ -0,0 +1,92 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(extracurricular_exercises_message):
+ */
+public class ExtracurricularExercisesMessage {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Long extracurricularExercisesReplyId;
+	
+	/** 留言人编号 */
+	private Integer userId;
+	
+	/** 角色(学生、老师) */
+	private String role;
+	
+	/** 留言内容 */
+	private String content;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/** 父级编号 */
+	private Long parentId;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setExtracurricularExercisesReplyId(Long extracurricularExercisesReplyId){
+		this.extracurricularExercisesReplyId = extracurricularExercisesReplyId;
+	}
+	
+	public Long getExtracurricularExercisesReplyId(){
+		return this.extracurricularExercisesReplyId;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setRole(String role){
+		this.role = role;
+	}
+	
+	public String getRole(){
+		return this.role;
+	}
+			
+	public void setContent(String content){
+		this.content = content;
+	}
+	
+	public String getContent(){
+		return this.content;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setParentId(Long parentId){
+		this.parentId = parentId;
+	}
+	
+	public Long getParentId(){
+		return this.parentId;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 125 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercisesReply.java

@@ -0,0 +1,125 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(extracurricular_exercises_reply):
+ */
+public class ExtracurricularExercisesReply {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Long extracurricularExercisesId;
+	
+	/**  */
+	private Integer userId;
+	
+	/** 作品附件 */
+	private String attachments;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/** 备注 */
+	private String remark;
+	
+	/** 提交状态 */
+	private Integer status;
+	
+	/** 是否回复 */
+	private Integer isReplied;
+	
+	/** 是否已查看 */
+	private Integer isView;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setExtracurricularExercisesId(Long extracurricularExercisesId){
+		this.extracurricularExercisesId = extracurricularExercisesId;
+	}
+	
+	public Long getExtracurricularExercisesId(){
+		return this.extracurricularExercisesId;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setAttachments(String attachments){
+		this.attachments = attachments;
+	}
+	
+	public String getAttachments(){
+		return this.attachments;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setRemark(String remark){
+		this.remark = remark;
+	}
+	
+	public String getRemark(){
+		return this.remark;
+	}
+			
+	public void setStatus(Integer status){
+		this.status = status;
+	}
+	
+	public Integer getStatus(){
+		return this.status;
+	}
+			
+	public void setIsReplied(Integer isReplied){
+		this.isReplied = isReplied;
+	}
+	
+	public Integer getIsReplied(){
+		return this.isReplied;
+	}
+			
+	public void setIsView(Integer isView){
+		this.isView = isView;
+	}
+	
+	public Integer getIsView(){
+		return this.isView;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 42 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExtraExercilseQueryInfo.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 2020/3/26
+ */
+public class ExtraExercilseQueryInfo extends QueryInfo {
+
+    private Integer teacherId;
+
+    private Integer studentId;
+
+    private Date createTime;
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ExtracurricularExercisesMessageService.java

@@ -0,0 +1,17 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage;
+import com.ym.mec.common.service.BaseService;
+
+public interface ExtracurricularExercisesMessageService extends BaseService<Long, ExtracurricularExercisesMessage> {
+
+    /**
+     * @describe 添加学生作业评论
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param extracurricularExercisesMessage:
+     * @return void
+     */
+    void addStudentExtraExerciseComment(ExtracurricularExercisesMessage extracurricularExercisesMessage);
+
+}

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

@@ -0,0 +1,49 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+
+public interface ExtracurricularExercisesReplyService extends BaseService<Long, ExtracurricularExercisesReply> {
+
+    /**
+     * @describe
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param extraExerciseId: 课外训练编号
+     * @return java.util.List<com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto>
+     */
+    List<ExtraExerciseStudentsDto> findExtraExerciseStudents(Long extraExerciseId,String studentName);
+
+    /**
+     * @describe 获取学生的课外训练列表
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param queryInfo:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto>
+     */
+    PageInfo findStudentExtraExercises(ExtraExercilseQueryInfo queryInfo);
+
+    /**
+     * @describe 获取学生课外训练详情
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param studentExerciseId: 学生课外训练编号
+     * @return com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto
+     */
+    ExtraExerciseStudentsDto findStudentExtraExerciseDetail(Long studentExerciseId);
+
+    /**
+     * @describe 学生提交课外训练
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param extracurricularExercisesReply:
+     * @return void
+     */
+    void submitExtraExercise(ExtracurricularExercisesReply extracurricularExercisesReply);
+
+}

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

@@ -0,0 +1,28 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
+import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.service.BaseService;
+
+public interface ExtracurricularExercisesService extends BaseService<Long, ExtracurricularExercises> {
+
+    /**
+     * @describe 创建课外训练
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param exercises:
+     * @return void
+     */
+    void createExtraExercises(ExtracurricularExercises exercises);
+
+    /**
+     * @describe 获取教师创建的课外训练列表
+     * @author Joburgess
+     * @date 2020/3/26
+     * @param queryInfo:
+     * @return com.ym.mec.common.page.PageInfo
+     */
+    PageInfo findExtraExercilses(ExtraExercilseQueryInfo queryInfo);
+
+}

+ 50 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesMessageServiceImpl.java

@@ -0,0 +1,50 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.ExtracurricularExercisesMessageDao;
+import com.ym.mec.biz.dal.dao.ExtracurricularExercisesReplyDao;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+import com.ym.mec.biz.service.ExtracurricularExercisesMessageService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+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 java.util.Objects;
+
+@Service
+public class ExtracurricularExercisesMessageServiceImpl extends BaseServiceImpl<Long, ExtracurricularExercisesMessage> implements ExtracurricularExercisesMessageService {
+	
+	@Autowired
+	private ExtracurricularExercisesMessageDao extracurricularExercisesMessageDao;
+	@Autowired
+	private ExtracurricularExercisesReplyDao extracurricularExercisesReplyDao;
+
+	@Override
+	public BaseDAO<Long, ExtracurricularExercisesMessage> getDAO() {
+		return extracurricularExercisesMessageDao;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void addStudentExtraExerciseComment(ExtracurricularExercisesMessage extracurricularExercisesMessage) {
+		if(Objects.isNull(extracurricularExercisesMessage.getExtracurricularExercisesReplyId())){
+			throw new BizException("请指定学生课外训练");
+		}
+		if(StringUtils.isBlank(extracurricularExercisesMessage.getContent())){
+			throw new BizException("请填写回复内容");
+		}
+		extracurricularExercisesMessageDao.insert(extracurricularExercisesMessage);
+		ExtracurricularExercisesReply extracurricularExercisesReply = extracurricularExercisesReplyDao.get(extracurricularExercisesMessage.getExtracurricularExercisesReplyId());
+		if(Objects.isNull(extracurricularExercisesReply)){
+			throw new BizException("课外训练不存在");
+		}
+		if("TEACHER".equals(extracurricularExercisesMessage.getRole())&&Objects.nonNull(extracurricularExercisesReply.getAttachments())){
+			extracurricularExercisesReply.setIsReplied(1);
+			extracurricularExercisesReplyDao.update(extracurricularExercisesReply);
+		}
+	}
+}

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

@@ -0,0 +1,93 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.ExtracurricularExercisesDao;
+import com.ym.mec.biz.dal.dao.ExtracurricularExercisesReplyDao;
+import com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
+import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
+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.util.collection.MapUtil;
+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 java.util.*;
+
+@Service
+public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Long, ExtracurricularExercisesReply> implements ExtracurricularExercisesReplyService {
+	
+	@Autowired
+	private ExtracurricularExercisesReplyDao extracurricularExercisesReplyDao;
+	@Autowired
+	private ExtracurricularExercisesDao extracurricularExercisesDao;
+
+	@Override
+	public BaseDAO<Long, ExtracurricularExercisesReply> getDAO() {
+		return extracurricularExercisesReplyDao;
+	}
+
+	@Override
+	public List<ExtraExerciseStudentsDto> findExtraExerciseStudents(Long extraExerciseId,String studentName) {
+		if(Objects.isNull(extraExerciseId)){
+			throw new BizException("请选择课外训练");
+		}
+		return extracurricularExercisesReplyDao.findExtraExerciseStudents(extraExerciseId,studentName);
+	}
+
+	@Override
+	public ExtraExerciseStudentsDto findStudentExtraExerciseDetail(Long studentExerciseId) {
+		return extracurricularExercisesReplyDao.findExtraExerciseReply(studentExerciseId);
+	}
+
+	@Override
+	public PageInfo findStudentExtraExercises(ExtraExercilseQueryInfo queryInfo) {
+		PageInfo<ExtraExerciseStudentsDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<ExtraExerciseStudentsDto> dataList = null;
+		int count = extracurricularExercisesReplyDao.countStudentExtraExercises(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = extracurricularExercisesReplyDao.findStudentExtraExercises(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void submitExtraExercise(ExtracurricularExercisesReply extracurricularExercisesReply) {
+		if(Objects.nonNull(extracurricularExercisesReply.getId())){
+			throw new BizException("请选择课外训练");
+		}
+		if(StringUtils.isBlank(extracurricularExercisesReply.getAttachments())){
+			throw new BizException("请先提交作业文件");
+		}
+		ExtracurricularExercisesReply existExtra = extracurricularExercisesReplyDao.get(extracurricularExercisesReply.getId());
+		if(Objects.isNull(existExtra)){
+			throw new BizException("作业不存在");
+		}
+		ExtracurricularExercises extracurricularExercises = extracurricularExercisesDao.get(existExtra.getExtracurricularExercisesId());
+		if(Objects.isNull(extracurricularExercises)){
+			throw new BizException("作业不存在");
+		}
+		existExtra.setAttachments(extracurricularExercisesReply.getAttachments());
+		existExtra.setStatus(1);
+		extracurricularExercisesReplyDao.update(existExtra);
+
+		int submitStudentNum=extracurricularExercisesReplyDao.countIsSubmitStudents(existExtra.getExtracurricularExercisesId());
+		extracurricularExercises.setCompletedNum(submitStudentNum);
+		extracurricularExercisesDao.update(extracurricularExercises);
+	}
+}

+ 89 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java

@@ -0,0 +1,89 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.ExtracurricularExercisesDao;
+import com.ym.mec.biz.dal.dao.ExtracurricularExercisesReplyDao;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
+import com.ym.mec.biz.service.ExtracurricularExercisesService;
+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.util.collection.MapUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, ExtracurricularExercises> implements ExtracurricularExercisesService {
+	
+	@Autowired
+	private ExtracurricularExercisesDao extracurricularExercisesDao;
+	@Autowired
+	private ExtracurricularExercisesReplyDao extracurricularExercisesReplyDao;
+
+	@Override
+	public BaseDAO<Long, ExtracurricularExercises> getDAO() {
+		return extracurricularExercisesDao;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public void createExtraExercises(ExtracurricularExercises exercises) {
+		if(StringUtils.isBlank(exercises.getTitle())){
+			throw new BizException("请填写标题");
+		}
+		if(StringUtils.isBlank(exercises.getContent())){
+			throw new BizException("请填写内容");
+		}
+		if(Objects.isNull(exercises.getExpireDate())){
+			throw new BizException("请指定截至日期");
+		}
+		if(StringUtils.isBlank(exercises.getStudentIdList())){
+			throw new BizException("请指定学生");
+		}
+		List<Integer> studentIds = Arrays.asList(exercises.getStudentIdList().split(",")).stream().mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
+		exercises.setBatchNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
+		exercises.setExpectNum(studentIds.size());
+		extracurricularExercisesDao.insert(exercises);
+		List<ExtracurricularExercisesReply> studentExtraExerises=new ArrayList<>();
+		for (Integer studentId : studentIds) {
+			ExtracurricularExercisesReply studentExtraExercise=new ExtracurricularExercisesReply();
+			studentExtraExercise.setExtracurricularExercisesId(exercises.getId());
+			studentExtraExercise.setUserId(studentId);
+			studentExtraExercise.setStatus(0);
+			studentExtraExercise.setIsReplied(0);
+			studentExtraExercise.setIsView(0);
+			studentExtraExerises.add(studentExtraExercise);
+		}
+		extracurricularExercisesReplyDao.batchInsert(studentExtraExerises);
+	}
+
+	@Override
+	public PageInfo findExtraExercilses(ExtraExercilseQueryInfo queryInfo) {
+		PageInfo<ExtracurricularExercises> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<ExtracurricularExercises> dataList = null;
+		int count = extracurricularExercisesDao.countExtraExercises(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = extracurricularExercisesDao.findExtraExercises(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+}

+ 119 - 0
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMapper.xml

@@ -0,0 +1,119 @@
+<?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.ExtracurricularExercisesDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.ExtracurricularExercises" id="ExtracurricularExercises">
+		<result column="id_" property="id" />
+		<result column="teacher_id_" property="teacherId" />
+		<result column="student_id_list_" property="studentIdList" />
+		<result column="batch_no_" property="batchNo" />
+		<result column="title_" property="title" />
+		<result column="attachments_" property="attachments" />
+		<result column="content_" property="content" />
+		<result column="expire_date_" property="expireDate" />
+		<result column="completed_num_" property="completedNum" />
+		<result column="expect_num_" property="expectNum" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExtracurricularExercises" >
+		SELECT * FROM extracurricular_exercises WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExtracurricularExercises">
+		SELECT * FROM extracurricular_exercises ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercises" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO extracurricular_exercises (id_,teacher_id_,student_id_list_,batch_no_,title_,attachments_,content_,expire_date_,completed_num_,expect_num_,create_time_,update_time_)
+		VALUES(#{id},#{teacherId},#{studentIdList},#{batchNo},#{title},#{attachments},#{content},#{expireDate},#{completedNum},#{expectNum},NOW(), NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercises">
+		UPDATE extracurricular_exercises
+		<set>
+			<if test="studentIdList != null">
+			student_id_list_ = #{studentIdList},
+			</if>
+			<if test="expireDate != null">
+			expire_date_ = #{expireDate},
+			</if>
+			<if test="batchNo != null">
+			batch_no_ = #{batchNo},
+			</if>
+			<if test="id != null">
+			id_ = #{id},
+			</if>
+			<if test="teacherId != null">
+			teacher_id_ = #{teacherId},
+			</if>
+			<if test="title != null">
+			title_ = #{title},
+			</if>
+			<if test="expectNum != null">
+			expect_num_ = #{expectNum},
+			</if>
+			<if test="content != null">
+			content_ = #{content},
+			</if>
+			<if test="attachments != null">
+			attachments_ = #{attachments},
+			</if>
+			<if test="completedNum != null">
+			completed_num_ = #{completedNum},
+			</if>
+			update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM extracurricular_exercises WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExtracurricularExercises" parameterType="map">
+		SELECT * FROM extracurricular_exercises ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM extracurricular_exercises
+	</select>
+
+	<sql id="queryExtraExercisesCondition">
+		<where>
+			<if test="teacherId!=null">
+				teacher_id_=#{teacherId}
+			</if>
+			<if test="createTime!=null">
+				DATE_FORMAT(create_time_, '%Y-%m-%d') = DATE_FORMAT(#{createTime}, '%Y-%m-%d')
+			</if>
+		</where>
+	</sql>
+
+	<select id="countExtraExercises" resultType="int">
+		SELECT COUNT(id_) FROM extracurricular_exercises
+		<include refid="queryExtraExercisesCondition"/>
+	</select>
+	<select id="findExtraExercises" resultMap="ExtracurricularExercises">
+		SELECT * FROM extracurricular_exercises
+		<include refid="queryExtraExercisesCondition"/>
+		ORDER BY create_time_ DESC
+		<include refid="global.limit"/>
+	</select>
+</mapper>

+ 79 - 0
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMessageMapper.xml

@@ -0,0 +1,79 @@
+<?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.ExtracurricularExercisesMessageDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage" id="ExtracurricularExercisesMessage">
+		<result column="id_" property="id" />
+		<result column="extracurricular_exercises_reply_id_" property="extracurricularExercisesReplyId" />
+		<result column="user_id_" property="userId" />
+		<result column="role_" property="role" />
+		<result column="content_" property="content" />
+		<result column="create_time_" property="createTime" />
+		<result column="parent_id_" property="parentId" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExtracurricularExercisesMessage" >
+		SELECT * FROM extracurricular_exercises_message WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExtracurricularExercisesMessage">
+		SELECT * FROM extracurricular_exercises_message ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO extracurricular_exercises_message (id_,extracurricular_exercises_reply_id_,user_id_,role_,content_,create_time_,parent_id_)
+		VALUES(#{id},#{extracurricularExercisesReplyId},#{userId},#{role},#{content},NOW(),#{parentId})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage">
+		UPDATE extracurricular_exercises_message
+		<set>
+			<if test="parentId != null">
+			parent_id_ = #{parentId},
+			</if>
+			<if test="userId != null">
+			user_id_ = #{userId},
+			</if>
+			<if test="role != null">
+			role_ = #{role},
+			</if>
+			<if test="id != null">
+			id_ = #{id},
+			</if>
+			<if test="content != null">
+			content_ = #{content},
+			</if>
+			<if test="extracurricularExercisesReplyId != null">
+			extracurricular_exercises_reply_id_ = #{extracurricularExercisesReplyId},
+			</if>
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM extracurricular_exercises_message WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExtracurricularExercisesMessage" parameterType="map">
+		SELECT * FROM extracurricular_exercises_message ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM extracurricular_exercises_message
+	</select>
+</mapper>

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

@@ -0,0 +1,161 @@
+<?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.ExtracurricularExercisesReplyDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply" id="ExtracurricularExercisesReply">
+		<result column="id_" property="id" />
+		<result column="extracurricular_exercises_id_" property="extracurricularExercisesId" />
+		<result column="user_id_" property="userId" />
+		<result column="attachments_" property="attachments" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="remark_" property="remark" />
+		<result column="status_" property="status" />
+		<result column="is_replied_" property="isReplied" />
+		<result column="is_view_" property="isView" />
+	</resultMap>
+
+	<resultMap id="ExtraExerciseStudentsDto" type="com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto" extends="ExtracurricularExercisesReply">
+		<result column="student_name_" property="studentName"/>
+		<result column="teacher_id_" property="teacherId"/>
+		<result column="teacher_name_" property="teacherName"/>
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExtracurricularExercisesReply" >
+		SELECT * FROM extracurricular_exercises_reply WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExtracurricularExercisesReply">
+		SELECT * FROM extracurricular_exercises_reply ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,update_time_,remark_,status_,is_replied_,is_view_)
+		VALUES(#{extracurricularExercisesId},#{userId},#{attachments},NOW(),NOW(),#{remark},#{status},#{isReplied},#{isView})
+	</insert>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO extracurricular_exercises_reply (extracurricular_exercises_id_,user_id_,attachments_,create_time_,update_time_,remark_,status_,is_replied_,is_view_)
+		VALUES
+		<foreach collection="replies" item="reply" separator=",">
+			(#{reply.extracurricularExercisesId},#{reply.userId},#{reply.attachments},NOW(),NOW(),#{reply.remark},#{reply.status},#{reply.isReplied},#{reply.isView})
+		</foreach>
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply">
+		UPDATE extracurricular_exercises_reply
+		<set>
+			<if test="status != null">
+			status_ = #{status},
+			</if>
+			<if test="isView != null">
+			is_view_ = #{isView},
+			</if>
+			<if test="userId != null">
+			user_id_ = #{userId},
+			</if>
+			<if test="remark != null">
+			remark_ = #{remark},
+			</if>
+			<if test="id != null">
+			id_ = #{id},
+			</if>
+			<if test="isReplied != null">
+			is_replied_ = #{isReplied},
+			</if>
+			<if test="extracurricularExercisesId != null">
+			extracurricular_exercises_id_ = #{extracurricularExercisesId},
+			</if>
+			<if test="attachments != null">
+			attachments_ = #{attachments},
+			</if>
+			update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM extracurricular_exercises_reply WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExtracurricularExercisesReply" parameterType="map">
+		SELECT * FROM extracurricular_exercises_reply ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM extracurricular_exercises_reply
+	</select>
+	<select id="findExtraExerciseStudents" resultMap="ExtraExerciseStudentsDto">
+		SELECT
+			eer.*,
+			su.student_name_
+		FROM
+			extracurricular_exercises_reply eer
+			LEFT JOIN sys_user su ON su.id_ = eer.user_id_
+		WHERE eer.extracurricular_exercises_id_= #{extraExerciseId}
+		<if test="studentName != null">
+			AND su.username_ LIKE CONCAT('%',#{studentName},'%')
+		</if>
+	</select>
+	<select id="findExtraExerciseReply" resultMap="ExtraExerciseStudentsDto">
+		SELECT
+			eer.*,
+			ee.teacher_id_,
+			su.student_name_
+		FROM
+			extracurricular_exercises_reply eer
+			LEFT JOIN extracurricular_exercises ee ON ee.id_=eer.extracurricular_exercises_id_
+			LEFT JOIN sys_user su ON su.id_ = eer.user_id_
+		WHERE
+			eer.id_ = #{extraExerciseReplyId}
+	</select>
+
+	<sql id="queryStudentExtraExercisesCondition">
+		<where>
+			<if test="teacherId!=null">
+				user_id_=#{studentId}
+			</if>
+			<if test="createTime!=null">
+				DATE_FORMAT(create_time_, '%Y-%m-%d') = DATE_FORMAT(#{createTime}, '%Y-%m-%d')
+			</if>
+		</where>
+	</sql>
+	<select id="countStudentExtraExercises" resultType="int">
+		SELECT COUNT(id_) FROM extracurricular_exercises_reply
+		<include refid="queryStudentExtraExercisesCondition"/>
+	</select>
+	<select id="findStudentExtraExercises" resultMap="ExtraExerciseStudentsDto">
+		SELECT
+			eer.*,
+			ee.teacher_id_,
+			tea.real_name_ teacher_name_,
+			su.student_name_
+		FROM
+			extracurricular_exercises_reply eer
+			LEFT JOIN extracurricular_exercises ee ON ee.id_=eer.extracurricular_exercises_id_
+			LEFT JOIN sys_user su ON su.id_ = eer.user_id_
+			LEFT JOIN sys_user tea ON tea.id_=ee.teacher_id_
+			<include refid="queryStudentExtraExercisesCondition"/>
+			ORDER BY eer.create_time_ DESC
+		<include refid="global.limit"/>
+	</select>
+	<select id="countIsSubmitStudents" resultType="int">
+		SELECT COUNT(id_) FROM extracurricular_exercises_reply WHERE extracurricular_exercises_id_=#{extraExerciseId} AND attachments_ IS NOT NULL
+	</select>
+</mapper>

+ 44 - 0
mec-student/src/main/java/com/ym/mec/student/controller/ExtracurricularExercisesMessageController.java

@@ -0,0 +1,44 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage;
+import com.ym.mec.biz.service.ExtracurricularExercisesMessageService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/26
+ */
+@Api(tags = "课外训练评论服务")
+@RequestMapping("extracurricularExercisesMessage")
+@RestController
+public class ExtracurricularExercisesMessageController extends BaseController {
+
+    @Autowired
+    private ExtracurricularExercisesMessageService extracurricularExercisesMessageService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "添加学生作业评论")
+    @GetMapping("/addStudentExtraExerciseComment")
+    public HttpResponseResult addStudentExtraExerciseComment(ExtracurricularExercisesMessage extracurricularExercisesMessage){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        extracurricularExercisesMessage.setUserId(sysUser.getId());
+        extracurricularExercisesMessage.setRole("STUDENT");
+        extracurricularExercisesMessageService.addStudentExtraExerciseComment(extracurricularExercisesMessage);
+        return succeed();
+    }
+
+}

+ 62 - 0
mec-student/src/main/java/com/ym/mec/student/controller/ExtracurricularExercisesReplyController.java

@@ -0,0 +1,62 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply;
+import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
+import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/26
+ */
+@Api(tags = "课外训练服务")
+@RequestMapping("extracurricularExercisesReply")
+@RestController
+public class ExtracurricularExercisesReplyController extends BaseController {
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private ExtracurricularExercisesReplyService extracurricularExercisesReplyService;
+
+    @ApiOperation(value = "获取学生的课外训练列表")
+    @GetMapping("/findStudentExtraExercises")
+    public HttpResponseResult findStudentExtraExercises(ExtraExercilseQueryInfo queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        queryInfo.setStudentId(sysUser.getId());
+        return succeed(extracurricularExercisesReplyService.findStudentExtraExercises(queryInfo));
+    }
+
+    @ApiOperation(value = "获取课外训练学生")
+    @GetMapping("/findExtraExerciseStudents")
+    public HttpResponseResult findExtraExerciseStudents(Long extraExerciseId,String studentName){
+        return succeed(extracurricularExercisesReplyService.findExtraExerciseStudents(extraExerciseId,studentName));
+    }
+
+    @ApiOperation(value = "获取课外训练详情")
+    @GetMapping("/findStudentExtraExerciseDetail")
+    public HttpResponseResult findStudentExtraExerciseDetail(Long studentExerciseId){
+        return succeed(extracurricularExercisesReplyService.findStudentExtraExerciseDetail(studentExerciseId));
+    }
+
+    @ApiOperation(value = "提交课外训练作业")
+    @GetMapping("/submitExtraExercise")
+    public HttpResponseResult submitExtraExercise(ExtracurricularExercisesReply extracurricularExercisesReply){
+        extracurricularExercisesReplyService.submitExtraExercise(extracurricularExercisesReply);
+        return succeed();
+    }
+
+}

+ 78 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/ExtracurricularExercisesController.java

@@ -0,0 +1,78 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.ExtraExerciseStudentsDto;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercises;
+import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
+import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
+import com.ym.mec.biz.service.ExtracurricularExercisesService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Objects;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/26
+ */
+@Api(tags = "课外训练服务")
+@RequestMapping("extracurricularExercises")
+@RestController
+public class ExtracurricularExercisesController extends BaseController {
+
+    @Autowired
+    private ExtracurricularExercisesService extracurricularExercisesService;
+    @Autowired
+    private ExtracurricularExercisesReplyService extracurricularExercisesReplyService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "创建课外训练")
+    @PostMapping("/createExtraExercises")
+    private HttpResponseResult createExtraExercises(ExtracurricularExercises exercises){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(sysUser)){
+            return failed(HttpStatus.FORBIDDEN,"请登录");
+        }
+        exercises.setTeacherId(sysUser.getId());
+        extracurricularExercisesService.createExtraExercises(exercises);
+        return succeed();
+    }
+
+    @ApiOperation(value = "获取课外训练列表")
+    @GetMapping("/findExtraExercilses")
+    private HttpResponseResult findExtraExercilses(ExtraExercilseQueryInfo queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(sysUser)){
+            return failed(HttpStatus.FORBIDDEN,"请登录");
+        }
+        queryInfo.setTeacherId(sysUser.getId());
+        return succeed(extracurricularExercisesService.findExtraExercilses(queryInfo));
+    }
+
+    @ApiOperation(value = "获取课外训练详情")
+    @GetMapping("/findStudentExtraExerciseDetail")
+    private HttpResponseResult findStudentExtraExerciseDetail(Long studentExerciseId){
+        if(Objects.isNull(studentExerciseId)){
+            return failed("请选择课外训练作业");
+        }
+        ExtraExerciseStudentsDto studentExtraExerciseDetail = extracurricularExercisesReplyService.findStudentExtraExerciseDetail(studentExerciseId);
+        if(Objects.isNull(studentExtraExerciseDetail)){
+            return failed("作业不存在");
+        }
+        if(Objects.nonNull(studentExtraExerciseDetail.getAttachments())){
+            studentExtraExerciseDetail.setIsView(1);
+            extracurricularExercisesReplyService.update(studentExtraExerciseDetail);
+        }
+        return succeed(extracurricularExercisesReplyService.findStudentExtraExerciseDetail(studentExerciseId));
+    }
+}

+ 44 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/ExtracurricularExercisesMessageController.java

@@ -0,0 +1,44 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.ExtracurricularExercisesMessage;
+import com.ym.mec.biz.service.ExtracurricularExercisesMessageService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/26
+ */
+@Api(tags = "课外训练评论服务")
+@RequestMapping("extracurricularExercisesMessage")
+@RestController
+public class ExtracurricularExercisesMessageController extends BaseController {
+
+    @Autowired
+    private ExtracurricularExercisesMessageService extracurricularExercisesMessageService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "添加学生作业评论")
+    @GetMapping("/addStudentExtraExerciseComment")
+    public HttpResponseResult addStudentExtraExerciseComment(ExtracurricularExercisesMessage extracurricularExercisesMessage){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        extracurricularExercisesMessage.setUserId(sysUser.getId());
+        extracurricularExercisesMessage.setRole("TEACHER");
+        extracurricularExercisesMessageService.addStudentExtraExerciseComment(extracurricularExercisesMessage);
+        return succeed();
+    }
+
+}