提交 01190d99 authored 作者: jiashixiong's avatar jiashixiong

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

上级 b5aed4e7
......@@ -5,6 +5,7 @@ import com.zrqx.resource.commons.form.fg.questionlibrary.FgSelectExamRecordForm;
import com.zrqx.resource.commons.model.questionlibrary.ExamRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.ietf.jgss.Oid;
import java.util.List;
......@@ -53,4 +54,13 @@ public interface FgExamRecordMapper extends BaseMapper<ExamRecord> {
+ " from (select * from res_examrecord where stuId = #{stuId} ORDER BY createTime DESC) des GROUP BY exampaperid"
+ " </script>")
List<ExamRecord> getSelectExamRecord(String stuId);
@Select("<script>"
+ " select *"
+ " from res_examrecord"
+ " where 1=1"
+ " eq(stuId,oid)"
+ " eq(exampaperid,exampaperid)"
+ " </script>")
ExamRecord selectInfo(@Param("oid") Integer oid,@Param("exampaperid") Integer exampaperid);
}
......@@ -79,6 +79,7 @@ public class FgExamPaperLibraryServiceImpl extends BaseServiceImpl<ExamPaperLibr
private OrganClient organClient;
@Autowired
private FgExamPaperLibrarDiyTypeMapper fgExamPaperLibrarDiyTypeMapper;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Override
......@@ -364,6 +365,17 @@ public class FgExamPaperLibraryServiceImpl extends BaseServiceImpl<ExamPaperLibr
}
}
List<ExamRecordInfo> examRecordInfo = saveOrUpdateExamRecord(examRecordForm);
ExamRecord record = new ExamRecord();
record.setStuId(redis.getMember().getId()+"");
record.setExampaperid(form.getExampaperid());
ExamRecord info = fgExamRecordMapper.selectInfo(redis.getMember().getId(), form.getExampaperid());
info.setSumscore(examRecordInfo.stream().map(ExamRecordInfo::getScore).reduce(0,Integer::sum));
info.setRealscore(0);
info.setQuestionnum(examRecordInfo.size());
info.setRightnum(0);
info.setPrecisionpercent(null);
info.setErrornum(0);
fgExamRecordMapper.updateByPrimaryKeySelective(info);
return examRecordInfo.stream().sorted(Comparator.comparing(ExamRecordInfo::getQuestionType)).collect(toList());
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论