diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java index 15f8edaef..32f743838 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java @@ -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 otherProperty, String productId) throws Exception { + public void setYearRate(Map otherProperty, String productId,BizObject lcctBo) throws Exception { Map> productRates = ProductParamUtil.getProductComponentType(productId, "PRD0350"); Map 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); + } } }