package com.shzg.project.worn.domain;

import java.math.BigDecimal;

import com.shzg.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.shzg.framework.aspectj.lang.annotation.Excel;

/**
 * 物料对象 worn_material
 *
 * @author shzg
 * @date 2026-03-11
 */
public class WornMaterial extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;
    private Long materialId;
    /** 物料名称 */
    @Excel(name = "物料名称")
    private String materialName;

    /** 物料简称 */
    @Excel(name = "物料简称")
    private String materialShortName;

    /** 物料编码 */
    @Excel(name = "物料编码")
    private String materialCode;

    /** 物料类型ID */
    @Excel(name = "物料类型ID")
    private Long typeId;

    /** 物料单位ID */
    @Excel(name = "物料单位ID")
    private Long unitId;

    /** 物料类别 */
    @Excel(name = "物料类别")
    private String materialCategory;

    /** 公斤转换系数 */
    @Excel(name = "公斤转换系数")
    private BigDecimal kgFactor;

    /** 规格 */
    @Excel(name = "规格")
    private String specification;

    /** 型号 */
    @Excel(name = "型号")
    private String model;

    /** 条形码 */
    @Excel(name = "条形码")
    private String barcode;

    /** 单件重量(kg) */
    @Excel(name = "单件重量(kg)")
    private BigDecimal weight;

    /** 描述 */
    @Excel(name = "描述")
    private String description;

    /** 排序 */
    @Excel(name = "排序")
    private Long orderNum;

    /** 状态（0正常 1停用） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 逻辑删除（0正常 1删除） */
    @Excel(name = "逻辑删除", readConverterExp = "0=正常,1=删除")
    private String isDelete;

    // ================== 🔥 新增 keyword（模糊搜索） ==================
    /** 关键字（用于模糊查询，不落库） */
    private String keyword;


    // ================== 查询展示字段（不落库） ==================

    /** 单位名称 */
    private String unitName;

    /** 当前类型名称 */
    private String typeName;

    /** 类型祖级ID */
    private String typeAncestors;

    /** 父级类型名称 */
    private String typeParentNames;
    /** 单位名称 */
    private BigDecimal quantity;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public Long getMaterialId() {
        return materialId;
    }

    public void setMaterialId(Long materialId) {
        this.materialId = materialId;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public String getMaterialShortName() {
        return materialShortName;
    }

    public void setMaterialShortName(String materialShortName) {
        this.materialShortName = materialShortName;
    }

    public String getMaterialCode() {
        return materialCode;
    }

    public void setMaterialCode(String materialCode) {
        this.materialCode = materialCode;
    }

    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public Long getUnitId() {
        return unitId;
    }

    public void setUnitId(Long unitId) {
        this.unitId = unitId;
    }

    public String getMaterialCategory() {
        return materialCategory;
    }

    public void setMaterialCategory(String materialCategory) {
        this.materialCategory = materialCategory;
    }

    public BigDecimal getKgFactor() {
        return kgFactor;
    }

    public void setKgFactor(BigDecimal kgFactor) {
        this.kgFactor = kgFactor;
    }

    public String getSpecification() {
        return specification;
    }

    public void setSpecification(String specification) {
        this.specification = specification;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getBarcode() {
        return barcode;
    }

    public void setBarcode(String barcode) {
        this.barcode = barcode;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Long orderNum) {
        this.orderNum = orderNum;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getTypeAncestors() {
        return typeAncestors;
    }

    public void setTypeAncestors(String typeAncestors) {
        this.typeAncestors = typeAncestors;
    }

    public String getTypeParentNames() {
        return typeParentNames;
    }

    public void setTypeParentNames(String typeParentNames) {
        this.typeParentNames = typeParentNames;
    }

    public BigDecimal getQuantity() { return quantity; }
    public void setQuantity(BigDecimal quantity) { this.quantity = quantity; }
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("materialName", getMaterialName())
                .append("materialShortName", getMaterialShortName())
                .append("materialCode", getMaterialCode())
                .append("typeId", getTypeId())
                .append("unitId", getUnitId())
                .append("materialCategory", getMaterialCategory())
                .append("kgFactor", getKgFactor())
                .append("specification", getSpecification())
                .append("model", getModel())
                .append("barcode", getBarcode())
                .append("weight", getWeight())
                .append("description", getDescription())
                .append("orderNum", getOrderNum())
                .append("status", getStatus())
                .append("isDelete", getIsDelete())
                .append("keyword", getKeyword())
                .append("unitName", getUnitName())
                .append("typeName", getTypeName())
                .append("typeAncestors", getTypeAncestors())
                .append("typeParentNames", getTypeParentNames())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}