Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-analysis
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.online.exam
pica-cloud-analysis
提交
1a9e474e
提交
1a9e474e
编写于
1月 07, 2019
作者:
minghao.wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: replyList接口优化
上级
a7c0d6cd
流水线
#3587
已通过 于阶段
in 10 second
变更
1
流水线
4
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
22 行增加
和
19 行删除
+22
-19
CHCAnalysisServiceImpl.java
.../analysis/server/service/impl/CHCAnalysisServiceImpl.java
+22
-19
未找到文件。
server/src/main/java/com/pica/cloud/online/exam/analysis/server/service/impl/CHCAnalysisServiceImpl.java
浏览文件 @
1a9e474e
...
@@ -187,8 +187,11 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -187,8 +187,11 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
ExamTitleReplyDto
examTitleReplyDto
=
new
ExamTitleReplyDto
();
ExamTitleReplyDto
examTitleReplyDto
=
new
ExamTitleReplyDto
();
ExamTitleDto
examTitleDto
=
getExamTitleDtoById
(
examTitleId
);
ExamTitleDto
examTitleDto
=
getExamTitleDtoById
(
examTitleId
);
List
<
ReplyDto
>
replyDtoList
=
getReplyListDtoByExamTitleId
(
examTitleId
,
user
!=
null
?
user
.
getId
()
:
0
);
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
examTitleReplyDto
.
setPublished
(
analysisRound
.
getIsPublished
()
?
1
:
0
);
List
<
ReplyDto
>
replyDtoList
=
getReplyListDtoByExamTitleId
(
analysisRound
,
examTitleId
,
user
!=
null
?
user
.
getId
()
:
0
);
/**
/**
* 如果是PSA 删除回复的时间显示
* 如果是PSA 删除回复的时间显示
*/
*/
...
@@ -202,8 +205,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -202,8 +205,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
examTitleReplyDto
.
setReplyList
(
replyDtoList
);
examTitleReplyDto
.
setReplyList
(
replyDtoList
);
examTitleReplyDto
.
setType
(
analysis
.
getType
().
intValue
());
examTitleReplyDto
.
setType
(
analysis
.
getType
().
intValue
());
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
examTitleReplyDto
.
setPublished
(
analysisRound
.
getIsPublished
()
?
1
:
0
);
/**
/**
* 设置回复状态
* 设置回复状态
*/
*/
...
@@ -223,7 +224,11 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -223,7 +224,11 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
ExamTitleReplyDto
examTitleReplyDto
=
new
ExamTitleReplyDto
();
ExamTitleReplyDto
examTitleReplyDto
=
new
ExamTitleReplyDto
();
ExamTitleDto
examTitleDto
=
getExamTitleDtoById
(
examTitleId
);
ExamTitleDto
examTitleDto
=
getExamTitleDtoById
(
examTitleId
);
List
<
ReplyDto
>
replyDtoList
=
getReplyListDtoByExamTitleId
(
examTitleId
,
user
!=
null
?
user
.
getId
()
:
0
);
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
examTitleReplyDto
.
setPublished
(
analysisRound
.
getIsPublished
()
?
1
:
0
);
List
<
ReplyDto
>
replyDtoList
=
getReplyListDtoByExamTitleId
(
analysisRound
,
examTitleId
,
user
!=
null
?
user
.
getId
()
:
0
);
/**
/**
* 分页 pageNo: 1,2,...
* 分页 pageNo: 1,2,...
...
@@ -251,8 +256,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -251,8 +256,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
examTitleReplyDto
.
setReplyList
(
replyDtoList
);
examTitleReplyDto
.
setReplyList
(
replyDtoList
);
examTitleReplyDto
.
setType
(
analysis
.
getType
().
intValue
());
examTitleReplyDto
.
setType
(
analysis
.
getType
().
intValue
());
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
examTitleReplyDto
.
setPublished
(
analysisRound
.
getIsPublished
()
?
1
:
0
);
/**
/**
* 设置回复状态
* 设置回复状态
*/
*/
...
@@ -281,8 +284,11 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -281,8 +284,11 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
Reply
reply
=
replyMapper
.
selectByPrimaryKey
(
replyId
);
Reply
reply
=
replyMapper
.
selectByPrimaryKey
(
replyId
);
AnalysisRoundExamTitle
analysisRoundExamTitle
=
analysisRoundExamTitleMapper
.
selectByPrimaryKey
(
reply
.
getAnalysisRoundExamTitleId
());
AnalysisRoundExamTitle
analysisRoundExamTitle
=
analysisRoundExamTitleMapper
.
selectByPrimaryKey
(
reply
.
getAnalysisRoundExamTitleId
());
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
examTitleReplyDetailDto
.
setPublished
(
analysisRound
.
getIsPublished
()
?
1
:
0
);
ExamTitleDto
examTitleDto
=
getExamTitleDtoById
(
reply
.
getAnalysisRoundExamTitleId
());
ExamTitleDto
examTitleDto
=
getExamTitleDtoById
(
reply
.
getAnalysisRoundExamTitleId
());
ReplyDto
replyDto
=
getReplyDtoByReply
(
reply
,
user
!=
null
?
user
.
getId
()
:
0
);
ReplyDto
replyDto
=
getReplyDtoByReply
(
analysisRound
,
reply
,
user
!=
null
?
user
.
getId
()
:
0
);
CHCAnalysis
analysis
=
analysisMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getAnalysisId
());
CHCAnalysis
analysis
=
analysisMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getAnalysisId
());
...
@@ -292,8 +298,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -292,8 +298,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
examTitleReplyDetailDto
.
setReply
(
replyDto
);
examTitleReplyDetailDto
.
setReply
(
replyDto
);
examTitleReplyDetailDto
.
setType
(
analysis
.
getType
().
intValue
());
examTitleReplyDetailDto
.
setType
(
analysis
.
getType
().
intValue
());
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
examTitleReplyDetailDto
.
setPublished
(
analysisRound
.
getIsPublished
()
?
1
:
0
);
/**
/**
* 设置回复状态
* 设置回复状态
*/
*/
...
@@ -320,9 +324,12 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -320,9 +324,12 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
AnalysisRoundExamTitle
analysisRoundExamTitle
=
analysisRoundExamTitleMapper
.
selectByPrimaryKey
(
examTitleId
);
AnalysisRoundExamTitle
analysisRoundExamTitle
=
analysisRoundExamTitleMapper
.
selectByPrimaryKey
(
examTitleId
);
ExamTitleDto
examTitleDto
=
getExamTitleDtoById
(
examTitleId
);
ExamTitleDto
examTitleDto
=
getExamTitleDtoById
(
examTitleId
);
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
examTitleReplyDetailDto
.
setPublished
(
analysisRound
.
getIsPublished
()
?
1
:
0
);
ReplyDto
replyDto
=
new
ReplyDto
();
ReplyDto
replyDto
=
new
ReplyDto
();
if
(
null
!=
reply
)
{
if
(
null
!=
reply
)
{
replyDto
=
getReplyDtoByReply
(
reply
,
user
!=
null
?
user
.
getId
()
:
0
);
replyDto
=
getReplyDtoByReply
(
analysisRound
,
reply
,
user
!=
null
?
user
.
getId
()
:
0
);
}
else
{
}
else
{
replyDto
.
setContent
(
""
);
replyDto
.
setContent
(
""
);
}
}
...
@@ -331,8 +338,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -331,8 +338,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
examTitleReplyDetailDto
.
setExamTitle
(
examTitleDto
);
examTitleReplyDetailDto
.
setExamTitle
(
examTitleDto
);
examTitleReplyDetailDto
.
setReply
(
replyDto
);
examTitleReplyDetailDto
.
setReply
(
replyDto
);
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
examTitleReplyDetailDto
.
setPublished
(
analysisRound
.
getIsPublished
()
?
1
:
0
);
CHCAnalysis
analysis
=
analysisMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getAnalysisId
());
CHCAnalysis
analysis
=
analysisMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getAnalysisId
());
examTitleReplyDetailDto
.
setType
(
analysis
.
getType
().
intValue
());
examTitleReplyDetailDto
.
setType
(
analysis
.
getType
().
intValue
());
...
@@ -650,7 +655,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -650,7 +655,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
return
examTitleDto
;
return
examTitleDto
;
}
}
private
List
<
ReplyDto
>
getReplyListDtoByExamTitleId
(
Integer
analysisRoundExamTitleId
,
Integer
userId
)
{
private
List
<
ReplyDto
>
getReplyListDtoByExamTitleId
(
AnalysisRound
round
,
Integer
analysisRoundExamTitleId
,
Integer
userId
)
{
List
<
Reply
>
replyList
=
getReplyList
(
analysisRoundExamTitleId
);
List
<
Reply
>
replyList
=
getReplyList
(
analysisRoundExamTitleId
);
List
<
ReplyDto
>
replyDtoList
=
new
ArrayList
<>();
List
<
ReplyDto
>
replyDtoList
=
new
ArrayList
<>();
...
@@ -660,7 +665,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -660,7 +665,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
/**
/**
* 发现有评论用户不在p_doctor的情况,数据不同步造成的
* 发现有评论用户不在p_doctor的情况,数据不同步造成的
*/
*/
replyDtoList
.
add
(
getReplyDtoByReply
(
reply
,
userId
));
replyDtoList
.
add
(
getReplyDtoByReply
(
r
ound
,
r
eply
,
userId
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// logger.error("getReplyListDtoByExamTitleId", e);
// logger.error("getReplyListDtoByExamTitleId", e);
}
}
...
@@ -693,7 +698,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -693,7 +698,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
return
replyList
.
get
(
idx
);
return
replyList
.
get
(
idx
);
}
}
private
ReplyDto
getReplyDtoByReply
(
Reply
reply
,
Integer
userId
)
{
private
ReplyDto
getReplyDtoByReply
(
AnalysisRound
round
,
Reply
reply
,
Integer
userId
)
{
ReplyDto
replyDto
=
new
ReplyDto
();
ReplyDto
replyDto
=
new
ReplyDto
();
Doctor
doctor
=
doctorMapper
.
selectByPrimaryKey
(
reply
.
getUserId
());
Doctor
doctor
=
doctorMapper
.
selectByPrimaryKey
(
reply
.
getUserId
());
...
@@ -710,10 +715,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -710,10 +715,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
replyDto
.
setReplayTime
(
DateUtils
.
fromNow
(
reply
.
getModifiedTime
()));
replyDto
.
setReplayTime
(
DateUtils
.
fromNow
(
reply
.
getModifiedTime
()));
replyDto
.
setStarCount
(
starRecordMapper
.
selectStarCountByReplyId
(
reply
.
getId
()));
replyDto
.
setStarCount
(
starRecordMapper
.
selectStarCountByReplyId
(
reply
.
getId
()));
AnalysisRoundExamTitle
analysisRoundExamTitle
=
analysisRoundExamTitleMapper
.
selectByPrimaryKey
(
reply
.
getAnalysisRoundExamTitleId
());
if
((
new
Date
()).
getTime
()
>
round
.
getEndTime
().
getTime
())
{
AnalysisRound
analysisRound
=
analysisRoundMapper
.
selectByPrimaryKey
(
analysisRoundExamTitle
.
getRoundId
());
if
((
new
Date
()).
getTime
()
>
analysisRound
.
getEndTime
().
getTime
())
{
replyDto
.
setStatus
(
2
);
replyDto
.
setStatus
(
2
);
}
else
{
}
else
{
StarRecord
starRecord
=
new
StarRecord
();
StarRecord
starRecord
=
new
StarRecord
();
...
@@ -853,6 +855,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -853,6 +855,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
* case 1. 按照时间排序,如果个数小于5,直接返回
* case 1. 按照时间排序,如果个数小于5,直接返回
*/
*/
List
<
Reply
>
replyList
=
replyMapper
.
selectReplyListOrderByTime
(
examTitleId
);
List
<
Reply
>
replyList
=
replyMapper
.
selectReplyListOrderByTime
(
examTitleId
);
if
(
replyCount
<
5
)
{
if
(
replyCount
<
5
)
{
return
replyList
;
return
replyList
;
}
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录