/*
*  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 cn.ysk.cashier.cons.domain;

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 java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;

/**
* @author admin
* @date 2024-07-17
**/
@Entity
@Data
@Table(name="view_con_info_flow")
public class ViewConInfoFlow implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`cons_id`")
    @ApiModelProperty(value = "耗材id")
    private Integer consId;

    @Column(name = "`con_name`")
    @ApiModelProperty(value = "耗材名称")
    private String conName;


    @Column(name = "`shop_id`")
    @ApiModelProperty(value = "店铺id")
    private Integer shopId;

    @Column(name = "`con_return`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "con_return")
    private BigDecimal conReturn;

    @Column(name = "`con_in`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "con_in")
    private BigDecimal conIn;

    @Column(name = "`con_consume`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "con_consume")
    private BigDecimal conConsume;

    @Column(name = "`con_out`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "con_out")
    private BigDecimal conOut;

    @Column(name = "`balance`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "balance")
    private BigDecimal balance;


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



    @Column(name = "`product_id`")
    @ApiModelProperty(value = "商品id")
    private String productId;


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

    @Column(name = "`con_code`")
    @ApiModelProperty(value = "耗材代码")
    private String conCode;

    @Column(name = "`con_type_code`")
    @ApiModelProperty(value = "耗材类型代码")
    private String conTypeCode;

    @Column(name = "`con_type_name`")
    @ApiModelProperty(value = "耗材类型名称")
    private String conTypeName;

    @Column(name = "`con_unit`")
    @ApiModelProperty(value = "耗材单位")
    private String conUnit;

    @Column(name = "`con_warning`")
    @ApiModelProperty(value = "预警值")
    private String conWarning;

    @Column(name = "`con_type_id`")
    @ApiModelProperty(value = "耗材类型名称")
    private Integer conTypeId;



    @Column(name = "`is_check`")
    @ApiModelProperty(value = "是否检测库存")
    private String isCheck;

    @Column(name = "`create_time`")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @Column(name = "price")
    @ApiModelProperty(value = "单价")
    private BigDecimal price;



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