package com.zfire.mall.manager.bean.k3.bill;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.zfire.mall.manager.constant.KingDeeCons;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@ApiModel
@Data
@JsonIgnoreProperties(value = { "unit", "unitId", "srcStock", "destStock" ,"number"})
public class TransferOrderBeanStock {

    /**
     * 明细行内码
     */
    @JsonProperty("FEntryID")
    @ApiModelProperty(value = "明细行内码", required = true)
    private String entryId;


    /**
     * 物料编码
     */
    @JsonProperty("FMaterialId")
    @Setter(AccessLevel.NONE)
    private Map<String, String> materialId = new HashMap<String, String>();



    @JsonProperty("FQty")
    @ApiModelProperty(value = "销售数量", required = true)
    private BigDecimal qty;

    /**
     * 调出仓库
     */
    @JsonProperty("FSrcStockId")
    @Setter(AccessLevel.NONE)
    private Map<String, String> srcStockId = new HashMap<>();


    /**
     * 调入仓库
     */
    @JsonProperty("FDestStockId")
    @Setter(AccessLevel.NONE)
    private Map<String, String> destStockId = new HashMap<>();



    @ApiModelProperty(value = "仓库编码", required = true)
    private String srcStock;

    @ApiModelProperty(value = "仓库编码", required = true)
    private String destStock;


    @ApiModelProperty(value = "物料id", required = true)
    private String number;


    public void setSrcStock(String srcStock) {
        this.srcStock = srcStock;
        this.srcStockId.put(KingDeeCons.NUMBER, this.srcStock);
    }

    public void setDestStock(String destStock) {
        this.destStock = destStock;
        this.destStockId.put(KingDeeCons.NUMBER, this.destStock);
    }


    public void setNumber(String number) {
        this.number = number;
        this.materialId.put(KingDeeCons.NUMBER, this.number);
    }
}
