gaoluyang
昨天 90b3ad820eea45d021835197eac5bc3ad55b12ed
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
package cn.iocoder.yudao.module.finance.controller.admin.voucher.vo;
 
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.finance.enums.DictTypeConstants;
import cn.iocoder.yudao.module.system.api.storage.dto.StorageBlobRespDTO;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
 
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
 
@Schema(description = "管理后台 - 记账凭证 Response VO")
@Data
@ExcelIgnoreUnannotated
public class FinVoucherRespVO {
 
    @Schema(description = "凭证编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("凭证编号")
    private Long id;
 
    @Schema(description = "凭证字号", requiredMode = Schema.RequiredMode.REQUIRED, example = "记-0001")
    @ExcelProperty("凭证字号")
    private String voucherNo;
 
    @Schema(description = "凭证日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("凭证日期")
    private LocalDate voucherDate;
 
    @Schema(description = "摘要", example = "销售收入")
    @ExcelProperty("摘要")
    private String summary;
 
    @Schema(description = "借方合计", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000.00")
    @ExcelProperty("借方合计")
    private BigDecimal debit;
 
    @Schema(description = "贷方合计", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000.00")
    @ExcelProperty("贷方合计")
    private BigDecimal credit;
 
    @Schema(description = "凭证状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
    // 注意:@DictFormat 只负责「从字段上取字典类型」,真正做翻译的是 DictConvert,
    // 必须在这里显式挂上 converter,否则导出的是 0/10/20 这样的原始码
    @ExcelProperty(value = "凭证状态", converter = DictConvert.class)
    @DictFormat(DictTypeConstants.VOUCHER_STATUS)
    private Integer status;
 
    @Schema(description = "制单人(用户编号)", example = "1")
    private String creator;
 
    /**
     * 制单人昵称,专供列表与 Excel 导出。
     * BaseDO.creator 存的是用户 ID,直接展示就是一串数字,所以另用这个字段承载昵称;
     * creator 本身仍保留在 JSON 里(前端搜索条件、权限判断靠它)。
     */
    @Schema(description = "制单人昵称", example = "管理员")
    @ExcelProperty("制单人")
    private String creatorName;
 
    @Schema(description = "附件张数", example = "0")
    @ExcelProperty("附件张数")
    private Integer attachmentCount;
 
    @Schema(description = "备注", example = "备注")
    @ExcelProperty("备注")
    private String remark;
 
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    // 「yyyy-MM-dd HH:mm:ss」正好 19 个字符,自适应列宽就只给 19,贴着边很难看,这里放宽到 22
    @ColumnWidth(22)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;
 
    @Schema(description = "凭证分录", example = "[]")
    private List<FinVoucherEntryRespVO> entries;
 
    @Schema(description = "附件列表", example = "[]")
    private List<StorageBlobRespDTO> attachmentList;
 
    @Schema(description = "是否存在附件", example = "true")
    private Boolean hasAttachment;
 
}