应该客户要求修改IRR计算规则和提示语
This commit is contained in:
parent
89b7ee0db4
commit
b044a87089
@ -187,16 +187,24 @@ public class CashFlowExecutor {
|
||||
SqlObject asql = new SqlObject("");
|
||||
asql.setOriginalSql(sql);
|
||||
Sqlca.executeSQL(asql);
|
||||
//由于安鹏目前没有从最后一期一直往前抵扣,这里临时处理下灵活产品的
|
||||
if( "Y".equals( cb.getFlexible() ) ){
|
||||
String lcftSql = "select ID,PLAN_DATE,FUND_IN,FUND_OUT from lc_cash_flow_temp where flowunid ='"+tcb.getDocId()+"' and "+tcb.getPlanCName()+"='"+tcb.getPlanCValue()+"' order by plan_date desc";
|
||||
List<Map<String, String>> lcftDate =DataOperatorUtil.getDataBySql(tx, lcftSql, null);
|
||||
BigDecimal outMoney = null ;
|
||||
BigDecimal inMoney = null ;
|
||||
String updateSql = "" ;
|
||||
|
||||
String depositStyle = "";
|
||||
Map<String, Map<String, String>> productCost = ProductParamUtil.getProductComponentType(productId, "PRD0315");
|
||||
if( productCost != null && productCost.size() > 0 ){
|
||||
Map<String, String> cautionMoney = productCost.get("CAUTION_MONEY");
|
||||
if( cautionMoney != null && cautionMoney.size() > 0 ){
|
||||
depositStyle = cautionMoney.get("DepositStyle");
|
||||
}
|
||||
}
|
||||
String lcftSql = "select ID,PLAN_DATE,FUND_IN,FUND_OUT from lc_cash_flow_temp where flowunid ='"+tcb.getDocId()+"' and "+tcb.getPlanCName()+"='"+tcb.getPlanCValue()+"' order by plan_date desc";
|
||||
List<Map<String, String>> lcftDate =DataOperatorUtil.getDataBySql(tx, lcftSql, null);
|
||||
BigDecimal outMoney = null ;//±£Ö¤½ð
|
||||
BigDecimal inMoney = null ;//ÿÆÚ×â½ð
|
||||
String updateSql = "" ;
|
||||
if( "caution_money_method01".equals( depositStyle ) ){//±£Ö¤½ðµÖ¿Û
|
||||
for (int i=0 ; i < lcftDate.size() ; i++ ) {
|
||||
if(i==0){
|
||||
outMoney = new BigDecimal(lcftDate.get(i).get("FUND_OUT") );
|
||||
outMoney = new BigDecimal(cb.getCautionMoney() );
|
||||
inMoney = new BigDecimal(lcftDate.get(i).get("FUND_IN") );
|
||||
}else{
|
||||
inMoney = new BigDecimal(lcftDate.get(i).get("FUND_IN") );
|
||||
@ -207,13 +215,19 @@ public class CashFlowExecutor {
|
||||
Sqlca.executeSQL(asql);
|
||||
outMoney = outMoney.subtract(inMoney);
|
||||
}else{
|
||||
updateSql = " update lc_cash_flow_temp set FUND_OUT='"+inMoney.subtract(outMoney)+"',FUND_OUT_DETAILS='抵扣保证金:"+inMoney.subtract(outMoney)+"',NET_FLOW='"+inMoney.subtract(outMoney)+"' where id='"+lcftDate.get(i).get("ID")+"' ";
|
||||
updateSql = " update lc_cash_flow_temp set FUND_OUT='"+outMoney+"',FUND_OUT_DETAILS='µÖ¿Û±£Ö¤½ð:"+outMoney+"',NET_FLOW='"+inMoney.subtract(outMoney)+"' where id='"+lcftDate.get(i).get("ID")+"' ";
|
||||
asql.setOriginalSql(updateSql);
|
||||
Sqlca.executeSQL(asql);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}else if ("caution_money_method02".equals( depositStyle )){//±£Ö¤½ðÍË»Ø
|
||||
outMoney = new BigDecimal(cb.getCautionMoney() );
|
||||
inMoney = new BigDecimal(lcftDate.get(0).get("FUND_IN") );
|
||||
updateSql = " update lc_cash_flow_temp set FUND_OUT='"+outMoney+"',FUND_OUT_DETAILS='µÖ¿Û±£Ö¤½ð:"+outMoney+"',NET_FLOW='"+inMoney.subtract(outMoney)+"' where id='"+lcftDate.get(0).get("ID")+"' ";
|
||||
asql.setOriginalSql(updateSql);
|
||||
Sqlca.executeSQL(asql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -99,7 +99,8 @@ public class ConditionHelper {
|
||||
throw new BusinessException( "灵活产品IRR区间值必须配置,请联业务人员!" );
|
||||
}
|
||||
if( !( irr.compareTo( new BigDecimal( irrMan ) ) <= 0 && irr.compareTo( new BigDecimal( irrMin ) ) >= 0 ) ){
|
||||
throw new BusinessException( "IRR: "+irr.setScale( 2, 4 ).toString()+",不在产品配置区间范围内!" );
|
||||
// throw new BusinessException( "IRR: "+irr.setScale( 2, 4 ).toString()+",不在产品配置区间范围内!" );
|
||||
throw new BusinessException( "不在产品配置区间范围内!" );
|
||||
}
|
||||
//修改计算中的税率取值
|
||||
List<Map<String, String>> pslData = DataOperatorUtil.getDataBySql("select leasform from prd_specific_library where productid='"+bean.getProductId()+"'");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user