SysInitQuery 类是NC 参数的前后台公共服务类, 前后台使用参数的必须通过该接口调用

370 篇文章 110 订阅

SysInitQuery 类是NC 参数的前后台公共服务类, 前后台使用参数的必须通过该接口调用

package nc.pubitf.para;

import java.util.Map;

import nc.bs.framework.common.NCLocator;
import nc.itf.uap.busibean.ISysInitGetValue;
import nc.itf.uap.busibean.ISysInitQry;
import nc.itf.uap.busibean.SysinitAccessor;
import nc.pubitf.annotation.Description;
import nc.pubitf.annotation.MethodInfo;
import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.para.SysInitVO;
/**
 * <p>
 * <b>参数对外服务接口(绝大多数API通过缓存访问,少数未走缓存已标明),前后台皆可调用.</b>
 * </p>
 * 
 * @author <b>Origin(sxj) Maintainer(dengliang1)</b>
 * @since <b>NC5.0</b>
 */
@Description("参数的前后台公共服务类, 前后台使用参数的必须通过该接口调用")
public class SysInitQuery 
{
	/**
	 * <b>取某一组织下UFBoolean型参数值</b>
	 * 
	 * <p>
	 * <strong>最后修改人:sxj</strong>
	 * <p>
	 * <strong>最后修改日期:2006-3-14</strong>
	 * <p>
	 * 
	 * @param pk_org
	 *            最明细的组织主键:如果参数组织类型不能转换那么:如果参数为组织级的,为组织主键; 如果参数为集团级的,为集团主键;
	 *            如果参数为全局级的,为全局主键常量; 如果参数存在参数组织类型转换,那么请把pk_org设为较明细的级别主键,
	 *            例如果存在参数存在“集团-公司”的转换关系,请传公司主键
	 * @param initCode
	 *            参数编码
	 * 
	 * @return <tt>UFBoolean</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC5.0
	 */

	@MethodInfo(description = "根据组织主键、参数编码查询逻辑型参数值", parameterName = {"pk_org", "initCode" }, parameterDescrition = { "组织主键", "参数编码" })
	public static nc.vo.pub.lang.UFBoolean getParaBoolean(String pk_org, String initCode) throws BusinessException
	{
		return SysinitAccessor.getInstance().getParaBoolean(pk_org, initCode);
	}

	/**
	 * <b>取某一组织下UFDouble型参数值 如果组织主键和参数的类型不匹配,系统自动转换</b>
	 * 
	 * <p>
	 * <strong>最后修改人:sxj</strong>
	 * <p>
	 * <strong>最后修改日期:2006-3-14</strong>
	 * <p>
	 * 
	 * @param pk_org
	 *            最明细的组织主键:如果参数组织类型不能转换那么:如果参数为组织级的,为组织主键; 如果参数为集团级的,为集团主键;
	 *            如果参数为全局级的,为全局主键常量; 如果参数存在参数组织类型转换,那么请把pk_org设为较明细的级别主键,
	 *            例如果存在参数存在“集团-公司”的转换关系,请传公司主键
	 * @param initCode
	 *            参数编码
	 * 
	 * @return <tt>UFDouble</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC5.0
	 */
	@MethodInfo(description = "根据组织主键、参数编码查询UFDouble型参数值", parameterName = {"pk_org", "initCode" }, parameterDescrition = { "组织主键", "参数编码" })
	public static nc.vo.pub.lang.UFDouble getParaDbl(String pk_org, String initCode) throws BusinessException
	{
		return SysinitAccessor.getInstance().getParaDbl(pk_org, initCode);
	}

	/**
	 * <b>取某一组织下Integer型参数值</b>
	 * <p>
	 * <strong>最后修改人:sxj</strong>
	 * <p>
	 * <strong>最后修改日期:2006-3-14</strong>
	 * <p>
	 * 
	 * @param pk_org
	 *            最明细的组织主键:如果参数组织类型不能转换那么:如果参数为组织级的,为组织主键; 如果参数为集团级的,为集团主键;
	 *            如果参数为全局级的,为全局主键常量; 如果参数存在参数组织类型转换,那么请把pk_org设为较明细的级别主键,
	 *            例如果存在参数存在“集团-公司”的转换关系,请传公司主键
	 * @param initCode
	 *            参数编码
	 * 
	 * @return <tt>Integer</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC5.0
	 */
	@MethodInfo(description = "根据组织主键、参数编码查询整数型参数值", parameterName = {"pk_org", "initCode" }, parameterDescrition = { "组织主键", "参数编码" })
	public static java.lang.Integer getParaInt(String pk_org, String initCode) throws BusinessException
	{
		return SysinitAccessor.getInstance().getParaInt(pk_org, initCode);
	}

	/**
	 *<b>取某一组织下String型参数值</b>
	 * <p>
	 * <strong>最后修改人:sxj</strong>
	 * <p>
	 * <strong>最后修改日期:2006-3-14</strong>
	 * <p>
	 * 
	 * @param pk_org
	 *            最明细的组织主键:如果参数组织类型不能转换那么:如果参数为组织级的,为组织主键; 如果参数为集团级的,为集团主键;
	 *            如果参数为全局级的,为全局主键常量; 如果参数存在参数组织类型转换,那么请把pk_org设为较明细的级别主键,
	 *            例如果存在参数存在“集团-公司”的转换关系,请传公司主键
	 * @param initCode
	 *            参数编码
	 * 
	 * @return <tt>String</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC5.0
	 */
	@MethodInfo(description = "根据组织主键、参数编码查询字符型参数值", parameterName = {"pk_org", "initCode" }, parameterDescrition = { "组织主键", "参数编码" })
	public static java.lang.String getParaString(String pk_org, String initCode) throws BusinessException
	{
		return SysinitAccessor.getInstance().getParaString(pk_org, initCode);
	}

	/**
	 * <b>取某一组织下的指定批量参数值</b>
	 * 
	 * <p>
	 * <strong>最后修改人:sxj</strong>
	 * <p>
	 * <strong>最后修改日期:2006-3-14</strong>
	 * <p>
	 * 
	 * @param pk_org
	 *            最明细的组织主键:如果参数组织类型不能转换那么:如果参数为组织级的,为组织主键; 如果参数为集团级的,为集团主键;
	 *            如果参数为全局级的,为全局主键常量; 如果参数存在参数组织类型转换,那么请把pk_org设为较明细的级别主键,
	 *            例如果存在参数存在“集团-公司”的转换关系,请传公司主键
	 * @param initCodeAry
	 *            参数编码数组
	 * 
	 * @return <tt>Map</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC5.0
	 */
	@MethodInfo(description = "根据组织主键、参数编码数组批查询参数值", parameterName = {"pk_org", "initCodeAry" }, parameterDescrition = { "组织主键", "参数编码数组" })
	public static Map<String, String> queryBatchParaValues(String pk_org, String[] initCodeAry) throws BusinessException
	{
		return (Map<String, String>) SysinitAccessor.getInstance().queryBatchParaValues(pk_org, initCodeAry);
	}

	/**
	 * <b>取某一组织下参数对象</b>
	 * 
	 * <p>
	 * <strong>最后修改人:sxj</strong>
	 * <p>
	 * <strong>最后修改日期:2006-3-14</strong>
	 * <p>
	 * 
	 * @param pk_org
	 *            最明细的组织主键:如果参数组织类型不能转换那么:如果参数为组织级的,为组织主键; 如果参数为集团级的,为集团主键;
	 *            如果参数为全局级的,为全局主键常量; 如果参数存在参数组织类型转换,那么请把pk_org设为较明细的级别主键,
	 *            例如果存在参数存在“集团-公司”的转换关系,请传公司主键
	 * @param initCode
	 *            参数编码
	 * 
	 * @return <tt>{@link SysInitVO}</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC5.0
	 */
	@MethodInfo(description = "根据组织主键、参数编码查询参数VO", parameterName = { "pk_org", "initCode" }, parameterDescrition = { "组织主键", "参数编码" })
	public static SysInitVO querySysinitVO(String pk_org, String initCode) throws BusinessException
	{
		return SysinitAccessor.getInstance().getSysInitVO(pk_org, initCode);
	}

	/**
	 * <b>取某一组织某一组编码的参数对象(不走缓存)</b>
	 * 
	 * <p>
	 * <strong>最后修改人:sxj</strong>
	 * <p>
	 * <strong>最后修改日期:2006-3-14</strong>
	 * <p>
	 * 
	 * @param pk_org
	 *            组织主键(暂不支持组织转换情形)
	 * @param groupCode
	 *            组编码
	 * 
	 * @return <tt>{@link SysInitVO[]}</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC5.0
	 */
	public static SysInitVO[] querySysInit(String pk_org, String groupCode) throws BusinessException
	{
		return NCLocator.getInstance().lookup(ISysInitQry.class).querySysInit(pk_org, groupCode);
	}

	/**
	 * <b>取某一参数代码下批量组织的参数值(不走缓存)</b>
	 * <p>
	 * <b>根据组织主键数据和initcode返回一个map数据结构(key-组织主键,value-参数值)</b>
	 * </p>
	 * 
	 * <p>
	 * <strong>最后修改人:dengliang1</strong>
	 * <p>
	 * <strong>最后修改日期:2012-07-02</strong>
	 * <p>
	 * 
	 * @param pk_orgs
	 *            组织主键数组,若该参数是支持组织转换模式请传入较小的组织主键(如‘集团-公司’请传入公司主键)
	 * @param initcode
	 *            参数代码
	 * 
	 * @return <tt>{@link Map<String, String>}</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC6.1
	 */
	public static Map<String, String> getBatchParaString(String[] pk_orgs, String initcode) throws BusinessException
	{
		return NCLocator.getInstance().lookup(ISysInitGetValue.class).getBatchParaString(pk_orgs, initcode);
	}

	/**
	 * <b>取某一参数代码下批量组织的参数值(不走缓存)</b>
	 * <p>
	 * <b>根据组织主键数据和initcode返回一个map数据结构(key-组织主键,value-参数值)</b>
	 * </p>
	 * 
	 * <p>
	 * <strong>最后修改人:dengliang1</strong>
	 * <p>
	 * <strong>最后修改日期:2012-07-02</strong>
	 * <p>
	 * 
	 * @param pk_orgs
	 *            组织主键数组,若该参数是支持组织转换模式请传入较小的组织主键(如‘集团-公司’请传入公司主键)
	 * @param initcode
	 *            参数代码
	 * 
	 * @return <tt>{@link Map<String, UFBoolean>}</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC6.1
	 */
	public static Map<String, UFBoolean> getBatchParaBoolean(String[] pk_orgs, String initcode) throws BusinessException
	{
		return NCLocator.getInstance().lookup(ISysInitGetValue.class).getBatchParaBoolean(pk_orgs, initcode);
	}

	/**
	 * <b>取某一参数代码下批量组织的参数值(不走缓存)</b>
	 * <p>
	 * <b>根据组织主键数据和initcode返回一个map数据结构(key-组织主键,value-参数值)</b>
	 * </p>
	 * 
	 * <p>
	 * <strong>最后修改人:dengliang1</strong>
	 * <p>
	 * <strong>最后修改日期:2012-07-02</strong>
	 * <p>
	 * 
	 * @param pk_orgs
	 *            		组织主键数组,若该参数是支持组织转换模式请传入较小的组织主键(如‘集团-公司’请传入公司主键)
	 * @param initcode
	 *           		 参数代码
	 * 
	 * @return <tt>{@link Map<String, Integer>}</tt>对象
	 * 
	 * @throws BusinessException
	 * 
	 * @since NC6.1
	 */
	public static Map<String, Integer> getBatchParaInt(String[] pk_orgs, String initcode) throws BusinessException
	{
		return NCLocator.getInstance().lookup(ISysInitGetValue.class).getBatchParaInt(pk_orgs, initcode);
	}
	
	/**
	 * <b>传入sysinitvo对象,获取与其同模块同组织下的参数数组(sysinitvo本身除外)</b>
	 * <P>
	 * <b>(若没有结果则返回空的数组)</b>
	 * 
	 * @param sysinitvo 
	 * 				给定的参数对象
	 * 
	 * @return SysInitVO[] 
	 * 				参数对象数组
	 * 
	 * @throws BusinessException
	 * 
	 * @Since NC6.3
	 */
	public static SysInitVO[] querySysinitArrayUnderSpecifiedModulePkOrg(SysInitVO sysinitvo) throws BusinessException
	{
		return NCLocator.getInstance().lookup(ISysInitQry.class).querySysinitArrayUnderSpecifiedModulePkOrg(sysinitvo);
	}
}

比如总账调用这个接口进行封装的类:

package nc.itf.glcom.para;

import nc.bs.logging.Logger;
import nc.itf.org.IOrgConst;
import nc.pubitf.para.SysInitQuery;
import nc.pubitf.uapbd.PriceAccuracyUtil;
import nc.vo.bd.currtype.CurrtypeVO;
import nc.vo.fipub.utils.StrTools;
import nc.vo.gateway60.itfs.Currency;
import nc.vo.gateway60.itfs.ICurrtypeConst;
import nc.vo.gateway60.pub.GlBusinessException;
import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.lang.UFDouble;

import org.apache.commons.lang.StringUtils;

/**
 * 
 * <p>
 * 总账参数获取工具类
 * 
 * 参数编码定义:GLParaCodeConst
 * 
 * 参数值定义:GLParaValueConst
 * </p>
 *
 * 修改记录:<br>
 * <li>修改人:修改日期:修改内容:</li>
 * <br><br>
 *
 * @see 
 * @author hurh
 * @version V6.0
 * @since V6.0 创建时间:2011-7-5
 */
public class GLParaAccessor {
	
	/**
	 * 
	 * 根据组织主键、参数编码查询逻辑型参数值
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @param code
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 * @hurh
	 */
	public static UFBoolean getParaBoolean(String pk_org, String code) throws BusinessException{
		try {
			return SysInitQuery.getParaBoolean(pk_org, code);
		} catch (BusinessException e) {
			Logger.error("获取参数错误:【" + code + "】" + e.getMessage(), e);
			throw new BusinessException(e.getMessage(), e);
		}
	}
	
	/**
	 * 
	 * 根据组织主键、参数编码查询字符型参数值
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @param code
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 * @hurh
	 */
	public static String getParaString(String pk_org, String code) throws BusinessException{
		try {
			return SysInitQuery.getParaString(pk_org, code);
		} catch (BusinessException e) {
			Logger.error("获取参数错误:【" + code + "】" + e.getMessage(), e);
			throw new BusinessException(e.getMessage(), e);
		}
	}
	
	/**
	 * 
	 * 根据组织主键、参数编码查询整数型参数值
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @param code
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 * @hurh
	 */
	public static Integer getParaInt(String pk_org, String code) throws BusinessException{
		try {
			return SysInitQuery.getParaInt(pk_org, code);
		} catch (BusinessException e) {
			Logger.error("获取参数错误:【" + code + "】" + e.getMessage(), e);
			throw new BusinessException(e.getMessage(), e);
		}
	}
	
	/**
	 * 
	 * 根据组织主键、参数编码查询UFDouble型参数值
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @param code
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFDouble getParaDouble(String pk_org, String code) throws BusinessException{
		try {
			return SysInitQuery.getParaDbl(pk_org, code);
		} catch (BusinessException e) {
			Logger.error("获取参错误:【" + code + "】" + e.getMessage(), e);
			throw new BusinessException(e.getMessage(), e);
		}
	}
	
	/**
	 * 
	 * 获取参数GL120:是否支持二级核算单位
	 * <p>修改记录:</p>
	 * @param accountingbook
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isSecondBUStart(String pk_org) throws BusinessException {
		if(pk_org == null){
			Logger.error("组织为空。");
			return UFBoolean.FALSE;
		}
		//pk_org = AccountBookUtil.getPk_orgByAccountBookPk(pk_org);
		return getParaBoolean(pk_org, GLParaCodeConst.IS_SECONDBUSTART);
	}
	
	/**
	 * 
	 * 获取参数GL121:是否按业务单元进行平衡检查
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isBUBalanceCheck(String pk_org) throws BusinessException {
		return getParaBoolean(pk_org, GLParaCodeConst.IS_BUBALANCECHK);
	}
	
	/**
	 * 
	 * 获取参数GL080:核销日期(凭证日期、业务日期)
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static String getVerifyDate(String pk_org) throws BusinessException {
		return getParaString(pk_org, GLParaCodeConst.S_VERIFYDATE);
	}
	
	/**
	 * 
	 * 获取参数GL116:是否校验集团本币借贷平衡(不控制、提示、控制)
	 * <p>修改记录:</p>
	 * @param accountingbook
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static String getGroupAmountCtrl(String pk_org) throws BusinessException{
		return getParaString(pk_org, GLParaCodeConst.S_GROUPAMOUNT_BALANCECTL);
	}
	
	/**
	 * 
	 * 获取参数GL118:是否校验全局本币借贷平衡(不控制、提示、控制)
	 * <p>修改记录:</p>
	 * @param accountingbook
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static String getGlobalAmountCtrl(String pk_org) throws BusinessException{
		return getParaString(pk_org, GLParaCodeConst.S_GLOBALAMOUNT_BALANCECTL);
	}
	
	/**
	 * 
	 * 获取参数GL066:上月未结账本月是否能记账
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isThisMonCanTally(String pk_org) throws BusinessException{
		return getParaBoolean(pk_org, GLParaCodeConst.IS_TALLYENABLE_NOSETTLE);
	}
	
	/**
	 * 
	 * 获取参数GL020:是否允许反关账
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isUnCloseEnable(String pk_org) throws BusinessException{
		return getParaBoolean(pk_org, GLParaCodeConst.IS_UNCLOSEENABLE);
	}
	
	/**
	 * 
	 * 获取参数GL112:是否支持提前关账
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isPreCloseEnable(String pk_org) throws BusinessException{
		return getParaBoolean(pk_org, GLParaCodeConst.IS_PRECLOSEENABLE);
	}
	
	/**
	 * 
	 * 获取参数NC001:集团本位币计算方式
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static String getGroupConvertModel(String pk_org) throws BusinessException{
		return getParaString(pk_org, GLParaCodeConst.S_GROUPCONVERTMODEL);
	}
	
	/**
	 * 
	 * 获取参数NC002:全局本位币计算方式
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static String getGlobalConvertModel(String pk_org) throws BusinessException{
		return getParaString(pk_org, GLParaCodeConst.S_GLOBALCONVERTMODEL);
	}
	
	/**
	 * 
	 * 组织是否启用集团本位币
	 * <p>修改记录:</p>
	 * @param pk_group
	 * @return
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isStartGroupCurr(String pk_org){
		String para;
		try {
			para = getGroupConvertModel(pk_org);
		} catch (BusinessException e) {
			Logger.error(e.getMessage(), e);
			throw new GlBusinessException(e.getMessage(), e);
		}
		UFBoolean model = UFBoolean.valueOf(StringUtils.isNotBlank(para) && !para.equals(GLParaValueConst.GROUP_DISABLE));
		return model;
	}
	
	/**
	 * 
	 * 是否启用全局本位币
	 * <p>修改记录:</p>
	 * @return
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isStartGlobalCurr(){
		String para;
		try {
			para = getGlobalConvertModel(IOrgConst.GLOBEORG);
		} catch (BusinessException e) {
			Logger.error(e.getMessage(), e);
			throw new GlBusinessException(e.getMessage(), e);
		}
		UFBoolean model = UFBoolean.valueOf(StringUtils.isNotBlank(para) && !para.equals(GLParaValueConst.GLOBAL_DISABLE));
		return model;
	}
	
	/**
	 * 
	 * 获取参数GL112:(提前)关账检查内部交易对账是否完成
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isCloseCheckContrast(String pk_org) throws BusinessException{
		return getParaBoolean(pk_org, GLParaCodeConst.IS_CLOSECHKCONTRAST);
	}
	
	/**
	 * 
	 * 获取参数GL093:辅助项为空是否显示
	 * <p>修改记录:</p>
	 * @param pk_org 
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isDisplayNullFree(String pk_org) throws BusinessException{
		return getParaBoolean(pk_org, GLParaCodeConst.IS_DISPLAYNULLFREE);
	}
	
	/**
	 * 
	 * 是否允许反记账
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isUnTallyable(String pk_org) throws BusinessException{
		return UFBoolean.TRUE;
	}

	/**
	 * 
	 * 获取参数GL033:检查凭证断号的环节
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static String getChkBreakNOStep(String pk_org) throws BusinessException{
		return getParaString(pk_org, GLParaCodeConst.S_CHKBREAKNOSTEP);
	}
	
	/**
	 * 
	 * 获取参数GL106:公有协调核算账簿
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static String getReconPk_accountingbook(String pk_org) throws BusinessException{
		return getParaString(pk_org, GLParaCodeConst.S_RECONCILE);
	}
	
	/**
	 * 
	 * 获取参数GL034:关账检查业务系统是否结账的财务核算账簿
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.1
	 */
	public static String getCloseChkAccBook(String pk_org) throws BusinessException{
		return getParaString(pk_org, GLParaCodeConst.S_CLOSECHK_ACCBOOK);
	}
	
	/**
	 * 
	 * 凭证打印是否检查凭证断号
	 * <p>修改记录:</p>
	 * @param pk_org
	 * @return
	 * @throws BusinessException
	 * @see 
	 * @since V6.0
	 */
	public static UFBoolean isPrintChkBreakNO(String pk_org) throws BusinessException{
		String value = getChkBreakNOStep(pk_org);
		if (value == null || "".equals(value)){
			value = GLParaValueConst.GL033_VOUCHER_PRINT;
		}
		if(GLParaValueConst.GL033_VOUCHER_PRINT.equals(value)){
			return UFBoolean.TRUE;
		}
		return UFBoolean.FALSE;
	}
	/**
	 * 根据币种得到单价精度
	 * @param pk_currtype
	 * @return
	 */
	public static int[] getPricePrecision(String pk_currtype){
		Integer priceDigit = ICurrtypeConst.CURRTYPE_DEFAULT_DIGIT;
		Integer priceRoundMod = UFDouble.ROUND_HALF_UP;
		if(!StrTools.isEmptyStr(pk_currtype)&&!pk_currtype.equals("ZZZZZZZZZZZZZZZZZZZZ")){
			try {
				priceDigit = PriceAccuracyUtil.getInstance().getPriceAccuracyValuePair(pk_currtype).getPriceAccuracy();
				if(priceDigit==null){
					priceDigit = 4;
				}
				priceRoundMod = PriceAccuracyUtil.getInstance().getPriceAccuracyValuePair(pk_currtype).getRoundMode();
				if(priceRoundMod==null){
					priceRoundMod = UFDouble.ROUND_HALF_UP;
				}
			} catch (Exception e) {
				Logger.error(e.getMessage(), e);
			}
		}
		return new int[]{priceDigit, priceRoundMod};
	}
}

使用案例:GLParaAccessor.isSecondBUStart(pk_org);

package nc.vo.pub.para;

import nc.vo.pub.SuperVO;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.lang.UFDate;
import nc.vo.pub.lang.UFDateTime;

/**
 * 参数设置业务对象.
 * <p>
 * <strong>拥有者:</strong>UAP
 * <p>
 * <strong>设计状态:</strong>详细
 * <p>
 * 
 * @version (业务对象版本)
 * @author (作者/最后修改人)
 * @since (开始使用的NC版本)
 */

public class SysInitVO extends SuperVO {
	/**
	 * <code>serialVersionUID</code> 的注释
	 */
	private static final long serialVersionUID = 1L;

	// sysinit pk
	private String pk_sysinit;

	// sysinit joins with sysinittemp
	private String sysinit;

	// parameter code
	private String initcode;

	// parameter name
	private String initname;

	// parameter value
	private String value;

	// the flag that indicates whether the parameter can be editted
	private UFBoolean editflag;

	// the flag that indicates whether the parameter can control the subordinate
	// parameter
	private UFBoolean controlflag;

	// parameter change flag;
	private boolean change = false;

	// 2001-12-25
	private UFDate loginDate = null;

	// pk_org 组织主键
	private String pk_org;

	// 下级单位名称
	private String subUnitName;

	// 标志位,记录当上级有控制下级状态变为放弃对下级控制状态
	private UFBoolean YtoN = UFBoolean.valueOf(false); 

	private Integer dr = Integer.valueOf(0);

	private UFDateTime ts;

	private String modifier;

	/**
	 * 为了满足分布式需求添加的属性
	 */
	private java.lang.Integer dataoriginflag = 0;

	public String getModifier() {
		return modifier;
	}

	public void setModifier(String modifier) {
		this.modifier = modifier;
	}

	public UFDateTime getModifiedTime() {
		return modifiedTime;
	}

	public void setModifiedTime(UFDateTime modifiedTime) {
		this.modifiedTime = modifiedTime;
	}

	private UFDateTime modifiedTime;

	public SysInitVO() {

	}

	/**
	 * 使用主键进行初始化的构造子。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @param ??fieldNameForMethod?? 主键值
	 */
	public SysInitVO(String newPk_sysinit) {

		// 为主键字段赋值:
		pk_sysinit = newPk_sysinit;

	}

	/**
	 * 根类Object的方法,克隆这个VO对象。
	 * 
	 * 创建日期:(2001-5-28)
	 */
	public Object clone() 
	{

		// 复制基类内容并创建新的VO对象:
		Object o = null;
		try 
		{
			o = super.clone();
		} 
		catch (Exception e)
		{
			throw new RuntimeException("clone not supported!");
		}
		return o;
	}

	/**
	 * 返回对象标识,用来唯一定位对象。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @return String
	 */
	public String getPrimaryKey() {

		return pk_sysinit;
	}

	/**
	 * 设置对象标识,用来唯一定位对象。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @param m_pk_sysinit
	 *            String
	 */
	public void setPrimaryKey(String newPk_sysinit) {

		pk_sysinit = newPk_sysinit;
	}

	/**
	 * 属性m_pk_sysinit的Getter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @return String
	 */
	public String getPk_sysinit() {
		return pk_sysinit;
	}

	/**
	 * 属性m_sysinit的Getter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @return String
	 */
	public String getSysinit() {
		return sysinit;
	}

	/**
	 * 属性m_initcode的Getter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @return String
	 */
	public String getInitcode() {
		return initcode;
	}

	/**
	 * 属性m_initname的Getter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @return String
	 */
	public String getInitname() {
		return initname;
	}

	/**
	 * 属性m_value的Getter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @return String
	 */
	public String getValue() {
		return value;
	}

	/**
	 * 属性m_editflag的Getter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @return UFBoolean
	 */
	public UFBoolean getEditflag() {
		return editflag;
	}

	public void setPk_sysinit(String newPk_sysinit) {

		pk_sysinit = newPk_sysinit;
	}

	/**
	 * 属性m_sysinit的setter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @param newM_sysinit
	 *            String
	 */
	public void setSysinit(String newSysinit) {

		sysinit = newSysinit;
	}

	/**
	 * 属性m_initcode的setter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @param newM_initcode
	 *            String
	 */
	public void setInitcode(String newInitcode) {

		initcode = newInitcode;
	}

	/**
	 * 属性m_initname的setter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @param newM_initname
	 *            String
	 */
	public void setInitname(String newInitname) {

		initname = newInitname;
	}

	/**
	 * 属性m_value的setter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @param newM_value
	 *            String
	 */
	public void setValue(String newValue) {

		value = newValue;
	}

	/**
	 * 属性m_editflag的setter方法。
	 * 
	 * 创建日期:(2001-5-28)
	 * 
	 * @param newM_editflag
	 *            UFBoolean
	 */
	public void setEditflag(UFBoolean newEditflag) {

		editflag = newEditflag;
	}

	/**
	 * 此处插入方法说明。 创建日期:(2001-12-25 17:39:22)
	 * 
	 * @return nc.vo.pub.lang.UFDate
	 */
	public nc.vo.pub.lang.UFDate getLoginDate() {
		return loginDate;
	}

	/**
	 * 此处插入方法说明。 创建日期:(2001-8-9 14:22:52)
	 * 
	 * @return boolean
	 */
	public boolean isChange() {
		return change;
	}

	/**
	 * 此处插入方法说明。 创建日期:(2002-10-31 16:31:33)
	 * 
	 * @param newChange
	 *            boolean
	 */
	public void setChange(boolean newChange) {
		change = newChange;
	}

	/**
	 * 此处插入方法说明。 创建日期:(2001-12-25 17:39:22)
	 * 
	 * @param newM_loginDate
	 *            nc.vo.pub.lang.UFDate
	 */
	public void setLoginDate(nc.vo.pub.lang.UFDate newM_loginDate) {
		loginDate = newM_loginDate;
	}

	/**
	 * @return 返回 m_pk_org。
	 */
	public String getPk_org() {
		return pk_org;
	}

	/**
	 * @param m_pk_org
	 *            要设置的 m_pk_org。
	 */
	public void setPk_org(String m_pk_org) {
		this.pk_org = m_pk_org;
	}

	/**
	 * @return 返回 m_subUnitName。
	 */
	public String getSubUnitName() {
		return subUnitName;
	}

	/**
	 * @param unitName
	 *            要设置的 m_subUnitName。
	 */
	public void setSubUnitName(String unitName) {
		subUnitName = unitName;
	}

	/*
	 * (非 Javadoc)
	 * 
	 * @see nc.vo.pub.SuperVO#getParentPKFieldName()
	 */
	public String getParentPKFieldName() {
		// TODO 自动生成方法存根
		return null;
	}

	/*
	 * (非 Javadoc)
	 * 
	 * @see nc.vo.pub.SuperVO#getPKFieldName()
	 */
	public String getPKFieldName() {
		// TODO 自动生成方法存根
		return "pk_sysinit";
	}

	/*
	 * (非 Javadoc)
	 * 
	 * @see nc.vo.pub.SuperVO#getTableName()
	 */
	public String getTableName() {
		// TODO 自动生成方法存根
		return "pub_sysinit";
	}

	/**
	 * @return 返回 m_dr。
	 */
	public Integer getDr() {
		return dr;
	}

	/**
	 * @param m_dr
	 *            要设置的 m_dr。
	 */
	public void setDr(Integer m_dr) {
		this.dr = m_dr;
	}

	/**
	 * @return 返回 m_ts。
	 */
	public UFDateTime getTs() {
		return ts;
	}

	/**
	 * @param m_ts
	 *            要设置的 m_ts。
	 */
	public void setTs(UFDateTime m_ts) {
		this.ts = m_ts;
	}

	public void changeFlagAndNewMakeDate(boolean flag) {
		setChange(flag);
		// if (flag) {
		// setModifiedTime(getLoginDate() == null ? new UFDate(
		// new java.util.Date().getTime()) : getLoginDate());
		// }
	}

	public UFBoolean getControlflag() {
		return controlflag;
	}

	public void setControlflag(UFBoolean m_controlflag) {
		this.controlflag = m_controlflag;
	}

	public UFBoolean getM_YtoN() {
		return YtoN;
	}

	public void setM_YtoN(UFBoolean ytoN) {
		YtoN = ytoN;
	}

	/**
	 * 属性dataoriginflag的Getter方法. 创建日期:$vmObject.createdDate
	 * 
	 * @return java.lang.Integer
	 */
	public java.lang.Integer getDataoriginflag() {
		return dataoriginflag;
	}

	/**
	 * 属性dataoriginflag的Setter方法. 创建日期:$vmObject.createdDate
	 * 
	 * @param newDataoriginflag
	 *            java.lang.Integer
	 */
	public void setDataoriginflag(java.lang.Integer newDataoriginflag) {
		this.dataoriginflag = newDataoriginflag;
	}
}

查询系统参数sql:

select * from ncdb.pub_sysinit
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值