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

fix: 修改活动id

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