⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uireportcriteria.java

📁 国外的一套开源CRM
💻 JAVA
字号:
package com.sourcetap.sfa.ui;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;

public class UIReportCriteria {
	public static final String module = UIReportCriteria.class.getName();

	protected String reportCriteriaId;
	protected String reportId;
	protected String attributeId;
	protected String displayTypeId;
	protected String displayObjectId;
	protected String queryOperatorId;
	protected String attributeValue;
	protected String displayLabel;

	protected boolean attNameLoaded = false;
	protected String attributeName;
	protected String entityName;

	protected String sectionId;
	protected String sectionName;

	protected GenericDelegator delegator;

	public static List loadFromGVL( List reportCriteriaGVL )
	{
		List retList = new ArrayList();
		Iterator iter = reportCriteriaGVL.iterator();
		while ( iter.hasNext() )
		{
			GenericValue gv = (GenericValue) iter.next();
			retList.add(new UIReportCriteria(gv));
		}
		return retList;
	}
		
	public UIReportCriteria(GenericValue genricValue)
	{
		setReportCriteriaId(genricValue.getString("reportCriteriaId"));
		setReportId(genricValue.getString("reportId"));
		setAttributeId(genricValue.getString("attributeId"));
		setDisplayTypeId(genricValue.getString("displayTypeId"));
		setDisplayObjectId(genricValue.getString("displayObjectId"));
		setQueryOperatorId(genricValue.getString("queryOperatorId"));
		setAttributeValue(genricValue.getString("attributeValue"));
		setDisplayLabel(genricValue.getString("displayLabel"));
			
		setDelegator(genricValue.getDelegator());
	}
	
	public UIReportCriteria(String attributeId, String displayTypeId, String displayObjectId, String queryOperatorId, String attributeValue, String displayLabel)
	{
		setAttributeId(attributeId);
		setDisplayTypeId(displayTypeId);
		setDisplayObjectId(displayObjectId);
		setQueryOperatorId(queryOperatorId);
		setAttributeValue(attributeValue);
		setDisplayLabel(displayLabel);
		
	}
		
	public void loadEntityAttributeInfo(GenericDelegator delegator, String attributeId)
	{
		try
		{
			List eaGVL = delegator.findByAnd("UiEntityAttribute", UtilMisc.toMap("attributeId", attributeId));
			GenericValue eaGV = (GenericValue) eaGVL.get(0);
				
			setEntityName(eaGV.getString("entityName"));
			setAttributeName(eaGV.getString("attributeName"));
			attNameLoaded = true;
				 
		} catch (GenericEntityException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	/**
	 * @return
	 */
	public String getAttributeId()
	{
		return attributeId;
	}

	/**
	 * @return
	 */
	public String getAttributeName()
	{
		if ( !attNameLoaded)
			loadEntityAttributeInfo(getDelegator(), getAttributeId());

		return attributeName;
	}

	/**
	 * @return
	 */
	public String getAttributeValue()
	{
		return attributeValue;
	}

	/**
	 * @return
	 */
	public GenericDelegator getDelegator()
	{
		return delegator;
	}

	/**
	 * @return
	 */
	public String getDisplayObjectId()
	{
		return displayObjectId;
	}

	/**
	 * @return
	 */
	public String getDisplayTypeId()
	{
		return displayTypeId;
	}

	/**
	 * @return
	 */
	public String getEntityName()
	{
		if ( !attNameLoaded)
			loadEntityAttributeInfo(getDelegator(), getAttributeId());

		return entityName;
	}

	/**
	 * @return
	 */
	public String getQueryOperatorId()
	{
		return queryOperatorId;
	}

	/**
	 * @return
	 */
	public String getReportCriteriaId()
	{
		return reportCriteriaId;
	}

	/**
	 * @return
	 */
	public String getReportId()
	{
		return reportId;
	}

	/**
	 * @return
	 */
	public String getSectionId()
	{
		return sectionId;
	}

	/**
	 * @return
	 */
	public String getSectionName()
	{
		return sectionName;
	}

	/**
	 * @param string
	 */
	public void setAttributeId(String string)
	{
		attributeId = string;
	}

	/**
	 * @param string
	 */
	public void setAttributeName(String string)
	{
		attributeName = string;
		attNameLoaded = true;
	}

	/**
	 * @param string
	 */
	public void setAttributeValue(String string)
	{
		attributeValue = string;
	}

	/**
	 * @param delegator
	 */
	public void setDelegator(GenericDelegator delegator)
	{
		this.delegator = delegator;
	}

	/**
	 * @param string
	 */
	public void setDisplayObjectId(String string)
	{
		displayObjectId = string;
	}

	/**
	 * @param string
	 */
	public void setDisplayTypeId(String string)
	{
		displayTypeId = string;
	}

	/**
	 * @param string
	 */
	public void setEntityName(String string)
	{
		entityName = string;
		attNameLoaded = true;
	}

	/**
	 * @param string
	 */
	public void setQueryOperatorId(String string)
	{
		queryOperatorId = string;
	}

	/**
	 * @param string
	 */
	public void setReportCriteriaId(String string)
	{
		reportCriteriaId = string;
	}

	/**
	 * @param string
	 */
	public void setReportId(String string)
	{
		reportId = string;
	}

	/**
	 * @param string
	 */
	public void setSectionId(String string)
	{
		sectionId = string;
	}

	/**
	 * @param string
	 */
	public void setSectionName(String string)
	{
		sectionName = string;
	}
	/**
	 * @return
	 */
	public String getDisplayLabel()
	{
		return displayLabel;
	}

	/**
	 * @param string
	 */
	public void setDisplayLabel(String string)
	{
		displayLabel = string;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -