apzl_leasing/src/com/ample/esb/service/impl/AmpServiceImpl.java
2023-09-26 15:29:53 +08:00

1224 lines
60 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.ample.esb.service.impl;
import com.amarsoft.app.util.ProductParamUtil;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.dict.als.manage.CodeManager;
import com.ample.esb.bean.amp.*;
import com.ample.esb.bean.esb.MessageAppHead;
import com.ample.esb.bean.esb.MessageBody;
import com.ample.esb.bean.esb.MessageEsbHead;
import com.ample.esb.common.EsbCommon;
import com.ample.esb.common.ParamDataUtils;
import com.ample.esb.service.AmpService;
import com.ample.esb.util.DateUtils;
import com.ample.esb.util.XstreamUtil;
import com.tenwa.lease.flow.project.businessapply.LBBusinessPrimary;
import jbo.app.tenwa.calc.*;
import jbo.app.tenwa.customer.*;
import jbo.com.tenwa.entity.comm.flow.CUSTOMER_HISTORY_INFO_TEMP;
import jbo.com.tenwa.lease.comm.*;
import jbo.oti.RC_ADDRESS_INFO;
import jbo.oti.RC_SCORE_RESULT;
import jbo.prd.PRD_SPECIFIC_LIBRARY;
import jbo.sys.FLOW_TASK;
import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.*;
public class AmpServiceImpl extends EsbCommon implements AmpService {
private String flowUnid;
private String operatorId;
private String tranNo;
public AmpServiceImpl(Map<String,String> map){
setFlowUnid(map.get("flowUnid"));
setOperatorId(map.get("operatorId"));
setTranNo(map.get("tranNo"));
}
public void resetFraudTakenCode(){
BizObjectManager bom = null;
BizObject boRsr = null;
try {
bom = JBOFactory.getBizObjectManager(RC_SCORE_RESULT.CLASS_NAME);
boRsr = bom.createQuery("flow_no=:flow_no").setParameter("flow_no",flowUnid).getSingleResult(true);
if(boRsr==null){
return;
}
boRsr.setAttributeValue("fraud_taken_code","");
boRsr.setAttributeValue("update_time", DateUtils.dateTimeNowCore());
bom.saveObject(boRsr);
} catch (JBOException e) {
e.printStackTrace();
}
}
@Override
public MessageEsbHead esbHead() {
MessageEsbHead head = new MessageEsbHead();
head = super.getCommonEsbHead(head);
head.setTargetSystemId("AMP");
head.setServiceId("SCN0003");
head.setServiceVersion("1.0.0");
head.setScenesId("018");
head.setScenesVersion("1.0");
head.setTranCode("AMP005");
head.setCommType("10");
head.setChannelId("09");
head.setFileFlag("0");
return head;
}
@Override
public MessageAppHead appHead() {
MessageAppHead head = new MessageAppHead();
head = super.getCommonAppHead(head);
head.setOperatorId(operatorId);
return head;
}
@Override
public MessageBody messgeBody() {
MessageBody body = new MessageBody();
body = super.getCommonBody(body);
body.setAmpRequest(getRequestBody());
return body;
}
public AmpRequest getRequestBody() {
String requestInfo = XstreamUtil.xmlConvertNotTitle(getApplicationTitle());
requestInfo = "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + requestInfo + "]]>";
AmpRequest ampRequest = new AmpRequest();
ampRequest.setApplication(requestInfo);
return ampRequest;
}
@Override
public ApplicationTitle getApplicationTitle() {
ApplicationTitle app = new ApplicationTitle();
try{
this.init();
Applicant2 app2 = new Applicant2();
app2.setDealerInfo(getDealerInfo());
app2.setLoanInfo(getLoanInfo());
app2.setVehicleInfo(getVehicleInfo());
app2.setCustomerInfo(getCustomerInfo());
app2.setCoborrowers(getCoborrowers());
app2.setGuarantorInfo(getGuarantorInfo());
app2.setContInfo(getContInfo());
app2.setApplicationInfo(getApplicationInfo());
app2.setPreviouslyVehicle(getPreviouslyVehicle());
app.setApplicant2(app2);
}catch (Exception e){
e.printStackTrace();
}
return app;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
private BizObject boLpit;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
private BizObject boCpt;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
private BizObject boLcct;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
private List<BizObject> boLects;
private List<BizObject> boLguts;
private BizObjectManager bomLpi;
private BizObject boCft;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>
private BizObject boDi;
/**
* <20><>bean<61><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
* @throws JBOException
*/
public void init() throws JBOException {
boLpit = JBOFactory.createBizObjectQuery(LB_PROJECT_INFO_TEMP.CLASS_NAME,"FLOWUNID=:FLOWUNID").setParameter("FLOWUNID",flowUnid).getSingleResult(false);
/*if(boLpit==null||boLpit.getAttribute("ID")==null||"".equals(boLpit.getAttribute("ID").toString())){
return;
}*/
boCpt = JBOFactory.createBizObjectQuery(CUSTOMER_PERSON_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
boLects = JBOFactory.createBizObjectQuery(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME,"FLOWUNID=:FLOWUNID").setParameter("FLOWUNID",flowUnid).getResultList(false);
boLcct = JBOFactory.createBizObjectQuery(LC_CALC_CONDITION_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
bomLpi = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME);
String distributorNo = boLpit.getAttribute("distributor_id").toString();
boDi = JBOFactory.createBizObjectQuery(DISTRIBUTOR_INFO.CLASS_NAME,"DISTRIBUTOR_NO=:distributorNo").setParameter("distributorNo",distributorNo).getSingleResult(false);
boCft = JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and Partner_='Y'").setParameter("flowunid",flowUnid).getSingleResult(false);
boLguts = JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,"FLOWUNID=:flowunid ").setParameter("flowunid",flowUnid).getResultList(false);
}
public DealerInfo getDealerInfo() throws JBOException {
if(boDi==null||boDi.getAttribute("ID")==null||"".equals(boDi.getAttribute("ID").toString())){
return null;
}
String distributorNo = boLpit.getAttribute("distributor_id").toString();
DealerInfo di = new DealerInfo();
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
di.setDealerName(boDi.getAttribute("DISTRIBUTOR_NAME").toString());
//<2F><><EFBFBD><EFBFBD><EFBFBD>̱<EFBFBD><CCB1><EFBFBD>
di.setDealerId(distributorNo);
di.setDealerMode("");
String addressCode = boDi.getAttribute("DISTRIBUTOR_ADDRESS").getString();
String dealerProvince = ParamDataUtils.queryMapBcProvinceCode("AreaCode",addressCode);
String dealerCity = ParamDataUtils.queryMapBcCityCode("AreaCode",addressCode);
di.setDealerProvince_gb(dealerProvince);
di.setDealerCity_gb(dealerCity);
di.setDealerDistrict_gb("");
di.setDealerStreet_gb("");
di.setSubDealerName("");
di.setDealerGuaranteeRatio("");
di.setDealerFiledVisitFlag("");
di.setSubDealerAppFlag("");
di.setDealerArea("");
di.setSubDealerCode("");
di.setDealerTotalUsedAmount("");
di.setDealerAvailableAmount("");
int monthApproveCount = bomLpi.createQuery("select 1 from o left join jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR lec on lec.project_id=o.id where o.distributor_id=:distributor_id and o.project_status='13' and left(o.INPUTTIME,7)=:curMonth").setParameter("distributor_id",distributorNo).setParameter("curMonth", DateUtils.monthNowCore()).getTotalCount();
int monthFailCount = bomLpi.createQuery("select 1 from o left join jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR lec on lec.project_id=o.id where o.distributor_id=:distributor_id and o.PROJECT_STATUS<>'13' and left(o.INPUTTIME,7)=:curMonth").setParameter("distributor_id",distributorNo).setParameter("curMonth",DateUtils.monthNowCore()).getTotalCount();
di.setApprovalCountThisMonth(monthApproveCount);
di.setRefuseCountThisMonth(monthFailCount);
BizObjectManager bomLfi = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME);
int monthLoanCount = bomLfi.createQuery("select 1 from o left join jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR lec on lec.project_id=o.project_id left join jbo.com.tenwa.lease.comm.LB_PROJECT_INFO lpi on lpi.id=o.project_id where o.pay_type = 'pay_type_out' and o.PAY_STATUS='have_paid' and o.FEE_TYPE='feetype10' and o.SETTLE_METHOD='settlemethod6' and left(o.fact_date,7)=:curMonth and lpi.distributor_id=:distributor_id").setParameter("distributor_id",distributorNo).setParameter("curMonth",DateUtils.monthNowCore()).getTotalCount();
di.setLoanCountThisMonth(monthLoanCount);
int yearApproveCount = bomLpi.createQuery("select 1 from o left join jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR lec on lec.project_id=o.id where o.distributor_id=:distributor_id and o.project_status='13' and left(o.INPUTTIME,4)=:curYear").setParameter("distributor_id",distributorNo).setParameter("curYear",DateUtils.yearNow()).getTotalCount();
int yearFailCount = bomLpi.createQuery("select 1 from o left join jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR lec on lec.project_id=o.id where o.distributor_id=:distributor_id and o.PROJECT_STATUS<>'13' and left(o.INPUTTIME,4)=:curYear").setParameter("distributor_id",distributorNo).setParameter("curYear",DateUtils.yearNow()).getTotalCount();
int yearLoanCount = bomLfi.createQuery("select FACT_MONEY from o left join jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR lec on lec.project_id=o.project_id left join jbo.com.tenwa.lease.comm.LB_PROJECT_INFO lpi on lpi.id=o.project_id where o.pay_type = 'pay_type_out' and o.PAY_STATUS='have_paid' and o.FEE_TYPE='feetype10' and o.SETTLE_METHOD='settlemethod6' and left(o.fact_date,4)=:curYear and lpi.distributor_id=:distributor_id").setParameter("distributor_id",distributorNo).setParameter("curYear",DateUtils.yearNow()).getTotalCount();
di.setApprovalCountThisYear(yearApproveCount);
di.setRefuseCountThisYear(yearFailCount);
di.setLoanCountThisYear(yearLoanCount);
return di;
}
public LoanInfo getLoanInfo() throws Exception {
LoanInfo li = new LoanInfo();
li.setProductId(boLpit.getAttribute("PRODUCT_ID").toString());
li.setProductName(boLpit.getAttribute("PRODUCT_NAME").toString());
String settleMethod = boLcct.getAttribute("SETTLE_METHOD").toString();
li.setProductType(ParamDataUtils.queryBcEnumType("SETTLE_METHOD",settleMethod));
li.setSubsityTypeCode("");
//<2F><><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>ʣ<EFBFBD>
String productRate = ProductParamUtil.getProductParameterValue(boLpit.getAttribute("PRODUCT_ID").toString(),"PRD0350","product_rate","ProductRate");
if("".equals(productRate)){
BizObject boLcsit = JBOFactory.createBizObjectQuery(LC_CALC_SUBSECTION_INFO_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
productRate = boLcsit.getAttribute("DISCOUNT_RATE").toString();
}
BigDecimal interestRate = new BigDecimal(productRate).divide(new BigDecimal("100"),4,BigDecimal.ROUND_HALF_UP);
li.setInterestRate(interestRate.toString());
//<2F>׸<EFBFBD><D7B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۺϣ<DBBA>
double firstRatio = boLcct.getAttribute("ALL_FIRST_PAYMENT_RATIO").getDouble()/100;
li.setDownPaymentPercentage(new BigDecimal(firstRatio).setScale(4,BigDecimal.ROUND_HALF_UP).toString());
//<2F><><EFBFBD>׸<EFBFBD><D7B8><EFBFBD><EFBFBD><EFBFBD>
li.setDownPaymentTotalAmount(boLcct.getAttribute("ALL_FIRST_PAYMENT").toString());
li.setFinanceAmountUnit("");
String finaAmountTotal = boLcct.getAttribute("CLEAN_LEASE_MONEY").toString();
li.setFinanceAmountTotal(finaAmountTotal);
//<2F><><EFBFBD><EFBFBD>
li.setTerms(boLcct.getAttribute("INCOME_NUMBER").toString());
List<BizObject> boLrps = JBOFactory.createBizObjectQuery(LC_RENT_PLAN_TEMP.CLASS_NAME,"select o.interest,o.rent from o where o.FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getResultList(false);
BigDecimal interestTotal = new BigDecimal("0");
double firstRent = 0;
for(int i=0;i<boLrps.size();i++){
firstRent = boLrps.get(0).getAttribute("rent").getDouble();
interestTotal = interestTotal.add(new BigDecimal(boLrps.get(i).getAttribute("interest").toString())).setScale(2,BigDecimal.ROUND_HALF_UP);
}
li.setInstallmentUnit("");
//<2F><><EFBFBD>»<EFBFBD><C2BB><EFBFBD><EFBFBD><EFBFBD>
li.setInstallmentTotal(firstRent);
li.setInterestUnit("");
li.setInterestTotal(null);
li.setCustInterestUnit("");
//<2F>ͻ<EFBFBD><CDBB><EFBFBD>Ϣ<EFBFBD>ܶ<EFBFBD>
li.setCustInterestTotal(interestTotal.doubleValue());
li.setCustInterestTotalDeposit("");
li.setDealerInterestUnit("");
//<2F><><EFBFBD><EFBFBD><EFBFBD>̳е<CCB3><D0B5><EFBFBD>Ϣ<EFBFBD>ܶ<DCB6><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
li.setDealerInterestTotal("0");
li.setDealerInterestTotalDeposit("");
li.setMakerInterestUnit("");
String IsSubsity = "0";
double makerInterestTotal = 0;
if(boLcct.getAttribute("DISCOUNT_INTEREST")!=null&&!"".equals(boLcct.getAttribute("DISCOUNT_INTEREST").toString())){
makerInterestTotal = boLcct.getAttribute("DISCOUNT_INTEREST").getDouble();
BigDecimal dibd = BigDecimal.valueOf(makerInterestTotal);
if (dibd.compareTo(BigDecimal.ZERO) > 0) {
IsSubsity="1";
}
}
//<2F><><EFBFBD>ҳе<D2B3><D0B5><EFBFBD>Ϣ<EFBFBD>ܶ<DCB6><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
li.setMakerInterestTotal(makerInterestTotal);
li.setMakerInterestTotalDeposit("");
li.setIsSubsity(IsSubsity);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD><EFBFBD>ܼۿ<DCBC>
li.setContractPriceTotal(boLcct.getAttribute("TOTAL_ALL").toString());
li.setMonthInterestRate(interestRate.divide(new BigDecimal("12"),4,BigDecimal.ROUND_HALF_UP).toString());
li.setPayType("<EFBFBD><EFBFBD><EFBFBD>п<EFBFBD>ֱ<EFBFBD><EFBFBD>");
li.setPayRemark("");
li.setIsLinked(ParamDataUtils.queryBcEnumType("TrueFalse",boLpit.getAttribute("IS_NETCAR").toString()));
li.setLinkedCompany(boLpit.getAttribute("AFFILIATEDNAME").toString());
li.setLinkedCompanyType(boLpit.getAttribute("LEGALPERSONID").toString());
li.setReserveString1("0");
li.setReserveString2("");
li.setReserveString3("");
li.setReserveString4("");
li.setReserveString5("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; <20><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD> 0<><30><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><C3B3><EFBFBD>Ŀǰȡ<C7B0><C8A1>TCF<43><46><EFBFBD>ó<EFBFBD><C3B3><EFBFBD>TCC<43><43><EFBFBD>ó<EFBFBD>
String carType = boLpit.getAttribute("car_type").toString();
li.setAssetPurpose("<EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>".equals(carType)?"TCC":"TCF");
li.setBalloonPercentage("");
li.setBalloonAmount("");
String financedAmtPct = new BigDecimal(finaAmountTotal).divide(new BigDecimal(boLcct.getAttribute("TOTAL_ALL").toString()),4,BigDecimal.ROUND_HALF_UP).toString();
li.setFinancedAmtPct(financedAmtPct);
li.setRentalCalculationMtd("");
//<2F>ͻ<EFBFBD><CDBB>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
String yearRate = boLcct.getAttribute("YEAR_RATE").toString();
li.setBaseCustomerRate(yearRate);
//<2F><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
li.setSubsidyRte(interestRate.subtract(new BigDecimal(yearRate)).toString());
li.setCalcSubsidyRte("");
li.setCalcSubsidyAmt("");
//ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
li.setActualRte(interestRate.toString());
li.setPaymentScheme(ParamDataUtils.queryBcEnumType("income_number_year",boLcct.getAttribute("INCOME_NUMBER_YEAR").toString()));
li.setDealerSubsidyPct("0");
li.setManufacturerSubsidyPct("0");
li.setCalcDealerSubsidyAmt(interestRate.subtract(new BigDecimal(yearRate)).doubleValue());
li.setCalcManufacturerSubsidyAmt(makerInterestTotal);
li.setCarCount(boLects.size());
li.setExposuresNumber(getExposuresNumber());
li.setExposureAmount(getExposuresAmount());
li.setCarRealDownPaymentRatio(boLcct.getAttribute("FIRST_PAYMENT_RATIO").toString());
li.setCarRealDownPaymentAmt(boLcct.getAttribute("FIRST_PAYMENT").toString());
li.setFinancingRatio(1.0-boLcct.getAttribute("FIRST_PAYMENT_RATIO").getDouble());
return li;
}
public VehicleInfo getVehicleInfo() throws JBOException {
VehicleInfo vi = new VehicleInfo();
List<SingleVehicleType> SingleVehicleTypes = new ArrayList<>();
for(BizObject bo : boLects){
SingleVehicleType svt = new SingleVehicleType();
//Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
svt.setMaker(ParamDataUtils.queryBcEnumType("MANUFACTURER_NAME",bo.getAttribute("MANUFACTURER_NAME").toString()));
svt.setBrand(bo.getAttribute("BRAND").toString());
svt.setSeries(bo.getAttribute("car_series").toString());
//<2F><><EFBFBD><EFBFBD>
svt.setModel(bo.getAttribute("MODEL").toString());
//<2F><><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>
svt.setQuantity("1");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׼۸<D7BC>
svt.setPriceUnit(bo.getAttribute("EQUIP_PRICE").toString());
svt.setPriceTotal("");
svt.setGps("");
svt.setChassisVehicleModel("");
svt.setSubsityVehicleModel("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A>³<EFBFBD><C2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֳ<EFBFBD>
svt.setVehicleType(ParamDataUtils.queryBcEnumType("CarType",boLpit.getAttribute("CAR_TYPE").toString()));
svt.setOtherFee("");
svt.setProducer("");
//<2F>³<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>
svt.setNewPrice(bo.getAttribute("NOW_TOTAL").toString());
svt.setVinNumber("");
svt.setEngineNumber("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
svt.setPurpose(ParamDataUtils.queryBcEnumType("car_use_type",bo.getAttribute("car_use_type").toString()));
svt.setComments("");
svt.setTransmission("");
svt.setIsAffiliated("");
svt.setAffiliatedCompName("");
svt.setAffiliatedCompCrdcode("");
svt.setRoadOperationLicenseCode(boLpit.getAttribute("TRANSPORTCERTID").toString());
svt.setCarType(ParamDataUtils.queryBcEnumType("CarType",boLpit.getAttribute("CAR_TYPE").toString()));
svt.setBuyUseType(bo.getAttribute("cartype").toString());
svt.setPurchaseTax(boLcct.getAttribute("PURCHASE_TAX").toString());
svt.setCarPrice(bo.getAttribute("EQUIP_PRICE").toString());
svt.setCarRealPrice(bo.getAttribute("EQUIP_PRICE").toString());
SingleVehicleTypes.add(svt);
}
vi.setSingleVehicleTypes(SingleVehicleTypes);
return vi;
}
public CustomerInfo getCustomerInfo() throws Exception {
CustomerInfo ci = null;
BizObject boCit = JBOFactory.createBizObjectQuery(CUSTOMER_INFO_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
String customerType = boCit.getAttribute("customertype").toString();
if("01".equals(customerType)){
ci = getCustomerInfoOfCompany();
}
if("03".equals(customerType)){
ci = getCustomerInfoOfPerson();
}
return ci;
}
public CustomerInfo getCustomerInfoOfCompany() throws JBOException {
CustomerInfo ci = new CustomerInfo();
BizObject boCct = JBOFactory.createBizObjectQuery(CUSTOMER_COMPANY_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
String chName = boCct.getAttribute("company_name").toString();
String idCardNum = boCct.getAttribute("certid").toString();
String idTypeCode = boCct.getAttribute("CERTTYPE").toString();
String annualIncome = boCct.getAttribute("business_income").toString();
String phoneHome = boCct.getAttribute("tel").toString();
String phoneOffice = boCct.getAttribute("company_tel").toString();
String businessTypeCode = boCct.getAttribute("unit_properties").toString();
ci.setChName(chName);
ci.setIdCardNum(idCardNum);
ci.setIdTypeCode(ParamDataUtils.queryBcEnumType("CertType",idTypeCode));
ci.setAnnualIncome(annualIncome);
ci.setPhoneHome(phoneHome);
ci.setPhoneOffice(phoneOffice);
ci.setBusinessNatureCde(ParamDataUtils.queryBcEnumType("Unit_nature",businessTypeCode));
ci.setCustTypeId("2");
ci.setCheckedType("2");
return ci;
}
public CustomerInfo getCustomerInfoOfPerson() throws Exception {
CustomerInfo ci = new CustomerInfo();
BizObject boCat = JBOFactory.createBizObjectQuery(CUSTOMER_ACCOUNT_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
String idTypeCode = ParamDataUtils.queryBcEnumType("CertType",boCpt.getAttribute("CERTTYPE").toString());
String chName = boCpt.getAttribute("FULLNAME").toString();
String idCardNum = boCpt.getAttribute("CERTID").toString();
String genderCode = ParamDataUtils.queryBcEnumType("sex",boCpt.getAttribute("SEX").toString());
String maritalStatusCode = ParamDataUtils.queryBcEnumType("marry",boCpt.getAttribute("MARRIAGE").toString(),boCpt.getAttribute("childrens_number").toString());
String residentialStatusCode = ParamDataUtils.queryBcEnumType("Property_type",boCpt.getAttribute("Property_type").toString());
String MonthlyIncome = boCpt.getAttribute("FAMILYMONTHINCOME").toString();
String phoneCellPhone01 = boCpt.getAttribute("mobile").toString();
String empemployerName = boCpt.getAttribute("WORKCORP").toString();
String businessTypeCode = boCpt.getAttribute("Unit_nature").toString();
String phoneHome = boCpt.getAttribute("telephone").toString();
String phoneOffice = boCpt.getAttribute("WORKTEL").toString();
String loanCardNumber = boCat.getAttribute("acc_number").toString();
String openBankMobileNo = boCat.getAttribute("MOBILE").toString();
String expense = boCpt.getAttribute("monthly_expenses").toString();
String birthday = boCpt.getAttribute("birthday").toString().replace("/","-");
String idBirthday = idCardNum.substring(6,14);
String nowDay = DateUtils.dateNow();
int ageInYear = DateUtils.yearDiffByDate(idBirthday,nowDay);
int ageInMonth = DateUtils.monthDiffByDate(idBirthday,nowDay);
String workAddressId = boCpt.getAttribute("work_address_id").getString();
BizObject boRai = this.getAddressById(workAddressId);
if(boRai==null){
}
String workProvinceCode = boRai.getAttribute("province_code").toString();
String workCityCode = boRai.getAttribute("city_code").toString();
String workDistrictCode = boRai.getAttribute("district_code").toString();
String workAddressDetail = boRai.getAttribute("address_detail").toString();
String occupationCode = ParamDataUtils.queryBcEnumType("career",boCpt.getAttribute("HEADSHIP").toString());
String empBusinessTypeCode = ParamDataUtils.queryBcEnumType("workUnitIndustry",boCpt.getAttribute("UNITKIND").toString());
String empPositionCode = ParamDataUtils.queryBcEnumType("duties",boCpt.getAttribute("OCCUPATION").toString());
String highestEducation = ParamDataUtils.queryBcEnumType("Education",boCpt.getAttribute("EDUEXPERIENCE").toString());
String CardTermBeginDate = boCpt.getAttribute("start_idexpiry").toString().replace("/","-");
String CardTermEndDate = idDateConvert(boCpt.getAttribute("idexpiry").toString());
String nationId = ParamDataUtils.queryBcEnumType("nation",boCpt.getAttribute("NATIONALITY").toString());
String localResidentFlag = ParamDataUtils.queryBcEnumType("spouse_hukou",boCpt.getAttribute("shukou").toString());
ci.setChName(chName);
//֤<><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ci.setIdTypeCode(idTypeCode);
//֤<><D6A4><EFBFBD><EFBFBD>
ci.setIdCardNum(idCardNum);
//<2F><><EFBFBD><EFBFBD>
ci.setAgeInYear(ageInYear);
//<2F>Ա<EFBFBD>
ci.setGenderCode(genderCode);
//<2F><><EFBFBD><EFBFBD>״<EFBFBD><D7B4>
ci.setMaritalStatusCode(maritalStatusCode);
//ѧ<><D1A7>
ci.setEducationCode(highestEducation);
//<2F><>ס״<D7A1><D7B4>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
ci.setResidentialStatusCode(residentialStatusCode);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ci.setMonthlyIncome(MonthlyIncome);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ci.setAnnualIncome("");
ci.setMonthlyDTI("");
ci.setNoOfDependents("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
ci.setEmpemployerName(empemployerName);
//<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ
ci.setEmpBusinessTypeCode(empBusinessTypeCode);
//ְҵ
ci.setEmpOccupationCode(occupationCode);
//ְ<><D6B0>
ci.setEmpPositionCode(empPositionCode);
ci.setEmpProfessionalRank("");
ci.setWorkSince("");
ci.setEmpTimeOfEmployee("");
ci.setPhoneCellphone01(phoneCellPhone01);
ci.setPhoneCellphone02("");
ci.setPhoneHome(phoneHome);
ci.setPhoneOffice(phoneOffice);
ci.setBankStatementStatusCode("");
ci.setLocalResidentFlag(localResidentFlag);
ci.setLocalApplicantFlag("");
ci.setVipCust("");
//<2F>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>0:<3A><>1:<3A>ǣ<EFBFBD>
ci.setRepeatedApplicantFlag(repeatedApplicantFlag(idCardNum));
ci.setHukouType("");
//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
ci.setHighestEducation(highestEducation);
ci.setHighestDegree("");
ci.setOfficePostCode("");
ci.setCurrentOfficeEntryDate("");
ci.setPhsNumber("");
ci.setEmail("");
ci.setHasDrivingLicence("");
ci.setAllowDrivingType("");
//<2F><>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1.<2E><><EFBFBD>ˡ<EFBFBD>2.<2E><><EFBFBD>ˣ<EFBFBD>
ci.setCheckedType("1");
//<2F><><EFBFBD><EFBFBD><EEBFA8>(<28><><EFBFBD>п<EFBFBD><D0BF><EFBFBD>)
ci.setLoanCardNumber(loanCardNumber);
ci.setLoanCardPassword("");
ci.setArchiveUrl("");
ci.setAgeInMonth(ageInMonth);
ci.setChildrenFlag("");
ci.setBlacklistInd("");
ci.setThaiTitleCde("");
//<2F><>֧<EFBFBD><D6A7>
ci.setExpense(expense);
//<2F><><EFBFBD><EFBFBD>
ci.setBrithday(birthday);
ci.setLicenseExpireDate("");
ci.setCountryCode("");
ci.setAreaCode("");
ci.setExtentionNbr("");
ci.setPhoneTypeCde("");
//ְ<><D6B0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
ci.setDesignationCde(empPositionCode);
ci.setCityCde("");
ci.setStateCde("");
//ʡ<><CAA1><EFBFBD><EFBFBD>
ci.setProvinceGB(workProvinceCode);
ci.setCityGB(workCityCode);
ci.setDistrictGB(workDistrictCode);
ci.setStreetGB("");
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
ci.setBusinessNatureCde(ParamDataUtils.queryBcEnumType("Unit_nature",businessTypeCode));
ci.setPostCode("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
ci.setEmployAddress(workAddressDetail);
//ְҵ
ci.setOccupationCode(occupationCode);
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
ci.setBusinessTypeCde(empBusinessTypeCode);
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޵ij<DEB5><C4B3><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>)
ci.setTimeInYear2("");
ci.setRankCde("");
//ְҵ
ci.setOccupationCde(occupationCode);
//<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ
ci.setIndustryTypeCde(empBusinessTypeCode);
ci.setAddr(getAddr());
ci.setExposure(getExposure(idTypeCode));
//<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
ci.setCustTypeId("1");
ci.setIdCardTermBeginDate(CardTermBeginDate);
ci.setIdCardTermEndDate(CardTermEndDate);
ci.setOpenBankMobileNo(openBankMobileNo);
ci.setNationId(nationId);
ci.setQueryReason(CodeManager.getItemName("pboc_query_strategy","qryReason_lessee"));
return ci;
}
public Coborrowers getCoborrowers() throws Exception {
Coborrowers cos = new Coborrowers();
if(boCft==null){
return cos;
}
List<Coborrower> coborrowerList = new ArrayList<>();
coborrowerList.add(getCoborrower());
cos.setCoborrower(coborrowerList);
return cos;
}
public Coborrower getCoborrower() throws Exception {
Coborrower co = new Coborrower();
String idTypeCode = ParamDataUtils.queryBcEnumType("CertType",boCft.getAttribute("CERTTYPE").toString());
String chName = boCft.getAttribute("name").toString();
String idCardNum = boCft.getAttribute("CERTID").toString();
String genderCode = ParamDataUtils.queryBcEnumType("sex",boCft.getAttribute("SEX").toString());
String maritalStatusCode = ParamDataUtils.queryBcEnumType("marry",boCft.getAttribute("marry_type").toString(),boCft.getAttribute("childrens_number").toString());
String residentialStatusCode = ParamDataUtils.queryBcEnumType("Property_type",boCft.getAttribute("residential_status").toString());
String MonthlyIncome = boCft.getAttribute("smincome").toString();
String phoneCellPhone01 = boCft.getAttribute("tel").toString();
String empemployerName = boCft.getAttribute("suname").toString();
String businessTypeCode = boCft.getAttribute("enterprise_nature").toString();
String phoneHome = boCft.getAttribute("tel").toString();
String phoneOffice = boCft.getAttribute("suphone").toString();
String expense = boCft.getAttribute("monthly_expenses").toString();
String birthday = boCft.getAttribute("birthday").toString().replace("/","-");
String idBirthday = idCardNum.substring(6,14);
String nowDay = DateUtils.dateNow();
int ageInYear = DateUtils.yearDiffByDate(idBirthday,nowDay);
int ageInMonth = DateUtils.monthDiffByDate(idBirthday,nowDay);
String workAddressId = boCft.getAttribute("work_address_id").getString();
BizObject boRai = getAddressById(workAddressId);
String workProvinceCode = boRai.getAttribute("province_code").toString();
String workCityCode = boRai.getAttribute("city_code").toString();
String workDistrictCode = boRai.getAttribute("district_code").toString();
String workAddressDetail = boRai.getAttribute("address_detail").toString();
String occupationCode = ParamDataUtils.queryBcEnumType("career",boCft.getAttribute("career_type").toString());
String empBusinessTypeCode = ParamDataUtils.queryBcEnumType("workUnitIndustry",boCft.getAttribute("industry_type").toString());
String empPositionCode = ParamDataUtils.queryBcEnumType("duties",boCft.getAttribute("sposition").toString());
String highestEducation = ParamDataUtils.queryBcEnumType("Education",boCft.getAttribute("education_level").toString());
String CardTermBeginDate = boCft.getAttribute("start_idexpiry").toString().replace("/","-");
String CardTermEndDate = idDateConvert(boCft.getAttribute("idexpiry").toString());
String nationId = ParamDataUtils.queryBcEnumType("nation",boCft.getAttribute("nation").toString());
String censusRegAddrId = boCft.getAttribute("id_address_id").toString();
BizObject boCens = this.getAddressById(censusRegAddrId);
String censusRegAddr = boCens.getAttribute("full_address").toString();
String relationshipCode = ParamDataUtils.queryBcEnumType("personContact",boCft.getAttribute("ASSURE_RELATION").toString());
String localResidentFlag = ParamDataUtils.queryBcEnumType("spouse_hukou",boCpt.getAttribute("shukou").toString());
co.setChName(chName);
//֤<><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
co.setIdTypeCode(idTypeCode);
//֤<><D6A4><EFBFBD><EFBFBD>
co.setIdCardNum(idCardNum);
//<2F><><EFBFBD><EFBFBD>
co.setAgeInYear(ageInYear);
//<2F>Ա<EFBFBD>
co.setGenderCode(genderCode);
//<2F><><EFBFBD><EFBFBD>״<EFBFBD><D7B4>
co.setMaritalStatusCode(maritalStatusCode);
//ѧ<><D1A7>
co.setEducationCode(highestEducation);
//<2F><>ס״<D7A1><D7B4>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
co.setResidentialStatusCode(residentialStatusCode);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
co.setMonthlyIncome(MonthlyIncome);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
co.setAnnualIncome("");
co.setMonthlyDTI("");
co.setNoOfDependents("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
co.setEmpemployerName(empemployerName);
//<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ
co.setEmpBusinessTypeCode(empBusinessTypeCode);
//ְҵ
co.setEmpOccupationCode(occupationCode);
//ְ<><D6B0>
co.setEmpPositionCode(empPositionCode);
co.setEmpProfessionalRank("");
co.setWorkSince("");
co.setEmpTimeOfEmployee("");
co.setPhoneCellphone01(phoneCellPhone01);
co.setPhoneCellphone02("");
co.setPhoneHome(phoneHome);
co.setPhoneOffice(phoneOffice);
co.setBankStatementStatusCode("");
co.setLocalResidentFlag(localResidentFlag);
co.setLocalApplicantFlag("");
co.setVipCust("");
//<2F>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>0:<3A><>1:<3A>ǣ<EFBFBD>
co.setRepeatedApplicantFlag(repeatedApplicantFlag(idCardNum));
co.setHukouType("");
//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
co.setHighestEducation(highestEducation);
co.setHighestDegree("");
co.setOfficePostCode("");
co.setCurrentOfficeEntryDate("");
co.setPhsNumber("");
co.setEmail("");
co.setHasDrivingLicence("");
co.setAllowDrivingType("");
//<2F><>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1.<2E><><EFBFBD>ˡ<EFBFBD>2.<2E><><EFBFBD>ˣ<EFBFBD>
co.setCheckedType("1");
co.setLoanCardPassword("");
co.setArchiveUrl("");
co.setAgeInMonth(ageInMonth);
co.setChildrenFlag("");
co.setBlacklistInd("");
co.setThaiTitleCde("");
//<2F><>֧<EFBFBD><D6A7>
co.setExpense(expense);
//<2F><><EFBFBD><EFBFBD>
co.setBrithday(birthday);
co.setLicenseExpireDate("");
co.setCountryCode("");
co.setAreaCode("");
co.setExtentionNbr("");
co.setPhoneTypeCde("");
//ְ<><D6B0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
co.setDesignationCde(empPositionCode);
co.setCityCde("");
co.setStateCde("");
//ʡ<><CAA1><EFBFBD><EFBFBD>
co.setProvinceGB(workProvinceCode);
co.setCityGB(workCityCode);
co.setDistrictGB(workDistrictCode);
co.setStreetGB("");
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
co.setBusinessNatureCde(ParamDataUtils.queryBcEnumType("Unit_nature",businessTypeCode));
co.setPostCode("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
co.setEmployAddress(workAddressDetail);
//ְҵ
co.setOccupationCode(occupationCode);
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
co.setBusinessTypeCde(empBusinessTypeCode);
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޵ij<DEB5><C4B3><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>)
co.setTimeInYear2("");
co.setRankCde("");
//ְҵ
co.setOccupationCde(occupationCode);
//<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ
co.setIndustryTypeCde(empBusinessTypeCode);
co.setAddr(getAddr());
co.setExposure(getExposure(idTypeCode));
//<2F>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ͣ<EFBFBD>Ŀǰϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>Ȼ<EFBFBD>ˣ<EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>
co.setCustTypeId("1");
co.setIdCardTermBeginDate(CardTermBeginDate);
co.setIdCardTermEndDate(CardTermEndDate);
//<2F><><EFBFBD><EFBFBD>
co.setNationId(nationId);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
co.setCensusRegAddr(censusRegAddr);
//<2F><>λ<EFBFBD>
co.setTelWorkNo(phoneOffice);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD>ϵ
co.setRelationshipCode(relationshipCode);
//<2F><><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD>(Ŀǰϵͳֻ<CDB3><D6BB>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD>1)
co.setBorrowerId("1");
//<2F><><EFBFBD>Ų<EFBFBD>ѯԭ<D1AF><D4AD>
co.setQueryReason(CodeManager.getItemName("pboc_query_strategy","qryReason_jointApplicant"));
return co;
}
public GuarantorInfo getGuarantorInfo() throws Exception {
GuarantorInfo gi = new GuarantorInfo();
List<Guar> gis = new ArrayList<>();
for(BizObject boLgu : boLguts){
Guar gr = getGuar(boLgu);
if(gr==null){
continue;
}
gis.add(gr);
}
gi.setGuars(gis);
return gi;
}
public Guar getGuar(BizObject boLgu) throws Exception {
String certType = boLgu.getAttribute("CERTTYPE").toString();
Guar gr = null;
if(certType.startsWith("Ind")){
gr = getGuarOfPerson(boLgu);
}
if(certType.startsWith("Ent")){
gr = getGuarOfCompany(boLgu);
}
return gr;
}
public Guar getGuarOfCompany(BizObject boLgu) throws JBOException {
Guar gr = new Guar();
String chName = boLgu.getAttribute("FULLNAME").toString();
String idCardNum = boLgu.getAttribute("CERTID").toString();
String idTypeCode = boLgu.getAttribute("CERTTYPE").toString();
String relationshipCode = ParamDataUtils.queryBcEnumType("personContact",boLgu.getAttribute("ASSURE_RELATION").toString());
gr.setChName(chName);
gr.setIdCardNum(idCardNum);
gr.setIdTypeCode(ParamDataUtils.queryBcEnumType("CertType",idTypeCode));
gr.setRelationshipCode(relationshipCode);
gr.setCustTypeId("2");
gr.setCheckedType("2");
return gr;
}
public Guar getGuarOfPerson(BizObject boLgu) throws Exception {
Guar gr = new Guar();
String idTypeCode = ParamDataUtils.queryBcEnumType("CertType",boLgu.getAttribute("CERTTYPE").toString());
String chName = boLgu.getAttribute("FULLNAME").toString();
String idCardNum = boLgu.getAttribute("CERTID").toString();
String genderCode = ParamDataUtils.queryBcEnumType("sex",boLgu.getAttribute("SEX").toString());
String maritalStatusCode = ParamDataUtils.queryBcEnumType("marry",boLgu.getAttribute("Marital_status").toString(),boLgu.getAttribute("childrens_number").toString());
String residentialStatusCode = ParamDataUtils.queryBcEnumType("Property_type",boLgu.getAttribute("residential_status").toString());
String MonthlyIncome = boLgu.getAttribute("Major_monthly_income").toString();
String phoneCellPhone01 = boLgu.getAttribute("MOBILE").toString();
String empemployerName = boLgu.getAttribute("WORKCORP").toString();
String businessTypeCode = boLgu.getAttribute("enterprise_nature").toString();
String phoneHome = boLgu.getAttribute("MOBILE").toString();
String phoneOffice = boLgu.getAttribute("WORKTEL").toString();
String expense = boLgu.getAttribute("monthly_expenses").toString();
String birthday = boLgu.getAttribute("birthday").toString().replace("/","-");
String idBirthday = idCardNum.substring(6,14);
String nowDay = DateUtils.dateNow();
int ageInYear = DateUtils.yearDiffByDate(idBirthday,nowDay);
int ageInMonth = DateUtils.monthDiffByDate(idBirthday,nowDay);
String workAddressId = boLgu.getAttribute("work_address_id").getString();
BizObject boRai = getAddressById(workAddressId);
String workProvinceCode = boRai.getAttribute("province_code").toString();
String workCityCode = boRai.getAttribute("city_code").toString();
String workDistrictCode = boRai.getAttribute("district_code").toString();
String workAddressDetail = boRai.getAttribute("address_detail").toString();
String occupationCode = ParamDataUtils.queryBcEnumType("career",boLgu.getAttribute("career_type").toString());
String empBusinessTypeCode = ParamDataUtils.queryBcEnumType("workUnitIndustry",boLgu.getAttribute("industry_type").toString());
String empPositionCode = ParamDataUtils.queryBcEnumType("duties",boLgu.getAttribute("TITLE").toString());
String highestEducation = ParamDataUtils.queryBcEnumType("Education",boLgu.getAttribute("education_level").toString());
String CardTermBeginDate = boLgu.getAttribute("start_idexpiry").toString().replace("/","-");
String CardTermEndDate = idDateConvert(boLgu.getAttribute("idexpiry").toString());
String nationId = ParamDataUtils.queryBcEnumType("nation",boLgu.getAttribute("nation").toString());
String censusRegAddrId = boLgu.getAttribute("id_address_id").toString();
BizObject boCens = this.getAddressById(censusRegAddrId);
String censusRegAddr = boCens.getAttribute("full_address").toString();
String relationshipCode = ParamDataUtils.queryBcEnumType("personContact",boLgu.getAttribute("ASSURE_RELATION").toString());
String localResidentFlag = ParamDataUtils.queryBcEnumType("spouse_hukou",boCpt.getAttribute("shukou").toString());
gr.setChName(chName);
//֤<><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
gr.setIdTypeCode(idTypeCode);
//֤<><D6A4><EFBFBD><EFBFBD>
gr.setIdCardNum(idCardNum);
//<2F><><EFBFBD><EFBFBD>
gr.setAgeInYear(ageInYear);
//<2F>Ա<EFBFBD>
gr.setGenderCode(genderCode);
//<2F><><EFBFBD><EFBFBD>״<EFBFBD><D7B4>
gr.setMaritalStatusCode(maritalStatusCode);
//ѧ<><D1A7>
gr.setEducationCode(highestEducation);
//<2F><>ס״<D7A1><D7B4>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
gr.setResidentialStatusCode(residentialStatusCode);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
gr.setMonthlyIncome(MonthlyIncome);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
gr.setAnnualIncome("");
gr.setMonthlyDTI("");
gr.setNoOfDependents("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
gr.setEmpemployerName(empemployerName);
//<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ
gr.setEmpBusinessTypeCode(empBusinessTypeCode);
//ְҵ
gr.setEmpOccupationCode(occupationCode);
//ְ<><D6B0>
gr.setEmpPositionCode(empPositionCode);
gr.setEmpProfessionalRank("");
gr.setWorkSince("");
gr.setEmpTimeOfEmployee("");
gr.setPhoneCellphone01(phoneCellPhone01);
gr.setPhoneCellphone02("");
gr.setPhoneHome(phoneHome);
gr.setPhoneOffice(phoneOffice);
gr.setBankStatementStatusCode("");
gr.setLocalResidentFlag(localResidentFlag);
gr.setLocalApplicantFlag("");
gr.setVipCust("");
//<2F>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>0:<3A><>1:<3A>ǣ<EFBFBD>
gr.setRepeatedApplicantFlag(repeatedApplicantFlag(idCardNum));
gr.setHukouType("");
//<2F><><EFBFBD><EFBFBD>ѧ<EFBFBD><D1A7>
gr.setHighestEducation(highestEducation);
gr.setHighestDegree("");
gr.setOfficePostCode("");
gr.setCurrentOfficeEntryDate("");
gr.setPhsNumber("");
gr.setEmail("");
gr.setHasDrivingLicence("");
gr.setAllowDrivingType("");
//<2F><>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1.<2E><><EFBFBD>ˡ<EFBFBD>2.<2E><><EFBFBD>ˣ<EFBFBD>
gr.setCheckedType("1");
gr.setLoanCardPassword("");
gr.setArchiveUrl("");
gr.setAgeInMonth(ageInMonth);
gr.setChildrenFlag("");
gr.setBlacklistInd("");
gr.setThaiTitleCde("");
//<2F><>֧<EFBFBD><D6A7>
gr.setExpense(expense);
//<2F><><EFBFBD><EFBFBD>
gr.setBrithday(birthday);
gr.setLicenseExpireDate("");
gr.setCountryCode("");
gr.setAreaCode("");
gr.setExtentionNbr("");
gr.setPhoneTypeCde("");
//ְ<><D6B0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
gr.setDesignationCde(empPositionCode);
gr.setCityCde("");
gr.setStateCde("");
//ʡ<><CAA1><EFBFBD><EFBFBD>
gr.setProvinceGB(workProvinceCode);
gr.setCityGB(workCityCode);
gr.setDistrictGB(workDistrictCode);
gr.setStreetGB("");
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
gr.setBusinessNatureCde(ParamDataUtils.queryBcEnumType("Unit_nature",businessTypeCode));
gr.setPostCode("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
gr.setEmployAddress(workAddressDetail);
//ְҵ
gr.setOccupationCode(occupationCode);
//<2F><>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
gr.setBusinessTypeCde(empBusinessTypeCode);
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޵ij<DEB5><C4B3><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>)
gr.setTimeInYear2("");
gr.setRankCde("");
//ְҵ
gr.setOccupationCde(occupationCode);
//<2F><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ
gr.setIndustryTypeCde(empBusinessTypeCode);
gr.setAddr(getAddr());
gr.setExposure(getExposure(idTypeCode));
gr.setCustTypeId("1");
gr.setIdCardTermBeginDate(CardTermBeginDate);
gr.setIdCardTermEndDate(CardTermEndDate);
//<2F><><EFBFBD><EFBFBD>
gr.setNationId(nationId);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
gr.setCensusRegAddr(censusRegAddr);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD>ϵ
gr.setRelationshipCode(relationshipCode);
//<2F><><EFBFBD>Ų<EFBFBD>ѯԭ<D1AF><D4AD>
gr.setQueryReason(CodeManager.getItemName("pboc_query_strategy","qryReason_guarantor"));
return gr;
}
public ContInfo getContInfo() throws JBOException {
ContInfo ci = new ContInfo();
List<Contr> contrs = new ArrayList<>();
Contr contr = new Contr();
contr.setContNum("1");
contr.setChName(boCpt.getAttribute("EMERGENCY_CONTACT_PERSON").toString());
String relationshipCode1 = ParamDataUtils.queryBcEnumType("personContact",boCpt.getAttribute("EMPLOYRECORD").toString());
contr.setRelationshipCode(relationshipCode1);
contr.setCellPhone(boCpt.getAttribute("EMERGENCY_CONTACT_TEL").toString());
Contr contr2 = new Contr();
contr2.setContNum("2");
contr2.setChName(boCpt.getAttribute("INTRO").toString());
String relationshipCode2 = ParamDataUtils.queryBcEnumType("personContact",boCpt.getAttribute("EDUDEGREE").toString());
contr2.setRelationshipCode(relationshipCode2);
contr2.setCellPhone(boCpt.getAttribute("REMARK").toString());
contrs.add(contr);
contrs.add(contr2);
ci.setContrs(contrs);
return ci;
}
public int repeatedApplicantFlag(String certId) throws JBOException {
int repeatedApplicantFlag = 0;
//int boCountLgu = JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT.CLASS_NAME,"CERTID=:certId").setParameter("certId",certId).getTotalCount();
//int boCountCf = JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY.CLASS_NAME,"CERTID=:certId and status='valid' and Partner_='Y' ").setParameter("certId",certId).getTotalCount();
int boCountCi = JBOFactory.createBizObjectQuery(CUSTOMER_INFO.CLASS_NAME,"CERTID=:certId ").setParameter("certId",certId).getTotalCount();
if(boCountCi>0){
repeatedApplicantFlag = 1;
}
return repeatedApplicantFlag;
}
public Addr getAddr() throws JBOException {
BizObject boCat = JBOFactory.createBizObjectQuery(CUSTOMER_ADDRESS_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and customerid=:customerId").setParameter("flowunid",flowUnid).setParameter("customerId",boCpt.getAttribute("customerid").toString()).getSingleResult(false);
String liveAddressId = boCat.getAttribute("province").getString();
String provinceCode = ParamDataUtils.queryMapBcProvinceCode("AreaCode",liveAddressId);
String cityCode = ParamDataUtils.queryMapBcCityCode("AreaCode",liveAddressId);
String districtCode = ParamDataUtils.queryMapBcCountyCode("AreaCode",liveAddressId);
String fullAddress = boCat.getAttribute("dressdetail").getString();
String residentialStatusCode = ParamDataUtils.queryBcEnumType("Property_type",boCpt.getAttribute("Property_type").toString());
Addr addr = new Addr();
addr.setProvince("");
addr.setCity("");
addr.setDistrict("");
addr.setProvinceGB(provinceCode);
addr.setCityGB(cityCode);
addr.setDistrictGB(districtCode);
addr.setStreetGB("");
addr.setAddress(fullAddress);
addr.setPostCode("");
addr.setAddrType("");
addr.setAddrNum("");
addr.setPropertyTypeCde(residentialStatusCode);
addr.setHukouAddress("");
return addr;
}
public Exposure getExposure(String certId) throws JBOException {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>customerid<69><64><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD>customerid<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
List<BizObject> boCis = JBOFactory.createBizObjectQuery(CUSTOMER_INFO.CLASS_NAME,"CERTID=:certId").setParameter("certId",certId).getResultList(false);
BigDecimal corpusRemain = new BigDecimal("0");
BigDecimal yetLoan = new BigDecimal("0");
int carCountRemain = 0;
int carCountYetLoan = 0;
for(BizObject boCi : boCis){
String customerId = boCi.getAttribute("CUSTOMERID").toString();
//һ<><D2BB>customerId<49><64><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD>ͬ
List<BizObject> boLuls = JBOFactory.createBizObjectQuery(LB_UNION_LESSEE.CLASS_NAME,"CUSTOMER_ID=:CUSTOMER_ID and is_main='Y'").setParameter("CUSTOMER_ID",customerId).getResultList(false);
for(BizObject boLul : boLuls){
String contractId = boLul.getAttribute("contract_id").toString();
BizObject boLci = JBOFactory.createBizObjectQuery(LB_CONTRACT_INFO.CLASS_NAME,"ID=:ID").setParameter("ID",contractId).getSingleResult(false);
String contractStatus = boLci.getAttribute("CONTRACT_STATUS").toString();
if("31".equals(contractStatus)){
BizObject boCat = JBOFactory.createBizObjectQuery(LC_CALC_CONDITION.CLASS_NAME,"CONTRACT_ID=:CONTRACT_ID").setParameter("CONTRACT_ID",contractId).getSingleResult(false);
String financeAmount = boCat.getAttribute("CLEAN_LEASE_MONEY").toString();
BizObject boLri = JBOFactory.createBizObjectQuery(LC_RENT_INCOME.CLASS_NAME,"select ifnull(sum(corpus),0) as v.corpusTotal from o where CONTRACT_ID=:CONTRACT_ID and ROLL_BACK='0' ").setParameter("CONTRACT_ID",contractId).getSingleResult(false);
String corpusTotal = boLri.getAttribute("corpusTotal").toString();
corpusRemain = corpusRemain.add(new BigDecimal(financeAmount).subtract(new BigDecimal(corpusTotal)));
carCountRemain = JBOFactory.createBizObjectQuery(LB_EQUIPMENT_CAR.CLASS_NAME,"CONTRACT_ID=:CONTRACT_ID").setParameter("CONTRACT_ID",contractId).getTotalCount();
}
if("21".equals(contractStatus)){
BizObject boLfi = JBOFactory.createBizObjectQuery(LC_FUND_INCOME.CLASS_NAME,"CONTRACT_ID=:CONTRACT_ID and pay_type='pay_type_out' and fee_type='feetype10' and SETTLE_METHOD='settlemethod6' and roll_back='0' and PAY_STATUS<>'have_paid' ").setParameter("CONTRACT_ID",contractId).getSingleResult(false);
String factMoney = boLfi.getAttribute("fact_money").toString();
yetLoan = yetLoan.add(new BigDecimal(factMoney));
carCountYetLoan = JBOFactory.createBizObjectQuery(LB_EQUIPMENT_CAR.CLASS_NAME,"CONTRACT_ID=:CONTRACT_ID").setParameter("CONTRACT_ID",contractId).getTotalCount();
}
}
}
Exposure ep = new Exposure();
ep.setOutstanding(corpusRemain.toString());
ep.setApprovalAmt(yetLoan.toString());
ep.setOsNum(carCountRemain);
ep.setApprovalNum(carCountYetLoan);
return ep;
}
public ApplicationInfo getApplicationInfo() throws Exception {
ApplicationInfo app = new ApplicationInfo();
String number = boLpit.getAttribute("PROJECT_NO").toString();
BizObject boft = JBOFactory.createBizObjectQuery(FLOW_TASK.CLASS_NAME,"select min(begintime) as v.minTime,max(begintime) as v.maxTime from o where flowno='BusinessApplyFlow' and phasetype='1020' and objectno=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
String minTime = boft.getAttribute("minTime").toString().replace("/","-").replace(" ","T");
String maxTime = boft.getAttribute("maxTime").toString().replace("/","-").replace(" ","T");
String faName = boLpit.getAttribute("inputName").toString();
String faCellphone = boLpit.getAttribute("inputTel").toString();
String carType = boLpit.getAttribute("car_type").toString();
app.setNumber(number);
app.setApplicationType("APF");
app.setOriginalSystemId("APF");
app.setTranNo(tranNo);
app.setFirstProposalDate(minTime);
app.setLastProposalDate(maxTime);
app.setFaName(faName);
app.setFaid("");
app.setFaCellphone(faCellphone);
app.setFvName("");
app.setFvCellphone("");
app.setFvDateoffv("");
app.setFieldVisitFlag("");
app.setBusinessStep("");
app.setGroupCustomerUpId("");
app.setGroupCustomerSpecialLimit("");
//<2F><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EEB3B5><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>CV<43><56>PV<50><56>
app.setLoanvehicleType("<EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>".equals(carType)?"PV":"CV");
app.setQueryReason("");
app.setCreditQueryType("");
app.setCreditQueryInterface("");
BizObject boPsl = JBOFactory.createBizObjectQuery(PRD_SPECIFIC_LIBRARY.CLASS_NAME,"PRODUCTID=:PRODUCTID").setParameter("PRODUCTID",boLpit.getAttribute("PRODUCT_ID").toString()).getSingleResult(false);
String lendingType = boPsl.getAttribute("LENDING_TYPE").toString();
app.setIsVehicleGuaranty("AFTER".equals(lendingType)||"FIRST".equals(lendingType)?"1":"0");
app.setCvHeadVehicleCount("");
app.setSosRandomNumber("");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
app.setApplicationDate(boLpit.getAttribute("project_date").toString().replace("/","-").replace(" ","T"));
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>ʱ<EFBFBD>
app.setApplicationSubmitDate(maxTime);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> 1<><31><EFBFBD><EFBFBD> 2<><32><EFBFBD><EFBFBD>
BizObject boCit = JBOFactory.createBizObjectQuery(CUSTOMER_INFO_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
String customerType = "1";
if("01".equals(boCit.getAttribute("customertype").toString())){
customerType="2";
}
app.setCustomerType(customerType);
//<2F><><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ģʽ
app.setStatusCode(ParamDataUtils.queryBcEnumType("dischanneltype",boDi.getAttribute("channeltype").toString()));
return app;
}
public PreviouslyVehicle getPreviouslyVehicle() throws JBOException {
PreviouslyVehicle pv = new PreviouslyVehicle();
pv.setWorkingTime(ParamDataUtils.queryBcEnumType("employmentTime",boCpt.getAttribute("pre_operate_years").toString()));
pv.setPreviouslyVehicleType(ParamDataUtils.queryBcEnumType("operatePreVehicleType",boCpt.getAttribute("pre_operate_car_type").toString()));
pv.setPreviouslyVehicleLicense(boCpt.getAttribute("pre_operate_car_no").toString());
return pv;
}
public BizObject getAddressById(String addressId) throws JBOException {
BizObject boRai = null;
BizObjectManager rcAddressInfo = JBOFactory.getBizObjectManager(RC_ADDRESS_INFO.CLASS_NAME);
if(addressId==null || "".equals(addressId)){
boRai = rcAddressInfo.newObject();
boRai.setAttributeValue("province_code","");
boRai.setAttributeValue("city_code","");
boRai.setAttributeValue("district_code","");
boRai.setAttributeValue("address_detail","<EFBFBD>յ<EFBFBD>ַ");
return boRai;
}
boRai = rcAddressInfo.createQuery("address_id=:id").setParameter("id", addressId).getSingleResult(false);
if(boRai == null){
boRai = rcAddressInfo.newObject();
boRai.setAttributeValue("province_code","");
boRai.setAttributeValue("city_code","");
boRai.setAttributeValue("district_code","");
boRai.setAttributeValue("address_detail","<EFBFBD><EFBFBD><EFBFBD><EFBFBD>address_idδ<EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>ַ");
}
return boRai;
}
public int exposures() throws JBOException {
Set<String> projectSet = new HashSet<>();
BizObject boCit = JBOFactory.createBizObjectQuery(CUSTOMER_INFO_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
String applyCertId = boCpt.getAttribute("CERTID").toString();
projectSet.addAll(getExposuresNumberByCertID(applyCertId));
if(boCft!=null){
String coBorroeerId = boCft.getAttribute("CERTID").toString();
projectSet.addAll(getExposuresNumberByCertID(coBorroeerId));
}
if(boLguts.size()>0){
for(BizObject boLgu : boLguts){
String lguCertId = boLgu.getAttribute("CERTID").toString();
projectSet.addAll(getExposuresNumberByCertID(lguCertId));
}
}
return projectSet.size();
}
public String exposuresAmount() throws JBOException {
Set<String> projectSet = new HashSet<>();
BigDecimal amount = new BigDecimal("0.00");
BizObject boCit = JBOFactory.createBizObjectQuery(CUSTOMER_INFO_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid",flowUnid).getSingleResult(false);
String applyCertId = boCpt.getAttribute("CERTID").toString();
projectSet.addAll(getExposuresNumberByCertID(applyCertId));
if(boCft!=null){
String coBorroeerId = boCft.getAttribute("CERTID").toString();
projectSet.addAll(getExposuresNumberByCertID(coBorroeerId));
}
if(boLguts.size()>0){
for(BizObject boLgu : boLguts){
String lguCertId = boLgu.getAttribute("CERTID").toString();
projectSet.addAll(getExposuresNumberByCertID(lguCertId));
}
}
for(String projectId : projectSet){
BizObject boLpc = JBOFactory.createBizObjectQuery(LC_PROJ_CONDITION.CLASS_NAME,"PROJECT_ID=:PROJECT_ID").setParameter("PROJECT_ID",projectId).getSingleResult(false);
String cleanLeaseMoney = boLpc.getAttribute("CLEAN_LEASE_MONEY").toString();
String cautionMoney =boLpc.getAttribute("CAUTION_MONEY").toString();
BizObject boLri = JBOFactory.createBizObjectQuery(LC_RENT_INCOME.CLASS_NAME,"select sum(rent) as v.rentIncome from O where ROLL_BACK=0 and PROJECT_ID=:PROJECT_ID").setParameter("PROJECT_ID",projectId).getSingleResult(false);
String rentIncome = boLri.getAttribute("rentIncome").toString();
if("".equals(rentIncome)){
continue;
}
amount = new BigDecimal(cleanLeaseMoney).subtract(new BigDecimal(cautionMoney)).subtract(new BigDecimal(rentIncome)).add(amount);
}
return amount.toString();
}
public Set getExposuresNumberByCertID(String certId) throws JBOException {
/*
<20><><EFBFBD><EFBFBD><E5B3A8><EFBFBD>߼<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD><CBBB>߹<EFBFBD><DFB9><EFBFBD><EFBFBD>˻򵣱<CBBB><F2B5A3B1>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߹<EFBFBD><DFB9><EFBFBD><EFBFBD>˻򵣱<CBBB><F2B5A3B1>ˣ<EFBFBD><CBA3>ظ<EFBFBD><D8B8><EFBFBD>ͬȡһ<C8A1>μ<EFBFBD><CEBC>
<><C8AB><EFBFBD><EFBFBD>ͬ<EFBFBD>ģ<EFBFBD><C4A3>ѷſ<D1B7><C5BF>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> + <20><><EFBFBD>ſ<EFBFBD><C5BF>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> + <20>Ѻ<EFBFBD>׼δ<D7BC>ſ<EFBFBD><C5BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD> + <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD>
+<2B><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD>
<20><><EFBFBD>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>˿ͻ<CBBF><CDBB><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5A3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>ʵ<EFBFBD>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD>˼<EFBFBD><CBBC>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڡ<EFBFBD>
*/
//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD>ܴ<EFBFBD><DCB4>ڶ<EFBFBD><DAB6><EFBFBD>customerid
List<BizObject> boCis = JBOFactory.createBizObjectQuery(CUSTOMER_INFO.CLASS_NAME,"select CUSTOMERID from O where CERTID=:certId").setParameter("certId",certId).getResultList(false);
Set<String> projectSet = new HashSet<>();
for(BizObject boCi : boCis){
String customerId = boCi.getAttribute("CUSTOMERID").toString();
//һ<><D2BB>customerId<49><64><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD>ͬ
List<BizObject> boLuls = JBOFactory.createBizObjectQuery(LB_UNION_LESSEE.CLASS_NAME,"select project_id from O where CUSTOMER_ID=:CUSTOMER_ID and is_main='Y'").setParameter("CUSTOMER_ID",customerId).getResultList(false);
for(BizObject boLul : boLuls){
String projectId = boLul.getAttribute("project_id").toString();
projectSet.add(projectId);
}
}
List<BizObject> boCfs = JBOFactory.createBizObjectQuery(CUSTOMER_FAMILY.CLASS_NAME,"select PROJECT_ID from O where CERTID=:certId and status='valid' and Partner_='Y'").setParameter("certId",certId).getResultList(false);
for(BizObject boCf : boCfs){
String projectId = boCf.getAttribute("PROJECT_ID").toString();
projectSet.add(projectId);
}
List<BizObject> boLgus = JBOFactory.createBizObjectQuery(LB_GUARANTEE_UNIT.CLASS_NAME,"select PROJECT_ID from O where CERTID=:certId ").setParameter("certId",certId).getResultList(false);
for(BizObject boLgu : boLgus){
String projectId = boLgu.getAttribute("PROJECT_ID").toString();
projectSet.add(projectId);
}
return projectSet;
}
public int getExposuresNumber() throws JBOException {
BigDecimal count = new BigDecimal("0");
for(BizObject boChit : getExposures()){
count = count.add(new BigDecimal(boChit.getAttribute("CLIENTBUYNUMBER").toString()));
}
return count.intValue();
}
public List<BizObject> getExposures() throws JBOException {
List<BizObject> boChits = JBOFactory.createBizObjectQuery(CUSTOMER_HISTORY_INFO_TEMP.CLASS_NAME,"FLOWUNID=:flowunid ").setParameter("flowunid",flowUnid).getResultList(false);
System.out.println(boChits.size());
return boChits;
}
public String getExposuresAmount() throws JBOException {
Transaction Sqlca = null;
String amount = "0.00";
try {
Sqlca = Transaction.createTransaction("als");
amount = LBBusinessPrimary.obtainExposureMoney(Sqlca,flowUnid).toString();
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (Sqlca != null)
try {
Sqlca.commit();
Sqlca.disConnect();
Sqlca = null;
} catch (Exception e) {
e.printStackTrace();
}
}
return amount;
}
public String idDateConvert(String date){
if("2100/12/31".equals(date)){
date = "0000-00-00";
}else{
date = date.replace("/","-");
}
return date;
}
public String getFlowUnid() {
return flowUnid;
}
public void setFlowUnid(String flowUnid) {
this.flowUnid = flowUnid;
}
public String getOperatorId() {
return operatorId;
}
public void setOperatorId(String operatorId) {
this.operatorId = operatorId;
}
public String getTranNo() {
return tranNo;
}
public void setTranNo(String tranNo) {
this.tranNo = tranNo;
}
}