86 lines
3.0 KiB
Java
86 lines
3.0 KiB
Java
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(new BigDecimal(cleanLeaseMoney).compareTo( clm ) != 0){
|
|
return "分段融资额和综合融资额不一致,请检查!";
|
|
}
|
|
/*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;
|
|
}
|
|
}
|
|
|