PurchaseMaterial.java 4.2 KB
package com.skua.modules.erp.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import com.skua.core.util.ConvertUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

/**
 * 采购物料清单
 */
@Data
@TableName("erp_purchase_material")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_purchase_material对象", description="采购物料清单")
public class PurchaseMaterial {

	/**主键*/
	@TableId(type = IdType.UUID)
	@ApiModelProperty(value = "主键")
	private String id;
	@ApiModelProperty(value = "所属机构")
	@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
	private String departId;
	/**采购计划编号*/
	@Excel(name = "采购合同编号", width = 15)
	@ApiModelProperty(value = "采购合同编号")
	private String contractId;
	/**物料类别编号*/
	@Excel(name = "物料类别编号", width = 15)
	@ApiModelProperty(value = "物料类别编号")
	private String sparepartType;
	/**物料编号*/
	@Excel(name = "物料编号", width = 15)
	@ApiModelProperty(value = "物料编号")
	private String sparepartId;
	@ApiModelProperty(value = "物料编码")
	private String sparepartCode;
	@ApiModelProperty(value = "物料名称")
	private String sparepartName;
	/**物料编号*/
	@Excel(name = "货号", width = 15)
	@ApiModelProperty(value = "货号")
	private String goodCode;

	/**规格型号*/
	@Excel(name = "规格型号", width = 15)
	@ApiModelProperty(value = "规格型号")
	private String specification;
	/**计量单位*/
	@Excel(name = "计量单位", width = 15)
	@ApiModelProperty(value = "计量单位")
	private String measuringUnit;
	/**计划采购数量*/
	@Excel(name = "计划采购数量", width = 15)
	@ApiModelProperty(value = "计划采购数量")
	private String purchaseNum;
	/**单价*/
	@Excel(name = "单价", width = 15)
	@ApiModelProperty(value = "单价")
	private String unitPrice;

	@Excel(name = "总价", width = 15)
	@ApiModelProperty(value = "总价")
	private String totalPrice;
	/**备注*/
	@Excel(name = "备注", width = 15)
	@ApiModelProperty(value = "备注")
	private String remark;


	/**供应商编号*/
	@Excel(name = "供应商编号", width = 15)
	@ApiModelProperty(value = "供应商编号")
	@Dict(dictTable = "ajh_supplier_manage", dicCode="id", dicText = "supp_name")
	private String supplierId;
	/**税额*/
	@Excel(name = "税额", width = 15)
	@ApiModelProperty(value = "税额")
	private String taxAmount;
	/**价税合计*/
	@Excel(name = "价税合计", width = 15)
	@ApiModelProperty(value = "价税合计")
	private String totalPriceTax;

	@TableField(exist=false)
	@ApiModelProperty(value = "物料类别名称")
	private String sparepartTypeName;

	@TableField(exist=false)
	@ApiModelProperty(value = "供应商名称")
	private String supplierName;

	@TableField(exist=false)
	@ApiModelProperty(value = "厂站名称")
	private String departName;

	@TableField(exist=false)
	@ApiModelProperty(value = "扩展:采购物料数量")
	private String materialNum;
	/**单价*/
	@Excel(name = "分销单价", width = 15)
	@ApiModelProperty(value = "扩展:分销单价")
	private String distributPrice;
	/**总价*/
	@Excel(name = "分销总价", width = 15)
	@ApiModelProperty(value = "扩展:分销总价")
	private String distributTotalPrice;

	@TableField(exist=false)
	@ApiModelProperty(value = "扩展:货号物料入库数量")
	private String storeNum;

	@TableField(exist=false)
	@ApiModelProperty(value = "扩展:剩余数量")
	private Double remainNum;

	@TableField(exist=false)
	@ApiModelProperty(value = "采购合同编号")
	private String purchaseContractId;

	public String getPurchaseContractId() {
		return this.getContractId();
	}

	public Double getRemainNum() {
		remainNum = ConvertUtils.getDouble(this.getPurchaseNum() ,0d) - ConvertUtils.getDouble(this.getStoreNum() ,0d);// JSUtils.divide(this.getPurchaseNum()   ,this.getStoreNum());
		return remainNum;
	}
}