package com.prolog.eis.model.outbound;

import com.prolog.framework.core.annotation.AutoKey;
import com.prolog.framework.core.annotation.Column;
import com.prolog.framework.core.annotation.Id;
import com.prolog.framework.core.annotation.Table;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.prolog.eis.utils.GoodsPropertyUtils.getGoodsProperty;

/**
 * @author zmr
 * @description: 出库任务详情表
 * @date 2023-07-06 11:36
 */
@Data
@Table("biz_outbound_task_detail")
public class BizOutboundTaskDetail {

	@Id
	@AutoKey(type = AutoKey.TYPE_IDENTITY)
	@Column("id")
	@ApiModelProperty("id")
	private Integer id;

	@Column("outbound_id")
	@ApiModelProperty("出库任务id")
	private Integer outboundId;

	@Column("container_no")
	@ApiModelProperty("容器号")
	private String containerNo;

	@Column("seq_no")
	@ApiModelProperty("行号")
	private String seqNo;

	@Column("plan_qty")
	@ApiModelProperty("计划数量")
	private BigDecimal planQty;

	@Column("act_qty")
	@ApiModelProperty("实际数量")
	private BigDecimal actQty;

	@Column("out_qty")
	@ApiModelProperty("出库数量")
	private BigDecimal outQty;

	@Column("status")
	@ApiModelProperty("状态(-20 库存不足,-10.取消,0.创建,10.开始,15已复核 20.完成,)")
	private Integer status;

	@Column("target_area")
	@ApiModelProperty("订单目标位置")
	private String targetArea;


	@Column("create_time")
	@ApiModelProperty("创建时间")
	private LocalDateTime createTime;

	@Column("update_time")
	@ApiModelProperty("修改时间")
	private LocalDateTime updateTime;

	@Column("extend_1")
	@ApiModelProperty("拓展字段1")
	private String extend1;

	@Column("extend_2")
	@ApiModelProperty("拓展字段2")
	private String extend2;

	@Column("extend_3")
	@ApiModelProperty("拓展字段3")
	private String extend3;

	@Column("item_id")
	@ApiModelProperty("物料id")
	private String itemId;

	@Column("owner_id")
	@ApiModelProperty("货主")
	private String ownerId;

	@Column("lot_id")
	@ApiModelProperty("批号")
	private String lotId;

	@Column("pack_id")
	@ApiModelProperty("包装ID")
	private String packId;

	@Column("lack_qty")
	@ApiModelProperty("短拣数量")
	private BigDecimal lackQty;

	@Column("supply_qty")
	@ApiModelProperty("补货数量")
	private BigDecimal supplyQty;

	@Column("check_store")
	@ApiModelProperty("校验库存（0：未校验，1：已校验库存）")
	private Integer checkStore;

	@Column("is_supply")
	@ApiModelProperty("是否为拆零区缺货补货任务（0否  1是）")
	private Integer isSupply;

	@Column("lack_state")
	@ApiModelProperty("-1 正常 0：缺货冲红 1：重新推任务")
	private Integer lackState;

	@Column("is_check")
	@ApiModelProperty("EIS盘点执行完是否需要WMS审核后再调EIS库存账 1是 0否")
	private Integer isCheck;
	public String getBusinessProperty(){
		return getGoodsProperty(this.itemId,this.lotId);
	}
	public String getBusinessProperty2(){
		return getGoodsProperty(this.itemId,this.lotId,this.ownerId,this.packId);
	}
}

