wenminjie
2026-08-06 02c7bf03fa071325c201d29353330152d35ac71a
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
package com.talentcard.server.response;
 
import java.time.LocalDateTime;
 
import com.talentcard.server.entity.DependentCardApply;
import io.swagger.v3.oas.annotations.media.Schema;
 
@Schema(name = "DependentCardApplyAdminResponse", description = "管理后台家属附属卡申请信息")
public record DependentCardApplyAdminResponse(
        Long id,
        String applyNo,
        Long talentId,
        Long talentCardId,
        String talentName,
        String talentMobile,
        String talentCardNo,
        String cardLevel,
        String dependentName,
        String dependentMobile,
        String dependentIdCardNo,
        String relation,
        String proofFiles,
        Integer status,
        String statusText,
        LocalDateTime applyTime,
        Long auditBy,
        LocalDateTime auditTime,
        String auditRemark
) {
    public static DependentCardApplyAdminResponse from(DependentCardApply apply) {
        return new DependentCardApplyAdminResponse(
                apply.getId(), apply.getApplyNo(), apply.getTalentId(), apply.getTalentCardId(),
                apply.getTalentName(), apply.getTalentMobile(), apply.getTalentCardNo(), apply.getCardLevel(),
                apply.getDependentName(), apply.getDependentMobile(), apply.getDependentIdCardNo(), apply.getRelation(),
                apply.getProofFiles(), apply.getStatus(), statusText(apply.getStatus()), apply.getApplyTime(),
                apply.getAuditBy(), apply.getAuditTime(), apply.getAuditRemark()
        );
    }
 
    private static String statusText(Integer status) {
        if (status == null) return "未知";
        return switch (status) {
            case DependentCardApply.STATUS_PENDING_REVIEW -> "待审核";
            case DependentCardApply.STATUS_APPROVED -> "已通过";
            case DependentCardApply.STATUS_REJECTED -> "已驳回";
            case DependentCardApply.STATUS_CANCELLED -> "已解绑";
            default -> "未知";
        };
    }
}