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

fix: 修改活动id

上级 5fcf9893
......@@ -59,7 +59,13 @@ public class AnalysisController {
@Autowired
private CHCRankingListService rankingListService;
@ApiOperation(value = "获取活动详情", response = PicaResponse.class)
/**
* TODO: chc错题解析活动和psa的活动id 需要前端传入
*/
static final Integer CHC_ANALYSIS_ID = 1;
static final Integer PSA_ANALYSIS_ID = 2;
@ApiOperation(value = "获取活动详情", response = PicaResponse.class)
@RequestMapping(value = "/activityDetail", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public PicaResponse<CHCAnalysisDto> getActivityDetail(@RequestParam(required = false) Integer id,
@RequestHeader(required = false) String token) {
......@@ -68,7 +74,7 @@ public class AnalysisController {
/**
* 如果不传活动id进来,活动id就用1
*/
id = (id == null ? 1 : id);
id = (id == null ? CHC_ANALYSIS_ID : id);
try {
CHCAnalysisDto analysisDto = analysisService.getCHCAnalysisDtoById(id);
......@@ -111,7 +117,7 @@ public class AnalysisController {
/**
* 如果不传活动id进来,活动id就用1
*/
id = (id == null ? 2 : id);
id = (id == null ? PSA_ANALYSIS_ID : id);
try {
CHCAnalysisDto analysisDto = analysisService.getPSAAnalysisDtoById(id);
......@@ -170,7 +176,7 @@ public class AnalysisController {
/**
* TODO: 如果是PSA 删除时间显示
*/
if (analysisRoundExamTitle.getAnalysisId().intValue() == 2 ) {
if (analysisRoundExamTitle.getAnalysisId().intValue() == PSA_ANALYSIS_ID ) {
for (ReplyDto replyDto : replyDtoList) {
replyDto.setReplayTime("");
}
......@@ -591,7 +597,7 @@ public class AnalysisController {
*/
roundExamTitleV2Dto.setRoundList(new ArrayList<>());
} else {
List<AnalysisRoundDto> roundDtoList = analysisService.getCHCHistoryRound();
List<AnalysisRoundDto> roundDtoList = analysisService.getCHCHistoryRound(CHC_ANALYSIS_ID);
/**
* 获取list中第一个的roundId
......@@ -664,7 +670,7 @@ public class AnalysisController {
myStarDto.setDoctor(doctorService.getDoctorDtoById(user.getId()));
myStarDto.setRoundList(new ArrayList<>());
if (roundId == null) {
List<AnalysisRoundDto> roundDtoList = analysisService.getCHCHistoryRound();
List<AnalysisRoundDto> roundDtoList = analysisService.getCHCHistoryRound(CHC_ANALYSIS_ID);
roundId = roundDtoList.get(0).getRoundId();
myStarDto.setRoundList(roundDtoList);
}
......
......@@ -168,9 +168,10 @@ public interface CHCAnalysisService {
/**
* 获取所有的历史轮详情
* @param ananlysisId
* @return
*/
List<AnalysisRoundDto> getCHCHistoryRound();
List<AnalysisRoundDto> getCHCHistoryRound(Integer analysisId);
/**
* 获取某一轮的最多得票数
......
......@@ -519,13 +519,13 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
}
@Override
public List<AnalysisRoundDto> getCHCHistoryRound() {
public List<AnalysisRoundDto> getCHCHistoryRound(Integer analysisId) {
List<AnalysisRound> roundList = new ArrayList<>();
/**
* TODO: 需要前端传入id
*/
roundList = analysisRoundMapper.selectHistoryRoundListById(1);
roundList = analysisRoundMapper.selectHistoryRoundListById(analysisId);
List<AnalysisRoundDto> roundDtoList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册