提交 026adaf5 authored 作者: jiashixiong's avatar jiashixiong

前台公共资源接口添加查询专家

上级 25a2acef
......@@ -135,34 +135,32 @@ public class FgExamPaperLibraryServiceImpl extends BaseServiceImpl<ExamPaperLibr
form.setResourcid(examRecordForm.getResourcId()); //资源类型id
//录获取该用户的课程下的试卷的练习记录
form = fgExamRecordMapper.getUserPracticeRecord(form);
PageParam pageParam = new PageParam();
FgSelectExamRecordForm form1 = new FgSelectExamRecordForm();
form1.setExampaperid(examRecordForm.getExampaperid());
form1.setResourcId(examRecordForm.getResourcId());
//获取试卷信息[试卷名称,试卷总分,总题数]
PageInfo<ExamPaperLibrary> info = queryByPage(pageParam,form1);
ExamPaperLibrary paperLibrary = info.getList().get(0);
ExamPaperLibrary library = mapper.selectByPrimaryKey(examRecordForm.getExampaperid());
ExamPaperInfo info = new ExamPaperInfo();
info.setExampaperid(examRecordForm.getExampaperid());
List<ExamPaperInfo> list = infoManage.select(info);
//判断练习记录表中有没有该用户下的资源的试卷记录,如果有更新最新的试卷信息及试卷详情信息,否则直接插入
ExamRecord examRecord = new ExamRecord();
List<ExamRecordInfo> result = null;
if (form != null) {
examRecord.setId(form.getId());
examRecord.setExampaperid(form.getExampaperid());
examRecord.setName(paperLibrary.getName());
examRecord.setName(library.getName());
examRecord.setBegintime(sdf.format(new Date()));
examRecord.setSumscore(paperLibrary.getSumscore());
examRecord.setSumscore(list.stream().map(ExamPaperInfo::getScore).reduce(0, Integer::sum));
examRecord.setRealscore(0);
examRecord.setQuestionnum(paperLibrary.getQuestionnum());
examRecord.setQuestionnum(list.size());
fgExamRecordMapper.updateByPrimaryKeySelective(examRecord);
//保存练习记录详情信息
result = saveOrUpdateExamRecordInfo(form);
}
if (form == null) {
examRecord.setExampaperid(paperLibrary.getId());
examRecord.setName(paperLibrary.getName());
examRecord.setExampaperid(library.getId());
examRecord.setName(library.getName());
examRecord.setBegintime(sdf.format(new Date()));
examRecord.setSumscore(paperLibrary.getSumscore());
examRecord.setQuestionnum(paperLibrary.getNum());
examRecord.setSumscore(list.stream().map(ExamPaperInfo::getScore).reduce(0, Integer::sum));
examRecord.setQuestionnum(list.size());
examRecord.setStuId(redis.getMember().getId()+"");
examRecord.setResourcid(examRecordForm.getResourcId());
if (examRecordForm.getResourcId() ==null){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论