Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hxkf
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
hxkf
Commits
026adaf5
提交
026adaf5
authored
12月 29, 2020
作者:
jiashixiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
前台公共资源接口添加查询专家
上级
25a2acef
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
13 行删除
+11
-13
FgExamPaperLibraryServiceImpl.java
...service/questionlibray/FgExamPaperLibraryServiceImpl.java
+11
-13
没有找到文件。
app/resource/src/main/java/com/zrqx/resource/fg/service/questionlibray/FgExamPaperLibraryServiceImpl.java
浏览文件 @
026adaf5
...
...
@@ -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
(
paperL
ibrary
.
getName
());
examRecord
.
setName
(
l
ibrary
.
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
(
paperL
ibrary
.
getId
());
examRecord
.
setName
(
paperL
ibrary
.
getName
());
examRecord
.
setExampaperid
(
l
ibrary
.
getId
());
examRecord
.
setName
(
l
ibrary
.
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论