1. 整体额度可以进行按照产品、币种进行切分,也可以不切分。如果不切分,按照整体额度进行控制,不考虑产品明细;如果进行了切分,则按照切分的产品明细进行额度控制。
特别说明:
(一) 整体额度一旦切分,就必须全部切分,不能只切分部分。
(二) 授信品种只能选择到细类。
(三) 同一业务品种、同一币种只能有一条记录,品种间不能串用。
注意:对金额按照同一币种进行比较,已分配的子额度有可能是不同币种的,可以统一按照总额度的币种汇率进行转换在比较。
//在CL_INFO表中取到授信总额 sSql = "select LineSum1,getERate1('"+sCurrency+"',Currency) as ERateValue, Currency from CL_INFO where LineID='"+sParentLineID+"'"; rs = Sqlca.getASResultSet(sSql); while(rs.next()) { dLineSum = rs.getDouble("LineSum1"); dERateValue = rs.getDouble("ERateValue"); sParentCurrency = rs.getString("Currency"); } rs.getStatement().close();
//查找已分配的子额度业务类型 sSql = "select BusinessType from CL_INFO where LineID <> '" + sLineID + "'" + " and ParentLineID = '" + sParentLineID + "'"; rs = Sqlca.getASResultSet(sSql); iCount = rs.getRowCount(); sBusinessTypes = new String[iCount]; int i=0; while(rs.next()) { sBusinessTypes[i] = rs.getString("BusinessType"); i++; } rs.getStatement().close(); for(i=0;i<iCount;i++) { if(sBusinessType.equals(sBusinessTypes[i]) || sBusinessType.startsWith(sBusinessTypes[i])){ flag4 = true; } } //查找已分配的子额度币种类型 sSql = "select Currency from CL_INFO where LineID <> '" + sLineID + "'" + " and ParentLineID = '" + sParentLineID + "'"; rs = Sqlca.getASResultSet(sSql); iCount = rs.getRowCount(); sCurrencyTypes = new String[iCount]; int j=0; while(rs.next()) { sCurrencyTypes[j] = rs.getString("Currency"); j++; } rs.getStatement().close(); for(i=0;i<iCount;i++) { if(sCurrency.equals(sCurrencyTypes[i])){ flag5 = true; } } //两个标志位同时为真时说明有重复子额度 if(flag4&&flag5){ flag3 = "99"; }
//计算已分配的子额度的总额 sSql = "select LineSum1,getERate1(Currency,'"+sParentCurrency+"') as ERateValue from CL_INFO where ParentLineID='"+sParentLineID+"' AND LineID <> '"+sLineID+"'"; rs = Sqlca.getASResultSet(sSql); iCount = rs.getRowCount(); dSubLineSum = new double[iCount]; int k=0; while(rs.next()) { dSubLineSum[k] = rs.getDouble("LineSum1")*rs.getDouble("ERateValue"); i++; } rs.getStatement().close(); //如果当前授信限额加已分配限额大于授信总额,则超额 //对授信限额进行汇率控制 dSubLineSum1=dSubLineSum1*dERateValue; for(int m=0; m<dSubLineSum.length;m++){ dSubLine = dSubLine + dSubLineSum[m]; } System.out.println(dSubLine + dSubLineSum1); if(dSubLine + dSubLineSum1 > dLineSum){ flag2 = true; } //如果授信限额大于授信总额,则超额 if(dSubLineSum1 > dLineSum) flag1 = true;