/*
*  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.businessdata.domain;

import com.youchain.basicdata.domain.Item;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import com.youchain.base.BaseEntity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author houjianlan
* @date 2026-02-11
**/
@Entity
@Data
@Table(name="data_xpp_plan")
public class XppPlan  extends BaseEntity implements Serializable {

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

    @OneToOne
    @JoinColumn(name = "`item_id`")
    @ApiModelProperty(value = "品番")
    private Item item;

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

    @Column(name = "`nrs`")
    @ApiModelProperty(value = "纳入数")
    private Integer nrs;

    @Column(name = "`ddbh`")
    @ApiModelProperty(value = "定单编号")
    private String ddbh;

    @Column(name = "`zf`")
    @ApiModelProperty(value = "受入受領ＮＯ")
    private String zf;

    @Column(name = "`fzh`")
    @ApiModelProperty(value = "分支号")
    private String fzh;

    @Column(name = "`nr_date`")
    @ApiModelProperty(value = "更新日期")
    private Timestamp nrDate;

    @Column(name = "`cj_date`")
    @ApiModelProperty(value = "创建日期")
    private Timestamp cjDate;

    @Column(name = "`sh_quantity`")
    @ApiModelProperty(value = "送货数量")
    private String shQuantity;

    @Column(name = "`cjr`")
    @ApiModelProperty(value = "采集人")
    private String cjr;

    @Column(name = "`bhr`")
    @ApiModelProperty(value = "备货人")
    private String bhr;

    @Column(name = "`fhr`")
    @ApiModelProperty(value = "发货人")
    private String fhr;

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

    @Column(name = "`rela_supplier`")
    @ApiModelProperty(value = "供应商")
    private String relaSupplier;

    @Column(name = "`rela_door`")
    @ApiModelProperty(value = "门号")
    private String relaDoor;

    @Column(name = "`rela_code`")
    @ApiModelProperty(value = "纳入场所")
    private String relaCode;

    @Column(name = "`rela_type`")
    @ApiModelProperty(value = "箱种")
    private String relaType;

    @Column(name = "`rela_quantity`")
    @ApiModelProperty(value = "收容数")
    private Double relaQuantity;

    @Column(name = "`area_code`")
    @ApiModelProperty(value = "品区")
    private String areaCode;

    @Column(name = "`item_code`")
    @ApiModelProperty(value = "品番")
    private String itemCode;

    @Column(name = "`dept_id`")
    @ApiModelProperty(value = "仓库ID")
    private Long deptId;

    @Column(name = "`description`")
    @ApiModelProperty(value = "描述")
    private String description;

    @Column(name = "`ewm`",unique = true)
    @ApiModelProperty(value = "现品票二维码")
    private String ewm;

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