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.Data;
import lombok.EqualsAndHashCode;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@EqualsAndHashCode(callSuper = true)
@ApiModel
@Data
@JsonIgnoreProperties(value = { "isPushUpdate" })
public class PurchaseInStockBean extends CommonOrderBean {

    /**
     * 供应商
     */
    @JsonProperty("FSupplierId")
    @ApiModelProperty(value = "供应商", required = true)
    private Map<String, String> supplierId = new HashMap<>();


    /**
     * 日期
     */
    @JsonProperty("FDate")
    @ApiModelProperty(value = "日期")
    private String date;


    /**
     * 仓库
     */
    @JsonProperty("F_abcd_Base1")
    @ApiModelProperty(value = "仓库", required = true)
    private Map<String, String> FAbcdBase1 = new HashMap<>();


    @JsonProperty("FInStockEntry")
    @ApiModelProperty(value = "订单明细", required = true)
    private List<PurchaseInStockItemBean> orderItems;

    @ApiModelProperty(value = "是否下推更新")
    private boolean isPushUpdate = true;

    @Override
    public boolean isPushUpdate() {
        return isPushUpdate;
    }


    @ApiModelProperty(value = "供应商编码", required = true)
    private String supplier;


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

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

    public void setSupplier(String supplier) {
        this.supplier = supplier;
        this.supplierId.put(KingDeeCons.NUMBER, this.supplier);
    }

/*    @Override
    public String[] pushUpdateFields() {
        return new String[]{"FSupplierId","FDate", "F_abcd_Base1", "FMaterialId", "FUnitID", "FPriceUnitID", "FRealQty","FRemainInStockUnitId"};
    }*/
}
