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", "stock", "mustQty","stock" })
public class SalesReturnItemBean {

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

    /**
     * 单位
     */
    @JsonProperty("FUnitID")
    @Setter(AccessLevel.NONE)
    private Map<String, String> unitId = new HashMap<>();

    /**
     * 应退数量
     */
    @JsonProperty("FMustqty")
    private BigDecimal mustQty;

    /**
     * 实退数量
     */
    @JsonProperty("FRealQty")
    private BigDecimal realQty;


    @JsonProperty("F_kls_Text")
    @ApiModelProperty(value = "供应链标识（默认存明细id）", required = true)
    private String supplyColVal;

    @JsonProperty("F_kls_Text1")
    @ApiModelProperty(value = "销售类型", required = true)
    private String salesTypeName;


    @JsonProperty("F_kls_Text2")
    @ApiModelProperty(value = "销售类型Id", required = true)
    private String salesTypId;


    @JsonProperty("F_kls_Base")
    @ApiModelProperty(value = "金蝶部门编号", required = false)
    private Map<String, String> klsBase = new HashMap<String, String>();

    /**
     * 单位
     */
    @JsonProperty("FStockId")
    @Setter(AccessLevel.NONE)
    private Map<String, String> stockId = new HashMap<>();

    @ApiModelProperty(value = "单位编码", required = true)
    private String unit;

    @ApiModelProperty(value = "仓库id", required = true)
    private String stock;


    @ApiModelProperty(value = "金蝶部门编号", required = true)
    private String kls;


    public void setUnit(String unit) {
        this.unit = unit;
        this.unitId.put(KingDeeCons.NUMBER, this.unit);
    }


    public void setStock(String stock) {
        this.stock = stock;
        this.stockId.put(KingDeeCons.NUMBER, this.stock);
    }

    public void setKls(String kls) {
        this.kls = kls;
        this.klsBase.put(KingDeeCons.NUMBER, this.kls);
    }
}
