现金流增加贴息
This commit is contained in:
parent
25653c352d
commit
2d6d37d302
@ -23,14 +23,14 @@ import com.tenwa.reckon.util.IRRCalculateUtil;
|
||||
import com.tenwa.reckon.util.IrrTools;
|
||||
|
||||
public class CashFlowExecutor {
|
||||
|
||||
|
||||
private JBOTransaction tx;
|
||||
|
||||
|
||||
public CashFlowExecutor(JBOTransaction tx){
|
||||
this.tx=tx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String run(ConditionBean cb , TabCalBean tcb) throws Exception{
|
||||
this.delete(tcb, cb);
|
||||
this.add(cb, tcb);
|
||||
@ -87,15 +87,15 @@ public class CashFlowExecutor {
|
||||
}
|
||||
return irr;
|
||||
}
|
||||
|
||||
|
||||
private void delete(TabCalBean tcb,ConditionBean cb) throws Exception{
|
||||
BizObjectManager bm=JBOFactory.getBizObjectManager(tcb.getContractCashTb(), tx);
|
||||
String sql = " delete from O where flowunid='" + tcb.getDocId() + "' and "+tcb.getPlanCName()+"='"+tcb.getPlanCValue()+"'";
|
||||
bm.createQuery(sql).executeUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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" );
|
||||
@ -115,7 +115,7 @@ public class CashFlowExecutor {
|
||||
personalInsuranceDifference = "0";
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
String sql = "";
|
||||
if("MYSQL".equals(InitDBType.DBTYPE)){
|
||||
sql += "INSERT INTO " +Tools.getTable(tcb.getContractCashTb())+ " (id," + tcb.getPlanCName() + "";
|
||||
@ -127,7 +127,7 @@ public class CashFlowExecutor {
|
||||
sql += ",net_flow";
|
||||
sql += ",flowunid";//create_date,creator_ "+DateUtil.getSystemDate()+"' create_date ,'"+SecurityUtil.getPrincipal().getId()+"' creator_"
|
||||
sql += " )";
|
||||
|
||||
|
||||
sql +=" select replace(uuid(),'-','') id,'"+tcb.getPlanCValue()+"' "+tcb.getPlanCName()+",t.plan_date,sum(t.flowin) fundin,ifnull(group_concat(if(t.flowindetail='',null,t.flowindetail)),'-') fundindetails, ";
|
||||
sql +=" sum(t.flowout) fundout ,ifnull(group_concat(if(t.flowoutdetail='',null,t.flowoutdetail)),'-')fundoutdetails,sum(t.cleanfow)netflow ,'"+tcb.getDocId()+"' flowunid " ;
|
||||
sql +=" from (" ;
|
||||
@ -146,7 +146,7 @@ public class CashFlowExecutor {
|
||||
sql +=" if(fundplan.pay_type='pay_type_in',fundplan.plan_money,-fundplan.plan_money) cleanfow " ;
|
||||
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','feetype24') ";
|
||||
sql +=" where fundplan.flowunid = '"+ tcb.getDocId()+"' and fundplan."+tcb.getPlanCName()+"='"+tcb.getPlanCValue()+"' and fundplan.fee_type in ('feetype2','feetype1','feetype10','feetype16','feetype17','feetype33','feetype24','feetype27') ";
|
||||
//根据客户(张文竹)不管是否灵活产品,配置的GPS差额和个人意外险差额添加到IRR计算
|
||||
/*
|
||||
if( !"0".equals(personalInsuranceDifference) ){
|
||||
@ -156,7 +156,7 @@ public class CashFlowExecutor {
|
||||
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";
|
||||
@ -167,7 +167,7 @@ public class CashFlowExecutor {
|
||||
sql += ",net_flow";
|
||||
sql += ",flowunid";//create_date,creator_ "+DateUtil.getSystemDate()+"' create_date ,'"+SecurityUtil.getPrincipal().getId()+"' creator_"
|
||||
sql += " )";
|
||||
|
||||
|
||||
sql +=" select sys_guid() id,'"+tcb.getPlanCValue()+"' "+tcb.getPlanCName()+",t.plan_date,sum(t.flowin) fundin,nvl(wmsys.wm_concat(case when t.flowindetail='' then null else t.flowindetail end ),'-') fundindetails, ";
|
||||
sql +=" sum(t.flowout) fundout ,nvl(wmsys.wm_concat(case when t.flowoutdetail='' then null else t.flowoutdetail end),'-') fundoutdetails,sum(t.cleanfow)netflow ,'"+tcb.getDocId()+"' flowunid " ;
|
||||
sql +=" from (" ;
|
||||
@ -207,10 +207,10 @@ public class CashFlowExecutor {
|
||||
sql +=" )t group by t.plan_date ";
|
||||
Transaction Sqlca =null;
|
||||
Sqlca = Transaction.createTransaction(tx);
|
||||
SqlObject asql = new SqlObject("");
|
||||
SqlObject asql = new SqlObject("");
|
||||
asql.setOriginalSql(sql);
|
||||
Sqlca.executeSQL(asql);
|
||||
|
||||
|
||||
String depositStyle = "";
|
||||
Map<String, Map<String, String>> productCost = ProductParamUtil.getProductComponentType(productId, "PRD0315");
|
||||
if( productCost != null && productCost.size() > 0 ){
|
||||
@ -244,7 +244,7 @@ public class CashFlowExecutor {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}else if ("caution_money_method02".equals( depositStyle )){//保证金退回
|
||||
outMoney = new BigDecimal(cb.getCautionMoney() );
|
||||
inMoney = new BigDecimal(lcftDate.get(0).get("FUND_IN") );
|
||||
@ -252,9 +252,9 @@ public class CashFlowExecutor {
|
||||
asql.setOriginalSql(updateSql);
|
||||
Sqlca.executeSQL(asql);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user