| | |
| | | private RatingSchemeResponse ratingScheme; |
| | | private List<ActivityResponse> stages; |
| | | private ActivityResponse parent; |
| | | private List<ActivityJudgeResponse> judges; // 评委列表 |
| | | |
| | | // 统计数据 |
| | | private Integer playerCount = 0; // 报名人数(实际人数) |
| | |
| | | // 设置状态名称 |
| | | this.stateName = getStateNameByValue(activity.getState()); |
| | | |
| | | // 设置关联数据(仅浅映射评分模板,避免任何层级的活动递归) |
| | | if (activity.getRatingScheme() != null) { |
| | | this.ratingScheme = new RatingSchemeResponse(activity.getRatingScheme()); |
| | | } |
| | | // 明确不在DTO构造中填充stages和parent,避免递归与懒加载环路 |
| | | // 避免访问懒加载的关联关系,防止在没有活跃Hibernate会话时出现异常 |
| | | // 如果需要ratingScheme信息,应该在Service层单独处理 |
| | | this.ratingScheme = null; |
| | | this.stages = null; |
| | | this.parent = null; |
| | | } |
| | |
| | | this.stateName = stateName; |
| | | } |
| | | |
| | | public List<ActivityJudgeResponse> getJudges() { |
| | | return judges; |
| | | } |
| | | |
| | | public void setJudges(List<ActivityJudgeResponse> judges) { |
| | | this.judges = judges; |
| | | } |
| | | |
| | | // 业务方法 |
| | | public boolean isCompetition() { |
| | | public boolean isMainActivity() { |
| | | return pid == 0; |
| | | } |
| | | |