jbo数据库取值

首先要配置web.xml

 <class name="BUSINESS_APPLY" label="申请信息" keyAttributes="SERIALNO">
            <attributes>
                <attribute name="SERIALNO" label="申请流水号" type="STRING" length="40"/>
                <attribute name="OCCURDATE" label="发生日期" type="STRING" length="10"/>
                <attribute name="CUSTOMERID" label="客户编号" type="STRING" length="40"/>
                <attribute name="CUSTOMERNAME" label="客户名称" type="STRING" length="80"/>
                <attribute name="BUSINESSTYPE" label="业务品种" type="STRING" length="10"/>
                <attribute name="PRODUCTID" label="产品编号" type="STRING" length="40"/>
                <attribute name="SPECIFICSERIALNO" label="产品版本流水号" type="STRING" length="40"/>
                <attribute name="BUSINESSSUBTYPE" label="业务分类类型(CodeNo:BusinessSubType)" type="STRING" length="10"/>
                <attribute name="OCCURTYPE" label="发生类型(CodeNo:CreditOccurType)" type="STRING" length="10"/>
                <attribute name="OPERATETYPE" label="贷款操作方式(CodeNo:CreditOperateType)" type="STRING" length="10"/>
                <attribute name="REVOLVEFLAG" label="授信循环使用标志(CodeNo:CreditRevolveFlag)" type="STRING" length="10"/>
                <attribute name="CONTRACTSIGNTYPE" label="签约方式(CodeNo:ContractSignType)" type="STRING" length="10"/>
                <attribute name="CONTRACTARTIFICIALNO" label="合同协议编号" type="STRING" length="40"/>
                <attribute name="BUSINESSCURRENCY" label="币种(CodeNo:Currency)" type="STRING" length="10"/>
                <attribute name="BUSINESSSUM" label="名义金额" type="DOUBLE" length="24" scale="2"/>
                <attribute name="BUSINESSTERM" label="期限" type="INT"/>
                <attribute name="BUSINESSTERMUNIT" label="期限单位(CodeNo:TermUnit)" type="STRING" length="10"/>
                <attribute name="MATURITYDATE" label="到期日期" type="STRING" length="10"/>
                <attribute name="DRAWDOWNTYPE" label="放款方式(CodeNo:DrawdownType)" type="STRING" length="10"/>
                <attribute name="FIRSTDRAWDOWNDATE" label="首次提款日期" type="STRING" length="10"/>
                <attribute name="GRACEPERIOD" label="贷款宽限期" type="INT"/>
                <attribute name="DIRECTION" label="行业投向" type="STRING" length="10"/>
                <attribute name="PURPOSETYPE" label="用途分类(CodeNo:BusinessPurposeType)" type="STRING" length="10"/>
                <attribute name="PURPOSEDESCRIPTION" label="用途" type="STRING" length="300"/>
                <attribute name="VOUCHTYPE" label="主要担保方式(CodeNo:VouchType)" type="STRING" length="80"/>
                <attribute name="RISKRATE" label="综合风险度" type="DOUBLE" length="12" scale="8"/>
                <attribute name="RISKGRADE" label="风险度(CodeNo:BusinessRiskGrade)" type="STRING" length="10"/>
                <attribute name="APPROVEORGID" label="终批机构编号" type="STRING" length="32"/>
                <attribute name="APPROVEUSERID" label="终批用户编号" type="STRING" length="32"/>
                <attribute name="APPROVEDATE" label="终批日期" type="STRING" length="10"/>
                <attribute name="APPROVESTATUS" label="审批状态(CodeNo:BusinessApproveStatus)" type="STRING" length="10"/>
                <attribute name="OPERATEORGID" label="经办机构" type="STRING" length="32"/>
                <attribute name="OPERATEUSERID" label="经办人" type="STRING" length="32"/>
                <attribute name="OPERATEDATE" label="经办日期" type="STRING" length="10"/>
                <attribute name="INPUTORGID" label="登记机构" type="STRING" length="32"/>
                <attribute name="INPUTUSERID" label="登记人" type="STRING" length="32"/>
                <attribute name="INPUTDATE" label="登记日期" type="STRING" length="10"/>
                <attribute name="INPUTTIME" label="登记时间" type="STRING" length="20"/>
                <attribute name="UPDATEDATE" label="更新日期" type="STRING" length="10"/>
                <attribute name="REMARK" label="备注" type="STRING" length="400"/>
                <attribute name="CLASSIFYRESULT" label="风险分类(CodeNo:ClassifyGrade10)" type="STRING" length="10"/>
                <attribute name="TEMPSAVEFLAG" label="暂存标志" type="STRING" length="10"/>
                <attribute name="MARKETCHANNELFLAG" label="业务渠道(CodeNo:MarketChannelFlag),合作方推荐,自主申请" type="STRING" length="10"/>
                <attribute name="SYSTEMCHANNELFLAG" label="业务来源(CodeNo:SystemChannelFlag),网上银行,电话银行" type="STRING" length="10"/>
                <attribute name="ACCOUNTINGORGID" label="入账机构编号" type="STRING" length="32"/>
                <attribute name="PAYMENTTYPE" label="付款方式(CodeNo:PaymentType)" type="STRING" length="10"/>
                <attribute name="PURPOSESUBTYPE" label="用途子类(CodeNo:BusinessPurposeSubType)" type="STRING" length="10"/>
                <attribute name="CLASSIFYMETHOD" label="风险分类方式(CodeNo:ClassifyMethod)" type="STRING" length="10"/>
                <attribute name="NONSTDINDICATOR" label="特殊业务标示(CodeNo:NonstandardIndicator)" type="STRING" length="10"/>
                <attribute name="BUSINESSPRIORITY" label="业务优先级(CodeNo:BusinessPriority)" type="STRING" length="10"/>
                <attribute name="BILLMAILFLAG" label="是否寄送账单(CodeNo:YesNo)" type="STRING" length="10"/>
                <attribute name="BILLADDRESSTYPE" label="账单寄送地址(CodeNo:AddressType)" type="STRING" length="10"/>
                <attribute name="EXCEPTREASON" label="例外贷款原因(CodeNo:ExceptCreditReason)" type="STRING" length="200"/>
                <attribute name="BUSINESSTERMDAY" label="期限(天)" type="INT"/>
                <attribute name="RESDERATIONREASONS" label="贷款复议原因(CodeNo:ResderationReasons)" type="STRING" length="10"/>
                <attribute name="ACCUFUNDREPAYFLAG" label="是否可以用公积金充还标识(CodeNo:YesNo)" type="STRING" length="10"/>
                <attribute name="RESDERATIONREMARK" label="复议备注" type="STRING" length="400"/>
                <attribute name="FUNDREPAYTYPE" label="公积金冲还贷方式(CodeNo:FundRepayType)" type="STRING" length="10"/>
                <attribute name="FUNDREPAYMONTH" label="公积金冲还贷月份(CodeNo:FundRepayMonth)" type="STRING" length="10"/>
                <attribute name="GUARANTYTYPE" label="担保类型(五位:1-信用0-保证0-抵押0-质押0-履约保险)" type="STRING" length="10"/>
                <attribute name="DUEBILLSERIALNO" label="借据编号" type="STRING" length="40"/>
                <attribute name="BATCHSERIALNO" label="批次流水号" type="STRING" length="40"/>
                <attribute name="PREAMOUNT1" label="预评估额度下限" type="DOUBLE" length="24" scale="6"/>
                <attribute name="PREAMOUNT2" label="预评估额度上限" type="DOUBLE" length="24" scale="6"/>
                <attribute name="LOANCHANNEL" label="贷款信息获取途径" type="STRING" length="80"/>
                <attribute name="HOUSECITY" label="房产地址(省市区)" type="STRING" length="18"/>
                <attribute name="HOUSEADD" label="房产地址" type="STRING" length="200"/>
                <attribute name="BUILDINGNAME" label="楼盘名称" type="STRING" length="200"/>
                <attribute name="BUILDINGAREA" label="房产面积" type="DOUBLE" length="10" scale="6"/>
                <attribute name="TRANSACTIONVALUE" label="房产成交价值" type="DOUBLE" length="24" scale="6"/>
                <attribute name="OBLIGEE" label="房产权利人(CodeNo:ObligeeStatus)" type="STRING" length="18"/>
                <attribute name="APPSERIALNO" label="App申请流水号" type="STRING" length="40"/>
                <attribute name="TDSEQ_ID" label="同盾查询ID" type="STRING" length="80"/>
                <attribute name="PRODUCTLEVEL" label="产品级别" type="STRING" length="18"/>
                <attribute name="LIABILITIES" label="负债比" type="DOUBLE" length="18"/>
                <attribute name="LIABILITIES1" label="负债比1" type="DOUBLE" length="100"/>
                <attribute name="SPECIFICID" label="专案产品编号" type="STRING" length="40"/>    
                <attribute name="OTHERDEBT" label="其他负债金额" type="DOUBLE" length="24" scale="6"/>
                <attribute name="ACCTPROVESUM" label="房产价值" type="DOUBLE" length="24" scale="6"/>
                <attribute name="ISHIGHFLOW" label="是否高流动性员工" type="STRING" length="10"/>
                <attribute name="AUTOBUSINESSSUM" label="自动审批额度" type="DOUBLE" length="10"/>
                <attribute name="MANUALBUSINESSSUM" label="人工核实额度" type="DOUBLE" length="10"/>
                <attribute name="APPROVALQUOTA" label="最终审批额度" type="DOUBLE" length="40"/>
                <attribute name="ISHIGHFLOW" label="是否高流动性员工" type="STRING" length="10"/>
                <attribute name="STATUS" label="状态" type="STRING" length="100"/>
                <attribute name="ADJMONTHSALARY"   label="调整后的月收入"  type="DOUBLE" length="24" scale="6"/>
                <attribute name="CALCULATESTATE" label="额度测算阶段" type="STRING" length="10"/>
                <attribute name="CUSRANK" label="员工职级" type="STRING" length="40"/>
                <attribute name="CUSWORKAGE" label="工作年限" type="STRING" length="40"/>
                <attribute name="ASSET" label="资产证明" type="STRING" length="40"/>
                <attribute name="PROPCERTIFICATE" label="个人房产证明" type="STRING" length="40"/>
                <attribute name="STATIONNAME" label="岗位名称" type="STRING" length="100"/>
                <attribute name="ISSPECIALSTATION" label="特殊岗位标识" type="STRING" length="10"/>
                <attribute name="OTHERMONTHPAYMENTSUM" label="其他月还款额" type="DOUBLE" length="24" scale="6"/>
                <attribute name="HOUSEVALUE" label="家庭房产价值(商品房)" type="DOUBLE" length="24" scale="6"/>
                <attribute name="HOMEASSET" label="家庭资产" type="DOUBLE" length="24" scale="6"/>
                <attribute name="PROFITMONTHSALARY" label="税后固定月薪" type="DOUBLE" length="24" scale="6"/>
                <attribute name="SUMMARYMONTHSALARY" label="最终核定月薪" type="DOUBLE" length="24" scale="6"/>
                <attribute name="MONTHSALARYCONSTANT" label="月收入调节系数" type="DOUBLE" length="10" scale="6"/>
                <attribute name="ISAMOUNTOVERTOP" label="是否触及金额上限" type="STRING" length="10"/>
                <attribute name="SPECIALPOSITIONFLAG" label="特殊岗位标识" type="STRING" length="10"/>
            </attributes>
            <manager>
                <managerProperties>
                    <property name="table" value="BUSINESS_APPLY" />
                    <property name="createKey" value="true" />
                </managerProperties>
            </manager>
        </class>

这是数据库配置的申请表信息

2.建立类连接

public class JBOUtil {
    public final static String JBO_BUSINESS_APPLY = "jbo.app.BUSINESS_APPLY";
    public final static String JBO_CUSTOMER_INFO = "jbo.customer.CUSTOMER_INFO";
    public final static String JBO_IND_INFO = "jbo.customer.IND_INFO";
    public final static String JBO_ACCT_RATE_SEGMENT = "jbo.acct.ACCT_RATE_SEGMENT";
    public final static String JBO_DEYUNSHENG_RECORD = "jbo.app.DEYUNSHENG_RECORD";
    public final static String JBO_LIMIT_RANK_WORKAGE = "jbo.app.LIMIT_RANK_WORKAGE";
    public final static String JBO_ACCT_BUSINESS_ACCOUNT = "jbo.acct.ACCT_BUSINESS_ACCOUNT";
    public final static String JBO_ACCT_RPT_SEGMENT = "jbo.acct.ACCT_RPT_SEGMENT";
    public static final String JBO_PRD_SPECIFIC_LIBRARY = "jbo.prd.PRD_SPECIFIC_LIBRARY";
    public final static String JBO_FLOW_TASK = "jbo.sys.FLOW_TASK";
    public final static String JBO_DOC_LIBRARY = "jbo.doc.DOC_LIBRARY";
    public final static String JBO_DOC_ATTACHMENT = "jbo.doc.DOC_ATTACHMENT";
    public final static String JBO_DOC_RELATIVE = "jbo.doc.DOC_RELATIVE";
    public static final String JBO_BUSINESS_CONTRACT = "jbo.app.BUSINESS_CONTRACT";
    public static final String JBO_LIMIT_PRD_LIBRARY = "jbo.prd.LIMIT_PRD_LIBRARY";
    public static final String JBO_INTEREST_RATE_CHANGE = "jbo.app.INTEREST_RATE_CHANGE";
}
3.最后是类方法调用数据库的数据

public static double getSysCalLimit(String baSerialno) throws Exception{
        BizObjectManager bmBA = JBOFactory.getBizObjectManager(JBOUtil.JBO_BUSINESS_APPLY);
        BizObject boBA = bmBA.createQuery(" serialno=:serialno").setParameter("serialno", baSerialno).getSingleResult(false);
        double businessSum = boBA.getAttribute("BUSINESSSUM").getDouble();
        double limitIncomeLiabiltyRate = boBA.getAttribute("LIABILITIES").getDouble();
        /*if(limitIncomeLiabiltyRate==0){
            return businessSum;//限制收入比为0或为空时返回原申请金额
        }*/ 
        String customerId = boBA.getAttribute("CUSTOMERID").getString();
        int businessTerm = boBA.getAttribute("BUSINESSTERM").getInt();
        if(businessTerm==0){
            throw new Exception("请确认贷款期限!");
        } 
        double monthPayment = LimitCalManage.getMonthPayment(baSerialno,businessSum,businessTerm,"RPT-01",false);//rs/(1-1/(1+r)^m) r:月利率  s:申请金额  m:贷款期限
        double newMonthPayment = getNewMonthPayment(baSerialno,customerId,limitIncomeLiabiltyRate);
        double newBusinessSum = businessSum*newMonthPayment/monthPayment;
        if(newBusinessSum<0){
            return -1;
        } 
        double maxBusinessSum = 2300000;
        System.err.println("businessSum-->"+businessSum);
        System.err.println("limitIncomeLiabiltyRate-->"+limitIncomeLiabiltyRate);
        System.err.println("businessTerm-->"+businessTerm);
        System.err.println("monthPayment-->"+monthPayment);
        System.err.println("newMonthPayment-->"+newMonthPayment);
        System.err.println("newBusinessSum-->"+newBusinessSum);
        
        return Math.min(maxBusinessSum, newBusinessSum);
    }

转载于:https://my.oschina.net/zhuguilin/blog/983027

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值