From 75bdb21a5a72860f01d38ed4f63ea4c4004703eb Mon Sep 17 00:00:00 2001 From: gityjf <2211675158@qq.com> Date: Wed, 23 Dec 2020 14:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=98=E6=AC=BE=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E8=B5=8B=E5=80=BC=E6=93=8D=E4=BD=9C,=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=AE=A2=E6=88=B7=E8=AF=81=E4=BB=B6=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commbusiness/PlatformDataToTemp.java | 36 +++++++++++----- .../PlatformDataToTempNotKjflc.java | 42 ++++++++++++++----- 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java index 39add7417..3be856fcc 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTemp.java @@ -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")); diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTempNotKjflc.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTempNotKjflc.java index d752352e2..be59e4c4d 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTempNotKjflc.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PlatformDataToTempNotKjflc.java @@ -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 otherProperty, String productId,BizObject lcctBo) throws Exception { + public void setYearRate(Map otherProperty, String productId, BizObject lcctBo) throws Exception { Map> productRates = ProductParamUtil.getProductComponentType(productId, "PRD0350"); Map 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); }