修复租金休眠测算bug

This commit is contained in:
zhangbeibei 2021-04-27 16:53:48 +08:00
parent 58ce9376cd
commit f00fc45f21
3 changed files with 20 additions and 8 deletions

View File

@ -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;
}

View File

@ -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<String, String> fromCondition = new HashMap<String, String>();
Map<String,String> toCondition=new HashMap<String, String>();
toCondition.put("flowunid", this.getFlowunid());
toCondition.put("payment_number", this.getPlannumber());
Map<String, String> otherProperty = new HashMap<String, String>();
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);
}
/**
* 租金计划变更
*/

View File

@ -48,7 +48,7 @@ public interface Transaction {
* ×â½ð¼Æ»®ÐÝÃß
* @return
*/
public String runRentdormant() throws Exception;
public String runRentdormant(JBOTransaction tx) throws Exception;
/**
* ×â½ð¼Æ»®±ä¸ü
* @return