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 32f743838..9dfe2db26 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java @@ -365,7 +365,7 @@ public class PlatformDataToTemp extends BaseBussiness { // 租金推算方式 lcctBo.setAttributeValue("RENT_OR_RATE", "rate"); // 设置年利率 - setYearRate(otherProperty, productId,lcctBo); + setYearRate(otherProperty, productId); lcctBo.setAttributeValue("PERIOD_TYPE", otherProperty.get("PERIOD_TYPE")); lcctBo.setAttributeValue("YEAR_RATE", otherProperty.get("YEAR_RATE")); // 设置还款间隔 @@ -425,30 +425,20 @@ public class PlatformDataToTemp extends BaseBussiness { } } - public void setYearRate(Map otherProperty, String productId,BizObject lcctBo) throws Exception { + + public void setYearRate(Map otherProperty, String productId) 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 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); - } + String yearRate = productRate.get("ProductRate") == null ? "0" : productRate.get("ProductRate"); + otherProperty.put("YEAR_RATE", yearRate); } } + public void setFirstSecondPlan(Map otherProperty, String productId, BizObject fcc) throws Exception { String periodType = otherProperty.get("PERIOD_TYPE"); String leaseAmtDate = DateUtil.getToday(); diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTempNotKjflc.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTempNotKjflc.java index 1428e69ee..3eb39c8d0 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTempNotKjflc.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTempNotKjflc.java @@ -159,7 +159,7 @@ public class PlatformDataToTempNotKjflc 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")); // 设置还款间隔 @@ -219,15 +219,27 @@ public class PlatformDataToTempNotKjflc 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); + } } }