package com.zbf.system.domain;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zbf.common.annotation.Excel;
import com.zbf.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.poi.ss.usermodel.IndexedColors;

import java.lang.reflect.Field;
import java.util.List;

/**
 * 库位 对象 t_base_storage_area_location
 *
 * @author tony
 * @date 2024-06-14
 */
@TableName(resultMap = "com.zbf.system.mapper.TBaseStorageAreaLocationMapper.TBaseStorageAreaLocationResult")
public class TBaseStorageAreaLocation extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 库位编号
     */
    @Excel(name = "库位编号", required = true, headerColor = IndexedColors.RED)
    private String locationId;

    /**
     * 助记码
     */
    @Excel(name = "助记码")
    private String pyName;

    /**
     * 仓库编号
     */
    @Excel(name = "仓库编号", required = true, headerColor = IndexedColors.RED)
    private String storageId;

    /**
     * 是否有锁
     */
    @Excel(name = "禁用状态",dictType = "common_status",type = Excel.Type.EXPORT)
    private String isLock;

    /**
     * 长
     */

    private Long locationLong;

    /**
     * 宽
     */

    private Long locationWidth;

    /**
     * 高
     */

    private Long locationHeight;

    /**
     * 容量
     */

    private Long volume;

    /**
     * 已占用容积
     */

    private Long hasVolume;

    /**
     * 承载重量
     */

    private Long bearWeight;

    /**
     * ABC分类
     */

    private String abcId;

    /**
     * 状态
     */
    @Excel(name = "占用状态" ,dictType = "location_type",type = Excel.Type.EXPORT)
    private String status;

    /**
     * 排序
     */

    private Long sort;

    /**
     * 版本
     */

    private String version;

    /**
     * 堆垛机编号
     */

    private String decid;

    /**
     * 入库站台
     */

    private String instand;

    /**
     * 出库站台
     */

    private String outstand;

    /**
     * 入库输送线
     */
    private String inLine;

    /**
     * 出库输送线
     */
    private String outLine;

    /**
     * 行
     */
    private String line;

    /**
     * 列
     */
    private String cln;

    /**
     * 层级
     */
    private String layer;

    /**
     * 深度
     */
    private String depth;

    /**
     * 入库站台
     */
    private String instand1;

    /**
     * 入库站台
     */
    private String instand2;

    /**
     * 出库站台
     */
    private String outstand1;

    /**
     * 入库站台
     */
    private String instand3;

    /**
     * 出库站台
     */
    private String outstand2;

    /**
     * 出库站台
     */
    private String outstand3;

    /**
     * 虚拟库位
     */
    private String fictitious;
    /**
     * 选中的数据
     */
    private String[] selectIds;

    private List<Long> ids;

    public List<Long> getIds() {
        return ids;
    }

    public void setIds(List<Long> ids) {
        this.ids = ids;
    }

    public static JSONArray getColumnsJson() {
        JSONArray columns = new JSONArray();
        Field[] fields = TBaseStorageAreaLocation.class.getDeclaredFields();
        int key = 0;
        for (Field field : fields) {
            Excel excelAnnotation = field.getAnnotation(Excel.class);
            if (excelAnnotation != null) {
                JSONObject column = new JSONObject();
                column.put("seq", key++);
                column.put("key", field.getName());
                column.put("label", excelAnnotation.name());
                column.put("visible", true);  // 假设所有列默认都是可见的
                column.put("columnName", field.getName());  // 设置列ID
                columns.put(column);
            }
        }
        return columns;
    }

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

    public Long getId() {
        return id;
    }

    public void setLocationId(String locationId) {
        this.locationId = locationId;
    }

    public String getLocationId() {
        return locationId;
    }

    public void setPyName(String pyName) {
        this.pyName = pyName;
    }

    public String getPyName() {
        return pyName;
    }

    public void setStorageId(String storageId) {
        this.storageId = storageId;
    }

    public String getStorageId() {
        return storageId;
    }

    public void setIsLock(String isLock) {
        this.isLock = isLock;
    }

    public String getIsLock() {
        return isLock;
    }

    public void setLocationLong(Long locationLong) {
        this.locationLong = locationLong;
    }

    public Long getLocationLong() {
        return locationLong;
    }

    public void setLocationWidth(Long locationWidth) {
        this.locationWidth = locationWidth;
    }

    public Long getLocationWidth() {
        return locationWidth;
    }

    public void setLocationHeight(Long locationHeight) {
        this.locationHeight = locationHeight;
    }

    public Long getLocationHeight() {
        return locationHeight;
    }

    public void setVolume(Long volume) {
        this.volume = volume;
    }

    public Long getVolume() {
        return volume;
    }

    public void setHasVolume(Long hasVolume) {
        this.hasVolume = hasVolume;
    }

    public Long getHasVolume() {
        return hasVolume;
    }

    public void setBearWeight(Long bearWeight) {
        this.bearWeight = bearWeight;
    }

    public Long getBearWeight() {
        return bearWeight;
    }

    public void setAbcId(String abcId) {
        this.abcId = abcId;
    }

    public String getAbcId() {
        return abcId;
    }

    public void setSort(Long sort) {
        this.sort = sort;
    }

    public Long getSort() {
        return sort;
    }

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

    public String getStatus() {
        return status;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getVersion() {
        return version;
    }

    public void setDecid(String decid) {
        this.decid = decid;
    }

    public String getDecid() {
        return decid;
    }

    public void setInstand(String instand) {
        this.instand = instand;
    }

    public String getInstand() {
        return instand;
    }

    public void setOutstand(String outstand) {
        this.outstand = outstand;
    }

    public String getOutstand() {
        return outstand;
    }

    public void setInLine(String inLine) {
        this.inLine = inLine;
    }

    public String getInLine() {
        return inLine;
    }

    public void setOutLine(String outLine) {
        this.outLine = outLine;
    }

    public String getOutLine() {
        return outLine;
    }

    public void setLine(String line) {
        this.line = line;
    }

    public String getLine() {
        return line;
    }

    public void setCln(String cln) {
        this.cln = cln;
    }

    public String getCln() {
        return cln;
    }

    public void setLayer(String layer) {
        this.layer = layer;
    }

    public String getLayer() {
        return layer;
    }

    public void setDepth(String depth) {
        this.depth = depth;
    }

    public String getDepth() {
        return depth;
    }

    public void setInstand1(String instand1) {
        this.instand1 = instand1;
    }

    public String getInstand1() {
        return instand1;
    }

    public void setInstand2(String instand2) {
        this.instand2 = instand2;
    }

    public String getInstand2() {
        return instand2;
    }

    public void setOutstand1(String outstand1) {
        this.outstand1 = outstand1;
    }

    public String getOutstand1() {
        return outstand1;
    }

    public void setInstand3(String instand3) {
        this.instand3 = instand3;
    }

    public String getInstand3() {
        return instand3;
    }

    public void setOutstand2(String outstand2) {
        this.outstand2 = outstand2;
    }

    public String getOutstand2() {
        return outstand2;
    }

    public void setOutstand3(String outstand3) {
        this.outstand3 = outstand3;
    }

    public String getOutstand3() {
        return outstand3;
    }

    public String getFictitious() {
        return fictitious;
    }

    public void setFictitious(String fictitious) {
        this.fictitious = fictitious;
    }

    public String[] getSelectIds() {
        return selectIds;
    }

    public void setSelectIds(String[] selectIds) {
        this.selectIds = selectIds;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("locationId", getLocationId())
                .append("pyName", getPyName())
                .append("storageId", getStorageId())
                .append("isLock", getIsLock())
                .append("locationLong", getLocationLong())
                .append("locationWidth", getLocationWidth())
                .append("locationHeight", getLocationHeight())
                .append("volume", getVolume())
                .append("hasVolume", getHasVolume())
                .append("bearWeight", getBearWeight())
                .append("abcId", getAbcId())
                .append("sort", getSort())
                .append("status", getStatus())
                .append("remark", getRemark())
                .append("version", getVersion())
                .append("decid", getDecid())
                .append("instand", getInstand())
                .append("outstand", getOutstand())
                .append("inLine", getInLine())
                .append("outLine", getOutLine())
                .append("line", getLine())
                .append("cln", getCln())
                .append("layer", getLayer())
                .append("depth", getDepth())
                .append("instand1", getInstand1())
                .append("instand2", getInstand2())
                .append("outstand1", getOutstand1())
                .append("instand3", getInstand3())
                .append("outstand2", getOutstand2())
                .append("outstand3", getOutstand3())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .toString();
    }
}
