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

fix: roundDetail中增加remainingTime

上级 89e9a03b
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<groupId>com.pica.cloud.online.exam</groupId> <groupId>com.pica.cloud.online.exam</groupId>
<artifactId>pica-cloud-analysis-common</artifactId> <artifactId>pica-cloud-analysis-common</artifactId>
<name>pica-cloud-analysis-common</name> <name>pica-cloud-analysis-common</name>
<version>1.0.7</version> <version>1.0.8</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
......
...@@ -11,6 +11,8 @@ public class RoundExamTitleV2Dto { ...@@ -11,6 +11,8 @@ public class RoundExamTitleV2Dto {
private Integer roundId; private Integer roundId;
private String remainingTime;
private String startTime; private String startTime;
private String endTime; private String endTime;
...@@ -54,6 +56,14 @@ public class RoundExamTitleV2Dto { ...@@ -54,6 +56,14 @@ public class RoundExamTitleV2Dto {
this.roundId = roundId; this.roundId = roundId;
} }
public String getRemainingTime() {
return remainingTime;
}
public void setRemainingTime(String remainingTime) {
this.remainingTime = remainingTime;
}
public String getStartTime() { public String getStartTime() {
return startTime; return startTime;
} }
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
<dependency> <dependency>
<groupId>com.pica.cloud.online.exam</groupId> <groupId>com.pica.cloud.online.exam</groupId>
<artifactId>pica-cloud-analysis-common</artifactId> <artifactId>pica-cloud-analysis-common</artifactId>
<version>1.0.7</version> <version>1.0.8</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
......
...@@ -603,21 +603,24 @@ public class AnalysisController { ...@@ -603,21 +603,24 @@ public class AnalysisController {
/** /**
* 转换格式 * 转换格式
*/ */
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat outFormat = new SimpleDateFormat("yyyy-M-d");
roundExamTitleV2Dto.setAnalysisId(roundExamTitleDto.getAnalysisId()); roundExamTitleV2Dto.setAnalysisId(roundExamTitleDto.getAnalysisId());
roundExamTitleV2Dto.setRoundId(roundExamTitleDto.getRoundId()); roundExamTitleV2Dto.setRoundId(roundExamTitleDto.getRoundId());
roundExamTitleV2Dto.setStartTime(roundExamTitleDto.getStartTime()); roundExamTitleV2Dto.setStartTime(outFormat.format(sdf.parse(roundExamTitleDto.getStartTime())));
roundExamTitleV2Dto.setEndTime(roundExamTitleDto.getEndTime()); roundExamTitleV2Dto.setEndTime(outFormat.format(sdf.parse(roundExamTitleDto.getEndTime())));
roundExamTitleV2Dto.setTotalCount(roundExamTitleDto.getTotalCount()); roundExamTitleV2Dto.setTotalCount(roundExamTitleDto.getTotalCount());
roundExamTitleV2Dto.setPublished(roundExamTitleDto.getPublished()); roundExamTitleV2Dto.setPublished(roundExamTitleDto.getPublished());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if ((new Date()).getTime() > sdf.parse(roundExamTitleDto.getEndTime()).getTime()) { if ((new Date()).getTime() > sdf.parse(roundExamTitleDto.getEndTime()).getTime()) {
roundExamTitleV2Dto.setRemainingTime("");
roundExamTitleV2Dto.setIsFinished(1); roundExamTitleV2Dto.setIsFinished(1);
roundExamTitleV2Dto.setElectedStarCount(analysisService.getElectedStarCountByRoundId(roundId)); roundExamTitleV2Dto.setElectedStarCount(analysisService.getElectedStarCountByRoundId(roundId));
Integer doctorId = analysisService.getElectedDoctorIdByRoundId(roundId); Integer doctorId = analysisService.getElectedDoctorIdByRoundId(roundId);
roundExamTitleV2Dto.setElectedDoctor(doctorService.getDoctorDtoById(doctorId)); roundExamTitleV2Dto.setElectedDoctor(doctorService.getDoctorDtoById(doctorId));
} else { } else {
roundExamTitleV2Dto.setRemainingTime(DateUtils.remainingTime(sdf.parse(roundExamTitleDto.getEndTime())));
roundExamTitleV2Dto.setIsFinished(0); roundExamTitleV2Dto.setIsFinished(0);
roundExamTitleV2Dto.setElectedDoctor(new DoctorDto()); roundExamTitleV2Dto.setElectedDoctor(new DoctorDto());
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册