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
package com.ruoyi.business.vo;
 
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
 
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;
 
@Data
public class OfficialInventoryExportVo {
 
    /**
     * 供货商
     */
    @Excel(name = "供货商")
    private String supplierName;
 
    /**
     * 煤种
     */
    @Excel(name = "煤种")
    private String coal;
    /**
     * 单位
     */
    @Excel(name = "单位")
    private String unit;
    /**
     * 库存数量
     */
    @Excel(name = "库存数量")
    private BigDecimal inventoryQuantity;
    /**
     * 单价(含税)
     */
    @Excel(name = "单价(含税)")
    private BigDecimal priceIncludingTax;
    /**
     * 总价(含税)
     */
    @Excel(name = "总价(含税)")
    private BigDecimal totalPriceIncludingTax;
    /**
     * 不含税单价
     */
    @Excel(name = "不含税单价")
    private BigDecimal priceExcludingTax;
    /**
     * 不含税总价
     */
    @Excel(name = "不含税总价")
    private BigDecimal totalPriceExcludingTax;
    /**
     * 待补库
     */
    @Excel(name = "待补库")
    private BigDecimal pendingReplenishment;
    /**
     * 登记人
     */
    @Excel(name = "登记人")
    private String registrant;
 
    /**
     * 登记日期
     */
    @Excel(name = "登记日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate registrationDate;
 
    /**
     * 动态煤质属性(存储所有煤质子表头数据)
     */
    // 动态字段容器(不参与导出)
    private transient Map<String, String> coalQualityProperties;
 
    // 动态字段访问方法
    public String getDynamicProperty(String fieldName) {
        return coalQualityProperties != null ?
                coalQualityProperties.getOrDefault(fieldName, "-") : "-";
    }
 
    // 初始化方法(在convertToExportVo中调用)
    public void initDynamicFields() {
        // 确保map不为null
        if (this.coalQualityProperties == null) {
            this.coalQualityProperties = new HashMap<>();
        }
    }
 
}