Browse Source

Merge branch 'feature_HW_20230331' into master_saas

liujunchi 2 years ago
parent
commit
627873b434
28 changed files with 378 additions and 32 deletions
  1. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseHomeworkDao.java
  2. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesDao.java
  3. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExtracurricularExercisesReplyDao.java
  4. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCourseHomeworkDao.java
  5. 14 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseHomeworkWrapper.java
  6. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentHomeworkRecordDto.java
  7. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentLessonTrainingDetailWrapper.java
  8. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendanceDetailDto.java
  9. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/WebCourseHomeworkListDto.java
  10. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseHomework.java
  11. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ExtracurricularExercises.java
  12. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentLessonTrainingDetail.java
  13. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseHomeworkQueryInfo.java
  14. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExtraExercilseQueryInfo.java
  15. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreService.java
  16. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java
  17. 13 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java
  18. 122 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java
  19. 28 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java
  20. 34 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentLessonTrainingDetailServiceImpl.java
  21. 17 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java
  22. 11 1
      mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml
  23. 4 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  24. 13 3
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMapper.xml
  25. 4 1
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml
  26. 21 1
      mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml
  27. 9 1
      mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseHomeworkController.java
  28. 2 2
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java

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

@@ -74,4 +74,8 @@ public interface CourseHomeworkDao extends BaseDAO<Long, CourseHomework> {
 	 * @return
 	 */
 	List<TeacherHomeworkListDto> findByIdList(@Param("homeworkIdList") List<Integer> homeworkIdList);
+
+    void updateFinishNum(@Param("courseHomeworkId") Long courseHomeworkId);
+
+    CourseHomework getByCourseScheduleId(@Param("courseScheduleId") Integer courseScheduleId);
 }

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

@@ -70,4 +70,6 @@ public interface ExtracurricularExercisesDao extends BaseDAO<Long, Extracurricul
     int countTeacherExtraHomeworkDetailV2(Map<String, Object> params);
 
     List<CourseHomeworkWrapper.CourseHomeworkList> queryTeacherExtraHomeworkDetailV2(Map<String, Object> params);
+
+    void updateFinishNum(@Param("courseHomeworkId") Long courseHomeworkId);
 }

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

@@ -136,4 +136,5 @@ public interface ExtracurricularExercisesReplyDao extends BaseDAO<Long, Extracur
                                                                              @Param("endTime") Date endTime);
 
     ExtracurricularExercisesReply getByExtraIdAndUserId(@Param("extraId") Long extraId, @Param("userId") Long userId);
+
 }

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

@@ -213,4 +213,7 @@ public interface StudentCourseHomeworkDao extends BaseDAO<Long, StudentCourseHom
     List<StudentCourseHomework> findStudentCourseHomeworkByCourse(@Param("query") StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query);
 
     int queryNotSuccessHomeworkList(Integer userId);
+
+    StudentCourseHomework getHomeworkByUserIdAndCourseHomeworkId(@Param("userId") Long userId, @Param(
+        "courseHomeworkId") Long courseHomeworkId);
 }

+ 14 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseHomeworkWrapper.java

@@ -87,6 +87,15 @@ public class CourseHomeworkWrapper {
         @ApiModelProperty(value = "老师id")
         private Integer teacherId;
 
+        @ApiModelProperty("老师名")
+        private String teacherName;
+
+        @ApiModelProperty("课程名称")
+        private String courseScheduleName;
+
+        @ApiModelProperty("老师头像")
+        private String teacherImg;
+
         @ApiModelProperty(value = "乐团id")
         private String musicGroupId;
 
@@ -129,6 +138,8 @@ public class CourseHomeworkWrapper {
         @ApiModelProperty(value = "作业类型 来源(HOMEWORK,EXTRACURRICULAR,EXTRA)",required = true)
         private ELessonTrainingType type;
 
+        private String studentIdList;
+
         @ApiModelProperty("练习内容")
         private List<StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail> trainingDetailList;
     }
@@ -161,7 +172,7 @@ public class CourseHomeworkWrapper {
 
         @ApiModelProperty(value = "作业详情id",required = true)
         @NotNull(message = "作业详情id不能为空")
-        private Integer id;
+        private Long id;
 
     }
 
@@ -304,6 +315,8 @@ public class CourseHomeworkWrapper {
         @ApiModelProperty("班级名")
         private String classGroupName;
 
+        private String versionTag;
+
 
         @ApiModelProperty("布置时间")
         private Date assignTime;

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentHomeworkRecordDto.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.biz.dal.enums.ELessonTrainingType;
+import com.ym.mec.biz.dal.enums.StandardEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
@@ -52,6 +53,7 @@ public class StudentHomeworkRecordDto {
     @ApiModelProperty(value = "乐团图片")
     private String musicGroupImg;
 
+    private StandardEnum standardFlag;
 
     @ApiModelProperty("班级id")
     private Integer classGroupId;
@@ -68,6 +70,14 @@ public class StudentHomeworkRecordDto {
     @ApiModelProperty("完成状态 false 未完成 true 已完成")
     private Boolean finishStatus;
 
+    public StandardEnum getStandardFlag() {
+        return standardFlag;
+    }
+
+    public void setStandardFlag(StandardEnum standardFlag) {
+        this.standardFlag = standardFlag;
+    }
+
     public ELessonTrainingType getType() {
         return type;
     }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentLessonTrainingDetailWrapper.java

@@ -55,6 +55,9 @@ public class StudentLessonTrainingDetailWrapper {
         @ApiModelProperty("曲目id")
         private Long musicScoreId;
 
+        @ApiModelProperty("曲目名称")
+        private String  musicScoreName;
+
         @ApiModelProperty("分谱")
         private Integer partIndex;
 

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendanceDetailDto.java

@@ -37,6 +37,16 @@ public class TeacherAttendanceDetailDto {
     
     private School school;
 
+    private String versionTag;
+
+    public String getVersionTag() {
+        return versionTag;
+    }
+
+    public void setVersionTag(String versionTag) {
+        this.versionTag = versionTag;
+    }
+
     public Integer getErrorAttendanceNum() {
         return errorAttendanceNum;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/WebCourseHomeworkListDto.java

@@ -71,6 +71,16 @@ public class WebCourseHomeworkListDto {
     @ApiModelProperty(value = "截止时间")
     private Date expiryDate;
 
+    private String versionTag;
+
+    public String getVersionTag() {
+        return versionTag;
+    }
+
+    public void setVersionTag(String versionTag) {
+        this.versionTag = versionTag;
+    }
+
     public Date getExpiryDate() {
         return expiryDate;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseHomework.java

@@ -46,6 +46,8 @@ public class CourseHomework extends BaseEntity {
 	
 	/**  */
 	private String musicGroupId;
+
+    private String versionTag;
 	
 	private MusicGroup musicGroup = new MusicGroup();
 	
@@ -76,6 +78,14 @@ public class CourseHomework extends BaseEntity {
         this.studentLessonTrainingDetails = studentLessonTrainingDetails;
     }
 
+    public String getVersionTag() {
+        return versionTag;
+    }
+
+    public void setVersionTag(String versionTag) {
+        this.versionTag = versionTag;
+    }
+
     public String getTitle() {
 		return title;
 	}

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

@@ -41,6 +41,8 @@ public class ExtracurricularExercises extends BaseEntity {
 	/** 批次号 */
 	@ApiModelProperty(value="批次号")
 	private String batchNo;
+
+    private String versionTag;
 	
 	/** 标题 */
 	@ApiModelProperty(value="标题")
@@ -106,6 +108,13 @@ public class ExtracurricularExercises extends BaseEntity {
     @ApiModelProperty("新版作业 time:2023-03-31")
     private List<StudentLessonTrainingDetailWrapper.AddStudentLessonTrainingDetail> studentLessonTrainingDetails;
 
+    public String getVersionTag() {
+        return versionTag;
+    }
+
+    public void setVersionTag(String versionTag) {
+        this.versionTag = versionTag;
+    }
 
     public String getMusicGroupName() {
         return musicGroupName;

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentLessonTrainingDetail.java

@@ -25,7 +25,7 @@ import java.util.Date;
 public class StudentLessonTrainingDetail implements Serializable {
 
     @ApiModelProperty("主键ID") 
-	    @TableId(value = "id_")
+	    @TableId(value = "id_",type = IdType.AUTO)
 	    private Long id;
 
     @ApiModelProperty("用户ID") 

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseHomeworkQueryInfo.java

@@ -37,6 +37,16 @@ public class CourseHomeworkQueryInfo extends QueryInfo {
     @ApiModelProperty("完成状态 false 未完成 true 已完成")
     private Boolean finishStatus;
 
+    @ApiModelProperty
+    private String versionTag;
+
+    public String getVersionTag() {
+        return versionTag;
+    }
+
+    public void setVersionTag(String versionTag) {
+        this.versionTag = versionTag;
+    }
 
     public Boolean getFinishStatus() {
         return finishStatus;

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ExtraExercilseQueryInfo.java

@@ -51,6 +51,16 @@ public class ExtraExercilseQueryInfo extends QueryInfo {
 
     private Long studentExerciseId;
 
+    private String versionTag;
+
+    public String getVersionTag() {
+        return versionTag;
+    }
+
+    public void setVersionTag(String versionTag) {
+        this.versionTag = versionTag;
+    }
+
     public Boolean getStudentAssignFlag() {
         return studentAssignFlag;
     }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreService.java

@@ -26,4 +26,5 @@ public interface SysMusicScoreService extends BaseService<Integer, SysMusicScore
     void transcod(Integer sysMusicScoreId);
 
     int updateExtStyleConfigJson(Integer id, String extStyleConfigJson);
-}
+
+}

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

@@ -290,6 +290,7 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
      */
     @Override
     public PageInfo<StudentHomeworkRecordDto> findStudentExtraExercisesV2(ExtraExercilseQueryInfo queryInfo) {
+        queryInfo.setVersionTag("v2");
         PageInfo<ExtraExerciseStudentsDto> studentExtraExercises = findStudentExtraExercises(queryInfo);
 
         // 构建返回数据

+ 13 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesServiceImpl.java

@@ -21,6 +21,7 @@ import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
 import com.ym.mec.biz.service.ExtracurricularExercisesService;
 import com.ym.mec.biz.service.StudentLessonTrainingDetailService;
 import com.ym.mec.biz.service.StudentServeService;
+import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
@@ -72,6 +73,8 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
     private ClassGroupDao classGroupDao;
 
     @Autowired
+    private SysConfigService sysConfigService;
+    @Autowired
     private StudentLessonTrainingDetailService studentLessonTrainingDetailService;
 
 	@Override
@@ -83,10 +86,10 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
 	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
 	public void createExtraExercises(ExtracurricularExercises exercises) {
 		if(StringUtils.isBlank(exercises.getTitle())){
-			throw new BizException("请填写标题");
+			// throw new BizException("请填写标题");
 		}
 		if(StringUtils.isBlank(exercises.getContent())){
-			throw new BizException("请填写内容");
+			// throw new BizException("请填写内容");
 		}
 		List<MusicScoreSubjectDto> scoreSubjectDtoList = exercises.getMusicScoreSubjectDtos();
 
@@ -122,7 +125,7 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
 
 		if(Objects.isNull(exercises.getExpireDate())){
 			LocalDateTime localDateTime=LocalDateTime.now();
-			localDateTime=localDateTime.plusDays(2).withHour(21).withMinute(0).withSecond(0);
+			localDateTime=localDateTime.plusDays(Integer.parseInt(sysConfigService.findByParamName("homework_expire_time").getParanValue()));
 			exercises.setExpireDate(Date.from(localDateTime.atZone(DateUtil.zoneId).toInstant()));
 		}
 		List<Integer> studentIds = Arrays.asList(exercises.getStudentIdList().split(",")).stream().mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
@@ -168,7 +171,13 @@ public class ExtracurricularExercisesServiceImpl extends BaseServiceImpl<Long, E
                                                        ELessonTrainingType.valueOf(exercises.getGroupType())));
         }
         extracurricularExercisesReplyDao.batchInsert(extracurricularExercisesReplies);
-        studentLessonTrainingDetailService.saveBatch(studentLessonTrainingDetailList);
+        if (!CollectionUtils.isEmpty(studentLessonTrainingDetailList)) {
+            studentLessonTrainingDetailService.saveBatch(studentLessonTrainingDetailList);
+            exercises.setVersionTag("v2");
+        } else {
+            exercises.setVersionTag("v1");
+        }
+        extracurricularExercisesDao.update(exercises);
 
         for (ExtracurricularExercisesReply extracurricularExercisesReply : extracurricularExercisesReplies) {
             Integer studentId = extracurricularExercisesReply.getUserId();

+ 122 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -129,6 +129,9 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
     @Autowired
     private StudentLessonTrainingDetailService studentLessonTrainingDetailService;
 
+    @Autowired
+    private ExtracurricularExercisesDao extracurricularExercisesDao;
+
     @Override
     public BaseDAO<Long, StudentCourseHomework> getDAO() {
         return studentCourseHomeworkDao;
@@ -434,18 +437,25 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
         // 乐团信息
 
         // 乐团信息
+        Map<String, MusicGroup> musicGroupMap = new HashMap<>();
         List<String> musicGroupIds = dataList.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toList());
 
-        List<MusicGroup> musicGroups = musicGroupService.queryListByIds(new HashSet<>(musicGroupIds));
-        Map<String, MusicGroup> musicGroupMap = musicGroups.stream().collect(Collectors.toMap(MusicGroup::getId, Function.identity()));
+        if (!CollectionUtils.isEmpty(musicGroupIds)) {
+            List<MusicGroup> musicGroups = musicGroupService.queryListByIds(new HashSet<>(musicGroupIds));
+            musicGroupMap = musicGroups.stream().collect(Collectors.toMap(MusicGroup::getId, Function.identity()));
+        }
 
 
         // 班级名称
 
         List<Integer> classIds = dataList.stream().map(e -> e.getClassGroupId()).collect(Collectors.toList());
+        Map<Integer, ClassGroup> classGroupMap = new HashMap<>();
+        if (!CollectionUtils.isEmpty(classIds)) {
+
+            List<ClassGroup> classGroups = classGroupDao.queryByIds(classIds);
+            classGroupMap = classGroups.stream().collect(Collectors.toMap(ClassGroup::getId, Function.identity()));
+        }
 
-        List<ClassGroup> classGroups = classGroupDao.queryByIds(classIds);
-        Map<Integer, ClassGroup> classGroupMap = classGroups.stream().collect(Collectors.toMap(ClassGroup::getId, Function.identity()));
 
         for (StudentHomeworkRecordDto studentHomeworkRecordDto : dataList) {
             // 乐团信息
@@ -462,11 +472,16 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
             }
 
             // 设置完成状态
-            if (studentHomeworkRecordDto.getStatus() == 0) {
+            if (studentHomeworkRecordDto.getStandardFlag() == null) {
                 studentHomeworkRecordDto.setFinishStatus(false);
-            } else {
+            } else
+            if (studentHomeworkRecordDto.getStandardFlag().equals(StandardEnum.STANDARD)
+                || studentHomeworkRecordDto.getStandardFlag().equals(StandardEnum.EXCELLENT)){
                 studentHomeworkRecordDto.setFinishStatus(true);
+            } else {
+                studentHomeworkRecordDto.setFinishStatus(false);
             }
+            studentHomeworkRecordDto.setType(ELessonTrainingType.HOMEWORK);
         }
 
         pageInfo.setRows(dataList);
@@ -775,7 +790,7 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
             return studentCourseHomeworkByCourse;
         }
         // 转map
-        Map<Integer, Student> studentMap = students.stream().collect(Collectors.toMap(Student::getId, s -> s, (s1, s2) -> s1));
+        Map<Integer, Student> studentMap = students.stream().collect(Collectors.toMap(Student::getUserId, s -> s, (s1, s2) -> s1));
         for (StudentCourseHomework studentCourseHomework : studentCourseHomeworkByCourse) {
             if (studentMap.containsKey(studentCourseHomework.getUserId())) {
                 Student student = studentMap.get(studentCourseHomework.getUserId());
@@ -868,7 +883,7 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
     @Override
     public CourseHomeworkWrapper.CourseHomeworkList findStudentHomeworkRecordDetail(CourseHomeworkWrapper.StudentCourseHomeworkQuery query) {
         CourseHomeworkWrapper.CourseHomeworkList courseHomeworkDetail = null;
-        if (ELessonTrainingType.HOMEWORK.equals(query)) {
+        if (ELessonTrainingType.HOMEWORK.equals(query.getType())) {
             courseHomeworkDetail= courseHomeworkService.findCourseHomeworkDetail(
                 query.getCourseScheduleId());
         } else {
@@ -899,10 +914,108 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
      * @param record
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean addStudentHomeworkRecord(CourseHomeworkWrapper.AddStudentHomeworkRecord record) {
-        return null;
+
+        StudentLessonTrainingDetail studentLessonTrainingDetail = studentLessonTrainingDetailService.getById(record.getId());
+        if (studentLessonTrainingDetail == null) {
+            throw new BizException("练习记录不存在");
+        }
+        // 设置个人作业练习详情记录
+        studentLessonTrainingDetail.setTrainingTimes(studentLessonTrainingDetail.getTrainingTimes() +1);
+
+        if (studentLessonTrainingDetail.getTrainingTimes() >= studentLessonTrainingDetail.getTimes()) {
+            studentLessonTrainingDetail.setTrainingStatus(StandardEnum.STANDARD);
+        } else {
+            studentLessonTrainingDetail.setTrainingStatus(StandardEnum.NOT_STANDARD);
+
+        }
+        studentLessonTrainingDetail.setUpdateTime(new Date());
+        studentLessonTrainingDetailService.updateById(studentLessonTrainingDetail);
+
+        // 查询当前作业的其他作业,判断是否全部完成
+        List<StudentLessonTrainingDetail> list = studentLessonTrainingDetailService.lambdaQuery()
+                                   .eq(StudentLessonTrainingDetail::getCourseHomeworkId,
+                                       studentLessonTrainingDetail.getCourseHomeworkId())
+                                   .eq(StudentLessonTrainingDetail::getUserId,
+                                       record.getUserId())
+                                   .eq(StudentLessonTrainingDetail::getType,
+                                       studentLessonTrainingDetail.getType())
+                                   .in(StudentLessonTrainingDetail::getTrainingStatus,
+                                       StandardEnum.NOT_START,
+                                       StandardEnum.NOT_STANDARD)
+                                   .list();
+        if (!CollectionUtils.isEmpty(list)) {
+            return true;
+        }
+
+        // 设置个人作业练习记录
+
+        if (studentLessonTrainingDetail.getType().equals(ELessonTrainingType.HOMEWORK)) {
+
+            StudentCourseHomework studentCourseHomework = studentCourseHomeworkDao.getHomeworkByUserIdAndCourseHomeworkId(
+                record.getUserId(), studentLessonTrainingDetail.getCourseHomeworkId());
+
+            if (studentCourseHomework == null) {
+                throw new BizException("学生作业记录不存在");
+            }
+            if (studentCourseHomework.getStandardFlag() == null) {
+
+            } else
+            if (studentCourseHomework.getStandardFlag().equals(StandardEnum.STANDARD)
+                || studentCourseHomework.getStandardFlag().equals(StandardEnum.EXCELLENT)){
+                return true;
+            }
+            // 设置作业完成
+            studentCourseHomework.setStandardFlag(StandardEnum.STANDARD);
+            studentCourseHomework.setUpdateTime(new Date());
+            studentCourseHomework.setSubmitTime(new Date());
+            studentCourseHomeworkDao.update(studentCourseHomework);
+
+            // 添加完成人数
+            CourseHomework courseHomework = courseHomeworkDao.get(studentLessonTrainingDetail.getCourseHomeworkId());
+            if (courseHomework == null) {
+                throw new BizException("课程作业不存在");
+            }
+            if (courseHomework.getExpiryDate().compareTo(new Date()) < 0) {
+                throw new BizException("作业已截止");
+            }
+            courseHomeworkDao.updateFinishNum(studentLessonTrainingDetail.getCourseHomeworkId());
+
+
+        } else {
+            ExtracurricularExercisesReply exercisesReply = extracurricularExercisesReplyDao.getByExtraIdAndUserId(
+                studentLessonTrainingDetail.getCourseHomeworkId(), record.getUserId());
+
+            if (exercisesReply == null) {
+                throw new BizException("学生作业记录不存在");
+            }
+            if (exercisesReply.getStandardFlag() == null) {
+
+            } else
+            if (exercisesReply.getStandardFlag().equals(StandardEnum.STANDARD)
+                || exercisesReply.getStandardFlag().equals(StandardEnum.EXCELLENT)){
+                return true;
+            }
+            // 设置作业完成
+            exercisesReply.setStandardFlag(StandardEnum.STANDARD);
+            exercisesReply.setUpdateTime(new Date());
+            exercisesReply.setSubmitTime(new Date());
+            extracurricularExercisesReplyDao.update(exercisesReply);
+            // 添加完成人数
+            ExtracurricularExercises extracurricularExercises = extracurricularExercisesDao.get(studentLessonTrainingDetail.getCourseHomeworkId());
+            if (extracurricularExercises == null) {
+                throw new BizException("课外作业不存在");
+            }
+            if (extracurricularExercises.getExpireDate().compareTo(new Date()) < 0) {
+                throw new BizException("作业已截止");
+            }
+            extracurricularExercisesDao.updateFinishNum(studentLessonTrainingDetail.getCourseHomeworkId());
+        }
+        return true;
     }
 
+
     /**
      * 老师查看学生作业练习详情
      *

+ 28 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -682,6 +682,7 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
         }
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
+        params.put("versionTag","v2");
 
         // 查出课程列表
         List<CourseHomeworkWrapper.CourseHomeworkList> courseHomeworkLists = courseScheduleDao.queryTeacherServeHomeworkDetailV2(
@@ -719,6 +720,16 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
             if (Objects.nonNull(classGroup)) {
                 courseHomeworkList.setClassGroupName(classGroup.getName());
             }
+
+            // 设置老师信息
+            Integer teacherId = courseHomeworkList.getTeacherId();
+            if (teacherId != null) {
+                SysUser sysUser = sysUserFeignService.queryUserById(teacherId);
+                courseHomeworkList.setTeacherImg(sysUser.getAvatar());
+                courseHomeworkList.setTeacherName(sysUser.getRealName());
+            }
+
+
         }
 
 
@@ -758,6 +769,7 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
         params.put("subjectIds", subjectIds);
+        params.put("versionTag","v2");
 
         int count = extracurricularExercisesDao.countTeacherExtraHomeworkDetailV2(params);
         if (count > 0) {
@@ -784,9 +796,11 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
                                                         .filter(Objects::nonNull)
                                                         .collect(Collectors.toList());
             Map<Integer, ClassGroup> classGroupMap = new HashMap<>();
-            List<ClassGroup> classGroups = classGroupService.queryByIds(classIds);
-            if (!CollectionUtils.isEmpty(classGroups)) {
-                classGroupMap = classGroups.stream().collect(Collectors.toMap(ClassGroup::getId, Function.identity()));
+            if (!CollectionUtils.isEmpty(classIds)) {
+                List<ClassGroup> classGroups = classGroupService.queryByIds(classIds);
+                if (!CollectionUtils.isEmpty(classGroups)) {
+                    classGroupMap = classGroups.stream().collect(Collectors.toMap(ClassGroup::getId, Function.identity()));
+                }
             }
             for (CourseHomeworkWrapper.CourseHomeworkList courseHomeworkList : courseHomeworkLists) {
 
@@ -803,6 +817,17 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
                 if (Objects.nonNull(classGroup)) {
                     courseHomeworkList.setClassGroupName(classGroup.getName());
                 }
+
+                // 如果是给学生布置的作业  名 : xx等多少名学员
+                if (StringUtils.isEmpty(courseHomeworkList.getMusicGroupId()) && courseHomeworkList.getClassGroupId() == null) {
+                    String studentIdList = courseHomeworkList.getStudentIdList();
+                    if (StringUtils.isNotBlank(studentIdList)) {
+                        String[] split = studentIdList.split(",");
+                        String userId = split[0];
+                        SysUser sysUser = sysUserFeignService.queryUserById(Integer.parseInt(userId));
+                        courseHomeworkList.setMusicGroupName(sysUser.getUsername() + "等"+split.length+"名学员");
+                    }
+                }
             }
 
             pageInfo.setRows(courseHomeworkLists);

+ 34 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentLessonTrainingDetailServiceImpl.java

@@ -3,18 +3,25 @@ package com.ym.mec.biz.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.biz.dal.dao.StudentLessonTrainingDetailMapper;
+import com.ym.mec.biz.dal.dao.SysMusicScoreDao;
 import com.ym.mec.biz.dal.dto.StudentLessonTrainingDetailWrapper;
 import com.ym.mec.biz.dal.entity.StudentLessonTrainingDetail;
+import com.ym.mec.biz.dal.entity.SysMusicScore;
 import com.ym.mec.biz.dal.enums.ELessonTrainingType;
 import com.ym.mec.biz.dal.enums.StandardEnum;
 import com.ym.mec.biz.service.StudentLessonTrainingDetailService;
+import com.ym.mec.biz.service.SysMusicScoreService;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * 练习内容
@@ -24,6 +31,8 @@ import java.util.List;
 @Service
 public class StudentLessonTrainingDetailServiceImpl extends ServiceImpl<StudentLessonTrainingDetailMapper, StudentLessonTrainingDetail> implements StudentLessonTrainingDetailService {
 
+    @Autowired
+    private SysMusicScoreDao sysMusicScoreDao;
 	/**
      * 查询详情
      * @param id 详情ID
@@ -122,13 +131,36 @@ public class StudentLessonTrainingDetailServiceImpl extends ServiceImpl<StudentL
         List<StudentLessonTrainingDetail> list = this.lambdaQuery()
                                                      .eq(StudentLessonTrainingDetail::getCourseHomeworkId,
                                                          courseHomeworkId)
-                                                     .isNull(StudentLessonTrainingDetail::getUserId)
+                                                     .isNull(userId == null,StudentLessonTrainingDetail::getUserId)
                                                      .eq(StudentLessonTrainingDetail::getType, type)
                                                      .eq(userId != null, StudentLessonTrainingDetail::getUserId, userId)
                                                      .list();
         if (CollectionUtils.isEmpty(list)) {
             return new ArrayList<>();
         }
-        return JSON.parseArray(JSON.toJSONString(list),StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail.class);
+        List<StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail> studentLessonTrainingDetails = JSON.parseArray(
+            JSON.toJSONString(list), StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail.class);
+
+         // 曲目id集合
+        List<Long> collect = studentLessonTrainingDetails.stream()
+                                                         .map(
+                                                             StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail::getMusicScoreId)
+                                                         .distinct()
+                                                         .collect(Collectors.toList());
+
+        List<SysMusicScore> scoreList = sysMusicScoreDao.findByIds(
+            collect.stream().map(String::valueOf).collect(Collectors.joining(",")));
+
+        // id 分组
+        Map<Integer, SysMusicScore> musicScoreMap = scoreList.stream()
+                                                     .collect(Collectors.toMap(SysMusicScore::getId, Function.identity()));
+
+        for (StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail studentLessonTrainingDetail : studentLessonTrainingDetails) {
+            SysMusicScore sysMusicScore = musicScoreMap.get(studentLessonTrainingDetail.getMusicScoreId().intValue());
+            if (sysMusicScore != null) {
+                studentLessonTrainingDetail.setMusicScoreName(sysMusicScore.getName());
+            }
+        }
+        return studentLessonTrainingDetails;
     }
 }

+ 17 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -79,6 +79,9 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 	private StudentService studentService;
 
     @Autowired
+    private SysConfigService sysConfigService;
+
+    @Autowired
     private StudentLessonTrainingDetailService studentLessonTrainingDetailService;
 
 	@Override
@@ -349,11 +352,12 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 					courseHomework.setMusicGroupId(currentCourseDetail.getMusicGroupId());
 					courseHomework.setGroupType(teacherAttendance.getGroupType());
 					courseHomework.setClassGroupId(currentCourseDetail.getClassId().intValue());
-					courseHomework.setExpiryDate(DateUtil.addDays(date,7));
+					courseHomework.setExpiryDate(DateUtil.addDays(date,Integer.parseInt(sysConfigService.findByParamName("homework_expire_time").getParanValue())));
 
 					courseHomeworkService.insert(courseHomework);
 					List<StudentCourseHomework> studentCourseHomeworks = new ArrayList<>();
 
+                    String versionTag = "v1";
                     // 作业详情
                     List<StudentLessonTrainingDetail> studentLessonTrainingDetails = new ArrayList<>();
 
@@ -394,6 +398,10 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
                         studentCourseHomework.setGroupType(teacherAttendance.getGroupType());
                     }
 
+                    if (CollectionUtils.isEmpty(studentLessonTrainingDetails)) {
+                        versionTag ="v2";
+                    }
+
 					//排除不被服务学员
 //					Set<Integer> serveStudentIds = studentServeService.getStudentWithCourse(teacherAttendance.getCourseScheduleId());
 //					Iterator<StudentCourseHomework> iterator = studentCourseHomeworks.iterator();
@@ -404,6 +412,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 //						}
 //					}
 					courseHomework.setExpectNum(studentCourseHomeworks.size());
+                    courseHomework.setVersionTag(versionTag);
 
 					Teacher teacher = teacherDao.get(courseSchedule.getActualTeacherId());
 					String dateStr = DateUtil.dateToString(DateUtil.addDays(date, 3), "MM月dd日");
@@ -802,7 +811,13 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		result.setTeacherName(teacherDao.queryNameById(courseSchedule.getActualTeacherId()));
 		result.setAttendClassTime(teacherAttendanceDao.getAttendClassTime(courseScheduleId));
 		result.setSchool(schoolDao.get(courseSchedule.getSchoolId()));
-		//获取异常考勤学员数量
+
+        // 设置课后作业版本
+        CourseHomework homework = courseHomeworkDao.getByCourseScheduleId(courseScheduleId);
+        if (homework != null) {
+            result.setVersionTag(homework.getVersionTag());
+        }
+        //获取异常考勤学员数量
 		result.setErrorAttendanceNum(studentAttendanceDao.countErrorAttendance(courseScheduleId));
 		if(teacherAttendance != null){
 			result.setIsSignIn(Objects.isNull(teacherAttendance.getSignInStatus())?3:teacherAttendance.getSignInStatus().getCode());

+ 11 - 1
mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml

@@ -21,6 +21,7 @@
 		<result column="expect_num_" property="expectNum" />
 		<result column="expiry_date_" property="expiryDate" />
 		<result column="tenant_id_" property="tenantId" />
+		<result column="version_tag_" property="versionTag" />
 	</resultMap>
 
 	<resultMap type="com.ym.mec.biz.dal.dto.CourseHomeworkListDto" id="CourseHomeworkDto">
@@ -286,12 +287,13 @@
 		<result property="classStartDate" column="start_class_time_"/>
 		<result property="classEndDate" column="end_class_time_"/>
 		<result property="musicScoreId" column="music_score_id_"/>
+		<result property="versionTag" column="versionTag"/>
 	</resultMap>
     <select id="queryHomePage" resultMap="WebCourseHomeworkListDtoMap">
 		SELECT ch.id_,cs.id_ course_schedule_id_,cs.name_ course_schedule_name_,
 		cs.class_date_,cs.start_class_time_,cs.end_class_time_,cs.organ_id_,o.name_ organ_name_,
 		mg.id_ group_id_,mg.name_ group_name_,ch.create_time_,cs.actual_teacher_id_,
-		su.real_name_ actual_teacher_name_,ch.completed_num_,ch.expect_num_,cs.group_type_,sch.music_score_id_,mg.name_ as musicGroupName,ch.expiry_date_ as expiryDate
+		su.real_name_ actual_teacher_name_,ch.completed_num_,ch.expect_num_,cs.group_type_,sch.music_score_id_,mg.name_ as musicGroupName,ch.expiry_date_ as expiryDate,ch.version_tag_ as versionTag
 		FROM course_homework ch
 		LEFT JOIN student_course_homework sch ON ch.id_ = sch.course_homework_id_
 		LEFT JOIN course_schedule cs ON cs.id_ = ch.course_schedule_id_
@@ -384,4 +386,12 @@
 			#{courseScheduleId}
 		</foreach>
 	</delete>
+
+	<update id="updateFinishNum">
+        UPDATE course_homework SET completed_num_ = ifnull(completed_num_,0) + 1 WHERE id_ = #{courseHomeworkId}
+    </update>
+
+	<select id="getByCourseScheduleId" resultMap="CourseHomework">
+        select * from course_homework where course_schedule_id_ = #{courseScheduleId}
+    </select>
 </mapper>

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

@@ -4147,6 +4147,7 @@
         ch.create_time_ as assignTime,
         ch.expiry_date_ as expiryDate,
         ch.completed_num_ as finishNum,
+        cs.name_ as courseScheduleName,
         ch.expect_num_ as studentNum
         from course_schedule cs
         left join course_homework ch on cs.id_ = ch.course_schedule_id_
@@ -4178,6 +4179,9 @@
             <if test="param.courseScheduleId != null">
                 and cs.id_ = #{param.courseScheduleId}
             </if>
+            <if test="param.versionTag !=null">
+                and ch.version_tag_ = #{param.versionTag}
+            </if>
         </where>
         <if test="param.offset != null">
             limit #{param.offset},#{param.rows}

+ 13 - 3
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesMapper.xml

@@ -27,6 +27,7 @@
 		<result column="music_score_id_" property="musicScoreId" />
 		<result column="assignTime" property="assignTime" />
 		<result column="musicGroupName" property="musicGroupName" />
+		<result column="versionTag" property="versionTag" />
 	</resultMap>
 
 	<sql id="queryPageCondition">
@@ -147,7 +148,7 @@
 	<select id="queryPage" resultMap="ExtracurricularExercises" parameterType="map">
 		SELECT ee.id_,ee.teacher_id_,ee.student_id_list_,ee.batch_no_,ee.title_,ee.attachments_,ee.music_group_id_,
 		       ee.content_,ee.expire_date_,ee.completed_num_,ee.expect_num_,ee.create_time_,ee.update_time_,ee.tenant_id_
-		     ,u.real_name_ username_,o.name_ organ_name_,eer.music_score_id_,ee.create_time_ as assignTime,mg.name_ as musicGroupName,ee.class_group_id_ as classGroupId
+		     ,u.real_name_ username_,o.name_ organ_name_,eer.music_score_id_,ee.create_time_ as assignTime,mg.name_ as musicGroupName,ee.class_group_id_ as classGroupId,ee.version_tag_ as versionTag
 		FROM extracurricular_exercises ee LEFT JOIN sys_user u ON ee.teacher_id_ = u.id_
 		LEFT JOIN teacher t ON t.id_ = ee.teacher_id_
         left join sys_user su on t.id_ = su.id_
@@ -352,6 +353,9 @@
         <if test="type != null">
             and group_type_ = #{type}
         </if>
+        <if test="versionTag != null">
+            and version_tag_ = #{versionTag}
+        </if>
 	</sql>
 	<select id="countTeacherExtraHomeworkDetailV2" resultType="int">
         select count(1) from (
@@ -383,7 +387,8 @@
             null as studentNum,
             null as finishNum,
             null as assignTime,
-            null as expiryDate
+            null as expiryDate,
+            null as studentIdList
             from music_group
             where id_ in
             <foreach collection="subjectIds" item="item" separator="," open="(" close=")">
@@ -402,7 +407,8 @@
         expect_num_ as studentNum,
         completed_num_ as finishNum,
         create_time_ as assignTime,
-        expire_date_ as expiryDate
+        expire_date_ as expiryDate,
+        student_id_list_ as studentIdList
         from extracurricular_exercises
         <where>
 
@@ -411,4 +417,8 @@
         )
         <include refid="global.limit"/>
     </select>
+
+	<update id="updateFinishNum">
+        UPDATE extracurricular_exercises SET completed_num_ = ifnull(completed_num_,0) + 1 WHERE id_ = #{courseHomeworkId}
+    </update>
 </mapper>

+ 4 - 1
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -256,6 +256,9 @@
                     and eer.standard_flag_  not in ('STANDARD','EXCELLENT')
                 </if>
             </if>
+            <if test="versionTag != null">
+                and ee.version_tag_ = #{versionTag}
+            </if>
 		</where>
 	</sql>
 	<select id="countStudentExtraExercises" resultType="int">
@@ -632,7 +635,7 @@
 		GROUP BY sr.actual_subject_id_
 	</select>
 
-	<select id="getByExtraIdAndUserId">
+	<select id="getByExtraIdAndUserId" resultType="com.ym.mec.biz.dal.entity.ExtracurricularExercisesReply">
         SELECT * from  extracurricular_exercises_reply where extracurricular_exercises_id_ = #{extraId} and user_id_ = #{userId}
     </select>
 </mapper>

+ 21 - 1
mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml

@@ -368,6 +368,7 @@
         <result property="musicGroupId" column="musicGroupId"/>
         <result property="classGroupId" column="classGroupId"/>
         <result property="teachMode" column="teachMode"/>
+        <result property="standardFlag" column="standardFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
     <select id="findStudentHomeworkRecord" resultMap="StudentHomeworkRecordDto">
         SELECT
@@ -378,6 +379,7 @@
         CONCAT(cs.class_date_,' ',cs.end_class_time_) endClassTime,
         cs.actual_teacher_id_,
         sch.status_,
+        sch.standard_flag_ as standardFlag,
         ch.expiry_date_,
         su.real_name_,
         su.avatar_,
@@ -399,12 +401,16 @@
                 and sch.standard_flag_  not in ('STANDARD','EXCELLENT')
             </if>
         </if>
+        <if test="versionTag != null">
+            and ch.version_tag_ = #{versionTag}
+        </if>
         ORDER BY CONCAT(cs.class_date_,' ',cs.start_class_time_) DESC
         <include refid="global.limit"/>
     </select>
     <select id="countStudentHomeworkRecord" resultType="int">
         SELECT COUNT(sch.id_)
         FROM student_course_homework sch
+        LEFT JOIN course_homework ch ON ch.id_ = sch.course_homework_id_
                  LEFT JOIN course_schedule cs ON cs.id_ = sch.course_schedule_id_
         WHERE sch.user_id_ = #{userId}
           AND DATE_FORMAT(class_date_, '%Y-%m') = DATE_FORMAT(#{classDate}, '%Y-%m')
@@ -416,6 +422,9 @@
                 and sch.standard_flag_  not in ('STANDARD','EXCELLENT')
             </if>
         </if>
+        <if test="versionTag != null">
+            and ch.version_tag_ = #{versionTag}
+        </if>
     </select>
     <select id="findByCourses" resultMap="StudentCourseHomework">
         SELECT * FROM student_course_homework WHERE course_schedule_id_ IN
@@ -680,7 +689,8 @@
 
     <select id="findByStudentIdsAndCourseScheduleId"
             resultType="com.ym.mec.biz.dal.dto.StudentLessonTrainingDetailWrapper$StudentLessonTrainingDetail">
-        SELECT * from student_lesson_training_detail s
+        SELECT s.*,sms.name_ as musicScoreName from student_lesson_training_detail s
+        left join sys_music_score sms on s.music_score_id_ = sms.id_
         where s.user_id_ in
         <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
             #{studentId}
@@ -720,4 +730,14 @@
                 AND sch.standard_flag_ not in ('STANDARD','EXCELLENT')
         and ch.expiry_date_ &gt;= #{now}
     </select>
+
+    <select id="getHomeworkByUserIdAndCourseHomeworkId" resultMap="StudentCourseHomework">
+        SELECT
+            sch.*
+        FROM
+            student_course_homework sch
+        WHERE
+            sch.user_id_ = #{userId}
+                AND sch.course_homework_id_ = #{courseHomeworkId}
+    </select>
 </mapper>

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

@@ -109,8 +109,16 @@ public class StudentCourseHomeworkController extends BaseController {
     }
 
 
+    @ApiOperation(value = "获取学生作业记录")
+    @GetMapping(value = "/findStudentHomeworkRecord/v2")
+    public HttpResponseResult<PageInfo<StudentHomeworkRecordDto>> findStudentHomeworkRecordV2(CourseHomeworkQueryInfo queryInfo){
+        queryInfo.setUserId(sysUserService.getUserId().longValue());
+        queryInfo.setVersionTag("v2");
+        return succeed(studentCourseHomeworkService.findStudentHomeworkRecord(queryInfo));
+    }
+
     @ApiOperation(value = "获取学生作业详情")
-    @GetMapping(value = "/findStudentHomeworkRecordDetail")
+    @GetMapping(value = "/findStudentHomeworkRecordDetail/v2")
     public HttpResponseResult<CourseHomeworkWrapper.CourseHomeworkList>
             findStudentHomeworkRecordDetail(CourseHomeworkWrapper.StudentCourseHomeworkQuery query){
         query.setUserId(sysUserService.getUserId().longValue());

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java

@@ -228,7 +228,7 @@ public class TeacherController extends BaseController {
     @ApiOperation(value = "根据课程计划获取需要交作业的学生-公用")
     @PostMapping("/findCourseStudentsPublic/v2")
     public HttpResponseResult<List<StudentCourseHomework>> findCourseStudentsPublicV2(@Validated @RequestBody StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query){
-        if(!ELessonTrainingType.HOMEWORK.equals(query.getType())){
+        if(ELessonTrainingType.HOMEWORK.equals(query.getType())){
             if (Objects.isNull(query.getCourseScheduleId())) {
                 throw new BizException("请指定课程");
             }
@@ -244,7 +244,7 @@ public class TeacherController extends BaseController {
     @PostMapping("/findCourseStudentsSubjectPublic/v2")
     public HttpResponseResult<List<Subject>> findCourseStudentsSubjectPublicV2(@Validated @RequestBody StudentLessonTrainingDetailWrapper.StudentLessonTrainingQuery query){
         List<StudentCourseHomework> studentCourseHomeworkByCourseV2;
-        if(!ELessonTrainingType.HOMEWORK.equals(query.getType())){
+        if(ELessonTrainingType.HOMEWORK.equals(query.getType())){
             if (Objects.isNull(query.getCourseScheduleId())) {
                 throw new BizException("请指定课程");
             }