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

import com.fasterxml.jackson.annotation.JsonIgnore;
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 java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@ApiModel
@Data
@JsonIgnoreProperties(value = { "isPushUpdate","userName" ,"saleDept","amountType","userName","judgeTime","bwb","customer"})
public class SyncK3OtherReceBean  extends CommonOrderBean{

    @JsonProperty("FBillTypeID")
    @ApiModelProperty(value = "单据类型：FBillTypeID", required = true)
    private Map<String, String> billType = new HashMap<String, String>() {
        {
            this.put(KingDeeCons.NUMBER, "QTYSD01_SYS");
        }
    };

    @JsonProperty("FID")
    @ApiModelProperty(value = " 实体主键", required = false)
    private String id;

    @JsonProperty("FBillNo")
    @ApiModelProperty(value = " 实体主键", required = false)
    private String billNo;

    @JsonProperty("FDocumentStatus")
    @ApiModelProperty(value = " 单据状态", required = false)
    private String  examineStatus;

    @JsonProperty("FDate")
    @ApiModelProperty(value = "日期", required = true)
    private String theTime;

    @JsonProperty("FENDDATE_H")
    @ApiModelProperty(value = "到期日", required = true)
    private String endTime;

    @JsonProperty("FCONTACTUNITTYPE")
    @ApiModelProperty(value = " 往来单位类型", required = true)
    private String userNameType;

    @ApiModelProperty(value = " 往来单位", required = true)
    private String userName;
    @JsonProperty("FCONTACTUNIT")
    private Map<String, String> contactUnit = new HashMap<String, String>();

    @JsonProperty("FISINIT")
    @ApiModelProperty(value = "是否初期单据", required = false)
    private Boolean isInit;


    @ApiModelProperty(value = "币别", required = true)
    private String amountType;
    @JsonProperty("FCURRENCYID")
    private Map<String, String> currencyId = new HashMap<String, String>();

    @JsonProperty("FSETTLEORGID")
    @ApiModelProperty(value = "结算组织", required = false)
    private Map<String, String> FSETTLEORGID = new HashMap<String, String>(){
        {
            this.put(KingDeeCons.NUMBER, "100");
        }
    };

    @JsonProperty("FPAYORGID")
    @ApiModelProperty(value = "收款组织", required = true)
    private Map<String, String> FPAYORGID = new HashMap<String, String>(){
        {
            this.put(KingDeeCons.NUMBER, "100");
        }
    };

    @ApiModelProperty(value = "销售部门", required = true)
    private String saleDept;
    @JsonProperty("FSALEDEPTID")
    private Map<String, String> saleDeptId = new HashMap<String, String>();

//    @JsonProperty("FSALEORGID")
//    @ApiModelProperty(value = "销售组织", required = true)
//    private Map<String, String> FSALEORGID = new HashMap<String, String>(){
//        {
//            this.put(KingDeeCons.NUMBER, "100");
//        }
//    };

    @JsonProperty("FACCNTTIMEJUDGETIME")
    @ApiModelProperty(value = "到期日计算日期")
    private String judgeTime;


    @ApiModelProperty(value = "本位币", required = true)
    private String bwb;
    @JsonProperty("FMAINBOOKSTDCURRID")
    private Map<String, String> bookStdcurrid = new HashMap<String, String>();

    @JsonProperty("FEXCHANGETYPE")
    @ApiModelProperty(value = "汇率类型", required = true)
    private Map<String, String> FEXCHANGETYPE = new HashMap<String, String>(){
        {
            this.put(KingDeeCons.NUMBER, "HLTX01_SYS");
        }
    };

    @ApiModelProperty(value = "汇率")
    @JsonProperty("FExchangeRate")
    private String rate;

    @ApiModelProperty(value = "作废状态")
    @JsonProperty("FCancelStatus")
    private String cancelStatus;

    @JsonProperty("FEntity")
    @ApiModelProperty(value = "订单明细", required = true)
    private List<OtherReceItemBean> items;

    @ApiModelProperty(value = "客户")
    private String customer;
    @JsonProperty("F_kls_Base")
    private Map<String, String> klsBase = new HashMap<String, String>();

    @JsonIgnore
    private boolean isPushUpdate = false;

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



    public void setUserName(String userName) {
        this.userName = userName;
        this.contactUnit.put(KingDeeCons.NUMBER, this.userName);
    }

    public void setAmountType(String amountType) {
        this.amountType = amountType;
        this.currencyId.put(KingDeeCons.NUMBER, this.amountType);
    }


    public void setSaleDept(String saleDept) {
        this.saleDept = saleDept;
        this.saleDeptId.put(KingDeeCons.NUMBER, this.saleDept);
    }

    public void setBwb(String bwb) {
        this.bwb = bwb;
        this.bookStdcurrid.put(KingDeeCons.NUMBER, this.bwb);
    }

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

}
