接口平台业务申请拷表脚本
This commit is contained in:
parent
1d4000227e
commit
a477b9b31c
@ -5,9 +5,7 @@ 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;
|
||||
@ -24,7 +22,6 @@ 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;
|
||||
@ -241,6 +238,74 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
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.add(new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()));
|
||||
}
|
||||
|
||||
String gpsFeeFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","GPS_FEE","FINAN");
|
||||
String gpsFee = ProductParamUtil.getProductParameterValue(productId,"GPS_FEE","CostType08");
|
||||
if("Y".equals(gpsFeeFinan)&&gpsFee.length()>0){
|
||||
totalAll.add(new BigDecimal(gpsFee));
|
||||
}
|
||||
|
||||
String tablewareFeeFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","TABLEWARE_FEE","FINAN");
|
||||
if("Y".equals(tablewareFeeFinan)&&pccBo.getAttribute("TABLEWARE_FEE").toString().length()>0){
|
||||
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.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.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);
|
||||
}
|
||||
|
||||
if(lcctBo==null){
|
||||
lcctBo = lcctBm.newObject();
|
||||
}
|
||||
@ -265,9 +330,7 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
// 设置还款间隔
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR","income_12");
|
||||
lcctBo.setAttributeValue("INCOME_INTERVAL_MONTH","1");
|
||||
lcctBo.setAttributeValue("GPS_FEE",ProductParamUtil.getProductParameterValue(productId,"GPS_FEE","CostType08"));
|
||||
//¾»ÈÚ×ʶî
|
||||
lcctBo.setAttributeValue("CLEAN_LEASE_MONEY",setCleanLeaseMoney(pccBo,productId));
|
||||
lcctBo.setAttributeValue("GPS_FEE",gpsFee);
|
||||
lcctBo.setAttributeValue("LEASE_TERM",pccBo.getAttribute( "INCOME_NUMBER" ));
|
||||
// 计算第一,第二期租金支付日
|
||||
setFirstSecondPlan(otherProperty,productId,pccBo);
|
||||
@ -275,16 +338,28 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
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("INSURANCE_PREMIUM",pccBo.getAttribute("INSURANCE_PREMIUM"));
|
||||
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("TOTAL_ALL",totalAll);
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT",pccBo.getAttribute("FIRST_PAYMENT").toString());
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT_RATIO",firstPaymentReferB);
|
||||
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);
|
||||
|
||||
// 自动测算
|
||||
@ -293,18 +368,6 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
return "true";
|
||||
}
|
||||
|
||||
public String setCleanLeaseMoney(BizObject fcc,String productId) throws Exception {
|
||||
String equipAmt = fcc.getAttribute( "EQUIP_AMT" ).toString();
|
||||
String firstPayment = fcc.getAttribute( "FIRST_PAYMENT" ).toString();
|
||||
String gpsFee = ProductParamUtil.getProductParameterValue(productId,"GPS_FEE","CostType08");
|
||||
|
||||
BigDecimal financingMoney = BigDecimal.ZERO;
|
||||
financingMoney = financingMoney.add( new BigDecimal( "".equals( gpsFee ) ? "0" : gpsFee ) );
|
||||
// TODO ²¹³äÆäËûÈÚ×ÊÏî
|
||||
|
||||
return new BigDecimal("".equals( equipAmt ) ? "0" : equipAmt ).subtract(new BigDecimal( "".equals( firstPayment ) ? "0" : firstPayment ) ).add( financingMoney ).toString();
|
||||
}
|
||||
|
||||
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" ) ){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user