//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package nc.vo.cm.meascostcontrast;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import nc.bd.framework.base.CMStringUtil;
import nc.vo.pub.BeanHelper;
import nc.vo.pub.SuperVO;
import nc.vo.pub.lang.UFDouble;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;

public class MeasCostItemVO extends SuperVO {
    private static final long serialVersionUID = 50098708851615159L;
    private String bookname;
    private String orgname;
    private String profitcentername;
    private String cccode;
    private String ccname;
    private String vcostobjcode;
    private String vcostobjname;
    private String vcostobjname0;
    private UFDouble nnum;
    private String measdocname;
    private Integer bitnumber;
    private String materialspec;
    private String materialtype;
    /** 项目编码 */
    private String projectcode;

    /** 项目名称 */
    private String projectname;
    private Map<String, Serializable> factorMap = new HashMap();

    public MeasCostItemVO() {
    }

    public String getMeasdocname() {
        return this.measdocname;
    }

    public void setMeasdocname(String measdocname) {
        this.measdocname = measdocname;
    }

    public Integer getBitnumber() {
        return this.bitnumber;
    }

    public void setBitnumber(Integer bitnumber) {
        this.bitnumber = bitnumber;
    }

    public String getMaterialspec() {
        return this.materialspec;
    }

    public void setMaterialspec(String materialspec) {
        this.materialspec = materialspec;
    }

    public String getMaterialtype() {
        return this.materialtype;
    }

    public void setMaterialtype(String materialtype) {
        this.materialtype = materialtype;
    }

    public String getBookname() {
        return this.bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname;
    }

    public String getOrgname() {
        return this.orgname;
    }

    public void setOrgname(String orgname) {
        this.orgname = orgname;
    }

    public String getProfitcentername() {
        return this.profitcentername;
    }

    public void setProfitcentername(String profitcentername) {
        this.profitcentername = profitcentername;
    }


    public String getProjectcode() {
        return this.projectcode;
    }

    public void setProjectcode(String projectcode) {
        this.projectcode = projectcode;
    }

    public String getProjectname() {
        return this.projectname;
    }

    public void setProjectname(String projectname) {
        this.projectname = projectname;
    }

    public Map<String, Serializable> getFactorMap() {
        return this.factorMap;
    }

    public void setFactorMap(Map<String, Serializable> factorMap) {
        this.factorMap = factorMap;
    }

    public void setAttributeValue(String name, Object value) {
        if (value != null) {
            if (value instanceof Serializable) {
                this.factorMap.put(name, (Serializable)value);
                this.setFactorMap(this.factorMap);
            } else {
                ExceptionUtils.wrappBusinessException("field not instanceof Serializable");
            }
        } else {
            this.factorMap.put(name, (Serializable) null);
            this.setFactorMap(this.factorMap);
        }

    }

    public Object getAttributeValue(String name) {
        if (!this.getFactorMap().containsKey(name)) {
            Object value = BeanHelper.getProperty(this, name);
            return value instanceof UFDouble && UFDouble.ZERO_DBL.equals(value) ? null : value;
        } else {
            Object value = this.getFactorMap().get(name);
            return value instanceof UFDouble && UFDouble.ZERO_DBL.equals(value) ? null : value;
        }
    }

    public boolean equals(Object o) {
        if (o != null && o instanceof MeasCostItemVO vo) {
            return this.getVcostobjcode().equals(vo.getVcostobjcode());
        } else {
            return false;
        }
    }

    public int hashCode() {
        return super.hashCode();
    }

    public String getCccode() {
        return this.cccode;
    }

    public void setCccode(String vcostcentercode) {
        this.cccode = vcostcentercode;
    }

    public String getCcname() {
        return this.ccname;
    }

    public void setCcname(String vcostcentername) {
        this.ccname = vcostcentername;
    }

    public String getVcostobjcode() {
        return this.vcostobjcode;
    }

    public void setVcostobjcode(String vcostobjcode) {
        this.vcostobjcode = vcostobjcode;
    }

    public String getVcostobjname() {
        return CMStringUtil.isNotEmpty(this.vcostobjname) ? this.vcostobjname : this.vcostobjname0;
    }

    public void setVcostobjname(String vcostobjname) {
        this.vcostobjname = vcostobjname;
    }

    public String getVcostobjname0() {
        return this.vcostobjname0;
    }

    public void setVcostobjname0(String vcostobjname0) {
        this.vcostobjname0 = vcostobjname0;
    }

    public UFDouble getNnum() {
        return this.nnum;
    }

    public void setNnum(UFDouble nnum) {
        this.nnum = nnum;
    }

    public void setAttrbuteByRule(String groupItemCode, String subItemCode, Object value) {
        String code = MeasCostUtil.getItemCodeByRule(groupItemCode, subItemCode);
        this.setAttributeValue(code, value);
    }
}
