当前位置: 首页>>代码示例>>Java>>正文


Java Env.getAD_Org_ID方法代码示例

本文整理汇总了Java中org.compiere.util.Env.getAD_Org_ID方法的典型用法代码示例。如果您正苦于以下问题:Java Env.getAD_Org_ID方法的具体用法?Java Env.getAD_Org_ID怎么用?Java Env.getAD_Org_ID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.compiere.util.Env的用法示例。


在下文中一共展示了Env.getAD_Org_ID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toInfoString

import org.compiere.util.Env; //导入方法依赖的package包/类
private String toInfoString(final Properties ctx)
{
	final String threadName = (String)ctx.get(CTXNAME_ThreadName);
	final String threadId = (String)ctx.get(CTXNAME_ThreadId);
	final int adClientId = Env.getAD_Client_ID(ctx);
	final int adOrgId = Env.getAD_Org_ID(ctx);
	final int adUserId = Env.getAD_User_ID(ctx);
	final int adRoleId = Env.getAD_Role_ID(ctx);
	final int adSessionId = Env.getAD_Session_ID(ctx);

	return "Thread=" + threadName + "(" + threadId + ")"
			//
			+ "\n"
			+ ", Client/Org=" + adClientId + "/" + adOrgId
			+ ", User/Role=" + adUserId + "/" + adRoleId
			+ ", SessionId=" + adSessionId
			//
			+ "\n"
			+ ", id=" + System.identityHashCode(ctx)
			+ ", " + ctx.getClass()
			//
			+ "\n"
			+ ", " + ctx.toString();
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:25,代码来源:TraceContextProviderListener.java

示例2: assertDefaultConversionType

import org.compiere.util.Env; //导入方法依赖的package包/类
private final void assertDefaultConversionType(final I_C_ConversionType expectedConversionType, final Date date)
{
	final int adClientId = Env.getAD_Client_ID(ctx);
	final int adOrgId = Env.getAD_Org_ID(ctx);

	final I_C_ConversionType actualConversionType = currencyDAO.retrieveDefaultConversionType(ctx, adClientId, adOrgId, date);

	final String info = "AD_Client_ID=" + adClientId + ", AD_Org_ID=" + adOrgId
			+ ", date=" + date
			+ ", expectedConversionType=" + (expectedConversionType == null ? null : expectedConversionType.getValue())
			+ ", actualConversionType=" + (actualConversionType == null ? null : actualConversionType.getValue())
	//
	;

	Assert.assertEquals("Invalid conversion type -- " + info, expectedConversionType.getC_ConversionType_ID(), actualConversionType.getC_ConversionType_ID());
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:17,代码来源:CurrencyDAOTest.java

示例3: mkAddress

import org.compiere.util.Env; //导入方法依赖的package包/类
public String mkAddress(I_C_Location location, boolean isLocalAddress, final I_C_BPartner bPartner, String bPartnerBlock, String userBlock)
{
	final Properties ctx = InterfaceWrapperHelper.getCtx(bPartner);
	final String adLanguage;
	final int orgId;
	if (bPartner == null)
	{
		adLanguage = Services.get(ICountryDAO.class).getDefault(Env.getCtx()).getAD_Language();
		orgId = Env.getAD_Org_ID(ctx);
	}
	else
	{
		adLanguage = bPartner.getAD_Language();
		orgId = bPartner.getAD_Org_ID();
	}

	final I_AD_Org org = InterfaceWrapperHelper.create(ctx, orgId, I_AD_Org.class, ITrx.TRXNAME_None);
	final de.metas.adempiere.model.I_C_Location loc = InterfaceWrapperHelper.create(location, de.metas.adempiere.model.I_C_Location.class);
	return new AddressBuilder(org)
			.setLanguage(adLanguage)
			.buildAddressString(loc, isLocalAddress, bPartnerBlock, userBlock);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:23,代码来源:LocationBL.java

示例4: findPrintingService

import org.compiere.util.Env; //导入方法依赖的package包/类
public IPrintingService findPrintingService(final ProcessInfo pi)
{
	final Properties ctx = Env.getCtx();
	final int AD_Client_ID = Env.getAD_Client_ID(ctx);
	final int AD_Org_ID = Env.getAD_Org_ID(ctx);
	final int AD_Role_ID = Env.getAD_Role_ID(ctx);
	final int AD_User_ID = Env.getAD_User_ID(ctx);
	final int AD_Process_ID = pi.getAD_Process_ID();
	final int C_DocType_ID = Services.get(IDocumentBL.class).getC_DocType_ID(ctx, pi.getTable_ID(), pi.getRecord_ID());
	final String printerType = null;

	return findPrintingService0(ctx,
			AD_Client_ID, AD_Org_ID,
			AD_Role_ID, AD_User_ID,
			C_DocType_ID, AD_Process_ID,
			printerType);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:18,代码来源:PrinterRoutingBL.java

示例5: evaluate

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public String evaluate(final Evaluatee ctx, final OnVariableNotFound onVariableNotFound) throws ExpressionEvaluationException
{
	Integer adClientId = ctx.get_ValueAsInt(PARAMETER_AD_Client_ID, null);
	if (adClientId == null || adClientId < 0)
	{
		adClientId = Env.getAD_Client_ID(Env.getCtx());
	}

	Integer adOrgId = ctx.get_ValueAsInt(PARAMETER_AD_Org_ID, null);
	if (adOrgId == null || adOrgId < 0)
	{
		adOrgId = Env.getAD_Org_ID(Env.getCtx());
	}

	final IDocumentNoBuilderFactory documentNoFactory = Services.get(IDocumentNoBuilderFactory.class);
	final String value = documentNoFactory.forTableName(tableName, adClientId, adOrgId)
			.setFailOnError(onVariableNotFound == OnVariableNotFound.Fail)
			.setUsePreliminaryDocumentNo(true)
			.build();

	if (value == null && onVariableNotFound == OnVariableNotFound.Fail)
	{
		throw new AdempiereException("No auto value sequence found for " + tableName + ", AD_Client_ID=" + adClientId + ", AD_Org_ID=" + adOrgId);
	}

	return value;
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:29,代码来源:AutoSequenceDefaultValueExpression.java

示例6: isAvailableStockQueryActivatedInSysConfig

import org.compiere.util.Env; //导入方法依赖的package包/类
private boolean isAvailableStockQueryActivatedInSysConfig()
{
	final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
	final int clientId = Env.getAD_Client_ID(Env.getCtx());
	final int orgId = Env.getAD_Org_ID(Env.getCtx());

	final boolean stockQueryActivated = sysConfigBL.getBooleanValue(
			SYSCONFIG_PRODUCT_LOOKUP_DESCRIPTOR_QUERY_AVAILABLE_STOCK,
			false, clientId, orgId);
	return stockQueryActivated;
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:12,代码来源:ProductLookupDescriptor.java

示例7: addStorageAttributeKeysToQueryBuilder

import org.compiere.util.Env; //导入方法依赖的package包/类
private void addStorageAttributeKeysToQueryBuilder(@NonNull final StockQueryBuilder stockQueryBuilder)
{
	final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
	final int clientId = Env.getAD_Client_ID(Env.getCtx());
	final int orgId = Env.getAD_Org_ID(Env.getCtx());

	final String storageAttributesKeys = sysConfigBL.getValue(
			SYSCONFIG_PRODUCT_LOOKUP_DESCRIPTOR_STORAGE_ATTRIBUTES_KEYS,
			AttributesKey.ALL.getAsString(),
			clientId, orgId);

	final Splitter splitter = Splitter
			.on(",")
			.trimResults(CharMatcher.whitespace())
			.omitEmptyStrings();
	for (final String storageAttributesKey : splitter.splitToList(storageAttributesKeys))
	{
		if ("<ALL_STORAGE_ATTRIBUTES_KEYS>".equals(storageAttributesKey))
		{
			stockQueryBuilder.storageAttributesKey(AttributesKey.ALL);
		}
		else if ("<OTHER_STORAGE_ATTRIBUTES_KEYS>".equals(storageAttributesKey))
		{
			stockQueryBuilder.storageAttributesKey(AttributesKey.OTHER);
		}
		else
		{
			stockQueryBuilder.storageAttributesKey(AttributesKey.ofString(storageAttributesKey));
		}
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:32,代码来源:ProductLookupDescriptor.java

示例8: retrieveRelevantProducts

import org.compiere.util.Env; //导入方法依赖的package包/类
private List<I_M_Product> retrieveRelevantProducts(@NonNull final List<DocumentFilter> filters)
{
	final int orgId = Env.getAD_Org_ID(Env.getCtx());
	final List<I_M_Product> allProducts = orgIdToproducts
			.getOrLoad(orgId, () -> retrieveAllProducts(orgId));

	return allProducts.stream()
			.filter(product -> materialCockpitFilters.doesProductMatchFilters(product, filters))
			.collect(ImmutableList.toImmutableList());
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:11,代码来源:MaterialCockpitRowRepository.java

示例9: getDefaultContractUserInCharge_ID

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public int getDefaultContractUserInCharge_ID(final Properties ctx)
{
	final int ad_Client_ID = Env.getAD_Client_ID(ctx);
	final int ad_Org_ID = Env.getAD_Org_ID(ctx);
	final int adUserInChargeId = Services.get(ISysConfigBL.class).getIntValue(SYSCONFIG_AD_USER_IN_CHARGE, -1, ad_Client_ID, ad_Org_ID);
	return adUserInChargeId <= 0 ? -1 : adUserInChargeId;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:9,代码来源:PMMContractsBL.java

示例10: configureC_Activity_ID

import org.compiere.util.Env; //导入方法依赖的package包/类
private void configureC_Activity_ID(final IContextAware contextProvider, final I_M_Product product, final I_M_PricingSystem pricingSystem)
{
	final int orgId = Env.getAD_Org_ID(contextProvider.getCtx());
	final I_AD_Org org = InterfaceWrapperHelper.create(contextProvider.getCtx(), orgId, I_AD_Org.class, contextProvider.getTrxName());

	int activityId = -1;
	try
	{
		final I_C_Activity activity = Services.get(IProductAcctDAO.class).retrieveActivityForAcct(contextProvider, org, product);
		if (activity != null)
		{
			activityId = activity.getC_Activity_ID();
		}
	}
	catch (final Exception e)
	{
		// Do nothing
		//
		// ADialog.error(windowNo, getContentPane(), e);
		return;
	}

	if (activityId <= 0)
	{
		return;
	}
	activityField.setValue(activityId);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:29,代码来源:CreateInvoiceCandidateDialog.java

示例11: retrieveADRAttribute

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public I_M_Attribute retrieveADRAttribute(Properties ctx)
{
	final int adClientId = Env.getAD_Client_ID(ctx);
	final int adOrgId = Env.getAD_Org_ID(ctx);
	return retrieveADRAttribute(ctx, adClientId, adOrgId);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:8,代码来源:ADRAttributeDAO.java

示例12: setRate

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * Creates/Updates an {@link I_C_Conversion_Rate} using given parameters and following defaults:
 * <ul>
 * <li>ValidFrom: 1970-01-01
 * <li>ConversionType: default
 * <li>Client/Org: from {@link Env#getCtx()}
 * </ul>
 *
 * @param currencyFrom
 * @param currencyTo
 * @param rate
 */
public void setRate(final I_C_Currency currencyFrom, final I_C_Currency currencyTo, final BigDecimal rate)
{
	final Properties ctx = Env.getCtx();
	final int adClientId = Env.getAD_Client_ID(ctx);
	final int adOrgId = Env.getAD_Org_ID(ctx);
	final Date date = TimeUtil.getDay(1970, 1, 1);
	final I_C_ConversionType conversionType = retrieveDefaultConversionType(ctx, adClientId, adOrgId, date);
	final ICurrencyConversionContext conversionCtx = CurrencyConversionContext.builder()
			.setAD_Client_ID(adClientId)
			.setAD_Org_ID(adOrgId)
			.setC_ConversionType_ID(conversionType.getC_ConversionType_ID())
			.setConversionDate(date)
			.build();

	I_C_Conversion_Rate conversionRate = retrieveRateQuery(conversionCtx, currencyFrom.getC_Currency_ID(), currencyTo.getC_Currency_ID())
			.create()
			.first();
	if (conversionRate == null)
	{
		conversionRate = InterfaceWrapperHelper.create(ctx, I_C_Conversion_Rate.class, ITrx.TRXNAME_None);
		conversionRate.setAD_Org_ID(adOrgId);
		conversionRate.setC_ConversionType(conversionType);
		conversionRate.setC_Currency(currencyFrom);
		conversionRate.setC_Currency_ID_To(currencyTo.getC_Currency_ID());
		// FIXME: this one is not working due a bug in POJOWrapper or because it's not respecting the standard naming conventions (i.e. C_Currency_To_ID)
		// conversionRate.setC_Currency_To(currencyTo);
		conversionRate.setValidFrom(TimeUtil.asTimestamp(date));
	}

	conversionRate.setMultiplyRate(rate);
	conversionRate.setDivideRate(null); // not used

	InterfaceWrapperHelper.save(conversionRate);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:47,代码来源:PlainCurrencyDAO.java

示例13: getBaseCurrency

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public final I_C_Currency getBaseCurrency(final Properties ctx)
{
	final int adClientId = Env.getAD_Client_ID(ctx);
	final int adOrgId = Env.getAD_Org_ID(ctx);

	return getBaseCurrency(ctx, adClientId, adOrgId);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:9,代码来源:CurrencyBL.java

示例14: getPropertiesMap

import org.compiere.util.Env; //导入方法依赖的package包/类
private Map<String, String> getPropertiesMap()
{
	final Properties ctx = Env.getCtx();
	final int adClientId = Env.getAD_Client_ID(ctx);
	final int adOrgId = Env.getAD_Org_ID(ctx);
	final boolean removePrefix = false; // keep the prefix, our BL is relying on that

	// Load the properties map from underlying database
	// NOTE: we assume it's cached on that level
	return Services.get(ISysConfigBL.class).getValuesForPrefix(CFG_C_LOGGER_LEVEL_PREFIX, removePrefix, adClientId, adOrgId);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:12,代码来源:SysConfigLoggerCustomizer.java

示例15: getDefaultAttributesDevicesHub

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public AttributesDevicesHub getDefaultAttributesDevicesHub()
{
	final IHostIdentifier clientHost = NetUtils.getLocalHost();
	final Properties ctx = Env.getCtx();
	final int adClientId = Env.getAD_Client_ID(ctx);
	final int adOrgId = Env.getAD_Org_ID(ctx);
	return getAttributesDevicesHub(clientHost, adClientId, adOrgId);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:10,代码来源:DevicesHubFactory.java


注:本文中的org.compiere.util.Env.getAD_Org_ID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。