package cn.estsh.i3plus.pojo.andon.bean;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

/**
 * @Description :工作中心
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_WORK_CENTER")
@Api("工作中心")
public class MesWorkCenter extends BaseBean implements Serializable {

    private static final long serialVersionUID = 1988041859547182829L;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("工作中心代码")
    private String workCenterCode;

    @Column(name = "WORK_CENTER_NAME")
    @ApiParam("工作中心名称")
    private String workCenterName;

    @Column(name = "ERP_WORK_CENTER")
    @ApiParam("ERP工作中心")
    private String erpWorkCenter;

    @Column(name = "WORK_VER")
    @ApiParam("工作版本")
    private String workVer;

    @Column(name = "AREA_CODE")
    @ApiParam("生产区域代码")
    private String areaCode;

    @Transient
    @ApiParam(value ="子集列表")
    @AnnoOutputColumn(hidden = true)
    private List<MesWorkCell> childTreeList;

    @Transient
    @ApiParam(value ="名称")
    @AnnoOutputColumn(hidden = true)
    private String name;

    public String getName(){
        return this.workCenterName;
    }

    public MesWorkCenter(String organizeCode) {
        this.organizeCode = organizeCode;
    }

    public MesWorkCenter() {
    }
}
