添加分段融部分校验
This commit is contained in:
parent
4684322a5b
commit
b895ca8934
@ -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;
|
||||
|
||||
81
calc/com/tenwa/reckon/check/SubsectionCheck.java
Normal file
81
calc/com/tenwa/reckon/check/SubsectionCheck.java
Normal file
@ -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<Map<String, String>> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user