From 2d6d37d30228d0eccec383936099f67e94916738 Mon Sep 17 00:00:00 2001 From: zhulh Date: Fri, 30 Jul 2021 15:44:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E9=87=91=E6=B5=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=B4=B4=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reckon/executor/CashFlowExecutor.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/calc/com/tenwa/reckon/executor/CashFlowExecutor.java b/calc/com/tenwa/reckon/executor/CashFlowExecutor.java index ae3b1dc7a..7843cbd13 100644 --- a/calc/com/tenwa/reckon/executor/CashFlowExecutor.java +++ b/calc/com/tenwa/reckon/executor/CashFlowExecutor.java @@ -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> productRevenues = tcb.getProductRevenues(); String GPSDifference = "0";//获取产品中的GPS差额配置 Map 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> 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); } - + } - - - + + + }