From a1fadc06908d8b89f944904815074f7fae38c05f Mon Sep 17 00:00:00 2001 From: tangft <32189@DESKTOP-M6TAG3K> Date: Wed, 19 Dec 2018 15:52:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=89=8D=E7=BB=93=E6=B8=85=E7=BD=91?= =?UTF-8?q?=E9=93=B6=E6=A0=B8=E9=94=80=E6=B2=A1=E6=9C=89=E6=9C=AC=E6=AC=A1?= =?UTF-8?q?=E6=A0=B8=E9=94=80=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LCContractTerminateInfo.jsp | 19 +++++++++ .../executor/CreateTransactionExecutor.java | 42 +++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/LCContractTerminateInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/LCContractTerminateInfo.jsp index d8f078076..14103ff70 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/LCContractTerminateInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/LCContractTerminateInfo.jsp @@ -196,8 +196,27 @@ alert('最终还款金额大于网银核销金额!!!'); return; } + //更新lc_ebank_temp中的值 + var mage = AsControl.RunJavaMethodTrans("com.tenwa.reckon.executor.CreateTransactionExecutor","updateEbank","flowunid=<%=flowunid%>,cleanLeasemoney="+maximumtotal); + if("Success"!=mage){ + alert('提前结清失败!!!'); + return; + } + }else{ + var contractTotal = getItemValue(0,0,"CONTRACT_TOTAL"); + if(Number(contractTotal)>Number(<%=mayopemoney%>)){ + alert('最终还款金额大于网银核销金额!!!'); + return; + } + //更新lc_ebank_temp中的值 + var mage = AsControl.RunJavaMethodTrans("com.tenwa.reckon.executor.CreateTransactionExecutor","updateEbank","flowunid=<%=flowunid%>,cleanLeasemoney="+contractTotal); + if("Success"!=mage){ + alert('提前结清失败!!!'); + return; + } } as_save("myiframe0","run()"); + }else{ alert('请先撤销变更,再进行变更操作!!!'); } diff --git a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java index e60a7ff86..739ffcc15 100644 --- a/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java +++ b/calc/com/tenwa/reckon/executor/CreateTransactionExecutor.java @@ -22,6 +22,7 @@ import jbo.app.tenwa.calc.LC_CASH_FLOW; import jbo.app.tenwa.calc.LC_CASH_FLOW_TEMP; import jbo.app.tenwa.calc.LC_EBANK; import jbo.app.tenwa.calc.LC_EBANK_PROCESS; +import jbo.app.tenwa.calc.LC_EBANK_TEMP; import jbo.app.tenwa.calc.LC_FUND_PLAN; import jbo.app.tenwa.calc.LC_FUND_PLAN_TEMP; import jbo.app.tenwa.calc.LC_FUND_RENT_ADJUST_TEMP; @@ -664,6 +665,10 @@ public class CreateTransactionExecutor implements Transaction { 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); + String mage = deleteEbank(tx); + if(!"Success".equals(mage)){ + return "false"; + } return "true"; } @@ -992,6 +997,43 @@ public class CreateTransactionExecutor implements Transaction { lepManage.createQuery("delete from O where flowunid=:flowunid and EBANK_NUMBER=:ebanknumber").setParameter("flowunid", flowunid).setParameter("ebanknumber", le.getAttribute("ID").getString()).executeUpdate(); return "true"; } + //提前结清更新LC_EBANK_TEMP表 + public String updateEbank(JBOTransaction tx)throws Exception{ + BizObjectManager letManage = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME, tx); + List lets = letManage.createQuery(" flowunid=:flowunid ").setParameter("flowunid",flowunid).getResultList(true); + for (BizObject let : lets) { + Double mayopeMoney = new Double(let.getAttribute("MAYOPE_MONEY").getString()); + Double advanceMoney = new Double(cleanLeasemoney); + if(mayopeMoney>=advanceMoney){ + let.setAttributeValue("HAD_MONEY", advanceMoney); + let.setAttributeValue("MAYOPE_MONEY", mayopeMoney-advanceMoney); + letManage.saveObject(let); + break; + }else{ + let.setAttributeValue("HAD_MONEY", advanceMoney-mayopeMoney); + advanceMoney = advanceMoney-mayopeMoney; + let.setAttributeValue("MAYOPE_MONEY", 0); + letManage.saveObject(let); + } + } + tx.commit(); + return "Success"; + } + + //提前结清更新LC_EBANK_TEMP表 + public String deleteEbank(JBOTransaction tx)throws Exception{ + BizObjectManager letManage = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME, tx); + List lets = letManage.createQuery(" flowunid=:flowunid ").setParameter("flowunid",flowunid).getResultList(true); + for (BizObject let : lets) { + Double mayopeMoney = new Double(let.getAttribute("MAYOPE_MONEY").getString()); + Double hadMoney = new Double(let.getAttribute("HAD_MONEY").getString()); + let.setAttributeValue("HAD_MONEY", 0); + let.setAttributeValue("MAYOPE_MONEY", mayopeMoney+hadMoney); + letManage.saveObject(let); + } + tx.commit(); + return "Success"; + } public String getCalType() { return calType;