提前结清网银核销没有本次核销金额

This commit is contained in:
tangft 2018-12-19 15:52:25 +08:00
parent 6a0958188f
commit a1fadc0690
2 changed files with 61 additions and 0 deletions

View File

@ -196,8 +196,27 @@
alert('最终还款金额大于网银核销金额!!!'); alert('最终还款金额大于网银核销金额!!!');
return; 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()"); as_save("myiframe0","run()");
}else{ }else{
alert('请先撤销变更,再进行变更操作!!!'); alert('请先撤销变更,再进行变更操作!!!');
} }

View File

@ -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_CASH_FLOW_TEMP;
import jbo.app.tenwa.calc.LC_EBANK; import jbo.app.tenwa.calc.LC_EBANK;
import jbo.app.tenwa.calc.LC_EBANK_PROCESS; 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;
import jbo.app.tenwa.calc.LC_FUND_PLAN_TEMP; import jbo.app.tenwa.calc.LC_FUND_PLAN_TEMP;
import jbo.app.tenwa.calc.LC_FUND_RENT_ADJUST_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_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_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); 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"; 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(); lepManage.createQuery("delete from O where flowunid=:flowunid and EBANK_NUMBER=:ebanknumber").setParameter("flowunid", flowunid).setParameter("ebanknumber", le.getAttribute("ID").getString()).executeUpdate();
return "true"; return "true";
} }
//提前结清更新LC_EBANK_TEMP表
public String updateEbank(JBOTransaction tx)throws Exception{
BizObjectManager letManage = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME, tx);
List<BizObject> 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<BizObject> 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() { public String getCalType() {
return calType; return calType;