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
提交
94177732
提交
94177732
编写于
9月 04, 2018
作者:
minghao.wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature: replyStatus新增回复状态2,如果轮时间过期则不允许点赞
上级
fbeb2445
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
56 行增加
和
24 行删除
+56
-24
AnalysisController.java
...e/exam/analysis/server/controller/AnalysisController.java
+41
-22
CHCAnalysisService.java
...line/exam/analysis/server/service/CHCAnalysisService.java
+9
-1
CHCAnalysisServiceImpl.java
.../analysis/server/service/impl/CHCAnalysisServiceImpl.java
+6
-1
未找到文件。
server/src/main/java/com/pica/cloud/online/exam/analysis/server/controller/AnalysisController.java
浏览文件 @
94177732
...
...
@@ -24,6 +24,7 @@ import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -118,7 +119,7 @@ public class AnalysisController {
PicaResponse
.
Builder
<
RoundExamTitleDto
>
builder
=
new
PicaResponse
.
Builder
<>();
try
{
RoundExamTitleDto
roundExamTitleDto
=
analysisService
.
getRoundById
(
roundId
);
RoundExamTitleDto
roundExamTitleDto
=
analysisService
.
getRound
ExamTitleDto
ById
(
roundId
);
List
<
ExamTitleDto
>
examTitleDtoList
=
analysisService
.
getExamTitleListByRoundId
(
roundId
);
roundExamTitleDto
.
setExamTitleList
(
examTitleDtoList
);
...
...
@@ -164,16 +165,20 @@ public class AnalysisController {
examTitleReplyDto
.
setExamTitle
(
examTitleDto
);
examTitleReplyDto
.
setReplyList
(
replyDtoList
);
AnalysisRound
analysisRound
=
analysisService
.
getRoundInfoById
(
analysisRoundExamTitle
.
getRoundId
());
/**
* 设置回复状态
*/
examTitleReplyDto
.
setReplyStatus
(
0
);
if
((
new
Date
()).
getTime
()
>
analysisRound
.
getEndTime
().
getTime
())
{
examTitleReplyDto
.
setReplyStatus
(
2
);
}
else
{
examTitleReplyDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
examTitleReplyDto
.
setReplyStatus
(
getReplyStatus
(
analysisRoundExamTitle
.
getAnalysisId
(),
examTitleId
,
user
.
getId
()));
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
examTitleReplyDto
.
setReplyStatus
(
getReplyStatus
(
analysisRoundExamTitle
.
getAnalysisId
(),
examTitleId
,
user
.
getId
()));
}
}
/**
* 设置类型
*/
...
...
@@ -215,16 +220,22 @@ public class AnalysisController {
examTitleReplyDetailDto
.
setExamTitle
(
examTitleDto
);
examTitleReplyDetailDto
.
setReply
(
replyDto
);
AnalysisRound
analysisRound
=
analysisService
.
getRoundInfoById
(
analysisRoundExamTitle
.
getRoundId
());
/**
* 设置回复状态
*/
examTitleReplyDetailDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
examTitleReplyDetailDto
.
setReplyStatus
(
getReplyStatus
(
analysisRoundExamTitle
.
getAnalysisId
(),
reply
.
getAnalysisRoundExamTitleId
(),
user
.
getId
()));
if
((
new
Date
()).
getTime
()
>
analysisRound
.
getEndTime
().
getTime
())
{
examTitleReplyDetailDto
.
setReplyStatus
(
2
);
}
{
examTitleReplyDetailDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
examTitleReplyDetailDto
.
setReplyStatus
(
getReplyStatus
(
analysisRoundExamTitle
.
getAnalysisId
(),
reply
.
getAnalysisRoundExamTitleId
(),
user
.
getId
()));
}
}
/**
* 设置类型
*/
...
...
@@ -371,15 +382,19 @@ public class AnalysisController {
examTitleReplyDto
.
setExamTitle
(
examTitleDto
);
examTitleReplyDto
.
setReplyList
(
replyDtoList
);
AnalysisRound
analysisRound
=
analysisService
.
getRoundInfoById
(
analysisRoundExamTitle
.
getRoundId
());
/**
* 设置回复状态
*/
examTitleReplyDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
examTitleReplyDto
.
setReplyStatus
(
getReplyStatus
(
analysisRoundExamTitle
.
getAnalysisId
(),
examTitleId
,
user
.
getId
()));
if
((
new
Date
()).
getTime
()
>
analysisRound
.
getEndTime
().
getTime
())
{
examTitleReplyDto
.
setReplyStatus
(
2
);
}
else
{
examTitleReplyDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
examTitleReplyDto
.
setReplyStatus
(
getReplyStatus
(
analysisRoundExamTitle
.
getAnalysisId
(),
examTitleId
,
user
.
getId
()));
}
}
/**
* 设置类型
*/
...
...
@@ -422,16 +437,20 @@ public class AnalysisController {
examTitleReplyDetailDto
.
setExamTitle
(
examTitleDto
);
examTitleReplyDetailDto
.
setReply
(
replyDto
);
AnalysisRound
analysisRound
=
analysisService
.
getRoundInfoById
(
analysisRoundExamTitle
.
getRoundId
());
/**
* 设置回复状态
*/
examTitleReplyDetailDto
.
setReplyStatus
(
0
);
if
((
new
Date
()).
getTime
()
>
analysisRound
.
getEndTime
().
getTime
())
{
examTitleReplyDetailDto
.
setReplyStatus
(
2
);
}
else
{
examTitleReplyDetailDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
examTitleReplyDetailDto
.
setReplyStatus
(
getReplyStatus
(
analysisRoundExamTitle
.
getAnalysisId
(),
reply
.
getAnalysisRoundExamTitleId
(),
user
.
getId
()));
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
examTitleReplyDetailDto
.
setReplyStatus
(
getReplyStatus
(
analysisRoundExamTitle
.
getAnalysisId
(),
reply
.
getAnalysisRoundExamTitleId
(),
user
.
getId
()));
}
}
/**
* 设置类型
*/
...
...
@@ -558,7 +577,7 @@ public class AnalysisController {
roundExamTitleV2Dto
.
setRoundList
(
roundDtoList
);
}
RoundExamTitleDto
roundExamTitleDto
=
analysisService
.
getRoundById
(
roundId
);
RoundExamTitleDto
roundExamTitleDto
=
analysisService
.
getRound
ExamTitleDto
ById
(
roundId
);
/**
* 转换格式
...
...
server/src/main/java/com/pica/cloud/online/exam/analysis/server/service/CHCAnalysisService.java
浏览文件 @
94177732
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
service
;
import
com.pica.cloud.online.exam.analysis.common.dto.*
;
import
com.pica.cloud.online.exam.analysis.server.entity.AnalysisRound
;
import
com.pica.cloud.online.exam.analysis.server.entity.AnalysisRoundExamTitle
;
import
com.pica.cloud.online.exam.analysis.server.entity.CHCAnalysis
;
import
com.pica.cloud.online.exam.analysis.server.entity.Reply
;
...
...
@@ -45,7 +46,14 @@ public interface CHCAnalysisService {
* @param roundId
* @return
*/
RoundExamTitleDto
getRoundById
(
Integer
roundId
);
RoundExamTitleDto
getRoundExamTitleDtoById
(
Integer
roundId
);
/**
* 根据轮的id获取信息
* @param roundId
* @return
*/
AnalysisRound
getRoundInfoById
(
Integer
roundId
);
/**
* 根据轮的id获取题目信息
...
...
server/src/main/java/com/pica/cloud/online/exam/analysis/server/service/impl/CHCAnalysisServiceImpl.java
浏览文件 @
94177732
...
...
@@ -138,7 +138,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
}
@Override
public
RoundExamTitleDto
getRoundById
(
Integer
roundId
)
{
public
RoundExamTitleDto
getRound
ExamTitleDto
ById
(
Integer
roundId
)
{
AnalysisRound
round
=
analysisRoundMapper
.
selectByPrimaryKey
(
roundId
);
if
(
null
==
round
)
{
...
...
@@ -159,6 +159,11 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
return
roundExamTitleDto
;
}
@Override
public
AnalysisRound
getRoundInfoById
(
Integer
roundId
)
{
return
analysisRoundMapper
.
selectByPrimaryKey
(
roundId
);
}
@Override
public
List
<
ExamTitleDto
>
getExamTitleListByRoundId
(
Integer
roundId
)
{
List
<
AnalysisRoundExamTitle
>
roundExamTitleList
=
analysisRoundExamTitleMapper
.
selectExamTitleListByRoundId
(
roundId
);
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录