添加渠道判断条件
This commit is contained in:
parent
b3371966f9
commit
d0cb3d61d6
@ -1,27 +1,5 @@
|
||||
package com.tenwa.lease.flow.project.commbusiness;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ADDRESS_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
|
||||
import jbo.sys.PF_CALC_CONDITION;
|
||||
import jbo.sys.PF_CUSTOMER_ACCOUNT;
|
||||
import jbo.sys.PF_CUSTOMER_ADDRESS;
|
||||
import jbo.sys.PF_CUSTOMER_FAMILY;
|
||||
import jbo.sys.PF_CUSTOMER_PERSON;
|
||||
import jbo.sys.PF_EQUIPMENT_CAR;
|
||||
import jbo.sys.PF_GUARANTEE_UNIT;
|
||||
import jbo.sys.PF_PROJECT_INFO;
|
||||
import com.amarsoft.app.als.sys.tools.DateUtil;
|
||||
import com.amarsoft.app.util.ProductParamUtil;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
@ -37,428 +15,447 @@ import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.flow.baseBussion.BaseBussiness;
|
||||
import com.tenwa.reckon.executor.CreateTransactionExecutor;
|
||||
import com.tenwa.util.SerialNumberUtil;
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ADDRESS_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
|
||||
import jbo.sys.*;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务申请阶段接口平台数据拷入临时表
|
||||
* 业务申请阶段接口平台数据拷入临时表
|
||||
*/
|
||||
public class PlatformDataToTemp extends BaseBussiness {
|
||||
|
||||
@Override
|
||||
public Object run(Transaction Sqlca) throws Exception {
|
||||
this.initBussinessParam(Sqlca);
|
||||
if(this.getAttribute("serial")==null) return "true";
|
||||
|
||||
ASUser asUser=new ASUser(this.getAttribute("CurUserID").toString());
|
||||
String serial = this.getAttribute("serial").toString();
|
||||
String flowunid = this.getAttribute("ObjectNo").toString();
|
||||
String customerId = Sqlca.getString("SELECT customerid FROM customer_info_temp WHERE flowunid='"+flowunid+"'");
|
||||
String projectId = this.getAttribute("ProjectId").toString();
|
||||
String customerType = this.getAttribute("CustomerType").toString();
|
||||
String productId = this.getAttribute( "ProductId" ).toString();
|
||||
String planNumber = null;
|
||||
String calType = "proj_process";
|
||||
|
||||
Map<String,String> fromCondtion = new HashMap<String,String>();
|
||||
Map<String,String> toCondtion = new HashMap<String,String>();
|
||||
toCondtion.put("customerid",customerId);
|
||||
toCondtion.put("flowunid",flowunid);
|
||||
|
||||
Map<String,String> otherProperty = new HashMap<String,String>();
|
||||
otherProperty.put("customerid",customerId);
|
||||
otherProperty.put("flowunid",flowunid);
|
||||
otherProperty.put("PROJECT_ID",projectId);
|
||||
|
||||
int number = Integer.valueOf(Sqlca.getString("select count(1) from PF_CUSTOMER_ACCOUNT where flowunid='"+flowunid+"'"));
|
||||
|
||||
String bowhere = null;
|
||||
String boKey = null;
|
||||
String boValue = null;
|
||||
|
||||
/**判断是新增业务申请还是修改业务申请*/
|
||||
if(number==0){
|
||||
boKey="SERIAL";
|
||||
boValue=serial;
|
||||
bowhere=boKey+"=:"+boKey;
|
||||
}else{
|
||||
//修改业务申请
|
||||
boKey="FLOWUNID";
|
||||
boValue=flowunid;
|
||||
bowhere=boKey+"=:"+boKey;
|
||||
}
|
||||
|
||||
fromCondtion.put(boKey,boValue);
|
||||
/**判断客户类型*/
|
||||
if("03".equals(customerType)){
|
||||
/**配偶信息拷表*/
|
||||
String marriage = Sqlca.getString("select MARRIAGE from PF_CUSTOMER_PERSON where "+boKey+"='"+boValue+"'");
|
||||
/**判断是否已婚*/
|
||||
if("01".equals(marriage)){
|
||||
fromCondtion.put("Spouse_","Y");
|
||||
toCondtion.put("Spouse_","Y");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME,fromCondtion,CUSTOMER_FAMILY_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
}else{
|
||||
Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_FAMILY_TEMP where flowunid='"+flowunid+"' and Spouse_='Y'"));
|
||||
}
|
||||
|
||||
/**自然人基本信息拷表*/
|
||||
fromCondtion.remove("Spouse_");
|
||||
toCondtion.remove("Spouse_");
|
||||
otherProperty.remove("PROJECT_ID");
|
||||
otherProperty.put("CERTTYPE",this.getAttribute("certtype").toString());
|
||||
otherProperty.put("CERTID",this.getAttribute("certid").toString());
|
||||
otherProperty.put("INPUTUSERID",asUser.getUserID());
|
||||
otherProperty.put("INPUTORGID",asUser.getOrgID());
|
||||
otherProperty.put("inputtime",StringFunction.getTodayNow());
|
||||
otherProperty.put("FULLNAME",this.getAttribute("custname").toString());
|
||||
otherProperty.put("BALANCESHEET","申请人");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_PERSON.CLASS_NAME,fromCondtion,CUSTOMER_PERSON_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
@Override
|
||||
public Object run(Transaction Sqlca) throws Exception {
|
||||
this.initBussinessParam(Sqlca);
|
||||
if (this.getAttribute("serial") == null) return "true";
|
||||
if (this.getAttribute("channel") != null && this.getAttribute("channel").toString().equals("KAER"))
|
||||
return "true";
|
||||
|
||||
/**自然人客户居住地址信息拷表*/
|
||||
String dressdetail = Sqlca.getString("select dressdetail from PF_CUSTOMER_ADDRESS where "+boKey+"='"+boValue+"'");
|
||||
String itemname = Sqlca.getString("SELECT cl.itemname FROM PF_CUSTOMER_ADDRESS pca INNER JOIN CODE_LIBRARY cl ON pca.province=cl.itemno WHERE codeno='AreaCode' AND "+boKey+"='"+boValue+"'");
|
||||
otherProperty.clear();
|
||||
otherProperty.put("customerid",customerId);
|
||||
otherProperty.put("flowunid",flowunid);
|
||||
otherProperty.put("addtype","0060");
|
||||
otherProperty.put("isadd","yes");
|
||||
otherProperty.put("isnew","yes");
|
||||
otherProperty.put("country","CHN");
|
||||
otherProperty.put("FULLADDRESS",itemname+dressdetail);
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME,fromCondtion,CUSTOMER_ADDRESS_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
}else{
|
||||
/**法人客户基本信息拷表*/
|
||||
otherProperty.put("customerid",customerId);
|
||||
otherProperty.put("flowunid",flowunid);
|
||||
otherProperty.put("CERTTYPE",this.getAttribute("certtype").toString());
|
||||
otherProperty.put("CERTID",this.getAttribute("certid").toString());
|
||||
otherProperty.put("INPUTUSERID",asUser.getUserID());
|
||||
otherProperty.put("INPUTORGID",asUser.getOrgID());
|
||||
otherProperty.put("inputtime",StringFunction.getTodayNow());
|
||||
otherProperty.put("company_name",this.getAttribute("custname").toString());
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME,fromCondtion,CUSTOMER_ADDRESS_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
}
|
||||
|
||||
/**共同申请人信息拷表*/
|
||||
Sqlca.executeSQL(new SqlObject("DELETE FROM CUSTOMER_FAMILY_TEMP WHERE flowunid='"+flowunid+"' AND Spouse_='N'"));
|
||||
fromCondtion.clear();
|
||||
fromCondtion.put(boKey,boValue);
|
||||
fromCondtion.put("Spouse_","N");
|
||||
toCondtion.clear();
|
||||
toCondtion.put("customerid",customerId);
|
||||
toCondtion.put("flowunid",flowunid);
|
||||
toCondtion.put("Spouse_","N");
|
||||
otherProperty.clear();
|
||||
otherProperty.put("customerid",customerId);
|
||||
otherProperty.put("flowunid",flowunid);
|
||||
otherProperty.put("PROJECT_ID",projectId);
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME,fromCondtion,CUSTOMER_FAMILY_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
|
||||
/**担保人信息拷表*/
|
||||
Sqlca.executeSQL(new SqlObject("delete from LB_GUARANTEE_UNIT_TEMP where flowunid='"+flowunid+"'"));
|
||||
fromCondtion.clear();
|
||||
otherProperty.clear();
|
||||
otherProperty.put("FLOWUNID",flowunid);
|
||||
otherProperty.put("PROJECT_ID",projectId);
|
||||
ASResultSet res = Sqlca.getASResultSet(new SqlObject("select id from PF_GUARANTEE_UNIT where "+boKey+"='"+boValue+"'"));
|
||||
while(res.next()){
|
||||
fromCondtion.put("id",res.getString("id"));
|
||||
DataOperatorUtil.copySingleJBO(PF_GUARANTEE_UNIT.CLASS_NAME,fromCondtion,LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,null,otherProperty,Sqlca);
|
||||
}
|
||||
res.close();
|
||||
fromCondtion.remove("id");
|
||||
|
||||
/**扣款卡信息*/
|
||||
BizObjectManager catBm = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT_TEMP.CLASS_NAME,Sqlca);
|
||||
BizObject catBo = catBm.createQuery("flowunid=:flowunid and customerid=:customerid").setParameter("flowunid",flowunid).setParameter("customerid",customerId).getSingleResult(true);
|
||||
BizObject pcaBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_ACCOUNT.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false);
|
||||
if(catBo==null){
|
||||
catBo = catBm.newObject();
|
||||
catBo.setAttributeValue("flowunid",flowunid);
|
||||
catBo.setAttributeValue("customerid",customerId);
|
||||
catBo.setAttributeValue("project_id",projectId);
|
||||
catBo.setAttributeValue("acc_info","Debit");
|
||||
catBo.setAttributeValue("acc_type","Debit");
|
||||
catBo.setAttributeValue("CUSTTYPE","lessee");
|
||||
}
|
||||
catBo.setAttributeValue("acc_number",pcaBo.getAttribute("acc_number"));
|
||||
catBo.setAttributeValue("bank_name",pcaBo.getAttribute("bank_name"));
|
||||
catBo.setAttributeValue("account",pcaBo.getAttribute("account"));
|
||||
catBo.setAttributeValue("MOBILE",pcaBo.getAttribute("MOBILE"));
|
||||
catBo.setAttributeValue("certid",pcaBo.getAttribute("CERTID"));
|
||||
catBm.saveObject(catBo);
|
||||
|
||||
/**租赁物信息拷表*/
|
||||
BizObject pecBo = JBOFactory.createBizObjectQuery(PF_EQUIPMENT_CAR.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false);
|
||||
if(pecBo!=null){
|
||||
BizObjectManager lectBm = JBOFactory.getBizObjectManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME,Sqlca);
|
||||
BizObject lectBo = lectBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true);
|
||||
lectBo.setAttributeValue("DEVICE_TYPE",pecBo.getAttribute("DEVICE_TYPE"));
|
||||
lectBo.setAttributeValue("DRIVE_TYPE",pecBo.getAttribute("DRIVE_TYPE"));
|
||||
lectBo.setAttributeValue("FRAME_NUMBER",pecBo.getAttribute("FRAME_NUMBER"));
|
||||
lectBo.setAttributeValue("CAR_COLOUR",pecBo.getAttribute("CAR_COLOUR"));
|
||||
lectBo.setAttributeValue("ENGINE_NUMBER",pecBo.getAttribute("ENGINE_NUMBER"));
|
||||
lectBo.setAttributeValue("LICENSE_PLATE_NUMBER",pecBo.getAttribute("LICENSE_PLATE_NUMBER"));
|
||||
lectBo.setAttributeValue("EXPIRYDATE",pecBo.getAttribute("EXPIRYDATE"));
|
||||
lectBo.setAttributeValue("regDate",pecBo.getAttribute("regDate"));
|
||||
lectBo.setAttributeValue("zone",pecBo.getAttribute("zone"));
|
||||
lectBo.setAttributeValue("mile",pecBo.getAttribute("mile"));
|
||||
lectBo.setAttributeValue("MEMO",pecBo.getAttribute("MEMO"));
|
||||
lectBm.saveObject(lectBo);
|
||||
}
|
||||
|
||||
/**项目基本信息拷表*/
|
||||
BizObjectManager lpitBm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME,Sqlca);
|
||||
BizObject lpitBo = lpitBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true);
|
||||
BizObject ppiBo = JBOFactory.createBizObjectQuery(PF_PROJECT_INFO.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false);
|
||||
String distributorNo = Sqlca.getString("SELECT distributor_no FROM distributor_info di WHERE EXISTS (SELECT 1 FROM user_info ui LEFT JOIN org_info oi ON ui.belongorg=oi.orgid WHERE oi.orgname=di.distributor_name AND ui.userid='"+asUser.getUserID()+"')");
|
||||
|
||||
lpitBo.setAttributeValue("distributor_id",distributorNo);
|
||||
lpitBo.setAttributeValue("inputName",ppiBo.getAttribute("inputName"));
|
||||
lpitBo.setAttributeValue("inputTel",ppiBo.getAttribute("inputTel"));
|
||||
lpitBo.setAttributeValue("IS_NETCAR",ppiBo.getAttribute("IS_NETCAR"));
|
||||
lpitBo.setAttributeValue("source_type",ppiBo.getAttribute("source_type"));
|
||||
lpitBo.setAttributeValue("APPLICATION_NO",ppiBo.getAttribute("APPLICATION_NO"));
|
||||
lpitBo.setAttributeValue("PROJECT_NAME",lpitBo.getAttribute("project_no")+"-"+this.getAttribute("custname").toString());
|
||||
if(!"0".equals(ppiBo.getAttribute("IS_NETCAR").toString())){
|
||||
lpitBo.setAttributeValue("IS_OPERATION",ppiBo.getAttribute("IS_OPERATION"));
|
||||
lpitBo.setAttributeValue("IS_AFFILIATED",ppiBo.getAttribute("IS_AFFILIATED"));
|
||||
lpitBo.setAttributeValue("IS_OPERATION_QUALIFICATION",ppiBo.getAttribute("IS_OPERATION_QUALIFICATION").toString());
|
||||
lpitBo.setAttributeValue("AFFILIATEDNAME",ppiBo.getAttribute("AFFILIATEDNAME"));
|
||||
lpitBo.setAttributeValue("TRANSPORTCERTID",ppiBo.getAttribute("TRANSPORTCERTID"));
|
||||
lpitBo.setAttributeValue("TRANSPORTDATE",ppiBo.getAttribute("TRANSPORTDATE"));
|
||||
lpitBo.setAttributeValue("NETCERTID",ppiBo.getAttribute("NETCERTID"));
|
||||
lpitBo.setAttributeValue("LEGALPERSONNAME",ppiBo.getAttribute("LEGALPERSONNAME"));
|
||||
lpitBo.setAttributeValue("LEGALPERSONID",ppiBo.getAttribute("LEGALPERSONID"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDDATE",ppiBo.getAttribute("AFFILIATEDDATE"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDENDDATE",ppiBo.getAttribute("AFFILIATEDENDDATE"));
|
||||
lpitBo.setAttributeValue("REGISTEREDMONEY",ppiBo.getAttribute("REGISTEREDMONEY"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDACTUALADDRESS",ppiBo.getAttribute("AFFILIATEDACTUALADDRESS"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDADDRESS",ppiBo.getAttribute("AFFILIATEDADDRESS"));
|
||||
}
|
||||
lpitBm.saveObject(lpitBo);
|
||||
|
||||
/**商务条件*/
|
||||
BizObjectManager lcctBm = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME,Sqlca);
|
||||
BizObject lcctBo = lcctBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true);
|
||||
BizObject pccBo = JBOFactory.createBizObjectQuery(PF_CALC_CONDITION.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false);
|
||||
|
||||
/**计算综合融资额*/
|
||||
BigDecimal totalAll = new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString());
|
||||
/**购置税是否参融*/
|
||||
String purchaseTaxFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","PURCHASE_TAX","FINAN");
|
||||
if("Y".equals(purchaseTaxFinan)&&pccBo.getAttribute("PURCHASE_TAX").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()));
|
||||
}
|
||||
/**GPS设备费是否参融*/
|
||||
BigDecimal gpsFee = new BigDecimal(pccBo.getAttribute("GPS_FEE").toString());
|
||||
String gpsFeeFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","GPS_FEE","FINAN");
|
||||
if("Y".equals(gpsFeeFinan)&&pccBo.getAttribute("GPS_FEE").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("GPS_FEE").toString()));
|
||||
}
|
||||
/**加装费是否参融*/
|
||||
String tablewareFeeFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","TABLEWARE_FEE","FINAN");
|
||||
if("Y".equals(tablewareFeeFinan)&&pccBo.getAttribute("TABLEWARE_FEE").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()));
|
||||
}
|
||||
/**保险费是否参融*/
|
||||
String insurancePremiumFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","INSURANCE_PREMIUM","FINAN");
|
||||
if("Y".equals(insurancePremiumFinan)&&pccBo.getAttribute("INSURANCE_PREMIUM").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()));
|
||||
}
|
||||
/**杂费是否参融*/
|
||||
String incidentalFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","INCIDENTAL","FINAN");
|
||||
if("Y".equals(incidentalFinan)&&pccBo.getAttribute("INCIDENTAL").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()));
|
||||
}
|
||||
|
||||
/**首付款比例*/
|
||||
String firstPaymentRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","FIRST_PAYMENT","CostType07");
|
||||
BigDecimal firstPaymentReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("FIRST_PAYMENT").toString().length()>0)
|
||||
if("EquipAmt".equals(firstPaymentRefer)){
|
||||
firstPaymentReferB = new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(firstPaymentRefer)){
|
||||
firstPaymentReferB = new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**保证金比例*/
|
||||
String cautionMoneyRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","CAUTION_MONEY","CostType07");
|
||||
BigDecimal cautionMoneyReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("CAUTION_MONEY").toString().length()>0)
|
||||
if("EquipAmt".equals(cautionMoneyRefer)){
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(cautionMoneyRefer)){
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**手续费比例*/
|
||||
String handlingChargeMoneyRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","HANDLING_CHARGE_MONEY","CostType07");
|
||||
BigDecimal handlingChargeMoneyReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString().length()>0)
|
||||
if("EquipAmt".equals(handlingChargeMoneyRefer)){
|
||||
handlingChargeMoneyReferB = new BigDecimal(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(handlingChargeMoneyRefer)){
|
||||
handlingChargeMoneyReferB = new BigDecimal(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**加装费比例*/
|
||||
String tablewareFeeRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","TABLEWARE_FEE","CostType07");
|
||||
BigDecimal tablewareFeeReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("TABLEWARE_FEE").toString().length()>0)
|
||||
if("EquipAmt".equals(tablewareFeeRefer)){
|
||||
tablewareFeeReferB = new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(tablewareFeeRefer)){
|
||||
tablewareFeeReferB = new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
|
||||
/**购置锐比例*/
|
||||
String purchaseTaxRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","PURCHASE_TAX","CostType07");
|
||||
BigDecimal purchaseTaxReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("PURCHASE_TAX").toString().length()>0)
|
||||
if("EquipAmt".equals(purchaseTaxRefer)){
|
||||
purchaseTaxReferB = new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(purchaseTaxRefer)){
|
||||
purchaseTaxReferB = new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**保险费比例*/
|
||||
String insurancePremiumRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","INSURANCE_PREMIUM","CostType07");
|
||||
BigDecimal insurancePremiumReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("INSURANCE_PREMIUM").toString().length()>0)
|
||||
if("EquipAmt".equals(insurancePremiumRefer)){
|
||||
insurancePremiumReferB = new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(insurancePremiumRefer)){
|
||||
insurancePremiumReferB = new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**杂费比例*/
|
||||
String incidentalRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","INCIDENTAL","CostType07");
|
||||
BigDecimal incidentalReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("INCIDENTAL").toString().length()>0)
|
||||
if("EquipAmt".equals(incidentalRefer)){
|
||||
incidentalReferB = new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(incidentalRefer)){
|
||||
incidentalReferB = new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
if(lcctBo==null){
|
||||
lcctBo = lcctBm.newObject();
|
||||
}
|
||||
|
||||
lcctBo.setAttributeValue("FLOWUNID",flowunid);
|
||||
lcctBo.setAttributeValue("PROJECT_ID",projectId);
|
||||
planNumber = SerialNumberUtil.getPlannumber(this.getAttribute("ProjectNo").toString(),calType,Sqlca);
|
||||
lcctBo.setAttributeValue("PROJECT_PLAN_NUMBER",planNumber);
|
||||
// 调息方式
|
||||
setProductAdjustRules(otherProperty,productId);
|
||||
lcctBo.setAttributeValue("ADJUST_TYPE",otherProperty.get("ADJUST_TYPE"));
|
||||
lcctBo.setAttributeValue("ADJUST_STYLE",otherProperty.get("ADJUST_STYLE"));
|
||||
// 投放日
|
||||
lcctBo.setAttributeValue("LEASE_AMT_DATE",DateUtil.getToday());
|
||||
lcctBo.setAttributeValue("START_DATE",DateUtil.getToday());
|
||||
// 租金推算方式
|
||||
lcctBo.setAttributeValue("RENT_OR_RATE","rate");
|
||||
// 设置年利率
|
||||
setYearRate(otherProperty,productId);
|
||||
lcctBo.setAttributeValue("PERIOD_TYPE",otherProperty.get("PERIOD_TYPE"));
|
||||
lcctBo.setAttributeValue("YEAR_RATE",otherProperty.get("YEAR_RATE"));
|
||||
// 设置还款间隔
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR","income_12");
|
||||
lcctBo.setAttributeValue("INCOME_INTERVAL_MONTH","1");
|
||||
lcctBo.setAttributeValue("GPS_FEE",gpsFee.toString());
|
||||
lcctBo.setAttributeValue("LEASE_TERM",pccBo.getAttribute( "INCOME_NUMBER" ));
|
||||
// 计算第一,第二期租金支付日
|
||||
setFirstSecondPlan(otherProperty,productId,pccBo);
|
||||
lcctBo.setAttributeValue("FIRST_PLAN_DATE",otherProperty.get("FIRST_PLAN_DATE"));
|
||||
lcctBo.setAttributeValue("SECOND_PLAN_DATE",otherProperty.get("SECOND_PLAN_DATE"));
|
||||
lcctBo.setAttributeValue("EQUIP_AMT",pccBo.getAttribute("EQUIP_AMT"));
|
||||
lcctBo.setAttributeValue("FIRST_PAYMENT",pccBo.getAttribute("FIRST_PAYMENT"));
|
||||
lcctBo.setAttributeValue("FIRST_PAYMENT_RATIO",firstPaymentReferB);
|
||||
lcctBo.setAttributeValue("FINAL_PAYMENT",pccBo.getAttribute("FINAL_PAYMENT"));
|
||||
lcctBo.setAttributeValue("NOMINAL_PRICE",pccBo.getAttribute("NOMINAL_PRICE"));
|
||||
lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY",pccBo.getAttribute("HANDLING_CHARGE_MONEY"));
|
||||
lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY_RATIO",handlingChargeMoneyReferB);
|
||||
lcctBo.setAttributeValue("CAUTION_MONEY",pccBo.getAttribute("CAUTION_MONEY"));
|
||||
lcctBo.setAttributeValue("CAUTION_MONEY_RATIO",cautionMoneyReferB);
|
||||
lcctBo.setAttributeValue("GPS_FEE_FINA",pccBo.getAttribute("GPS_FEE_FINA"));
|
||||
lcctBo.setAttributeValue("PURCHASE_TAX",pccBo.getAttribute("PURCHASE_TAX"));
|
||||
lcctBo.setAttributeValue("PURCHASE_TAX_RATIO",purchaseTaxReferB);
|
||||
lcctBo.setAttributeValue("INSURANCE_PREMIUM",pccBo.getAttribute("INSURANCE_PREMIUM"));
|
||||
lcctBo.setAttributeValue("INSURANCE_PREMIUM_RATIO",insurancePremiumReferB);
|
||||
lcctBo.setAttributeValue("SETTLE_METHOD",pccBo.getAttribute("SETTLE_METHOD"));
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER",pccBo.getAttribute("INCOME_NUMBER"));
|
||||
lcctBo.setAttributeValue("DefaultDueDay",pccBo.getAttribute("DefaultDueDay"));
|
||||
lcctBo.setAttributeValue("TABLEWARE_FEE",pccBo.getAttribute("TABLEWARE_FEE"));
|
||||
lcctBo.setAttributeValue("TABLEWARE_FEE_RATIO",tablewareFeeReferB);
|
||||
lcctBo.setAttributeValue("INCIDENTAL",pccBo.getAttribute("INCIDENTAL"));
|
||||
lcctBo.setAttributeValue("INCIDENTAL_RATIO",incidentalReferB);
|
||||
lcctBo.setAttributeValue("TOTAL_ALL",totalAll);
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT",pccBo.getAttribute("FIRST_PAYMENT").toString());
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT_RATIO",new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).multiply(new BigDecimal("100")).divide(totalAll,6, BigDecimal.ROUND_HALF_UP));
|
||||
lcctBo.setAttributeValue("CLEAN_LEASE_MONEY",totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())));
|
||||
lcctBo.setAttributeValue("RENT_RATIO",totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN).toString());
|
||||
lcctBo.setAttributeValue("DISCOUNT","");
|
||||
lcctBm.saveObject(lcctBo);
|
||||
|
||||
// 自动测算
|
||||
autoCalc(flowunid,calType,planNumber,productId,Sqlca);
|
||||
|
||||
return "true";
|
||||
}
|
||||
|
||||
public void setProductAdjustRules( Map<String, String> otherProperty, String productId ) throws Exception {
|
||||
Map<String,Map<String,String>> map = ProductParamUtil.getProductComponentType(productId,"PRD0320");
|
||||
if ( map.containsKey( "ADJUST_INTEREST" ) ){
|
||||
Map<String,String> rule=map.get( "ADJUST_INTEREST" );
|
||||
if ( null != rule.get( "rate_float_type" ) && null != rule.get( "adjust_style" ) ) {
|
||||
//调息方式
|
||||
otherProperty.put( "ADJUST_TYPE", rule.get("rate_float_type") );
|
||||
otherProperty.put( "ADJUST_STYLE", rule.get("adjust_style") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setYearRate( Map<String, String> otherProperty, String productId ) throws Exception {
|
||||
Map<String, Map<String, String>> productRates = ProductParamUtil.getProductComponentType( productId, "PRD0350" );
|
||||
Map<String, String> productRate = productRates.get( "product_rate" );
|
||||
String periodType = ProductParamUtil.getProductParameterValue( productId, "PRD0350", "period_type", "begin_end" );
|
||||
periodType = periodType == null ? "period_type_0" : periodType;
|
||||
otherProperty.put( "PERIOD_TYPE", periodType );
|
||||
if ( productRate != null ) {
|
||||
String yearRate = productRate.get("ProductRate") == null ? "0" : productRate.get("ProductRate");
|
||||
otherProperty.put( "YEAR_RATE", yearRate );
|
||||
}
|
||||
}
|
||||
|
||||
public void setFirstSecondPlan( Map<String, String> otherProperty, String productId, BizObject fcc ) throws Exception {
|
||||
String periodType = otherProperty.get( "PERIOD_TYPE" );
|
||||
String leaseAmtDate = DateUtil.getToday();
|
||||
String incomeIntervalMonth = "1";
|
||||
String defaultDueDay = fcc.getAttribute( "DefaultDueDay" ).toString();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" );
|
||||
Date lad = sdf.parse( leaseAmtDate );
|
||||
lad = DateUtils.setDays( lad, Integer.parseInt( defaultDueDay ) );
|
||||
String firstPlanDate = "";
|
||||
String secondPlanDate = "";
|
||||
if ( "period_type_1".equals( periodType ) ) {
|
||||
firstPlanDate = leaseAmtDate;
|
||||
secondPlanDate = sdf.format( DateUtils.addMonths( lad, Integer.parseInt( incomeIntervalMonth ) ) );
|
||||
} else {
|
||||
firstPlanDate = sdf.format( DateUtils.addMonths( lad, Integer.parseInt( incomeIntervalMonth ) ) );
|
||||
secondPlanDate = sdf.format( DateUtils.addMonths( lad, Integer.parseInt( incomeIntervalMonth ) * 2 ) );
|
||||
}
|
||||
otherProperty.put( "FIRST_PLAN_DATE", firstPlanDate );
|
||||
otherProperty.put( "SECOND_PLAN_DATE", secondPlanDate );
|
||||
}
|
||||
|
||||
public void autoCalc( String flowunid, String calType, String planNumber, String productId, JBOTransaction tx ) throws Exception {
|
||||
CreateTransactionExecutor cte = new CreateTransactionExecutor();
|
||||
cte.setCalType( calType );
|
||||
cte.setFlowunid( flowunid );
|
||||
cte.setPlannumber( planNumber );
|
||||
cte.setProductId( productId );
|
||||
System.out.println("===========================自动测算开始===============================");
|
||||
cte.runTrans( tx );
|
||||
System.out.println("===========================自动测算结束===============================");
|
||||
}
|
||||
ASUser asUser = new ASUser(this.getAttribute("CurUserID").toString());
|
||||
String serial = this.getAttribute("serial").toString();
|
||||
String flowunid = this.getAttribute("ObjectNo").toString();
|
||||
String customerId = Sqlca.getString("SELECT customerid FROM customer_info_temp WHERE flowunid='" + flowunid + "'");
|
||||
String projectId = this.getAttribute("ProjectId").toString();
|
||||
String customerType = this.getAttribute("CustomerType").toString();
|
||||
String productId = this.getAttribute("ProductId").toString();
|
||||
String planNumber = null;
|
||||
String calType = "proj_process";
|
||||
|
||||
Map<String, String> fromCondtion = new HashMap<String, String>();
|
||||
Map<String, String> toCondtion = new HashMap<String, String>();
|
||||
toCondtion.put("customerid", customerId);
|
||||
toCondtion.put("flowunid", flowunid);
|
||||
|
||||
Map<String, String> otherProperty = new HashMap<String, String>();
|
||||
otherProperty.put("customerid", customerId);
|
||||
otherProperty.put("flowunid", flowunid);
|
||||
otherProperty.put("PROJECT_ID", projectId);
|
||||
|
||||
int number = Integer.valueOf(Sqlca.getString("select count(1) from PF_CUSTOMER_ACCOUNT where flowunid='" + flowunid + "'"));
|
||||
|
||||
String bowhere = null;
|
||||
String boKey = null;
|
||||
String boValue = null;
|
||||
|
||||
/**判断是新增业务申请还是修改业务申请*/
|
||||
if (number == 0) {
|
||||
boKey = "SERIAL";
|
||||
boValue = serial;
|
||||
bowhere = boKey + "=:" + boKey;
|
||||
} else {
|
||||
//修改业务申请
|
||||
boKey = "FLOWUNID";
|
||||
boValue = flowunid;
|
||||
bowhere = boKey + "=:" + boKey;
|
||||
}
|
||||
|
||||
fromCondtion.put(boKey, boValue);
|
||||
/**判断客户类型*/
|
||||
if ("03".equals(customerType)) {
|
||||
/**配偶信息拷表*/
|
||||
String marriage = Sqlca.getString("select MARRIAGE from PF_CUSTOMER_PERSON where " + boKey + "='" + boValue + "'");
|
||||
/**判断是否已婚*/
|
||||
if ("01".equals(marriage)) {
|
||||
fromCondtion.put("Spouse_", "Y");
|
||||
toCondtion.put("Spouse_", "Y");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
} else {
|
||||
Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_FAMILY_TEMP where flowunid='" + flowunid + "' and Spouse_='Y'"));
|
||||
}
|
||||
|
||||
/**自然人基本信息拷表*/
|
||||
fromCondtion.remove("Spouse_");
|
||||
toCondtion.remove("Spouse_");
|
||||
otherProperty.remove("PROJECT_ID");
|
||||
otherProperty.put("CERTTYPE", this.getAttribute("certtype").toString());
|
||||
otherProperty.put("CERTID", this.getAttribute("certid").toString());
|
||||
otherProperty.put("INPUTUSERID", asUser.getUserID());
|
||||
otherProperty.put("INPUTORGID", asUser.getOrgID());
|
||||
otherProperty.put("inputtime", StringFunction.getTodayNow());
|
||||
otherProperty.put("FULLNAME", this.getAttribute("custname").toString());
|
||||
otherProperty.put("BALANCESHEET", "申请人");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
|
||||
/**自然人客户居住地址信息拷表*/
|
||||
String dressdetail = Sqlca.getString("select dressdetail from PF_CUSTOMER_ADDRESS where " + boKey + "='" + boValue + "'");
|
||||
String itemname = Sqlca.getString("SELECT cl.itemname FROM PF_CUSTOMER_ADDRESS pca INNER JOIN CODE_LIBRARY cl ON pca.province=cl.itemno WHERE codeno='AreaCode' AND " + boKey + "='" + boValue + "'");
|
||||
otherProperty.clear();
|
||||
otherProperty.put("customerid", customerId);
|
||||
otherProperty.put("flowunid", flowunid);
|
||||
otherProperty.put("addtype", "0060");
|
||||
otherProperty.put("isadd", "yes");
|
||||
otherProperty.put("isnew", "yes");
|
||||
otherProperty.put("country", "CHN");
|
||||
otherProperty.put("FULLADDRESS", itemname + dressdetail);
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
} else {
|
||||
/**法人客户基本信息拷表*/
|
||||
otherProperty.put("customerid", customerId);
|
||||
otherProperty.put("flowunid", flowunid);
|
||||
otherProperty.put("CERTTYPE", this.getAttribute("certtype").toString());
|
||||
otherProperty.put("CERTID", this.getAttribute("certid").toString());
|
||||
otherProperty.put("INPUTUSERID", asUser.getUserID());
|
||||
otherProperty.put("INPUTORGID", asUser.getOrgID());
|
||||
otherProperty.put("inputtime", StringFunction.getTodayNow());
|
||||
otherProperty.put("company_name", this.getAttribute("custname").toString());
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
}
|
||||
|
||||
/**共同申请人信息拷表*/
|
||||
Sqlca.executeSQL(new SqlObject("DELETE FROM CUSTOMER_FAMILY_TEMP WHERE flowunid='" + flowunid + "' AND Spouse_='N'"));
|
||||
fromCondtion.clear();
|
||||
fromCondtion.put(boKey, boValue);
|
||||
fromCondtion.put("Spouse_", "N");
|
||||
toCondtion.clear();
|
||||
toCondtion.put("customerid", customerId);
|
||||
toCondtion.put("flowunid", flowunid);
|
||||
toCondtion.put("Spouse_", "N");
|
||||
otherProperty.clear();
|
||||
otherProperty.put("customerid", customerId);
|
||||
otherProperty.put("flowunid", flowunid);
|
||||
otherProperty.put("PROJECT_ID", projectId);
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
|
||||
/**担保人信息拷表*/
|
||||
Sqlca.executeSQL(new SqlObject("delete from LB_GUARANTEE_UNIT_TEMP where flowunid='" + flowunid + "'"));
|
||||
fromCondtion.clear();
|
||||
otherProperty.clear();
|
||||
otherProperty.put("FLOWUNID", flowunid);
|
||||
otherProperty.put("PROJECT_ID", projectId);
|
||||
ASResultSet res = Sqlca.getASResultSet(new SqlObject("select id from PF_GUARANTEE_UNIT where " + boKey + "='" + boValue + "'"));
|
||||
while (res.next()) {
|
||||
fromCondtion.put("id", res.getString("id"));
|
||||
DataOperatorUtil.copySingleJBO(PF_GUARANTEE_UNIT.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, null, otherProperty, Sqlca);
|
||||
}
|
||||
res.close();
|
||||
fromCondtion.remove("id");
|
||||
|
||||
/**扣款卡信息*/
|
||||
BizObjectManager catBm = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject catBo = catBm.createQuery("flowunid=:flowunid and customerid=:customerid").setParameter("flowunid", flowunid).setParameter("customerid", customerId).getSingleResult(true);
|
||||
BizObject pcaBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_ACCOUNT.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
if (catBo == null) {
|
||||
catBo = catBm.newObject();
|
||||
catBo.setAttributeValue("flowunid", flowunid);
|
||||
catBo.setAttributeValue("customerid", customerId);
|
||||
catBo.setAttributeValue("project_id", projectId);
|
||||
catBo.setAttributeValue("acc_info", "Debit");
|
||||
catBo.setAttributeValue("acc_type", "Debit");
|
||||
catBo.setAttributeValue("CUSTTYPE", "lessee");
|
||||
}
|
||||
catBo.setAttributeValue("acc_number", pcaBo.getAttribute("acc_number"));
|
||||
catBo.setAttributeValue("bank_name", pcaBo.getAttribute("bank_name"));
|
||||
catBo.setAttributeValue("account", pcaBo.getAttribute("account"));
|
||||
catBo.setAttributeValue("MOBILE", pcaBo.getAttribute("MOBILE"));
|
||||
catBo.setAttributeValue("certid", pcaBo.getAttribute("CERTID"));
|
||||
catBm.saveObject(catBo);
|
||||
|
||||
/**租赁物信息拷表*/
|
||||
BizObject pecBo = JBOFactory.createBizObjectQuery(PF_EQUIPMENT_CAR.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
if (pecBo != null) {
|
||||
BizObjectManager lectBm = JBOFactory.getBizObjectManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject lectBo = lectBm.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
lectBo.setAttributeValue("DEVICE_TYPE", pecBo.getAttribute("DEVICE_TYPE"));
|
||||
lectBo.setAttributeValue("DRIVE_TYPE", pecBo.getAttribute("DRIVE_TYPE"));
|
||||
lectBo.setAttributeValue("FRAME_NUMBER", pecBo.getAttribute("FRAME_NUMBER"));
|
||||
lectBo.setAttributeValue("CAR_COLOUR", pecBo.getAttribute("CAR_COLOUR"));
|
||||
lectBo.setAttributeValue("ENGINE_NUMBER", pecBo.getAttribute("ENGINE_NUMBER"));
|
||||
lectBo.setAttributeValue("LICENSE_PLATE_NUMBER", pecBo.getAttribute("LICENSE_PLATE_NUMBER"));
|
||||
lectBo.setAttributeValue("EXPIRYDATE", pecBo.getAttribute("EXPIRYDATE"));
|
||||
lectBo.setAttributeValue("regDate", pecBo.getAttribute("regDate"));
|
||||
lectBo.setAttributeValue("zone", pecBo.getAttribute("zone"));
|
||||
lectBo.setAttributeValue("mile", pecBo.getAttribute("mile"));
|
||||
lectBo.setAttributeValue("MEMO", pecBo.getAttribute("MEMO"));
|
||||
lectBm.saveObject(lectBo);
|
||||
}
|
||||
|
||||
/**项目基本信息拷表*/
|
||||
BizObjectManager lpitBm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject lpitBo = lpitBm.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
BizObject ppiBo = JBOFactory.createBizObjectQuery(PF_PROJECT_INFO.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
String distributorNo = Sqlca.getString("SELECT distributor_no FROM distributor_info di WHERE EXISTS (SELECT 1 FROM user_info ui LEFT JOIN org_info oi ON ui.belongorg=oi.orgid WHERE oi.orgname=di.distributor_name AND ui.userid='" + asUser.getUserID() + "')");
|
||||
|
||||
lpitBo.setAttributeValue("distributor_id", distributorNo);
|
||||
lpitBo.setAttributeValue("inputName", ppiBo.getAttribute("inputName"));
|
||||
lpitBo.setAttributeValue("inputTel", ppiBo.getAttribute("inputTel"));
|
||||
lpitBo.setAttributeValue("IS_NETCAR", ppiBo.getAttribute("IS_NETCAR"));
|
||||
lpitBo.setAttributeValue("source_type", ppiBo.getAttribute("source_type"));
|
||||
lpitBo.setAttributeValue("APPLICATION_NO", ppiBo.getAttribute("APPLICATION_NO"));
|
||||
lpitBo.setAttributeValue("PROJECT_NAME", lpitBo.getAttribute("project_no") + "-" + this.getAttribute("custname").toString());
|
||||
if (!"0".equals(ppiBo.getAttribute("IS_NETCAR").toString())) {
|
||||
lpitBo.setAttributeValue("IS_OPERATION", ppiBo.getAttribute("IS_OPERATION"));
|
||||
lpitBo.setAttributeValue("IS_AFFILIATED", ppiBo.getAttribute("IS_AFFILIATED"));
|
||||
lpitBo.setAttributeValue("IS_OPERATION_QUALIFICATION", ppiBo.getAttribute("IS_OPERATION_QUALIFICATION").toString());
|
||||
lpitBo.setAttributeValue("AFFILIATEDNAME", ppiBo.getAttribute("AFFILIATEDNAME"));
|
||||
lpitBo.setAttributeValue("TRANSPORTCERTID", ppiBo.getAttribute("TRANSPORTCERTID"));
|
||||
lpitBo.setAttributeValue("TRANSPORTDATE", ppiBo.getAttribute("TRANSPORTDATE"));
|
||||
lpitBo.setAttributeValue("NETCERTID", ppiBo.getAttribute("NETCERTID"));
|
||||
lpitBo.setAttributeValue("LEGALPERSONNAME", ppiBo.getAttribute("LEGALPERSONNAME"));
|
||||
lpitBo.setAttributeValue("LEGALPERSONID", ppiBo.getAttribute("LEGALPERSONID"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDDATE", ppiBo.getAttribute("AFFILIATEDDATE"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDENDDATE", ppiBo.getAttribute("AFFILIATEDENDDATE"));
|
||||
lpitBo.setAttributeValue("REGISTEREDMONEY", ppiBo.getAttribute("REGISTEREDMONEY"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDACTUALADDRESS", ppiBo.getAttribute("AFFILIATEDACTUALADDRESS"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDADDRESS", ppiBo.getAttribute("AFFILIATEDADDRESS"));
|
||||
}
|
||||
lpitBm.saveObject(lpitBo);
|
||||
|
||||
/**商务条件*/
|
||||
BizObjectManager lcctBm = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject lcctBo = lcctBm.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
BizObject pccBo = JBOFactory.createBizObjectQuery(PF_CALC_CONDITION.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
|
||||
/**计算综合融资额*/
|
||||
BigDecimal totalAll = new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString());
|
||||
/**购置税是否参融*/
|
||||
String purchaseTaxFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "PURCHASE_TAX", "FINAN");
|
||||
if ("Y".equals(purchaseTaxFinan) && pccBo.getAttribute("PURCHASE_TAX").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()));
|
||||
}
|
||||
/**GPS设备费是否参融*/
|
||||
BigDecimal gpsFee = new BigDecimal(pccBo.getAttribute("GPS_FEE").toString());
|
||||
String gpsFeeFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "GPS_FEE", "FINAN");
|
||||
if ("Y".equals(gpsFeeFinan) && pccBo.getAttribute("GPS_FEE").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("GPS_FEE").toString()));
|
||||
}
|
||||
/**加装费是否参融*/
|
||||
String tablewareFeeFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "TABLEWARE_FEE", "FINAN");
|
||||
if ("Y".equals(tablewareFeeFinan) && pccBo.getAttribute("TABLEWARE_FEE").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()));
|
||||
}
|
||||
/**保险费是否参融*/
|
||||
String insurancePremiumFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "INSURANCE_PREMIUM", "FINAN");
|
||||
if ("Y".equals(insurancePremiumFinan) && pccBo.getAttribute("INSURANCE_PREMIUM").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()));
|
||||
}
|
||||
/**杂费是否参融*/
|
||||
String incidentalFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "INCIDENTAL", "FINAN");
|
||||
if ("Y".equals(incidentalFinan) && pccBo.getAttribute("INCIDENTAL").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()));
|
||||
}
|
||||
|
||||
/**首付款比例*/
|
||||
String firstPaymentRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "FIRST_PAYMENT", "CostType07");
|
||||
BigDecimal firstPaymentReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("FIRST_PAYMENT").toString().length() > 0)
|
||||
if ("EquipAmt".equals(firstPaymentRefer)) {
|
||||
firstPaymentReferB = new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(firstPaymentRefer)) {
|
||||
firstPaymentReferB = new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**保证金比例*/
|
||||
String cautionMoneyRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "CAUTION_MONEY", "CostType07");
|
||||
BigDecimal cautionMoneyReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("CAUTION_MONEY").toString().length() > 0)
|
||||
if ("EquipAmt".equals(cautionMoneyRefer)) {
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(cautionMoneyRefer)) {
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**手续费比例*/
|
||||
String handlingChargeMoneyRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "HANDLING_CHARGE_MONEY", "CostType07");
|
||||
BigDecimal handlingChargeMoneyReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString().length() > 0)
|
||||
if ("EquipAmt".equals(handlingChargeMoneyRefer)) {
|
||||
handlingChargeMoneyReferB = new BigDecimal(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(handlingChargeMoneyRefer)) {
|
||||
handlingChargeMoneyReferB = new BigDecimal(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**加装费比例*/
|
||||
String tablewareFeeRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "TABLEWARE_FEE", "CostType07");
|
||||
BigDecimal tablewareFeeReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("TABLEWARE_FEE").toString().length() > 0)
|
||||
if ("EquipAmt".equals(tablewareFeeRefer)) {
|
||||
tablewareFeeReferB = new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(tablewareFeeRefer)) {
|
||||
tablewareFeeReferB = new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
|
||||
/**购置锐比例*/
|
||||
String purchaseTaxRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "PURCHASE_TAX", "CostType07");
|
||||
BigDecimal purchaseTaxReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("PURCHASE_TAX").toString().length() > 0)
|
||||
if ("EquipAmt".equals(purchaseTaxRefer)) {
|
||||
purchaseTaxReferB = new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(purchaseTaxRefer)) {
|
||||
purchaseTaxReferB = new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**保险费比例*/
|
||||
String insurancePremiumRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "INSURANCE_PREMIUM", "CostType07");
|
||||
BigDecimal insurancePremiumReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("INSURANCE_PREMIUM").toString().length() > 0)
|
||||
if ("EquipAmt".equals(insurancePremiumRefer)) {
|
||||
insurancePremiumReferB = new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(insurancePremiumRefer)) {
|
||||
insurancePremiumReferB = new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**杂费比例*/
|
||||
String incidentalRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "INCIDENTAL", "CostType07");
|
||||
BigDecimal incidentalReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("INCIDENTAL").toString().length() > 0)
|
||||
if ("EquipAmt".equals(incidentalRefer)) {
|
||||
incidentalReferB = new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(incidentalRefer)) {
|
||||
incidentalReferB = new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
if (lcctBo == null) {
|
||||
lcctBo = lcctBm.newObject();
|
||||
}
|
||||
|
||||
lcctBo.setAttributeValue("FLOWUNID", flowunid);
|
||||
lcctBo.setAttributeValue("PROJECT_ID", projectId);
|
||||
planNumber = SerialNumberUtil.getPlannumber(this.getAttribute("ProjectNo").toString(), calType, Sqlca);
|
||||
lcctBo.setAttributeValue("PROJECT_PLAN_NUMBER", planNumber);
|
||||
// 调息方式
|
||||
setProductAdjustRules(otherProperty, productId);
|
||||
lcctBo.setAttributeValue("ADJUST_TYPE", otherProperty.get("ADJUST_TYPE"));
|
||||
lcctBo.setAttributeValue("ADJUST_STYLE", otherProperty.get("ADJUST_STYLE"));
|
||||
// 投放日
|
||||
lcctBo.setAttributeValue("LEASE_AMT_DATE", DateUtil.getToday());
|
||||
lcctBo.setAttributeValue("START_DATE", DateUtil.getToday());
|
||||
// 租金推算方式
|
||||
lcctBo.setAttributeValue("RENT_OR_RATE", "rate");
|
||||
// 设置年利率
|
||||
setYearRate(otherProperty, productId);
|
||||
lcctBo.setAttributeValue("PERIOD_TYPE", otherProperty.get("PERIOD_TYPE"));
|
||||
lcctBo.setAttributeValue("YEAR_RATE", otherProperty.get("YEAR_RATE"));
|
||||
// 设置还款间隔
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR", "income_12");
|
||||
lcctBo.setAttributeValue("INCOME_INTERVAL_MONTH", "1");
|
||||
lcctBo.setAttributeValue("GPS_FEE", gpsFee.toString());
|
||||
lcctBo.setAttributeValue("LEASE_TERM", pccBo.getAttribute("INCOME_NUMBER"));
|
||||
// 计算第一,第二期租金支付日
|
||||
setFirstSecondPlan(otherProperty, productId, pccBo);
|
||||
lcctBo.setAttributeValue("FIRST_PLAN_DATE", otherProperty.get("FIRST_PLAN_DATE"));
|
||||
lcctBo.setAttributeValue("SECOND_PLAN_DATE", otherProperty.get("SECOND_PLAN_DATE"));
|
||||
lcctBo.setAttributeValue("EQUIP_AMT", pccBo.getAttribute("EQUIP_AMT"));
|
||||
lcctBo.setAttributeValue("FIRST_PAYMENT", pccBo.getAttribute("FIRST_PAYMENT"));
|
||||
lcctBo.setAttributeValue("FIRST_PAYMENT_RATIO", firstPaymentReferB);
|
||||
lcctBo.setAttributeValue("FINAL_PAYMENT", pccBo.getAttribute("FINAL_PAYMENT"));
|
||||
lcctBo.setAttributeValue("NOMINAL_PRICE", pccBo.getAttribute("NOMINAL_PRICE"));
|
||||
lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY", pccBo.getAttribute("HANDLING_CHARGE_MONEY"));
|
||||
lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY_RATIO", handlingChargeMoneyReferB);
|
||||
lcctBo.setAttributeValue("CAUTION_MONEY", pccBo.getAttribute("CAUTION_MONEY"));
|
||||
lcctBo.setAttributeValue("CAUTION_MONEY_RATIO", cautionMoneyReferB);
|
||||
lcctBo.setAttributeValue("GPS_FEE_FINA", pccBo.getAttribute("GPS_FEE_FINA"));
|
||||
lcctBo.setAttributeValue("PURCHASE_TAX", pccBo.getAttribute("PURCHASE_TAX"));
|
||||
lcctBo.setAttributeValue("PURCHASE_TAX_RATIO", purchaseTaxReferB);
|
||||
lcctBo.setAttributeValue("INSURANCE_PREMIUM", pccBo.getAttribute("INSURANCE_PREMIUM"));
|
||||
lcctBo.setAttributeValue("INSURANCE_PREMIUM_RATIO", insurancePremiumReferB);
|
||||
lcctBo.setAttributeValue("SETTLE_METHOD", pccBo.getAttribute("SETTLE_METHOD"));
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER", pccBo.getAttribute("INCOME_NUMBER"));
|
||||
lcctBo.setAttributeValue("DefaultDueDay", pccBo.getAttribute("DefaultDueDay"));
|
||||
lcctBo.setAttributeValue("TABLEWARE_FEE", pccBo.getAttribute("TABLEWARE_FEE"));
|
||||
lcctBo.setAttributeValue("TABLEWARE_FEE_RATIO", tablewareFeeReferB);
|
||||
lcctBo.setAttributeValue("INCIDENTAL", pccBo.getAttribute("INCIDENTAL"));
|
||||
lcctBo.setAttributeValue("INCIDENTAL_RATIO", incidentalReferB);
|
||||
lcctBo.setAttributeValue("TOTAL_ALL", totalAll);
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT", pccBo.getAttribute("FIRST_PAYMENT").toString());
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT_RATIO", new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).multiply(new BigDecimal("100")).divide(totalAll, 6, BigDecimal.ROUND_HALF_UP));
|
||||
lcctBo.setAttributeValue("CLEAN_LEASE_MONEY", totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())));
|
||||
lcctBo.setAttributeValue("RENT_RATIO", totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
||||
lcctBo.setAttributeValue("DISCOUNT", "");
|
||||
lcctBm.saveObject(lcctBo);
|
||||
|
||||
// 自动测算
|
||||
autoCalc(flowunid, calType, planNumber, productId, Sqlca);
|
||||
|
||||
return "true";
|
||||
}
|
||||
|
||||
public void setProductAdjustRules(Map<String, String> otherProperty, String productId) throws Exception {
|
||||
Map<String, Map<String, String>> map = ProductParamUtil.getProductComponentType(productId, "PRD0320");
|
||||
if (map.containsKey("ADJUST_INTEREST")) {
|
||||
Map<String, String> rule = map.get("ADJUST_INTEREST");
|
||||
if (null != rule.get("rate_float_type") && null != rule.get("adjust_style")) {
|
||||
//调息方式
|
||||
otherProperty.put("ADJUST_TYPE", rule.get("rate_float_type"));
|
||||
otherProperty.put("ADJUST_STYLE", rule.get("adjust_style"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setYearRate(Map<String, String> otherProperty, String productId) throws Exception {
|
||||
Map<String, Map<String, String>> productRates = ProductParamUtil.getProductComponentType(productId, "PRD0350");
|
||||
Map<String, String> productRate = productRates.get("product_rate");
|
||||
String periodType = ProductParamUtil.getProductParameterValue(productId, "PRD0350", "period_type", "begin_end");
|
||||
periodType = periodType == null ? "period_type_0" : periodType;
|
||||
otherProperty.put("PERIOD_TYPE", periodType);
|
||||
if (productRate != null) {
|
||||
String yearRate = productRate.get("ProductRate") == null ? "0" : productRate.get("ProductRate");
|
||||
otherProperty.put("YEAR_RATE", yearRate);
|
||||
}
|
||||
}
|
||||
|
||||
public void setFirstSecondPlan(Map<String, String> otherProperty, String productId, BizObject fcc) throws Exception {
|
||||
String periodType = otherProperty.get("PERIOD_TYPE");
|
||||
String leaseAmtDate = DateUtil.getToday();
|
||||
String incomeIntervalMonth = "1";
|
||||
String defaultDueDay = fcc.getAttribute("DefaultDueDay").toString();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
||||
Date lad = sdf.parse(leaseAmtDate);
|
||||
lad = DateUtils.setDays(lad, Integer.parseInt(defaultDueDay));
|
||||
String firstPlanDate = "";
|
||||
String secondPlanDate = "";
|
||||
if ("period_type_1".equals(periodType)) {
|
||||
firstPlanDate = leaseAmtDate;
|
||||
secondPlanDate = sdf.format(DateUtils.addMonths(lad, Integer.parseInt(incomeIntervalMonth)));
|
||||
} else {
|
||||
firstPlanDate = sdf.format(DateUtils.addMonths(lad, Integer.parseInt(incomeIntervalMonth)));
|
||||
secondPlanDate = sdf.format(DateUtils.addMonths(lad, Integer.parseInt(incomeIntervalMonth) * 2));
|
||||
}
|
||||
otherProperty.put("FIRST_PLAN_DATE", firstPlanDate);
|
||||
otherProperty.put("SECOND_PLAN_DATE", secondPlanDate);
|
||||
}
|
||||
|
||||
public void autoCalc(String flowunid, String calType, String planNumber, String productId, JBOTransaction tx) throws Exception {
|
||||
CreateTransactionExecutor cte = new CreateTransactionExecutor();
|
||||
cte.setCalType(calType);
|
||||
cte.setFlowunid(flowunid);
|
||||
cte.setPlannumber(planNumber);
|
||||
cte.setProductId(productId);
|
||||
System.out.println("===========================自动测算开始===============================");
|
||||
cte.runTrans(tx);
|
||||
System.out.println("===========================自动测算结束===============================");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user