IRR计算添加GPS差额和个人意外险差额

This commit is contained in:
32189 2021-04-23 16:16:52 +08:00
parent 546b8389f8
commit 7f11dc61d5
2 changed files with 33 additions and 13 deletions

View File

@ -97,6 +97,24 @@ public class CashFlowExecutor {
private void add(ConditionBean cb,TabCalBean tcb) throws Exception{
Map<String, Map<String, String>> productRevenues = tcb.getProductRevenues();
String GPSDifference = "0";//获取产品中的GPS差额配置
Map<String, String> GPSMap = productRevenues == null ? null : productRevenues.get( "GPSDifference" );
if( GPSMap != null && GPSMap.size() > 0){
GPSDifference = GPSMap.get("GPSDifference");
if( GPSDifference == null || GPSDifference.isEmpty() ){
GPSDifference = "0";
}
}
String personalInsuranceDifference = "0" ;//获取产品中的个人意外险差额配置
Map<String, String> pidMap = productRevenues == null ? null : productRevenues.get( "personalInsuranceDifference" );
if( pidMap != null && pidMap.size() > 0){
personalInsuranceDifference = pidMap.get("personalInsuranceDifference");
if( personalInsuranceDifference == null || personalInsuranceDifference.isEmpty() ){
personalInsuranceDifference = "0";
}
}
String sql = "";
if("MYSQL".equals(InitDBType.DBTYPE)){
sql += "INSERT INTO " +Tools.getTable(tcb.getContractCashTb())+ " (id," + tcb.getPlanCName() + "";
@ -128,12 +146,14 @@ public class CashFlowExecutor {
sql +=" from "+Tools.getTable(tcb.getFundFundPlan_tb())+" fundplan " ;
sql +=" left join code_library tdd on fundplan.fee_type = tdd.itemno and tdd.codeno='FeeType' " ;
sql +=" where fundplan.flowunid = '"+ tcb.getDocId()+"' and fundplan."+tcb.getPlanCName()+"='"+tcb.getPlanCValue()+"' and fundplan.fee_type in ('feetype2','feetype1','feetype10','feetype16','feetype17','feetype33') ";
//如果是灵活产品减去产品中配置的GPS差额
if("Y".equals( cb.getFlexible() ) ){
Map<String, Map<String, String>> productRevenue = tcb.getProductRevenues();
String GPSDifference = productRevenues.get( "GPSDifference" ).get( "GPSDifference" );
//根据客户张文竹不管是否灵活产品配置的GPS差额和个人意外险差额添加到IRR计算
if( !"0".equals(personalInsuranceDifference) ){
sql +=" union all select plan_date,'"+personalInsuranceDifference+"' flowin,'个人意外险差额:"+personalInsuranceDifference+"' flowindetail,'' flowout,'' flowoutdetil,'"+personalInsuranceDifference+"' cleanfow from lc_fund_plan_temp where flowunid = '"+tcb.getDocId()+"' and fee_type='feetype10' ";
}
if( !"0".equals(GPSDifference) ){
sql += "union all select plan_date,'"+GPSDifference+"' flowin,'GPS²î¶î:"+GPSDifference+"' flowindetail,'' flowout,'' flowoutdetil,'"+GPSDifference+"' cleanfow from lc_fund_plan_temp where flowunid = '"+tcb.getDocId()+"' and fee_type='feetype10' ";
}
}else if("ORACLE".equals(InitDBType.DBTYPE)){
sql += "INSERT INTO " +Tools.getTable(tcb.getContractCashTb())+ " (id," + tcb.getPlanCName() + "";
sql += ",plan_date";

View File

@ -150,7 +150,7 @@ public class CreateTransactionExecutor implements Transaction {
}
public void checkYearRate( ConditionBean cb, TabCalBean tcb, BigDecimal yearRate ) throws BusinessException {
if ( "Y".equals( cb.getFlexible() ) ) {
// if ( "Y".equals( cb.getFlexible() ) ) {
// 灵活产品验证年利率区间
try {
Map<String, Map<String, String>> productRevenues = ProductParamUtil.getProductComponentType( tcb.getProductId(), "PRD0390" );
@ -164,18 +164,18 @@ public class CreateTransactionExecutor implements Transaction {
if(!(yearRate.compareTo(new BigDecimal( prodRate )) == 0) ){
throw new BusinessException( "测算年利率跟产品配置的不相等,请检查!" );
}
}
//区间利率校验
}else if("N".equals(isFixedRate)){//区间利率校验
String rateMin = productRate.get("RateTermScope-MIN");
String rateMax = productRate.get("RateTermScope-MAX");
if ( !( yearRate.compareTo( new BigDecimal( rateMax ) ) <= 0 && yearRate.compareTo( new BigDecimal( rateMin ) ) >= 0 ) ) {
throw new BusinessException( "年利率: " + yearRate.setScale( 6, 4 ).toString() + ",不在产品配置区间范围内" );
}
}
} catch ( Exception e ) {
e.printStackTrace();
throw new BusinessException( e.getMessage() );
}
}
// }
}
/**