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


Java Env.getDate方法代码示例

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


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

示例1: doIt

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
protected String doIt() throws Exception
{
	final List<I_M_HU> husToDestroy = streamSelectedHUs(Select.ONLY_TOPLEVEL).collect(ImmutableList.toImmutableList());
	if (husToDestroy.isEmpty())
	{
		throw new AdempiereException("@[email protected]");
	}

	final Timestamp movementDate = Env.getDate(getCtx());
	huInventoryBL.moveToGarbage(husToDestroy, movementDate);

	huIdsDestroyed = husToDestroy.stream().map(I_M_HU::getM_HU_ID).collect(ImmutableSet.toImmutableSet());

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

示例2: onUserLogin

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public void onUserLogin(final int AD_Org_ID, final int AD_Role_ID, final int AD_User_ID)
{
	final Properties ctx = Env.getCtx();
	final int adClientId = Env.getAD_Client_ID(ctx);

	//
	// Set default conversion type to context
	if (adClientId > 0 && adClientId != Env.CTXVALUE_AD_Client_ID_System)
	{
		try
		{
			final Date date = Env.getDate(ctx);
			final I_C_ConversionType conversionType = Services.get(ICurrencyDAO.class).retrieveDefaultConversionType(ctx, adClientId, AD_Org_ID, date);
			Env.setContext(ctx, CTXNAME_C_ConversionType_ID, conversionType.getC_ConversionType_ID());
		}
		catch (Exception e)
		{
			logger.warn("Failed finding the default conversion type. Skip", e);
		}
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:23,代码来源:AcctModuleInterceptor.java

示例3: doMoveToGarbage

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * Move products from the warehouse to garbage (waste disposal)
 * After this process an internal use inventory is created.
 * 
 * @param warehouseFrom
 */
public void doMoveToGarbage(final I_M_Warehouse warehouseFrom)
{
	final Set<I_M_HU> selectedHUs = getSelectedHUs();
	final Timestamp movementDate = Env.getDate(getTerminalContext().getCtx());

	final IHUInventoryBL huInventoryBL = Services.get(IHUInventoryBL.class);
	final List<I_M_Inventory> inventories = huInventoryBL.moveToGarbage(selectedHUs, movementDate);

	//
	// Refresh the HUKeys
	if (!inventories.isEmpty())
	{
		refreshSelectedHUKeys();
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:22,代码来源:HUEditorModel.java

示例4: createVendorReturn0

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * 
 * Create vendor returns based on the selected hus
 */
public List<I_M_InOut> createVendorReturn0()
{
	// services
	final IHandlingUnitsBL handlingUnitsBL = Services.get(IHandlingUnitsBL.class);
	final IHUInOutBL huInOutBL = Services.get(IHUInOutBL.class);

	final List<I_M_HU> husToReturn = getSelectedHUKeys().stream()
			.map(HUKey::getM_HU)
			.filter(hu -> !handlingUnitsBL.isPureVirtual(hu)) // Exclude pure virtual HUs (i.e. those HUs which are linked to material HU Items)
			.collect(GuavaCollectors.toImmutableList());

	final Timestamp movementDate = Env.getDate(getTerminalContext().getCtx()); // use Login date

	final List<I_M_InOut> returnInOuts = huInOutBL.createVendorReturnInOutForHUs(husToReturn, movementDate);

	return returnInOuts;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:22,代码来源:HUEditorModel.java

示例5: retrieveUserRolesPermissionsForUserWithOrgAccess

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public List<IUserRolePermissions> retrieveUserRolesPermissionsForUserWithOrgAccess(final Properties ctx, final int adUserId, final int adOrgId)
{
	final boolean rw = false; // readonly access is fine for us
	final int adClientId = Env.getAD_Client_ID(ctx);
	final Date date = Env.getDate(ctx);

	final ImmutableList.Builder<IUserRolePermissions> permissionsWithOrgAccess = ImmutableList.builder();
	for (final I_AD_Role role : Services.get(IRoleDAO.class).retrieveRolesForUser(ctx, adUserId))
	{
		final int adRoleId = role.getAD_Role_ID();
		final IUserRolePermissions permissions = retrieveUserRolePermissions(adRoleId, adUserId, adClientId, date);
		if (permissions.isOrgAccess(adOrgId, rw))
		{
			permissionsWithOrgAccess.add(permissions);
		}
	}

	return permissionsWithOrgAccess.build();
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:21,代码来源:UserRolePermissionsDAO.java

示例6: retrieveFirstUserRolesPermissionsForUserWithOrgAccess

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
public Optional<IUserRolePermissions> retrieveFirstUserRolesPermissionsForUserWithOrgAccess(final Properties ctx, final int adUserId, final int adOrgId)
{
	final boolean rw = false; // readonly access is fine for us
	final int adClientId = Env.getAD_Client_ID(ctx);
	final Date date = Env.getDate(ctx);

	for (final I_AD_Role role : Services.get(IRoleDAO.class).retrieveRolesForUser(ctx, adUserId))
	{
		final int adRoleId = role.getAD_Role_ID();
		final IUserRolePermissions permissions = retrieveUserRolePermissions(adRoleId, adUserId, adClientId, date);
		if (permissions.isOrgAccess(adOrgId, rw))
		{
			return Optional.of(permissions);
		}
	}

	return Optional.absent();
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:20,代码来源:UserRolePermissionsDAO.java

示例7: prepare

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
protected void prepare()
{
	final IRangeAwareParams params = getParameterAsIParams();
	p_OpenAmt = params.getParameterAsBigDecimal(PARAM_OpenAmt);
	if(p_OpenAmt==null)
	{
		throw new FillMandatoryException(PARAM_OpenAmt);
	}

	p_PaymentDateFrom = params.getParameterAsTimestamp(PARAM_PaymentDate);
	p_PaymentDateTo = params.getParameter_ToAsTimestamp(PARAM_PaymentDate);
	p_isSOTrx = params.getParameterAsBool(PARAM_IsSOTrx);

	p_AllocDateTrx = params.getParameterAsTimestamp(PARAM_AllocDateTrx);
	if (p_AllocDateTrx == null)
	{
		p_AllocDateTrx = Env.getDate(getCtx());
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:21,代码来源:C_Payment_DiscountAllocation_Process.java

示例8: generateMovementHeader

import org.compiere.util.Env; //导入方法依赖的package包/类
private I_M_Movement generateMovementHeader(final I_M_InOut inOut)
{
	final I_M_Movement movement = InterfaceWrapperHelper.newInstance(I_M_Movement.class, inOut);

	// Use Login Date as movement date because some roles will relly on the fact that they can override it (08247)
	final Properties ctx = InterfaceWrapperHelper.getCtx(inOut);
	final Timestamp movementDate = Env.getDate(ctx);
	movement.setMovementDate(movementDate);

	movement.setDocStatus(IDocument.STATUS_Drafted);
	movement.setDocAction(IDocument.ACTION_Complete);

	// 06365: Also set the linked M_InOut entry to the movement
	movement.setM_InOut(inOut);

	InterfaceWrapperHelper.save(movement);

	return movement;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:20,代码来源:InOutMovementBL.java

示例9: doIt

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
protected String doIt() throws Exception
{
	husToReturn = streamSelectedHUs(Select.ONLY_TOPLEVEL).collect(ImmutableList.toImmutableList());
	if (husToReturn.isEmpty())
	{
		throw new AdempiereException("@[email protected]");
	}

	final Timestamp movementDate = Env.getDate(getCtx());
	Services.get(IHUInOutBL.class).createVendorReturnInOutForHUs(husToReturn, movementDate);
	return MSG_OK;
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:14,代码来源:WEBUI_M_HU_ReturnToVendor.java

示例10: getEffectiveRolePermissions

import org.compiere.util.Env; //导入方法依赖的package包/类
private final IUserRolePermissions getEffectiveRolePermissions(final I_PA_Goal goal)
{
	final int goalRoleId = goal.getAD_Role_ID();
	final int goalUserId = goal.getAD_User_ID();
	final Properties ctx = getCtx();
	final int contextUserId = Env.getAD_User_ID(ctx);
	final int contextClientId = Env.getAD_Client_ID(ctx);
	final Date contextDate = Env.getDate(ctx);

	IUserRolePermissions role = null;
	if (goalRoleId > 0)
	{
		role = Services.get(IUserRolePermissionsDAO.class).retrieveUserRolePermissions(
				goalRoleId,
				goalUserId > 0 ? goalUserId : contextUserId,
				contextClientId,
				contextDate);
	}
	else if (goalUserId > 0)
	{
		final List<IUserRolePermissions> roles = Services.get(IUserRolePermissionsDAO.class)
				.retrieveUserRolesPermissionsForUserWithOrgAccess(getCtx(), goalUserId, getAD_Org_ID());
		if (!roles.isEmpty())
		{
			role = roles.get(0);
		}
	}

	// Fallback
	if (role == null)
	{
		role = Env.getUserRolePermissions(ctx);
	}

	return role;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:37,代码来源:MMeasure.java

示例11: collectFacets

import org.compiere.util.Env; //导入方法依赖的package包/类
@Override
protected List<IFacet<I_PMM_PurchaseCandidate>> collectFacets(final IQueryBuilder<I_PMM_PurchaseCandidate> queryBuilder)
{
	final Timestamp today = Env.getDate(queryBuilder.getCtx());
	final List<Map<String, Object>> datePromised = queryBuilder
			.addNotEqualsFilter(I_PMM_PurchaseCandidate.COLUMN_DatePromised, null)
			.addCompareFilter(I_PMM_PurchaseCandidate.COLUMN_DatePromised, Operator.GREATER_OR_EQUAL, today)
			.create()
			.listDistinct(I_PMM_PurchaseCandidate.COLUMNNAME_DatePromised);

	final List<IFacet<I_PMM_PurchaseCandidate>> facets = new ArrayList<>(datePromised.size() + 1);
	for (final Map<String, Object> row : datePromised)
	{
		final IFacet<I_PMM_PurchaseCandidate> facet = createFacet(row);
		facets.add(facet);
	}
	

	//
	// Add Before Today facet
	facets.add(0, Facet.<I_PMM_PurchaseCandidate> builder()
			.setFacetCategory(getFacetCategory())
			.setDisplayName(" < " + dateFormat.format(today))
			.setFilter(TypedSqlQueryFilter.of(I_PMM_PurchaseCandidate.COLUMNNAME_DatePromised + "<" + DB.TO_DATE(today)))
			.build()
	);


	return facets;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:31,代码来源:PMM_PurchaseCandidate_DatePromised_FacetCollector.java

示例12: getMovementDate

import org.compiere.util.Env; //导入方法依赖的package包/类
private Timestamp getMovementDate()
{
	if (_movementDate == null)
	{
		_movementDate = Env.getDate(Env.getCtx()); // use login date by default
	}
	return _movementDate;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:9,代码来源:MultiCustomerHUReturnsInOutProducer.java

示例13: getMovementDateToUse

import org.compiere.util.Env; //导入方法依赖的package包/类
protected final Timestamp getMovementDateToUse()
{
	if (_movementDate != null)
	{
		return TimeUtil.asTimestamp(_movementDate);
	}

	final Properties ctx = getCtx();
	final Timestamp movementDate = Env.getDate(ctx); // use Login date (08306)
	return movementDate;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:12,代码来源:AbstractReturnsInOutProducer.java

示例14: getMovementDate

import org.compiere.util.Env; //导入方法依赖的package包/类
private Timestamp getMovementDate()
{
	if (_movementDate == null)
	{
		_movementDate = Env.getDate(Env.getCtx());
	}
	return _movementDate;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:9,代码来源:HUInternalUseInventoryProducer.java

示例15: getDateAcct

import org.compiere.util.Env; //导入方法依赖的package包/类
/**
 * task 09643: This date will be used, from now on, only as transaction date
 * 
 * @return suggested accounting date
 */
protected final Date getDateAcct()
{
	final Date dateAcct = calculateDateAcct();
	if (dateAcct != null)
	{
		return dateAcct;
	}

	// If no allocation date, use the login date
	return Env.getDate(getCtx());
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:17,代码来源:AbstractPaymentForm.java


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