提交 a3dbaddf 编写于 作者: minghao.wu's avatar minghao.wu

fix: 轮状态设置

上级 73a99bbd
......@@ -130,8 +130,15 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
roundDto.setStartTime(sdf.format(round.getStartTime()));
roundDto.setEndTime(sdf.format(round.getEndTime()));
roundDto.setSeqNo(round.getSeqNo());
roundDto.setPublished(round.getIsPublished() ? 1 : 0);
/**
* 如果时间过期 设置超时
*/
if ((new Date()).getTime() > round.getEndTime().getTime()) {
roundDto.setPublished(2);
} else {
roundDto.setPublished(round.getIsPublished() ? 1 : 0);
}
roundDtoList.add(roundDto);
}
......@@ -155,8 +162,15 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
roundExamTitleDto.setStartTime(sdf.format(round.getStartTime()));
roundExamTitleDto.setEndTime(sdf.format(round.getEndTime()));
roundExamTitleDto.setTotalCount(analysisRoundExamTitleMapper.selectExamTitleCountByRoundId(roundId));
roundExamTitleDto.setPublished(round.getIsPublished() ? 1: 0);
/**
* 如果时间过期 设置超时
*/
if ((new Date()).getTime() > round.getEndTime().getTime()) {
roundExamTitleDto.setPublished(2);
} else {
roundExamTitleDto.setPublished(round.getIsPublished() ? 1 : 0);
}
return roundExamTitleDto;
}
......@@ -515,8 +529,6 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
List<AnalysisRoundDto> roundDtoList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date dt = new Date();
for (AnalysisRound round : roundList) {
AnalysisRoundDto roundDto = new AnalysisRoundDto();
......@@ -531,7 +543,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
/**
* 如果时间过期 设置超时
*/
if (dt.getTime() > round.getEndTime().getTime()) {
if ((new Date()).getTime() > round.getEndTime().getTime()) {
roundDto.setPublished(2);
} else {
roundDto.setPublished(round.getIsPublished() ? 1 : 0);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册