MaterialIN.java 9.2 KB
package com.skua.modules.erp.entity;

import java.io.Serializable;
import java.util.Date;
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.tool.util.JSUtils;
import io.netty.util.internal.StringUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;

/**
 * 物料(药剂)入库
 */
@Data
@TableName("erp_material_in")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="erp_material_in对象", description="物料(药剂)入库")
public class MaterialIN {

	/**id*/
	@TableId(type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "id")
	private String id;
	/**所属机构*/
	@Excel(name = "所属机构", width = 15)
    @ApiModelProperty(value = "所属机构")
	@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
	private String departId;
	/**项目名称*/
	@Excel(name = "项目名称", width = 15)
    @ApiModelProperty(value = "项目名称")
	private String projectName;
	/**入库单号*/
    @ApiModelProperty(value = "入库单号")
	private String inOrder;
	/**采购合同*/
	@Excel(name = "采购合同", width = 15,dictTable = "erp_purchase_contract", dicCode="id", dicText = "contract_code")
	@Dict(dictTable = "erp_purchase_contract", dicCode="id", dicText = "contract_code")
	private String purchaseContractId;
	/**分销合同*/
	@Excel(name = "分销合同", width = 15,dictTable = "erp_distribut_contract", dicCode="id", dicText = "contract_code")
	@Dict(dictTable = "erp_distribut_contract", dicCode="id", dicText = "contract_code")
	private String distributContractId;
	/**到货时间*/
	@Excel(name = "到货时间", width = 15)
    @ApiModelProperty(value = "到货时间")
	private String arriveTime;
	/**收货人*/
	@Excel(name = "收货人", width = 15,dictTable = "sys_user", dicCode="id", dicText = "realname")
    @ApiModelProperty(value = "收货人")
	@Dict(dictTable = "sys_user", dicCode="id", dicText = "realname")
	private String receiver;

	@Excel(name = "物料类别", width = 15,dictTable = "equipment_sparepart_type", dicCode="id", dicText = "item_text")
	@ApiModelProperty(value = "物料类别")
	@Dict(dictTable = "equipment_sparepart_type", dicCode="id", dicText = "item_text")
	private String sparepartType;
	/**物料编号*/
	@Excel(name = "物料编号", width = 15,dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name")
    @ApiModelProperty(value = "物料编号")
	@Dict(dictTable = "equipment_sparepart_supplies", dicCode="id", dicText = "sparepart_name")
	private String sparepartId;
	/**药剂(物料)名称*/
	@Excel(name = "药剂(物料)名称", width = 15)
    @ApiModelProperty(value = "药剂(物料)名称")
	private String sparepartName;

	@ApiModelProperty(value = "物料编码")
	private String sparepartCode;
	/**规格型号*/
	@Excel(name = "规格型号", width = 15)
    @ApiModelProperty(value = "规格型号")
	private String specification;
	/**计量单位*/
	@Excel(name = "计量单位", width = 15)
    @ApiModelProperty(value = "计量单位")
	private String measuringUnit;

	@Excel(name = "入库仓库", width = 15,dictTable = "supplies_warehouse", dicCode="id", dicText = "warehouse_name")
	@ApiModelProperty(value = "入库仓库")
	@Dict(dictTable = "supplies_warehouse", dicCode="id", dicText = "warehouse_name")
	private String inWarehouseId;

	/**供应商编号*/
	@Excel(name = "供应商", width = 15,dictTable = "ajh_supplier_manage", dicCode="id", dicText = "supp_name")
    @ApiModelProperty(value = "供应商编号")
	@Dict(dictTable = "ajh_supplier_manage", dicCode="id", dicText = "supp_name")
	private String supplierId;
	/**货号*/
	@Excel(name = "货号", width = 15)
    @ApiModelProperty(value = "货号")
	private String goodCode;
	/**采购单价*/
    @ApiModelProperty(value = "采购单价")
	private String purchasePrice;
	/**分销单价*/
    @ApiModelProperty(value = "分销单价")
	private String distributPrice;

	@Excel(name = "物料数量", width = 15)
	@ApiModelProperty(value = "物料数量")
	private String materialNum;

	/**税额*/
    @ApiModelProperty(value = "税额")
	private String taxAmount;

	/**分享地址*/
    @ApiModelProperty(value = "分享地址")
	private String shareUrl;
	/**确认状态:0 未确认 1  部分确认 2 全部确认*/
	@Excel(name = "确认状态", width = 15,dicCode="purchase_confirm_status")
    @ApiModelProperty(value = "确认状态:0 未确认 1  部分确认 2 全部确认")
	@Dict( dicCode="purchase_confirm_status")
	private String confirmStatus;
	/**审批状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过*/
	@Excel(name = "审批状态", width = 15,dicCode="audit_status")
    @ApiModelProperty(value = "审批状态:0 未发布 1 已发布(待审核)2 审核驳回 3 审核通过")
	@Dict( dicCode="audit_status")
	private String auditStatus;

	/**审批意见*/
	@ApiModelProperty(value = "审批意见")
	private String approveMessage;
	@ApiModelProperty(value = "申请人")
	private String applyUser;


	/**入库类型*/
    @ApiModelProperty(value = "入库类型")
	private String inType;
	/**备注*/
	@Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
	private String remark;
	/**创建人id*/
	@Excel(name = "创建人", width = 15)
    @ApiModelProperty(value = "创建人id")
	private String createBy;
	/**创建时间*/
	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
	private Date createTime;
	/**修改人id*/
	@Excel(name = "修改人id", width = 15)
    @ApiModelProperty(value = "修改人id")
	private String updateBy;
	/**修改时间*/
	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "修改时间")
	private Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
	private String createDept;
	/**所属公司*/
    @ApiModelProperty(value = "所属公司")
	private String createCmpy;
	/**删除标识,0:正常,1:删除*/
    @ApiModelProperty(value = "删除标识,0:正常,1:删除")
	private Integer delFlag;

	@ApiModelProperty(value = "入库编号")
	private String equipmentInId;

	@ApiModelProperty(value = "出库编号")
	private String equipmentOutId;

    @Excel(name = "供应商结算", width = 15,dicCode="settlement_status")
	@ApiModelProperty(value = "供应商结算,0:申请,1::已申请,2:已结算")
    @Dict( dicCode="settlement_status")
	private Integer supplierSettlementFlag;

    @Excel(name = "水厂结算", width = 15,dicCode="settlement_status")
	@ApiModelProperty(value = "水厂结算,0:未申请,1:已申请,2:已结算")
    @Dict( dicCode="settlement_status")
	private Integer waterDepartSettlementFlag;

	@TableField(exist = false)
	@ApiModelProperty(value = "开始时间")
	private String startTime;

	@TableField(exist = false)
	@ApiModelProperty(value = "结束时间")
	private String endTime;

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

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

	@TableField(exist = false)
	private String departName;


	/**采购总价*/
	@TableField(exist = false)
	@ApiModelProperty(value = "采购总价")
	private String purchaseTotalPrice;
	/**价税合计*/
	@TableField(exist = false)
	@ApiModelProperty(value = "总价(不含税)")
	private String totalPriceTax;
	/**分销总价*/
	@TableField(exist = false)
	@ApiModelProperty(value = "分销总价")
	private String distributTotalPrice;
    public String getPurchaseTotalPrice() {
		if(StringUtils.isNotEmpty(this.getPurchasePrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
			purchaseTotalPrice = JSUtils.multiply(purchasePrice ,materialNum )  ;
		}
        return purchaseTotalPrice;
    }

    public String getDistributTotalPrice() {
		if( StringUtils.isNotEmpty(this.getDistributPrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
			distributTotalPrice = JSUtils.multiply(distributPrice ,materialNum )  ;
		}
        return distributTotalPrice;
    }

	public String getTotalPriceTax() {
		//不含税总价 = 含税总价 / (1 + 税率)
		if(StringUtils.isNotEmpty(this.getTaxAmount()) && StringUtils.isNotEmpty(this.getDistributPrice()) && StringUtils.isNotEmpty(this.getMaterialNum())){
			String expression = distributPrice +" * " +materialNum +"/( 1 +"+taxAmount+"* 0.01)";
			totalPriceTax = JSUtils.executeExpression(expression ,"0.00" )  ;
		}
		return totalPriceTax;
	}
}