diff --git a/WebContent/Accounting/LoanSimulation_dormant/LCRentDormantInfo.jsp b/WebContent/Accounting/LoanSimulation_dormant/LCRentDormantInfo.jsp index f3e8b43c4..577817d91 100644 --- a/WebContent/Accounting/LoanSimulation_dormant/LCRentDormantInfo.jsp +++ b/WebContent/Accounting/LoanSimulation_dormant/LCRentDormantInfo.jsp @@ -172,7 +172,7 @@ function cancelChange(){ function run() { - var result = AsControl.RunJavaMethod("com.tenwa.reckon.executor.CreateTransactionExecutor","runRentdormant","flowunid=<%=flowunid%>,plannumber=<%=paymentNumber%>,productId=<%=ProductId%>,calType=pay_process"); + var result = AsControl.RunJavaMethodTrans("com.tenwa.reckon.executor.CreateTransactionExecutor","runRentdormant","flowunid=<%=flowunid%>,plannumber=<%=paymentNumber%>,productId=<%=ProductId%>,calType=pay_process"); window.location.href=window.location.href; } diff --git a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java index 44b734f15..330cbe4b8 100644 --- a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java +++ b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java @@ -806,12 +806,10 @@ public class CreateTransactionExecutor implements Transaction { * 租金计划休眠 */ @Override - public String runRentdormant() throws Exception{ - + public String runRentdormant(JBOTransaction tx) throws Exception{ + this.reloadConditon(tx); JSONObject jsonObject = JSONObject.createObject(); - JBOTransaction tx=null; try { - tx=JBOFactory.createJBOTransaction(); //组装实体bean TabCalBean bean = TbBeanTools.getTabInfo(calType, flowunid,plannumber,productId); ConditionBean cb = bean.getCb(); @@ -899,7 +897,7 @@ public class CreateTransactionExecutor implements Transaction { bomLRPT.saveObject(bolLRPT.get(i)); } String irr = this.createCashFlow(bean,tx); - BizObjectManager bomLCCT = JBOFactory.getFactory().getManager(LC_CALC_CONDITION_TEMP.CLASS_NAME); + BizObjectManager bomLCCT = JBOFactory.getFactory().getManager(LC_CALC_CONDITION_TEMP.CLASS_NAME,tx); BizObject boLCCT = bomLCCT.createQuery("flowunid =:flowunid and payment_number=:payment_number").setParameter("flowunid", flowunid).setParameter("payment_number", plannumber).getSingleResult(true); boLCCT.setAttributeValue("IRR",irr); bomLCCT.saveObject(boLCCT); @@ -908,7 +906,7 @@ public class CreateTransactionExecutor implements Transaction { } catch (Exception e) { tx.rollback(); e.printStackTrace(); - jsonObject.appendElement("result", "false"); + jsonObject.appendElement("result", "false"); }finally{ if(tx!=null){ tx.commit(); @@ -916,6 +914,20 @@ public class CreateTransactionExecutor implements Transaction { } return JSONEncoder.encode(jsonObject); } + public void reloadConditon(JBOTransaction tx) throws Exception { + //重新复制正式表租金计划到临时表 + Map fromCondition = new HashMap(); + Map toCondition=new HashMap(); + toCondition.put("flowunid", this.getFlowunid()); + toCondition.put("payment_number", this.getPlannumber()); + Map otherProperty = new HashMap(); + fromCondition.put("payment_number",this.getPlannumber()); + otherProperty.put("flowunid", flowunid); + DataOperatorUtil.copyJBOSet(LC_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_TEMP.CLASS_NAME ,toCondition, otherProperty,null, tx); + DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_TEMP.CLASS_NAME ,toCondition, otherProperty,null, tx); + DataOperatorUtil.copyJBOSet(LC_FUND_PLAN.CLASS_NAME, fromCondition,LC_FUND_PLAN_TEMP.CLASS_NAME ,toCondition, otherProperty,null, tx); + DataOperatorUtil.copyJBOSet(LC_CASH_FLOW.CLASS_NAME, fromCondition,LC_CASH_FLOW_TEMP.CLASS_NAME ,toCondition, otherProperty,null, tx); + } /** * 租金计划变更 */ diff --git a/calc/com/tenwa/reckon/executor/Transaction.java b/calc/com/tenwa/reckon/executor/Transaction.java index a0f8ca584..41abd8174 100644 --- a/calc/com/tenwa/reckon/executor/Transaction.java +++ b/calc/com/tenwa/reckon/executor/Transaction.java @@ -48,7 +48,7 @@ public interface Transaction { * 租金计划休眠 * @return */ - public String runRentdormant() throws Exception; + public String runRentdormant(JBOTransaction tx) throws Exception; /** * 租金计划变更 * @return