From b895ca8934c6f51b448f42b34988b0bed5f9f01d Mon Sep 17 00:00:00 2001 From: tangfutang <3218982385@qq.com> Date: Thu, 29 Jul 2021 17:39:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E6=AE=B5=E8=9E=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LoanSimulation/LoanBasicInfo.jsp | 16 +++- .../tenwa/reckon/check/SubsectionCheck.java | 81 +++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 calc/com/tenwa/reckon/check/SubsectionCheck.java diff --git a/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp b/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp index 2a154c51f..819cbcc68 100644 --- a/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp +++ b/WebContent/Accounting/LoanSimulation/LoanBasicInfo.jsp @@ -898,7 +898,6 @@ function changeSettleMethod2(){ }); $("#INCOME_NUMBER_YEAR").val(incomeValue); } - document.all( 'A_Group_0020' ).style.display = 'none'; showItem(0,"SUBSECTION_CONDIG",'none'); if ( settleMethod === 'segmented_financing' ) { @@ -1087,6 +1086,21 @@ function changeCorpusRatio(){ } function saveRecord(sPostEvents){ + var settleMethod=getItemValue(0,0,"SETTLE_METHOD"); + if(settleMethod === 'segmented_financing'){ + var subsectionCondig=getItemValue(0,0,"SUBSECTION_CONDIG"); + if(typeof(subsectionCondig) == "undefined" || subsectionCondig.length == 0 ){ + alert("请先选择分段配置信息!"); + return ; + } + var equipAmt=getItemValue(0,0,"EQUIP_AMT"); + var cleanLeaseMoney=getItemValue(0,0,"CLEAN_LEASE_MONEY"); + var checkSubsectionInfo= AsControl.RunJavaMethod("com.tenwa.reckon.check.SubsectionCheck","checkSubsectionInfo","flowUnid=<%=flowunid%>"+",equipAmt="+equipAmt+",cleanLeaseMoney="+cleanLeaseMoney+",subsectionCondig="+subsectionCondig); + if(checkSubsectionInfo != "success"){ + alert(checkSubsectionInfo); + return ; + } + } if(getItemValue(0,0,"PURCHASE_TAX") < 0){ alert("购置税不能小于0"); return; diff --git a/calc/com/tenwa/reckon/check/SubsectionCheck.java b/calc/com/tenwa/reckon/check/SubsectionCheck.java new file mode 100644 index 000000000..4acb7b5d2 --- /dev/null +++ b/calc/com/tenwa/reckon/check/SubsectionCheck.java @@ -0,0 +1,81 @@ +package com.tenwa.reckon.check; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import jbo.app.tenwa.calc.LC_CALC_SUBSECTION_INFO_TEMP; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public class SubsectionCheck { + private String flowUnid ; + private String equipAmt ; + private String cleanLeaseMoney ; + private String subsectionCondig ; + + + public String checkSubsectionInfo() throws Exception{ + BizObjectManager lcsitManage = JBOFactory.getBizObjectManager(LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME); + List lcsits = lcsitManage.createQuery("flowunid=:flowunid").setParameter("flowunid", flowUnid).getResultList(false); + if( lcsits == null || lcsits.size()==0){ + return "分段信息为空,请检查!"; + } + lcsits = lcsitManage.createQuery("flowunid=:flowunid and (v.ifnull(CLEAN_LEASE_MONEY,0) > 0 or v.ifnull(FINANCING_RATE,0) > 0 or v.ifnull(INCOME_NUMBER,0) > 0)").setParameter("flowunid", flowUnid).getResultList(false); + if( lcsits == null || lcsits.size()==0){ + return "分段信息中有融资金额、融资利率、期次为空,请检查!"; + } + List> dataClm = DataOperatorUtil.getDataBySql("select sum(ifnull(CLEAN_LEASE_MONEY,0)) as CLEAN_LEASE_MONEY from LC_CALC_SUBSECTION_INFO_TEMP where flowunid='"+flowUnid+"' group by flowunid"); + BigDecimal clm = new BigDecimal("0"); + if( dataClm != null && dataClm.size() > 0 ){ + clm = new BigDecimal(dataClm.get(0).get("CLEAN_LEASE_MONEY")); + } + if(subsectionCondig.equals("CarPrice")){ + if(new BigDecimal(equipAmt).compareTo( clm ) != 0){ + return "分段融资额和车价金额不一致,请检查!"; + } + }else if(subsectionCondig.equals("FinancingPrice")){ + if(new BigDecimal(cleanLeaseMoney).compareTo( clm ) != 0){ + return "分段融资额和综合融资额不一致,请检查!"; + } + }else{ + return "没有检查到对应的分段配置,请检查!"; + } + return "success"; + } + + + public String getFlowUnid() { + return flowUnid; + } + public void setFlowUnid(String flowUnid) { + this.flowUnid = flowUnid; + } + + public String getEquipAmt() { + return equipAmt; + } + + public void setEquipAmt(String equipAmt) { + this.equipAmt = equipAmt; + } + + public String getCleanLeaseMoney() { + return cleanLeaseMoney; + } + + public void setCleanLeaseMoney(String cleanLeaseMoney) { + this.cleanLeaseMoney = cleanLeaseMoney; + } + + public String getSubsectionCondig() { + return subsectionCondig; + } + + public void setSubsectionCondig(String subsectionCondig) { + this.subsectionCondig = subsectionCondig; + } +} +