apzl_leasing/calc/com/tenwa/reckon/help/CalcConditionCopyService.java
2021-07-27 15:15:21 +08:00

481 lines
28 KiB
Java

package com.tenwa.reckon.help;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jbo.app.tenwa.calc.*;
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
import jbo.com.tenwa.lease.comm.LC_CONDITION;
import jbo.com.tenwa.lease.comm.LC_CONDITION_TEMP;
import jbo.com.tenwa.lease.comm.LC_PAY_CONDTION;
import jbo.com.tenwa.lease.comm.LC_PAY_CONDTION_TEMP;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.tenwa.comm.exception.RecordNotFoundException;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService;
import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum;
import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp;
import com.tenwa.reckon.copydata.CalcRentCompare;
import com.tenwa.util.SerialNumberUtil;
public class CalcConditionCopyService {
//客户报价到临时表
public void custToTemp(String flowunid,String quotid,String planCName,String planCValue,JBOTransaction tx) throws JBOException, RecordNotFoundException, Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("quot_id", quotid);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("FLOWUNID", flowunid);
otherProperty.put(planCName, planCValue);
Map<String,String> toCondition=new HashMap<String, String>();
toCondition.put(planCName, planCValue);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CUSTOMER_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_TEMP.CLASS_NAME, toCondition, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CUSTOMER_RULES.CLASS_NAME, fromCondition,LC_CALC_RULES_TEMP.CLASS_NAME, toCondition, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_CUSTOMER_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_TEMP.CLASS_NAME, toCondition, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_CUSTOMER_FUND_PLAN.CLASS_NAME, fromCondition,LC_FUND_PLAN_TEMP.CLASS_NAME, toCondition, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CUSTOMER_CASH_FLOW.CLASS_NAME, fromCondition, LC_CASH_FLOW_TEMP.CLASS_NAME, toCondition, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CUSTOMER_PERIOD.CLASS_NAME, fromCondition, LC_CALC_PERIOD_TEMP.CLASS_NAME, toCondition, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CUSTOMER_SUBSECTION.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_TEMP.CLASS_NAME, toCondition, otherProperty, null, tx);
}
//临时表到项目表
public void tempToProj(String flowunid,JBOTransaction tx) throws Exception{
BizObject flow=JBOFactory.createBizObjectQuery(FLOW_BUSSINESS_OBJECT.CLASS_NAME,"flow_unid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
String projid=flow.getAttribute("proj_id").getString();
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("FLOWUNID", flowunid);
Map<String,String> toCondition=new HashMap<String, String>();
toCondition.put("PROJECT_ID", projid);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("project_id", projid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION_TEMP.CLASS_NAME, fromCondition,LC_PROJ_CONDITION.CLASS_NAME, toCondition, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CALC_RULES_TEMP.CLASS_NAME, fromCondition,LC_PROJ_RULES.CLASS_NAME, toCondition, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN_TEMP.CLASS_NAME, fromCondition,LC_PROJ_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN_TEMP.CLASS_NAME, fromCondition, LC_PROJ_FUND_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW_TEMP.CLASS_NAME, fromCondition, LC_PROJ_CASH_FLOW.CLASS_NAME, toCondition, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CALC_PERIOD_TEMP.CLASS_NAME, fromCondition, LC_PROJ_PERIOD.CLASS_NAME, toCondition, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_TEMP.CLASS_NAME, fromCondition, LC_PROJ_SUBSECTION.CLASS_NAME, toCondition, otherProperty, null, tx);
//前提条件
DataOperatorUtil.copyJBOSet(LC_CONDITION_TEMP.CLASS_NAME, fromCondition, LC_CONDITION.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, fromCondition, LC_PROJ_SUBSECTION_INFO.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, fromCondition, LC_PROJ_SUBSECTION_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
}
//项目表到临时表
public void porjToTemp(String flowunid,String projid,JBOTransaction tx) throws Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("PROJECT_ID", projid);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("FLOWUNID", flowunid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_PROJ_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_PROJ_RULES.CLASS_NAME, fromCondition,LC_CALC_RULES_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_PROJ_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_PROJ_FUND_PLAN.CLASS_NAME, fromCondition,LC_FUND_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_PROJ_CASH_FLOW.CLASS_NAME, fromCondition, LC_CASH_FLOW_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_PROJ_PERIOD.CLASS_NAME, fromCondition, LC_CALC_PERIOD_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_PROJ_SUBSECTION.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//前提条件
DataOperatorUtil.copyJBOSet(LC_CONDITION.CLASS_NAME, fromCondition, LC_CONDITION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_PROJ_SUBSECTION_INFO.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_PROJ_SUBSECTION_RENT_PLAN.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
}
//项目表到合同临时表
public void projToContract(String flowunid,String projid,String contractid,JBOTransaction tx) throws Exception{
BizObject proj=JBOFactory.createBizObjectQuery(LB_PROJECT_INFO.CLASS_NAME,"id=:id").setParameter("id", projid).getSingleResult(false);
String project_id=proj.getAttribute("project_no").getString();//项目编号
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("PROJECT_ID", projid);
List<BizObject> list=DataOperatorUtil.getSetJBO(LC_PROJ_CONDITION.CLASS_NAME, fromCondition, tx);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("FLOWUNID", flowunid);
for(BizObject bo:list){
String projPlanNumber=bo.getAttribute("PROJECT_PLAN_NUMBER").getString();
String contractPlanNumber=projPlanNumber.replace(project_id, contractid);
fromCondition.clear();
fromCondition.put("PROJECT_ID", projid);
fromCondition.put("PROJECT_PLAN_NUMBER", projPlanNumber);
otherProperty.clear();
otherProperty.put("FLOWUNID", flowunid);
otherProperty.put("CONTRACT_PLAN_NUMBER", contractPlanNumber);
//商务条件
DataOperatorUtil.copyJBOSet(LC_PROJ_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_PROJ_RULES.CLASS_NAME, fromCondition,LC_CALC_RULES_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_PROJ_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_PROJ_FUND_PLAN.CLASS_NAME, fromCondition,LC_FUND_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_PROJ_CASH_FLOW.CLASS_NAME, fromCondition, LC_CASH_FLOW_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_PROJ_PERIOD.CLASS_NAME, fromCondition, LC_CALC_PERIOD_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_PROJ_SUBSECTION.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_PROJ_SUBSECTION_INFO.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_PROJ_SUBSECTION_RENT_PLAN.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
otherProperty.clear();
otherProperty.put("FLOWUNID", flowunid);
otherProperty.put("PLAN_NUMBER", contractPlanNumber);
//付款前提
DataOperatorUtil.copyJBOSet(LC_PAY_CONDTION.CLASS_NAME, fromCondition, LC_PAY_CONDTION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
}
}
//合同层 单次起租 临时 到正式
public void tempToContractOne(String flowunid,String contractid,JBOTransaction tx) throws Exception{
BizObject contract=JBOFactory.createBizObjectQuery(LB_CONTRACT_INFO_TEMP.CLASS_NAME,"flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
String paymentNumber=SerialNumberUtil.getPlannumber(contract.getAttribute("CONTRACT_NO").getString(),"pay_process", tx);
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("FLOWUNID", flowunid);
Map<String,String> toCondition=new HashMap<String, String>();
toCondition.put("contract_id", contractid);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("contract_id", contractid);
otherProperty.put("PAYMENT_NUMBER", paymentNumber);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION_TEMP.CLASS_NAME, fromCondition,LC_CONTRACT_CONDITION.CLASS_NAME, toCondition, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CALC_RULES_TEMP.CLASS_NAME, fromCondition,LC_CONTRACT_RULES.CLASS_NAME, toCondition, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN_TEMP.CLASS_NAME, fromCondition,LC_CONTRACT_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN_TEMP.CLASS_NAME, fromCondition,LC_CONTRACT_FUND_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_CASH_FLOW.CLASS_NAME, toCondition, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CALC_PERIOD_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_PERIOD.CLASS_NAME, toCondition, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_SUBSECTION.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_SUBSECTION_INFO.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_SUBSECTION_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION_TEMP.CLASS_NAME, fromCondition,LC_CALC_CONDITION.CLASS_NAME, toCondition, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CALC_RULES_TEMP.CLASS_NAME, fromCondition,LC_CALC_RULES.CLASS_NAME, toCondition, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN_TEMP.CLASS_NAME, fromCondition,LC_PAY_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN_TEMP.CLASS_NAME, fromCondition,LC_FUND_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW_TEMP.CLASS_NAME, fromCondition, LC_PAY_CASH_FLOW.CLASS_NAME, toCondition, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CALC_PERIOD_TEMP.CLASS_NAME, fromCondition, LC_CALC_PERIOD.CLASS_NAME, toCondition, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_TEMP.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//付款前提
LeaseFlowBaseService service=new LeaseFlowBaseServiceImp();
service.copyOrLoadPayCondtionInfo(tx, fromCondition,toCondition,otherProperty, ServiceOperatorEnum.TempToFormal,null);
HandlingApportionManager.setSingleHandlingApportion(flowunid,contractid,paymentNumber,tx);
}
//合同层 多次起租 临时 到正式
public void tempToContractMany(String flowunid,String contractid,JBOTransaction tx) throws Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("FLOWUNID", flowunid);
Map<String,String> toCondition=new HashMap<String, String>();
toCondition.put("contract_id", contractid);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("contract_id", contractid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION_TEMP.CLASS_NAME, fromCondition,LC_CONTRACT_CONDITION.CLASS_NAME, toCondition, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CALC_RULES_TEMP.CLASS_NAME, fromCondition,LC_CONTRACT_RULES.CLASS_NAME, toCondition, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN_TEMP.CLASS_NAME, fromCondition,LC_CONTRACT_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN_TEMP.CLASS_NAME, fromCondition,LC_CONTRACT_FUND_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_CASH_FLOW.CLASS_NAME, toCondition, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CALC_PERIOD_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_PERIOD.CLASS_NAME, toCondition, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_SUBSECTION.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_SUBSECTION_INFO.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, fromCondition, LC_CONTRACT_SUBSECTION_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//付款前提
LeaseFlowBaseService service=new LeaseFlowBaseServiceImp();
service.copyOrLoadPayCondtionInfo(tx, fromCondition,toCondition,otherProperty, ServiceOperatorEnum.TempToFormal,null);
}
//合同正式到临时
public void contractTotemp(String flowunid,String contractid,JBOTransaction tx) throws Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("contract_id", contractid);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("FLOWUNID", flowunid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CONTRACT_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CONTRACT_RULES.CLASS_NAME, fromCondition,LC_CALC_RULES_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_CONTRACT_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_CONTRACT_FUND_PLAN.CLASS_NAME, fromCondition,LC_FUND_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CONTRACT_CASH_FLOW.CLASS_NAME, fromCondition, LC_CASH_FLOW_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CONTRACT_PERIOD.CLASS_NAME, fromCondition, LC_CALC_PERIOD_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CONTRACT_SUBSECTION.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CONTRACT_SUBSECTION_INFO.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_CONTRACT_SUBSECTION_RENT_PLAN.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
}
//临时到投放
public void tempToPay(String flowunid,String paymentNumber,JBOTransaction tx) throws Exception{
BizObject flow=JBOFactory.createBizObjectQuery(FLOW_BUSSINESS_OBJECT.CLASS_NAME,"flow_unid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false);
String contractid=flow.getAttribute("contract_id").getString();
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("PAYMENT_NUMBER", paymentNumber);
fromCondition.put("flowunid", flowunid);
Map<String,String> toCondition=new HashMap<String, String>();
toCondition.put("PAYMENT_NUMBER", paymentNumber);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("contract_id", contractid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION_TEMP.CLASS_NAME, fromCondition,LC_CALC_CONDITION.CLASS_NAME, toCondition, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CALC_RULES_TEMP.CLASS_NAME, fromCondition,LC_CALC_RULES.CLASS_NAME, toCondition, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN_TEMP.CLASS_NAME, fromCondition,LC_PAY_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN_TEMP.CLASS_NAME, fromCondition,LC_FUND_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW_TEMP.CLASS_NAME, fromCondition, LC_PAY_CASH_FLOW.CLASS_NAME, toCondition, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CALC_PERIOD_TEMP.CLASS_NAME, fromCondition, LC_CALC_PERIOD.CLASS_NAME, toCondition, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_TEMP.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
HandlingApportionManager.setHandlingApportion(flowunid,contractid,paymentNumber,tx);
}
//投放到临时
public void payToTemp(String flowunid,String paymentNumber,JBOTransaction tx) throws Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("PAYMENT_NUMBER", paymentNumber);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("FLOWUNID", flowunid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CALC_RULES.CLASS_NAME, fromCondition,LC_CALC_RULES_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_PAY_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN.CLASS_NAME, fromCondition,LC_FUND_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_PAY_CASH_FLOW.CLASS_NAME, fromCondition, LC_CASH_FLOW_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CALC_PERIOD.CLASS_NAME, fromCondition, LC_CALC_PERIOD_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
}
//临时到起租
public void tempToOnhire(String flowunid,String paymentNumber,String contractid,JBOTransaction tx) throws Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("FLOWUNID", flowunid);
fromCondition.put("PAYMENT_NUMBER", paymentNumber);
Map<String,String> toCondition=new HashMap<String, String>();
toCondition.put("PAYMENT_NUMBER", paymentNumber);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("contract_id", contractid);
CalcRentCompare com=new CalcRentCompare();
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION_TEMP.CLASS_NAME, fromCondition,LC_CALC_CONDITION.CLASS_NAME, toCondition, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN_TEMP.CLASS_NAME, fromCondition,LC_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, com, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN_TEMP.CLASS_NAME, fromCondition,LC_FUND_PLAN.CLASS_NAME, toCondition, otherProperty, com, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW_TEMP.CLASS_NAME, fromCondition, LC_CASH_FLOW.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO.CLASS_NAME, toCondition, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN.CLASS_NAME, toCondition, otherProperty, null, tx);
//HandlingApportionManager.setHandlingApportion(flowunid,contractid,paymentNumber,tx);
}
//起租到临时
public void onhireToTemp(String flowunid,String paymentNumber,JBOTransaction tx) throws Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("PAYMENT_NUMBER", paymentNumber);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("FLOWUNID", flowunid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CALC_RULES.CLASS_NAME, fromCondition,LC_CALC_RULES_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//资金计划
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN.CLASS_NAME, fromCondition,LC_FUND_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW.CLASS_NAME, fromCondition, LC_CASH_FLOW_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CALC_PERIOD.CLASS_NAME, fromCondition, LC_CALC_PERIOD_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
}
//起租到临时
public void onhireToTempList(String flowunid,String contractid,JBOTransaction tx) throws Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("contract_id", contractid);
Map<String,String> otherProperty=new HashMap<String, String>();
otherProperty.put("FLOWUNID", flowunid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//测算租金规则
DataOperatorUtil.copyJBOSet(LC_CALC_RULES.CLASS_NAME, fromCondition,LC_CALC_RULES_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//资金计划
List<BizObject> funds=DataOperatorUtil.getSetJBO(LC_FUND_PLAN.CLASS_NAME, fromCondition, tx);
Map<String,String> from=new HashMap<String, String>();
Map<String,String> other=new HashMap<String, String>();
other.putAll(otherProperty);
for(BizObject fund:funds){
from.put("id", fund.getAttribute("id").getString());
other.put("p_id", fund.getAttribute("id").getString());
other.put("OPERATION_STATUS", "opera_after");
DataOperatorUtil.copyJBOSet(LC_FUND_PLAN.CLASS_NAME, from,LC_FUND_PLAN_TEMP.CLASS_NAME, null, other, null, tx);
}
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW.CLASS_NAME, fromCondition, LC_CASH_FLOW_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//已知表
DataOperatorUtil.copyJBOSet(LC_CALC_PERIOD.CLASS_NAME, fromCondition, LC_CALC_PERIOD_TEMP.CLASS_NAME, null, otherProperty, null, tx);
//分段测算
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME, null, otherProperty, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN_TEMP.CLASS_NAME, null, otherProperty, null, tx);
}
//租金计划历史
public void onhireToHis(String flowunid,String paymentNumber,JBOTransaction tx) throws Exception{
Map<String,String> fromCondition=new HashMap<String, String>();
fromCondition.put("payment_number", paymentNumber);
Map<String,String> other=new HashMap<String, String>();
other.put("flowunid", flowunid);
//商务条件
DataOperatorUtil.copyJBOSet(LC_CALC_CONDITION.CLASS_NAME, fromCondition,LC_CALC_CONDITION_HIS.CLASS_NAME, null, other, null, tx);
//租金计划
DataOperatorUtil.copyJBOSet(LC_RENT_PLAN.CLASS_NAME, fromCondition,LC_RENT_PLAN_HIS.CLASS_NAME, null, other, null, tx);
//现金流
DataOperatorUtil.copyJBOSet(LC_CASH_FLOW.CLASS_NAME, fromCondition, LC_CASH_FLOW_HIS.CLASS_NAME, null, other, null, tx);
// 分段融导表
DataOperatorUtil.copyJBOSet(LC_CALC_SUBSECTION_INFO.CLASS_NAME, fromCondition, LC_CALC_SUBSECTION_INFO_HIS.CLASS_NAME, null, other, null, tx);
// 分段租金计划导表
DataOperatorUtil.copyJBOSet(LC_SUBSECTION_RENT_PLAN.CLASS_NAME, fromCondition, LC_SUBSECTION_RENT_PLAN_HIS.CLASS_NAME, null, other, null, tx);
}
}