package com.sw.mes.agv.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name="mobile_charge")
public class MobileCharge {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
	/**
	 * 物料包编码
	 */
    @Column(length=255)
    private String chargeCode;

    /**
     * 出库单号（炉次号）
     */
    @Column
    private String storeCode;

    /**
     * 炉台号
     */
    @Column
    private String deviceNo;

    /**
     * 当前重量
     */
    @Column(length=22)
    private Double currentCount;
    
	/**
	 * 载具编号
	 */
    @Column(length=80)
    private String slingCode;
    
	/**
	 * 预装料开始时间
	 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(length=19)
	@Temporal(TemporalType.TIMESTAMP)
    private Date preChargeTime;


    /**
     * 装料结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(length=19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date chargeFinishTime;
    
	/**
	 * 预装料人员
	 */
    @Column(length=40)
    private String preChargeUser;
    
	/**
	 * 预装料人员ID
	 */
    @Column(length=19)
    private Long userId;
    
	/**
	 * 物料搭配方案
	 */
    @Column(length=80)
    private String techName;
    
	/**
	 * 物料搭配方案ID
	 */
    @Column(length=19)
    private Long techId;

    /**
     * 班组
     */
    @Column(length = 100)
    private String className;

    /**
     * 班次
     */
    @Column(length = 100)
    private String classNo;
    
	/**
	 * 备注
	 */
    @Column(length=2147483647)
    private String remark;

    @OneToMany(mappedBy = "charge", cascade = CascadeType.ALL)
    @OrderBy("id ASC")
    private List<MobileChargeItem> list = new ArrayList<>();
    
    /**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}
	
	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}
	
	/**
	 * @param chargeCode the chargeCode to set
	 */
    public void setChargeCode(String chargeCode){
       this.chargeCode = chargeCode;
    }
    
    /**
     * @return the chargeCode 
     */
    public String getChargeCode(){
       return this.chargeCode;
    }
	
	/**
	 * @param slingCode the slingCode to set
	 */
    public void setSlingCode(String slingCode){
       this.slingCode = slingCode;
    }
    
    /**
     * @return the slingCode 
     */
    public String getSlingCode(){
       return this.slingCode;
    }
	
	/**
	 * @param preChargeTime the preChargeTime to set
	 */
    public void setPreChargeTime(Date preChargeTime){
       this.preChargeTime = preChargeTime;
    }
    
    /**
     * @return the preChargeTime 
     */
    public Date getPreChargeTime(){
       return this.preChargeTime;
    }
	
	/**
	 * @param preChargeUser the preChargeUser to set
	 */
    public void setPreChargeUser(String preChargeUser){
       this.preChargeUser = preChargeUser;
    }
    
    /**
     * @return the preChargeUser 
     */
    public String getPreChargeUser(){
       return this.preChargeUser;
    }
	
	/**
	 * @param userId the userId to set
	 */
    public void setUserId(Long userId){
       this.userId = userId;
    }
    
    /**
     * @return the userId 
     */
    public Long getUserId(){
       return this.userId;
    }
	
	/**
	 * @param techName the techName to set
	 */
    public void setTechName(String techName){
       this.techName = techName;
    }
    
    /**
     * @return the techName 
     */
    public String getTechName(){
       return this.techName;
    }
	
	/**
	 * @param techId the techId to set
	 */
    public void setTechId(Long techId){
       this.techId = techId;
    }
    
    /**
     * @return the techId 
     */
    public Long getTechId(){
       return this.techId;
    }
	
	/**
	 * @param remark the remark to set
	 */
    public void setRemark(String remark){
       this.remark = remark;
    }
    
    /**
     * @return the remark 
     */
    public String getRemark(){
       return this.remark;
    }

    public List<MobileChargeItem> getList() {
        return list;
    }

    public void setList(List<MobileChargeItem> list) {
        this.list = list;
    }

    public String getStoreCode() {
        return storeCode;
    }

    public void setStoreCode(String storeCode) {
        this.storeCode = storeCode;
    }

    public Double getCurrentCount() {
        return currentCount;
    }

    public void setCurrentCount(Double currentCount) {
        this.currentCount = currentCount;
    }
    public Date getChargeFinishTime() {
        return chargeFinishTime;
    }

    public void setChargeFinishTime(Date chargeFinishTime) {
        this.chargeFinishTime = chargeFinishTime;
    }
    public String getDeviceNo() {
        return deviceNo;
    }

    public void setDeviceNo(String deviceNo) {
        this.deviceNo = deviceNo;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getClassNo() {
        return classNo;
    }

    public void setClassNo(String classNo) {
        this.classNo = classNo;
    }
}
