/*
*  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.Point;
import com.youchain.modules.system.domain.Dept;
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 2024-11-21
**/
@Entity
@Data
@Table(name="data_count_move_detail_record")
public class CountMoveDetailRecord  extends BaseEntity  implements Serializable {

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

    @OneToOne
    @JoinColumn(name = "`count_move_id`")
    @ApiModelProperty(value = "盘点序号")
    private CountMove countMove;

    @OneToOne
    @JoinColumn(name = "`count_move_detail_id`")
    @ApiModelProperty(value = "盘点明细序号")
    private CountMoveDetail countMoveDetail;

    @OneToOne
    @JoinColumn(name = "`item_key_id`")
    @ApiModelProperty(value = "物料")
    private ItemKey itemKey;

    @OneToOne
    @JoinColumn(name = "`src_point_id`")
    @ApiModelProperty(value = "原库位")
    private Point srcPoint;

    @OneToOne
    @JoinColumn(name = "`count_point_id`")
    @ApiModelProperty(value = "盘点库位")
    private Point countPoint;

    @OneToOne
    @JoinColumn(name = "`dst_point_id`")
    @ApiModelProperty(value = "目标库位")
    private Point dstPoint;

    @Column(name = "`src_stock_code`")
    @ApiModelProperty(value = "箱单号")
    private String srcStockCode;

    @Column(name = "`plan_qty`")
    @ApiModelProperty(value = "")
    private Double planQty;

    @OneToOne
    @JoinColumn(name = "`xpp_id`")
    @ApiModelProperty(value = "现品票序号")
    private XppRecord xpp;

    @Column(name = "`xpp_ewm`")
    @ApiModelProperty(value = "现品票二维码")
    private String xppEwm;

    @Column(name = "`xpp_qty`")
    @ApiModelProperty(value = "现品票数量")
    private Double xppQty;

    @Column(name = "`count_qty`")
    @ApiModelProperty(value = "盘点数量")
    private Double countQty;

    @Column(name = "`status`")
    @ApiModelProperty(value = "盘点状态")
    private String status;

    @Column(name = "`remark`")
    @ApiModelProperty(value = "备注")
    private String remark;

    @OneToOne
    @JoinColumn(name = "`dept_id`")
    @ApiModelProperty(value = "仓库ID")
    private Dept dept;


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