package com.rongyichuang.player.dto; import com.rongyichuang.player.entity.ActivityPlayer; import java.math.BigDecimal; import java.time.format.DateTimeFormatter; /** * 可晋级参赛者响应类 */ public class PromotableParticipantResponse { private Long id; private String playerName; private String projectName; private String phone; private BigDecimal averageScore; private Integer ratingCount; private String applyTime; private Integer state; private Long playerId; private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); public PromotableParticipantResponse() {} public PromotableParticipantResponse(ActivityPlayer activityPlayer, BigDecimal averageScore, Integer ratingCount) { this.id = activityPlayer.getId(); this.playerName = activityPlayer.getPlayer() != null ? activityPlayer.getPlayer().getName() : ""; this.projectName = activityPlayer.getProjectName(); this.phone = activityPlayer.getPlayer() != null ? activityPlayer.getPlayer().getPhone() : ""; this.averageScore = averageScore; this.ratingCount = ratingCount != null ? ratingCount : 0; this.applyTime = activityPlayer.getCreateTime() != null ? activityPlayer.getCreateTime().format(FORMATTER) : null; this.state = activityPlayer.getState(); this.playerId = activityPlayer.getPlayerId(); } // Getters and Setters public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getPlayerName() { return playerName; } public void setPlayerName(String playerName) { this.playerName = playerName; } public String getProjectName() { return projectName; } public void setProjectName(String projectName) { this.projectName = projectName; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public BigDecimal getAverageScore() { return averageScore; } public void setAverageScore(BigDecimal averageScore) { this.averageScore = averageScore; } public Integer getRatingCount() { return ratingCount; } public void setRatingCount(Integer ratingCount) { this.ratingCount = ratingCount; } public String getApplyTime() { return applyTime; } public void setApplyTime(String applyTime) { this.applyTime = applyTime; } public Integer getState() { return state; } public void setState(Integer state) { this.state = state; } public Long getPlayerId() { return playerId; } public void setPlayerId(Long playerId) { this.playerId = playerId; } }