package com.wms.entity.table;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.List;

/**
 * 电子标签库位对应工单工位盒子
 */
@Data
@TableName(value = "tbl_app_e_location_config", autoResultMap = true)
public class ELocationConfig {
    /**
     * 电子标签库位
     */
    @TableId("e_location_id")
    private String eLocationId;
    /**
     * 工站
     */
    @TableField("work_station")
    private String workStation;
    /**
     * 工单
     */
    @TableField("work_order")
    private String workOrder;
    /**
     * 工位
     */
    @TableField("work_center")
    private String workCenter;
    /**
     * 盒子号
     */
    @TableField("order_box_no")
    private String orderBoxNo;
    /**
     * 是否打印
     */
    @TableField("print_status")
    private Integer printStatus = 0;
    /**
     * 打印次数
     */
    @TableField("print_counts")
    private Integer printCounts = 0;

    /**
     * 转换为ELocationConfigLast
     * @return 转换后的ELocationConfigLast
     */
    public ELocationConfigLast toLocationConfigLast() {
        ELocationConfigLast newELocationConfigLast = new ELocationConfigLast();
        newELocationConfigLast.setELocationId(this.eLocationId);
        newELocationConfigLast.setOrderBoxNo(this.orderBoxNo);
        newELocationConfigLast.setWorkCenter(this.workCenter);
        newELocationConfigLast.setWorkOrder(this.workOrder);
        newELocationConfigLast.setWorkStation(this.workStation);

        return newELocationConfigLast;
    }

    /**
     * 转换为ELocationConfigLast列表
     * @param eLocationConfigs 原来配置列表
     * @return 转换后的列表
     */
    public static List<ELocationConfigLast> toLocationsConfigLastList(List<ELocationConfig> eLocationConfigs) {
        return BeanUtil.copyToList(eLocationConfigs, ELocationConfigLast.class);
    }
}
