easyexcel注解表改名、头合合并、改变排序、忽略字段
2025/8/5...大约 1 分钟
easyexcel注解表改名、头合合并、改变排序
实现效果:
直接使用 easyexcel 注解即可实现:
public class InOutStockVo {
@ExcelIgnore
private Long warehouseId;
@ExcelProperty(index = 0, value = "仓库")
private String warehouseName;
@ExcelProperty(index = 1, value = "品牌")
private String brandName;
@ExcelProperty(index = 2, value = "物料分类")
private String productTypeName;
@ExcelProperty(index = 3, value = "物料编码")
private String productCode;
@ExcelProperty(index = 4, value = "物料名称")
private String productName;
@ExcelProperty(index = 5, value = "物料规格")
private String specsValue;
@ExcelProperty(index = 6, value = "批次")
private String batchNumber;
@ExcelProperty(index = 7, value = "单位")
private String unit;
@ExcelProperty(index = 8, value = {"期初库存", "库存数量"})
private BigDecimal beginStockAmount;
@ExcelProperty(index = 9, value = {"期初库存", "单价"})
private BigDecimal beginPrice;
@ExcelProperty(index = 10, value = {"期初库存", "总计金额"})
private BigDecimal beginTotalPrice;
@ExcelProperty(index = 11, value = {"入库", "入库数量"})
private BigDecimal entryTotalAmount;
@ExcelProperty(index = 12, value = {"入库", "入库金额"})
private BigDecimal entryTotalPrice;
@ExcelProperty(index = 13, value = {"出库", "出库数量"})
private BigDecimal outTotalAmount;
@ExcelProperty(index = 14, value = {"出库", "出库金额"})
private BigDecimal outTotalPrice;
@ExcelProperty(index = 15, value = {"期末库存", "库存数量"})
private BigDecimal endStockAmount;
@ExcelProperty(index = 16, value = {"期末库存", "单价"})
private BigDecimal endPrice;
@ExcelProperty(index = 17, value = {"期末库存", "总计金额"})
private BigDecimal endTotalPrice;
}