瀏覽代碼

添加提交时间

liujunchi 2 年之前
父節點
當前提交
c98bc0cd2e

+ 1 - 19
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentLessonTrainingDetailWrapper.java

@@ -76,10 +76,6 @@ public class StudentLessonTrainingDetailWrapper {
         public String jsonString() {
             return JSON.toJSONString(this);
         }
-
-        public static StudentLessonTrainingDetail from(String json) {
-            return JSON.parseObject(json, StudentLessonTrainingDetail.class);
-        }
 	}
 
 
@@ -106,21 +102,12 @@ public class StudentLessonTrainingDetailWrapper {
         @ApiModelProperty(value = "true:完成 false未完成",hidden = true)
         private Boolean standardFlag;
 
-
-
-        public String jsonString() {
-            return JSON.toJSONString(this);
-        }
-
-        public static StudentLessonTrainingDetail from(String json) {
-            return JSON.parseObject(json, StudentLessonTrainingDetail.class);
-        }
 	}
 
 
 
     @Data
-    @ApiModel(" StudentLessonTrainingQuery-学生练习内容查询对象")
+    @ApiModel(" StudentLessonTraining-学生练习内容查询对象")
     public static class StudentLessonTraining {
 
 
@@ -150,11 +137,6 @@ public class StudentLessonTrainingDetailWrapper {
 
         @ApiModelProperty(value = "练习内容")
         private List<StudentLessonTrainingDetailWrapper.StudentLessonTrainingDetail> studentLessonTrainingDetail;
-
-        public String jsonString() {
-            return JSON.toJSONString(this);
-        }
-
     }
 
 }

+ 9 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java

@@ -16,6 +16,7 @@ import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.ExtraExercilseQueryInfo;
 import com.ym.mec.biz.dal.page.ExtraExercilseReplyQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseHomeWorkQueryInfo;
+import com.ym.mec.biz.service.CourseHomeworkService;
 import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
 import com.ym.mec.biz.service.ExtracurricularExercisesService;
 import com.ym.mec.biz.service.MusicGroupService;
@@ -71,6 +72,9 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
     @Autowired
     private ExtracurricularExercisesService extracurricularExercisesService;
 
+    @Autowired
+    private CourseHomeworkService courseHomeworkService;
+
 	@Override
 	public BaseDAO<Long, ExtracurricularExercisesReply> getDAO() {
 		return extracurricularExercisesReplyDao;
@@ -313,6 +317,7 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
             studentHomeworkRecordDto.setMusicGroupId(row.getMusicGroupId());
             studentHomeworkRecordDto.setClassGroupId(row.getClassGroupId());
             studentHomeworkRecordDto.setType(ELessonTrainingType.valueOf(row.getType()));
+            studentHomeworkRecordDto.setSubmitTime(row.getSubmitTime());
             recordDtoList.add(studentHomeworkRecordDto);
         }
 
@@ -362,6 +367,9 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
             } else {
                 studentHomeworkRecordDto.setFinishStatus(true);
             }
+
+            // 设置提交时间
+
         }
 
         PageInfo<StudentHomeworkRecordDto> pageInfo = new PageInfo<>(studentExtraExercises.getPageNo(),studentExtraExercises.getLimit());
@@ -372,19 +380,8 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 
     @Override
     public CourseHomeworkWrapper.CourseHomeworkList findStudentExtraExerciseDetailV2(Long studentExerciseId) {
-        ExtraExercilseQueryInfo queryInfo = new ExtraExercilseQueryInfo();
-        queryInfo.setPage(1);
-        queryInfo.setRows(1);
-        queryInfo.setStudentExerciseId(studentExerciseId);
-        PageInfo<ExtracurricularExercises> extracurricularExercisesReplyPageInfo = extracurricularExercisesService.queryPage(queryInfo);
-        if (CollectionUtils.isEmpty(extracurricularExercisesReplyPageInfo.getRows())) {
-            throw new BizException("课外训练不存在");
-        }
-        ExtracurricularExercises extracurricularExercises = extracurricularExercisesReplyPageInfo.getRows().get(0);
-
-
 
-        return null;
+        return courseHomeworkService.findCourseExtraHomeworkDetail( studentExerciseId.intValue());
 
 
     }

+ 6 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentExtracurricularExercisesSituationServiceImpl.java

@@ -821,10 +821,15 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
                 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+"名学员");
+                        if (split.length == 1) {
+                            courseHomeworkList.setMusicGroupName(sysUser.getUsername());
+                        } else {
+                            courseHomeworkList.setMusicGroupName(sysUser.getUsername() + "等" + split.length + "名学员");
+                        }
                     }
                 }
 

+ 3 - 2
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -262,7 +262,8 @@
 		</where>
 	</sql>
 	<select id="countStudentExtraExercises" resultType="int">
-		SELECT COUNT(id_) FROM extracurricular_exercises_reply eer
+		SELECT COUNT(eer.id_) FROM extracurricular_exercises_reply eer
+        left join extracurricular_exercises ee on eer.extracurricular_exercises_id_ = ee.id_
 		<include refid="queryStudentExtraExercisesCondition"/>
 	</select>
 	<select id="findStudentExtraExercises" resultMap="ExtraExerciseStudentsDto">
@@ -274,7 +275,7 @@
         ee.group_type_  as `type`,
             ee.id_ as extracurricularExercisesId,
             ee.music_group_id_ as musicGroupId,
-            eer.class_group_id_ as classGroupId,
+        ee.class_group_id_ as classGroupId,
 			tea.real_name_ teacher_name_,
 			tea.avatar_,
 			su.username_ student_name_

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

@@ -110,8 +110,8 @@ public class StudentCourseHomeworkController extends BaseController {
 
 
     @ApiOperation(value = "获取学生作业记录")
-    @PostMapping(value = "/findStudentHomeworkRecord/v2")
-    public HttpResponseResult<PageInfo<StudentHomeworkRecordDto>> findStudentHomeworkRecordV2(@RequestBody CourseHomeworkQueryInfo queryInfo){
+    @GetMapping(value = "/findStudentHomeworkRecord/v2")
+    public HttpResponseResult<PageInfo<StudentHomeworkRecordDto>> findStudentHomeworkRecordV2( CourseHomeworkQueryInfo queryInfo){
         queryInfo.setUserId(sysUserService.getUserId().longValue());
         queryInfo.setVersionTag("v2");
         return succeed(studentCourseHomeworkService.findStudentHomeworkRecord(queryInfo));