Commit 40108bcc authored by xingyuji's avatar xingyuji

1.添加接口:根据章节ID和学生ID查询实验完成状态;

parent a99826a7
...@@ -234,7 +234,21 @@ public class BChapterController extends PaginationController<BChapter> { ...@@ -234,7 +234,21 @@ public class BChapterController extends PaginationController<BChapter> {
scoreInfoDTO); scoreInfoDTO);
} }
@ApiOperation(value="根据学生ID(token判断获取)和章节ID查询该节的学习情况", notes="学习情况包括:分数、实验完成状态以及各个教学手段完成状态。")
@ApiImplicitParams({
@ApiImplicitParam(name = "slId", value = "开课ID", required = true, dataType = "varchar"),
@ApiImplicitParam(name = "chapterId", value = "章节ID", required = true, dataType = "varchar"),
})
@PreAuthorize("hasRole('ROLE_1003')")
@GetMapping(value = "/queryChapStudyState")
public Result queryChapterStudyState(ScoreInfoDTO scoreInfoDTO) throws Exception{
scoreInfoDTO.setStudentId(UserUtil.getUserInfoProp(getToken(),UserUtil.USER_ID));
scoreInfoDTO = bChapterService.getChapInfoById(scoreInfoDTO);
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
scoreInfoDTO);
}
@ApiOperation(value="更改章节状态", notes="根据章节ID更改章节状态") @ApiOperation(value="更改章节状态", notes="根据章节ID更改章节状态")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"), @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar"),
......
...@@ -86,6 +86,21 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -86,6 +86,21 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
@ResultMap("QueryScoreListByChapterIdResultMap") @ResultMap("QueryScoreListByChapterIdResultMap")
List<StudentChapterScoreVO> queryScoreListByChapterId(@Param("dto") QueryScoreListDTO dto); List<StudentChapterScoreVO> queryScoreListByChapterId(@Param("dto") QueryScoreListDTO dto);
/**
* 根据学生ID和章节ID查询该节的学习情况
* @param
* @return
*/
@Select("<script>SELECT\n" +
"\tt1.is_complete as isComplete\n" +
"FROM\n" +
"\tb_r_student_chapter t1\n" +
"LEFT JOIN b_student t2 ON t1.student_id = t2.business_id\n" +
"LEFT JOIN s_user t3 ON t3.login_name = t2.code\n" +
"WHERE t1.chapter_id = #{chapterId} and t3.business_id = #{studentId}"+
"</script>")
ScoreInfoDTO queryChapInfoById(@Param("chapterId")String chapterId,@Param("studentId")String studentId);
/** /**
* 根据课程id和学生id查找该学生所学课程分数列表 * 根据课程id和学生id查找该学生所学课程分数列表
* @param slid * @param slid
......
...@@ -92,6 +92,11 @@ public interface BChapterService{ ...@@ -92,6 +92,11 @@ public interface BChapterService{
*/ */
void updateIsComplete(ScoreInfoDTO scoreInfoDTO,String token) throws Exception; void updateIsComplete(ScoreInfoDTO scoreInfoDTO,String token) throws Exception;
/*
* 根据学生ID和章节ID查询该节的学习情况
* */
ScoreInfoDTO getChapInfoById(ScoreInfoDTO scoreInfoDTO) throws Exception;
int addBslFormLesson(String bLseeonId, String lessonCode, String businessId); int addBslFormLesson(String bLseeonId, String lessonCode, String businessId);
int updateChapterState(BChapter bChapter); int updateChapterState(BChapter bChapter);
......
...@@ -221,6 +221,12 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -221,6 +221,12 @@ public class BChapterServiceImpl implements BChapterService {
throw new ServiceException(ResultServiceEnums.UPDATE_ERROR); throw new ServiceException(ResultServiceEnums.UPDATE_ERROR);
} }
@Override
public ScoreInfoDTO getChapInfoById(ScoreInfoDTO scoreInfoDTO) throws Exception {
return bChapterRepository.queryChapInfoById(scoreInfoDTO.getChapterId(),scoreInfoDTO.getStudentId());
}
@Transactional(propagation = Propagation.REQUIRED,readOnly = false) @Transactional(propagation = Propagation.REQUIRED,readOnly = false)
@Override @Override
public int addBslFormLesson(String bLessonId, String lessonCode, String slId) { public int addBslFormLesson(String bLessonId, String lessonCode, String slId) {
......
...@@ -29,7 +29,7 @@ public class Swagger2Config { ...@@ -29,7 +29,7 @@ public class Swagger2Config {
.title("教学实训平台") .title("教学实训平台")
.description("教学实训平台") .description("教学实训平台")
.termsOfServiceUrl("教学实训平台") .termsOfServiceUrl("教学实训平台")
.version("1.0") .version("2.0")
.build(); .build();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment