/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.youchain.basicdata.domain;

import com.youchain.base.BaseEntity;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;

import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author LY
* @date 2024-04-26
**/
@Entity
@Data
@Table(name="data_design_list")
public class DesignList extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Long id;

    @Column(name = "`no`")
    @ApiModelProperty(value = "No")
    private String no;
    @Column(name = "`chase_center`")
    @ApiModelProperty(value = "変通No.11桁")
    private String chaseCenter;

    @Column(name = "`contraposition`")
    @ApiModelProperty(value = "设变号")
    private String contraposition;

    @Column(name = "`designation`")
    @ApiModelProperty(value = "一括番号")
    private String designation;

    @Column(name = "`hypothesis`")
    @ApiModelProperty(value = "关联设变")
    private String hypothesis;

    @Column(name = "`supplier_code`")
    @ApiModelProperty(value = "供应商代码")
    private String supplierCode;

    @Column(name = "`supplier_name`")
    @ApiModelProperty(value = "供应商名称")
    private String supplierName;

    @Column(name = "`ac`")
    @ApiModelProperty(value = "A/C")
    private String ac;

    @Column(name = "`content`")
    @ApiModelProperty(value = "加工内容")
    private String content;

    @Column(name = "`product_name`")
    @ApiModelProperty(value = "品名(中文)")
    private String productName;

    @Column(name = "`use_singly`")
    @ApiModelProperty(value = "单用")
    private Integer useSingly;

    @Column(name = "`enable`")
    @ApiModelProperty(value = "订货要否")
    private Boolean enable;

    @Column(name = "`naso`")
    @ApiModelProperty(value = "纳所")
    private String naso;

    @Column(name = "`monthly_output`")
    @ApiModelProperty(value = "月产量")
    private String monthlyOutput;

    @Column(name = "`t_type_code`")
    @ApiModelProperty(value = "T型式代码")
    private String tTypeCode;

    @Column(name = "`t_type_name`")
    @ApiModelProperty(value = "T型式名")
    private String tTypeName;

    @Column(name = "`scrap_disposal`")
    @ApiModelProperty(value = "旧品处理")
    private String scrapDisposal;

    @Column(name = "`implementation_date`")
    @ApiModelProperty(value = "系统实施日")
    private String implementationDate;

    @OneToOne
    @JoinColumn(name = "`big_item_id`")
    @ApiModelProperty(value = "完成品品番")
    private BigItem bigItem;

    @OneToOne
    @JoinColumn(name = "`new_item_id`")
    @ApiModelProperty(value = "新品番")
    private Item nitem;

    @OneToOne
    @JoinColumn(name = "`old_item_id`")
    @ApiModelProperty(value = "旧品番")
    private Item oitem;
    @Column(name = "`old_item_code`")
    @ApiModelProperty(value = "旧品番")
    private String oldItemCode;
    @Column(name = "`new_item_code`")
    @ApiModelProperty(value = "新品番")
    private String newItemCode;
    @Column(name = "`big_item_code`")
    @ApiModelProperty(value = "完成品番")
    private String bigItemCode;





    public void copy(DesignList source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
