package com.ssj.bean.sys.fx.domain;

import com.ssj.bean.common.framework.core.domain.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@Table(name="tb_materiel")
public class Materiel extends BaseEntity {
    private Integer materielFlow; //物料入库流水编号
    private String materielName; //物料名称
    private String materieCode; //物料编码
    private Integer userdCount; //剩余数量
    private Integer inCount; //入库数量
    private String supplier; //供应商
    private String supplierCode; //供应商编码
    private Date  createTime; //创建时间(入库时间)
    private BigDecimal price; //单价
    private BigDecimal totalSum; //总金额
    private Integer state; //状态 1正常 2删除
    private String createUser; //创建者/入库者
    private String delUser; //修改人/删除者

    private Integer leafCount; //已经用掉数量

    private BigDecimal leafPrice; //剩余物料的评价单价

    private String remark; //备注

    public String getMaterielName() {
        return materielName;
    }

    public void setMaterielName(String materielName) {
        this.materielName = materielName;
    }

    public String getMaterieCode() {
        return materieCode;
    }

    public void setMaterieCode(String materieCode) {
        this.materieCode = materieCode;
    }

    public Integer getUserdCount() {
        return userdCount;
    }

    public void setUserdCount(Integer userdCount) {
        this.userdCount = userdCount;
    }

    public Integer getInCount() {
        return inCount;
    }

    public void setInCount(Integer inCount) {
        this.inCount = inCount;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    public String getSupplierCode() {
        return supplierCode;
    }

    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getTotalSum() {
        return totalSum;
    }

    public void setTotalSum(BigDecimal totalSum) {
        this.totalSum = totalSum;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getDelUser() {
        return delUser;
    }

    public void setDelUser(String delUser) {
        this.delUser = delUser;
    }

    @Transient
    public Integer getLeafCount() {
        return inCount-userdCount;
    }

    public void setLeafCount(Integer leafCount) {
        this.leafCount = leafCount;
    }

    public Integer getMaterielFlow() {
        return materielFlow;
    }

    public void setMaterielFlow(Integer materielFlow) {
        this.materielFlow = materielFlow;
    }

    public BigDecimal getLeafPrice() {
        return leafPrice;
    }

    public void setLeafPrice(BigDecimal leafPrice) {
        this.leafPrice = leafPrice;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
