From 1bb93ff3868c8b963aeb7cb50a89951e05be350a Mon Sep 17 00:00:00 2001 From: zhulianghua Date: Tue, 24 Jul 2018 11:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E7=AE=97=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=BF=98=E6=AC=BE=E6=97=A5=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E6=81=AF=E6=96=B9=E5=BC=8F=EF=BC=8C=E7=A7=9F=E9=87=91=E6=8E=A8?= =?UTF-8?q?=E7=AE=97=E6=96=B9=E5=BC=8F=EF=BC=8C=E8=B4=B4=E6=81=AF=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LoanSimulation/LoanBasicInfo.jsp | 21 ++++++----- .../reckon/product/ProductCondition.java | 35 ++++++++++++++----- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp b/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp index ea7e4419b..bb2cba4ac 100644 --- a/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp +++ b/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp @@ -25,8 +25,6 @@ String nodeNo=CurPage.getParameter("NodeNo"); String RightType= CurPage.getParameter("RightType"); String calType = CurPage.getParameter("calType"); - String FlowNo = CurPage.getParameter("FlowNo"); - String PhaseNo = CurPage.getParameter("PhaseNo"); //判断是否为汽车业务 boolean isCarProduct = "004".equals(productId) ? false : true; /*获取参数*/ @@ -131,9 +129,6 @@ /*设置页面属性*/ CurPage.getCurComp().setAttribute("RightType", null); - if(FlowNo.equals("BusinessApplyFlow")&&(PhaseNo.equals("0010")||PhaseNo.equals("0020"))){ - doTemp.setVisible("RENT_RATIO",false); - } Parameter p=new Parameter("plannumber",plannumber); Vector v=CurPage.parameterList; v.add(p); @@ -188,7 +183,6 @@ $(function(){ incomeNumberYear=$("#INCOME_NUMBER_YEAR").children(); adjustType=$("#ADJUST_TYPE").children(); var fundRules=calcRules["fund"]; - console.log(fundRules); for(var key in fundRules){ $("#"+key).bind("change",function(){ getRatioByMoney(this); @@ -300,7 +294,17 @@ CalcControl.InitStartDate=function(){ var periodType=getItemValue(0,getRow(),"PERIOD_TYPE");//期初期末 var incomenumberyear=Number(getItemValue(0,getRow(),"INCOME_NUMBER_YEAR").split("_")[1]);//还款间隔 var rentDay=getItemValue(0,getRow(0),"DEFAULTDUEDAY");//还款日 - + var method = calcRules["method"]; + var methodName = ""; + for(var i in method) { + methodName = i; + break; + } + //是按起租日计算的情况,直接读取当前日期 + if(calcRules["method"][methodName]["DefaultDueDay"] != "02") { + rentDay = calcRules["method"][methodName]["ActualDay"]; + } + //默认起租日为投放日 if("period_type_1" == periodType){//期初 第一期还款日为投放日 setItemValue(0,0,"FIRST_PLAN_DATE",leaseAmtDate); @@ -795,8 +799,7 @@ function getRatioByMoney(e){ var firstPaymentRatio = getItemValue(0, 0, "FIRST_PAYMENT_RATIO_0"); var ratio = 100 - Number(firstPaymentRatio); if(ratio > 0 && allMoney != 0) { - //cleanLeaseMoney = allMoney * (ratio / 100); - cleanLeaseMoney = allMoney-equipAmt*firstPaymentRatio/100; + cleanLeaseMoney = allMoney * (ratio / 100); setItemValue(0, 0, "RENT_RATIO", ((cleanLeaseMoney / equipAmt) * 100).toFixed(6)); setItemValue(0, 0, "CLEAN_LEASE_MONEY", cleanLeaseMoney); } diff --git a/calc/com/tenwa/reckon/product/ProductCondition.java b/calc/com/tenwa/reckon/product/ProductCondition.java index 1e8aaa123..7a3583afc 100644 --- a/calc/com/tenwa/reckon/product/ProductCondition.java +++ b/calc/com/tenwa/reckon/product/ProductCondition.java @@ -1,8 +1,10 @@ package com.tenwa.reckon.product; +import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Vector; import jbo.sys.CODE_LIBRARY; @@ -341,17 +343,23 @@ public class ProductCondition { Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0320"); if(map.containsKey("ADJUST_INTEREST")){ Map rule=map.get("ADJUST_INTEREST"); - if("N".equals(rule.get("ISADJUST_INTEREST"))){ + /*if("N".equals(rule.get("ISADJUST_INTEREST"))){ doTemp.setColumnAttribute("ADJUST_STYLE","colvisible", "0"); doTemp.setColumnAttribute("ADJUST_TYPE","colvisible", "0"); }else if("Y".equals(rule.get("ISADJUST_INTEREST"))){ - doTemp.setColumnAttribute("ADJUST_STYLE","colvisible", "0"); - doTemp.setColumnAttribute("ADJUST_TYPE","colvisible", "0"); + doTemp.setColumnAttribute("ADJUST_STYLE","colvisible", "1"); + doTemp.setColumnAttribute("ADJUST_TYPE","colvisible", "1"); //调息生效节点 doTemp.setColumnAttribute("ADJUST_STYLE","coleditsource","jbo.sys.CODE_LIBRARY,itemno,itemname,codeno='adjust_style' and itemno in ("+this.getSqlWhere(rule.get("adjust_style"))+") order by sortno"); //调息方式 doTemp.setColumnAttribute("ADJUST_TYPE","coleditsource","jbo.sys.CODE_LIBRARY,itemno,itemname,codeno='adjust_type' and itemno in ("+this.getSqlWhere(rule.get("rate_float_type"))+") order by sortno"); + }*/ + if(null != rule.get("rate_float_type") && null != rule.get("adjust_style")) { + //调息方式 + doTemp.setDefaultValue("ADJUST_TYPE", rule.get("rate_float_type")); + //调息生效节点 + doTemp.setDefaultValue("ADJUST_STYLE", rule.get("adjust_style")); } } } @@ -394,26 +402,35 @@ public class ProductCondition { if(values.containsKey("InterestDayType")){ doTemp.setDefaultValue("INTEREST_DAY_TYPE", values.get("InterestDayType")); } - } - - + //是按起租日计算的情况,直接读取当前日期 + Map valMap = entry.getValue(); + for(Entry val : valMap.entrySet()) { + if("DefaultDueDay".equals(val.getKey())) { + if(!"02".equals(val.getValue())) { + sJson = sJson.replaceAll("}", ",ActualDay:" + Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "}"); + doTemp.setVisible("DefaultDueDay", false); + doTemp.setRequired("DefaultDueDay", false); + } + break; + } + } } if(submap.containsKey("ISSUBSECTION")){ if(s.length()>0)s+=","; s+="'even_subsection'"; } - if(s.indexOf("even_rent") != -1) { + /*if(s.indexOf("even_rent") != -1) { s = "'even_rent'"; } else if(s.indexOf("even_corpus") != -1) { s = "'even_corpus'"; } else { s = "'even_interest'"; - } + }*/ doTemp.setReadOnly("SETTLE_METHOD", true); doTemp.setColumnAttribute("SETTLE_METHOD","coleditsource","jbo.sys.CODE_LIBRARY,itemno,itemname,codeno='settle_method' and itemno in ("+s+") order by sortno"); - + doTemp.setDefaultValue("SETTLE_METHOD", s.replaceAll("'", "")); return "{"+sJson+"}";