获取年利率

This commit is contained in:
tangfutang 2020-09-05 09:29:38 +08:00
parent 891b8396f6
commit c70fe25fb8

View File

@ -16,6 +16,7 @@ import com.tenwa.flow.baseBussion.BaseBussiness;
import com.tenwa.httpclient.resources.InterfacePlatformConfigure;
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;
@ -25,6 +26,7 @@ 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;
@ -363,7 +365,7 @@ public class PlatformDataToTemp extends BaseBussiness {
// 租金推算方式
lcctBo.setAttributeValue("RENT_OR_RATE", "rate");
// 设置年利率
setYearRate(otherProperty, productId);
setYearRate(otherProperty, productId,lcctBo);
lcctBo.setAttributeValue("PERIOD_TYPE", otherProperty.get("PERIOD_TYPE"));
lcctBo.setAttributeValue("YEAR_RATE", otherProperty.get("YEAR_RATE"));
// 设置还款间隔
@ -423,15 +425,27 @@ public class PlatformDataToTemp extends BaseBussiness {
}
}
public void setYearRate(Map<String, String> otherProperty, String productId) throws Exception {
public void setYearRate(Map<String, String> otherProperty, String productId,BizObject lcctBo) 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);
String isFixedRate = productRate.get("isFixedRate") == null ? "Y" : productRate.get("isFixedRate");
if("N".equals(isFixedRate)){
String RateTermScopeMax = productRate.get("RateTermScope-MAX") == null ? "0" : productRate.get("RateTermScope-MAX");
String RateTermScopeMin = productRate.get("RateTermScope-MIN") == null ? "0" : productRate.get("RateTermScope-MIN");
String yearRate = lcctBo.getAttribute("YEAR_RATE")==null ? "-1": lcctBo.getAttribute("YEAR_RATE").toString();
if(new BigDecimal(RateTermScopeMax).compareTo(new BigDecimal(yearRate))>=0 && new BigDecimal(yearRate).compareTo(new BigDecimal(RateTermScopeMin))>=0){
otherProperty.put("YEAR_RATE", yearRate);
}else{
throw new Exception("ÊäÈëµÄÄêÀûÂʲ»ºÏ·¨£¡");
}
}else{
String yearRate = productRate.get("ProductRate") == null ? "0" : productRate.get("ProductRate");
otherProperty.put("YEAR_RATE", yearRate);
}
}
}