|
|
@ -6,14 +6,8 @@ import com.sztzjy.financial_bigdata.entity.stu_dto.StuCommitCaseDto;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.sys_dto.SysCourseChapterDto;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.sys_dto.SysCourseChapterDto;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.sys_dto.SysCourseDto;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.sys_dto.SysCourseDto;
|
|
|
|
import com.sztzjy.financial_bigdata.mapper.*;
|
|
|
|
import com.sztzjy.financial_bigdata.mapper.*;
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaResourceDataService;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.util.ResultEntity;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.SysCaseQuestion;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionExample;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStep;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.SysCaseQuestionStepExample;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaCaseStepService;
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaCaseStepService;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaResourceDataService;
|
|
|
|
import com.sztzjy.financial_bigdata.util.ResultEntity;
|
|
|
|
import com.sztzjy.financial_bigdata.util.ResultEntity;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@ -24,8 +18,7 @@ import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import java.util.List;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
@ -73,7 +66,7 @@ public class ExerciseExperimentalTraining {
|
|
|
|
SysCaseQuestionExample questionExample = new SysCaseQuestionExample();
|
|
|
|
SysCaseQuestionExample questionExample = new SysCaseQuestionExample();
|
|
|
|
questionExample.createCriteria().andChapterIdEqualTo(chapterId);
|
|
|
|
questionExample.createCriteria().andChapterIdEqualTo(chapterId);
|
|
|
|
List<SysCaseQuestion> sysCaseQuestions = caseQuestionMapper.selectByExample(questionExample);
|
|
|
|
List<SysCaseQuestion> sysCaseQuestions = caseQuestionMapper.selectByExample(questionExample);
|
|
|
|
List<String> caseIds=new ArrayList<>();
|
|
|
|
List<String> caseIds = new ArrayList<>();
|
|
|
|
for (int i = 0; i < sysCaseQuestions.size(); i++) {
|
|
|
|
for (int i = 0; i < sysCaseQuestions.size(); i++) {
|
|
|
|
String caseId = sysCaseQuestions.get(i).getCaseId();
|
|
|
|
String caseId = sysCaseQuestions.get(i).getCaseId();
|
|
|
|
caseIds.add(caseId);
|
|
|
|
caseIds.add(caseId);
|
|
|
@ -97,9 +90,9 @@ public class ExerciseExperimentalTraining {
|
|
|
|
|
|
|
|
|
|
|
|
//执行记录操作
|
|
|
|
//执行记录操作
|
|
|
|
Boolean flag = stepService.commitCase(commitCaseDto);
|
|
|
|
Boolean flag = stepService.commitCase(commitCaseDto);
|
|
|
|
if (flag){
|
|
|
|
if (flag) {
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "该步骤提交成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "该步骤提交成功");
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该步骤重复提交");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该步骤重复提交");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -119,16 +112,12 @@ public class ExerciseExperimentalTraining {
|
|
|
|
courseChapterExample.setOrderByClause("sequence ASC");
|
|
|
|
courseChapterExample.setOrderByClause("sequence ASC");
|
|
|
|
List<SysCourseChapter> sysCourseChapters = sysCourseChapterMapper.selectByExample(courseChapterExample);
|
|
|
|
List<SysCourseChapter> sysCourseChapters = sysCourseChapterMapper.selectByExample(courseChapterExample);
|
|
|
|
List<SysCourseChapterDto> CourseChapterDtoList = new ArrayList<>();
|
|
|
|
List<SysCourseChapterDto> CourseChapterDtoList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
for (SysCourseChapter sysCourseChapter : sysCourseChapters) {
|
|
|
|
for (SysCourseChapter sysCourseChapter : sysCourseChapters) {
|
|
|
|
SysCourseChapterDto sysCourseChapterDto = new SysCourseChapterDto();
|
|
|
|
SysCourseChapterDto sysCourseChapterDto = new SysCourseChapterDto();
|
|
|
|
BeanUtils.copyProperties(sysCourseChapter, sysCourseChapterDto);
|
|
|
|
BeanUtils.copyProperties(sysCourseChapter, sysCourseChapterDto);
|
|
|
|
StuTrainingExample example = new StuTrainingExample();
|
|
|
|
BigDecimal progress = stuTrainingMapper.getByUserIdAndChapterId(userId, sysCourseChapter.getChapterId());
|
|
|
|
example.createCriteria().andUserIdEqualTo(userId).andChapterIdEqualTo(sysCourseChapter.getChapterId());
|
|
|
|
sysCourseChapterDto.setSchedule(progress);
|
|
|
|
List<StuTrainingWithBLOBs> list = stuTrainingMapper.selectByExampleWithBLOBs(example);
|
|
|
|
|
|
|
|
if (!list.isEmpty()) {
|
|
|
|
|
|
|
|
StuTrainingWithBLOBs stuTrainingWithBLOBs = list.get(0);
|
|
|
|
|
|
|
|
sysCourseChapterDto.setSchedule(stuTrainingWithBLOBs.getProgress());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CourseChapterDtoList.add(sysCourseChapterDto);
|
|
|
|
CourseChapterDtoList.add(sysCourseChapterDto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
newDto.setSysCourseChapterDtos(CourseChapterDtoList);
|
|
|
|
newDto.setSysCourseChapterDtos(CourseChapterDtoList);
|
|
|
@ -137,6 +126,43 @@ public class ExerciseExperimentalTraining {
|
|
|
|
return new ResultEntity<List<SysCourseDto>>(dtoList);
|
|
|
|
return new ResultEntity<List<SysCourseDto>>(dtoList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// @AnonymousAccess
|
|
|
|
|
|
|
|
// @ApiOperation("实训演练页面查询")
|
|
|
|
|
|
|
|
// @PostMapping("getCourseChapter")
|
|
|
|
|
|
|
|
// public ResultEntity<List<SysCourseDto>> getIndexTheoryTest(@RequestParam String userId) {
|
|
|
|
|
|
|
|
// List<SysCourse> sysCourseList = sysCourseMapper.getBySchoolId();
|
|
|
|
|
|
|
|
// List<SysCourseDto> dtoList = new ArrayList<>();
|
|
|
|
|
|
|
|
// for (SysCourse sysCourse : sysCourseList) {
|
|
|
|
|
|
|
|
// SysCourseDto newDto = new SysCourseDto();
|
|
|
|
|
|
|
|
// BeanUtils.copyProperties(sysCourse, newDto);
|
|
|
|
|
|
|
|
// String courseId = newDto.getCourseId();
|
|
|
|
|
|
|
|
// SysCourseChapterExample courseChapterExample = new SysCourseChapterExample();
|
|
|
|
|
|
|
|
// courseChapterExample.createCriteria().andCourseIdEqualTo(courseId);
|
|
|
|
|
|
|
|
// courseChapterExample.setOrderByClause("sequence ASC");
|
|
|
|
|
|
|
|
// List<SysCourseChapter> sysCourseChapters = sysCourseChapterMapper.selectByExample(courseChapterExample);
|
|
|
|
|
|
|
|
// List<SysCourseChapterDto> CourseChapterDtoList = new ArrayList<>();
|
|
|
|
|
|
|
|
// for (SysCourseChapter sysCourseChapter : sysCourseChapters) {
|
|
|
|
|
|
|
|
//// stuTrainingMapper.getByUserIdAndChaptetId()
|
|
|
|
|
|
|
|
// SysCourseChapterDto sysCourseChapterDto = new SysCourseChapterDto();
|
|
|
|
|
|
|
|
// BeanUtils.copyProperties(sysCourseChapter, sysCourseChapterDto);
|
|
|
|
|
|
|
|
// StuTrainingExample example = new StuTrainingExample();
|
|
|
|
|
|
|
|
// example.createCriteria().andUserIdEqualTo(userId).andChapterIdEqualTo(sysCourseChapter.getChapterId());
|
|
|
|
|
|
|
|
// List<StuTrainingWithBLOBs> list = stuTrainingMapper.selectByExampleWithBLOBs(example);
|
|
|
|
|
|
|
|
// if (!list.isEmpty()) {
|
|
|
|
|
|
|
|
// StuTrainingWithBLOBs stuTrainingWithBLOBs = list.get(0);
|
|
|
|
|
|
|
|
// sysCourseChapterDto.setSchedule(stuTrainingWithBLOBs.getProgress());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// CourseChapterDtoList.add(sysCourseChapterDto);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// newDto.setSysCourseChapterDtos(CourseChapterDtoList);
|
|
|
|
|
|
|
|
// dtoList.add(newDto);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return new ResultEntity<List<SysCourseDto>>(dtoList);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//数据集下载
|
|
|
|
//数据集下载
|
|
|
|
@GetMapping("downloadResourceDataByCaseId")
|
|
|
|
@GetMapping("downloadResourceDataByCaseId")
|
|
|
|
@ApiOperation("数据集下载")
|
|
|
|
@ApiOperation("数据集下载")
|
|
|
@ -149,13 +175,13 @@ public class ExerciseExperimentalTraining {
|
|
|
|
@GetMapping("haveResourceData")
|
|
|
|
@GetMapping("haveResourceData")
|
|
|
|
@ApiOperation("判断案例是否有数据集")
|
|
|
|
@ApiOperation("判断案例是否有数据集")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
public Boolean haveResourceData(@ApiParam("案例题id") @RequestParam String caseId){
|
|
|
|
public Boolean haveResourceData(@ApiParam("案例题id") @RequestParam String caseId) {
|
|
|
|
SysResourceDataExample example = new SysResourceDataExample();
|
|
|
|
SysResourceDataExample example = new SysResourceDataExample();
|
|
|
|
example.createCriteria().andCaseIdEqualTo(caseId);
|
|
|
|
example.createCriteria().andCaseIdEqualTo(caseId);
|
|
|
|
List<SysResourceData> resourceDataList = resourceDataMapper.selectByExample(example);
|
|
|
|
List<SysResourceData> resourceDataList = resourceDataMapper.selectByExample(example);
|
|
|
|
if(resourceDataList!=null){
|
|
|
|
if (resourceDataList != null) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|