lrj
1 天以前 93eb6b470773bc49ea6e1a9d4cbd914eb95d525b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package com.rongyichuang.player.dto;
 
import com.rongyichuang.player.entity.ActivityPlayer;
 
import java.math.BigDecimal;
import java.time.format.DateTimeFormatter;
 
/**
 * 比赛参赛者响应类
 */
public class CompetitionParticipantResponse {
    
    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 static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    
    public CompetitionParticipantResponse() {}
    
    public CompetitionParticipantResponse(ActivityPlayer activityPlayer) {
        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 = activityPlayer.getTotalScore();
        this.ratingCount = 0; // 需要从评分表中统计
        this.applyTime = activityPlayer.getCreateTime() != null ? 
            activityPlayer.getCreateTime().format(FORMATTER) : null;
        this.state = activityPlayer.getState();
    }
    
    public CompetitionParticipantResponse(ActivityPlayer activityPlayer, Integer ratingCount) {
        this(activityPlayer);
        this.ratingCount = ratingCount != null ? ratingCount : 0;
    }
    
    // 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;
    }
}