修改还款方式赋值操作,保存客户证件临时数据
This commit is contained in:
parent
0184b1900b
commit
75bdb21a5a
@ -16,17 +16,12 @@ import com.tenwa.flow.baseBussion.BaseBussiness;
|
||||
import com.tenwa.httpclient.resources.InterfacePlatformConfigure;
|
||||
import com.tenwa.reckon.executor.CreateTransactionExecutor;
|
||||
import com.tenwa.util.SerialNumberUtil;
|
||||
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ADDRESS_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
|
||||
import jbo.app.tenwa.customer.*;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
|
||||
import jbo.sys.*;
|
||||
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -113,6 +108,23 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
otherProperty.put("BALANCESHEET", "申请人");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
|
||||
String cert_customerId = Sqlca.getString("SELECT customerid FROM CUSTOMER_CERT_TEMP WHERE flowunid='" + flowunid + "'");
|
||||
if (cert_customerId == null) {
|
||||
//Ö¤¼þºÅÂëÁÙʱ±í
|
||||
BizObjectManager bomCT = JBOFactory.getBizObjectManager(CUSTOMER_CERT_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject bomCTObject = bomCT.newObject();
|
||||
bomCTObject.setAttributeValue("customerid", customerId);
|
||||
bomCTObject.setAttributeValue("certid", this.getAttribute("certid").toString());
|
||||
bomCTObject.setAttributeValue("certtype", this.getAttribute("certtype").toString());
|
||||
bomCTObject.setAttributeValue("status", "valid");
|
||||
bomCTObject.setAttributeValue("flowunid", flowunid);
|
||||
bomCTObject.setAttributeValue("issuecountry", "CHN");
|
||||
bomCTObject.setAttributeValue("inputuserid", asUser.getUserID());
|
||||
bomCTObject.setAttributeValue("inputorgid", asUser.getOrgID());
|
||||
bomCTObject.setAttributeValue("inputtime", StringFunction.getToday());
|
||||
bomCT.saveObject(bomCTObject);
|
||||
}
|
||||
|
||||
/**自然人客户居住地址信息拷表*/
|
||||
String dressdetail = Sqlca.getString("select dressdetail from PF_CUSTOMER_ADDRESS where " + boKey + "='" + boValue + "'");
|
||||
String itemname = Sqlca.getString("SELECT cl.itemname FROM PF_CUSTOMER_ADDRESS pca INNER JOIN CODE_LIBRARY cl ON pca.province=cl.itemno WHERE codeno='AreaCode' AND " + boKey + "='" + boValue + "'");
|
||||
@ -187,6 +199,7 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
catBo.setAttributeValue("certid", pcaBo.getAttribute("CERTID"));
|
||||
catBm.saveObject(catBo);
|
||||
|
||||
|
||||
/**租赁物信息拷表*/
|
||||
BizObject pecBo = JBOFactory.createBizObjectQuery(PF_EQUIPMENT_CAR.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
if (pecBo != null) {
|
||||
@ -289,7 +302,7 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(cautionMoneyRefer)) {
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}else if ("EquipEndAmt".equals(cautionMoneyRefer)){
|
||||
} else if ("EquipEndAmt".equals(cautionMoneyRefer)) {
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
@ -345,10 +358,10 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
}
|
||||
/**逾期罚息比例*/
|
||||
String PENA_RATE = ProductParamUtil.getProductParameterValue(productId, "PRD0308", "PENALTY_RATE_DAY", "PENALTY_RATE_DAY");
|
||||
if("".equals(PENA_RATE)||PENA_RATE==null){
|
||||
PENA_RATE="0";
|
||||
if ("".equals(PENA_RATE) || PENA_RATE == null) {
|
||||
PENA_RATE = "0";
|
||||
}
|
||||
|
||||
|
||||
if (lcctBo == null) {
|
||||
lcctBo = lcctBm.newObject();
|
||||
}
|
||||
@ -371,7 +384,8 @@ public class PlatformDataToTemp extends BaseBussiness {
|
||||
lcctBo.setAttributeValue("PERIOD_TYPE", otherProperty.get("PERIOD_TYPE"));
|
||||
lcctBo.setAttributeValue("YEAR_RATE", otherProperty.get("YEAR_RATE"));
|
||||
// 设置还款间隔
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR", "income_12");
|
||||
String IncomeNumberYear = ProductParamUtil.getProductParameterValue(productId, "PRD0301", "even_rent", "PayFrequencyType");
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR", IncomeNumberYear);
|
||||
lcctBo.setAttributeValue("INCOME_INTERVAL_MONTH", "1");
|
||||
lcctBo.setAttributeValue("GPS_FEE", gpsFee.toString());
|
||||
lcctBo.setAttributeValue("LEASE_TERM", pccBo.getAttribute("INCOME_NUMBER"));
|
||||
|
||||
@ -7,12 +7,15 @@ import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.lang.StringX;
|
||||
import com.amarsoft.are.util.StringFunction;
|
||||
import com.amarsoft.awe.util.ASResultSet;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.tenwa.flow.baseBussion.BaseBussiness;
|
||||
import com.tenwa.httpclient.resources.InterfacePlatformConfigure;
|
||||
import com.tenwa.reckon.executor.CreateTransactionExecutor;
|
||||
import com.tenwa.util.SerialNumberUtil;
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_CERT_TEMP;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -39,6 +42,22 @@ public class PlatformDataToTempNotKjflc extends BaseBussiness {
|
||||
String productId = this.getAttribute("ProductId").toString();
|
||||
String calType = "proj_process";
|
||||
|
||||
ASResultSet asResultSet2 = Sqlca.getASResultSet2("SELECT cit.customerid as customerid_info ,cct.customerid customerid_cert FROM CUSTOMER_INFO_TEMP cit left join CUSTOMER_CERT_TEMP cct on cit.flowunid = cct.flowunid where cit.flowunid ='" + flowunid + "'");
|
||||
if (asResultSet2.next() && asResultSet2.getString("customerid_cert") == null) {
|
||||
//Ö¤¼þºÅÂëÁÙʱ±í
|
||||
BizObjectManager bomCT = JBOFactory.getBizObjectManager(CUSTOMER_CERT_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject bomCTObject = bomCT.newObject();
|
||||
bomCTObject.setAttributeValue("customerid", asResultSet2.getString("customerid_info"));
|
||||
bomCTObject.setAttributeValue("certid", this.getAttribute("certid").toString());
|
||||
bomCTObject.setAttributeValue("certtype", this.getAttribute("certtype").toString());
|
||||
bomCTObject.setAttributeValue("status", "valid");
|
||||
bomCTObject.setAttributeValue("flowunid", flowunid);
|
||||
bomCTObject.setAttributeValue("issuecountry", "CHN");
|
||||
bomCTObject.setAttributeValue("inputuserid", this.getAttribute("CurUserID").toString());
|
||||
bomCTObject.setAttributeValue("inputtime", StringFunction.getToday());
|
||||
bomCT.saveObject(bomCTObject);
|
||||
}
|
||||
|
||||
/**商务条件*/
|
||||
BizObjectManager lcctBm = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject lcctBo = lcctBm.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
@ -91,7 +110,7 @@ public class PlatformDataToTempNotKjflc extends BaseBussiness {
|
||||
cautionMoneyReferB = new BigDecimal(lcctBo.getAttribute("CAUTION_MONEY").toString()).divide(new BigDecimal(lcctBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(cautionMoneyRefer)) {
|
||||
cautionMoneyReferB = new BigDecimal(lcctBo.getAttribute("CAUTION_MONEY").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}else if ("EquipEndAmt".equals(cautionMoneyRefer)){
|
||||
} else if ("EquipEndAmt".equals(cautionMoneyRefer)) {
|
||||
cautionMoneyReferB = new BigDecimal(lcctBo.getAttribute("CAUTION_MONEY").toString()).divide(totalAll.subtract(new BigDecimal(lcctBo.getAttribute("FIRST_PAYMENT").toString())), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
@ -147,8 +166,8 @@ public class PlatformDataToTempNotKjflc extends BaseBussiness {
|
||||
}
|
||||
/**逾期罚息比例*/
|
||||
String PENA_RATE = ProductParamUtil.getProductParameterValue(productId, "PRD0308", "PENALTY_RATE_DAY", "PENALTY_RATE_DAY");
|
||||
if("".equals(PENA_RATE)||PENA_RATE==null){
|
||||
PENA_RATE="0";
|
||||
if ("".equals(PENA_RATE) || PENA_RATE == null) {
|
||||
PENA_RATE = "0";
|
||||
}
|
||||
lcctBo.setAttributeValue("PROJECT_ID", projectId);
|
||||
String planNumber = SerialNumberUtil.getPlannumber(this.getAttribute("ProjectNo").toString(), calType, Sqlca);
|
||||
@ -165,11 +184,12 @@ public class PlatformDataToTempNotKjflc extends BaseBussiness {
|
||||
// 租金推算方式
|
||||
lcctBo.setAttributeValue("RENT_OR_RATE", "rate");
|
||||
// 设置年利率
|
||||
setYearRate(otherProperty, productId,lcctBo);
|
||||
setYearRate(otherProperty, productId, lcctBo);
|
||||
lcctBo.setAttributeValue("PERIOD_TYPE", otherProperty.get("PERIOD_TYPE"));
|
||||
lcctBo.setAttributeValue("YEAR_RATE", otherProperty.get("YEAR_RATE"));
|
||||
// 设置还款间隔
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR", "income_12");
|
||||
String IncomeNumberYear = ProductParamUtil.getProductParameterValue(productId, "PRD0301", "even_rent", "PayFrequencyType");
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR", IncomeNumberYear);
|
||||
lcctBo.setAttributeValue("INCOME_INTERVAL_MONTH", "1");
|
||||
lcctBo.setAttributeValue("GPS_FEE", gpsFee.toString());
|
||||
lcctBo.setAttributeValue("LEASE_TERM", lcctBo.getAttribute("INCOME_NUMBER"));
|
||||
@ -226,7 +246,7 @@ public class PlatformDataToTempNotKjflc extends BaseBussiness {
|
||||
}
|
||||
}
|
||||
|
||||
public void setYearRate(Map<String, String> otherProperty, String productId,BizObject lcctBo) throws Exception {
|
||||
public void setYearRate(Map<String, String> otherProperty, String productId, BizObject lcctBo) throws Exception {
|
||||
Map<String, Map<String, String>> productRates = ProductParamUtil.getProductComponentType(productId, "PRD0350");
|
||||
Map<String, String> productRate = productRates.get("product_rate");
|
||||
String periodType = ProductParamUtil.getProductParameterValue(productId, "PRD0350", "period_type", "begin_end");
|
||||
@ -234,16 +254,16 @@ public class PlatformDataToTempNotKjflc extends BaseBussiness {
|
||||
otherProperty.put("PERIOD_TYPE", periodType);
|
||||
if (productRate != null) {
|
||||
String isFixedRate = productRate.get("isFixedRate") == null ? "Y" : productRate.get("isFixedRate");
|
||||
if("N".equals(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){
|
||||
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{
|
||||
} else {
|
||||
throw new Exception("输入的年利率不合法!");
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
String yearRate = productRate.get("ProductRate") == null ? "0" : productRate.get("ProductRate");
|
||||
otherProperty.put("YEAR_RATE", yearRate);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user