diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/BusinessApplicationPfToTemp.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/BusinessApplicationPfToTemp.java new file mode 100644 index 000000000..4e5476468 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/BusinessApplicationPfToTemp.java @@ -0,0 +1,139 @@ +package com.tenwa.lease.flow.project.commbusiness; + +import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; +import jbo.sys.CODE_LIBRARY; +import jbo.sys.PF_CUSTOMER_ADDRESS; +import jbo.sys.PF_CUSTOMER_FAMILY; +import jbo.sys.PF_CUSTOMER_PERSON; +import jbo.sys.PF_PROJECT_INFO; + +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.are.jbo.JBOTransaction; +import com.tenwa.flow.baseBussion.BaseBussiness; + +/** + * 业务申请接口平台初始化数据 + */ +public class BusinessApplicationPfToTemp extends BaseBussiness { + + /**自然人客户 + * @throws Exception + * @throws JBOException */ + public static void savePerson(BizObject boCRT,String serial) throws Exception{ + BizObject customerBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_PERSON.CLASS_NAME,"SERIAL=:serial").setParameter("serial",serial).getSingleResult(false); + boCRT.setAttributeValue("mobile",customerBo.getAttribute("mobile").toString()); + boCRT.setAttributeValue("LICENSENAME",customerBo.getAttribute("LICENSENAME").toString()); + boCRT.setAttributeValue("Mailing_Address",customerBo.getAttribute("Mailing_Address").toString()); + boCRT.setAttributeValue("NATIVEPLACE",customerBo.getAttribute("NATIVEPLACE").toString()); + boCRT.setAttributeValue("MARRIAGE",customerBo.getAttribute("MARRIAGE").toString()); + boCRT.setAttributeValue("POPULATION",customerBo.getAttribute("POPULATION").toString()); + boCRT.setAttributeValue("childrens_number",customerBo.getAttribute("childrens_number").toString()); + boCRT.setAttributeValue("EDUEXPERIENCE",customerBo.getAttribute("EDUEXPERIENCE").toString()); + boCRT.setAttributeValue("Property_type",customerBo.getAttribute("Property_type").toString()); + boCRT.setAttributeValue("WORKCORP",customerBo.getAttribute("WORKCORP").toString()); + boCRT.setAttributeValue("WORKADD",customerBo.getAttribute("WORKADD").toString()); + boCRT.setAttributeValue("WORKTEL",customerBo.getAttribute("WORKTEL").toString()); + boCRT.setAttributeValue("ENTRYTIME",customerBo.getAttribute("ENTRYTIME").toString()); + boCRT.setAttributeValue("Unit_nature",customerBo.getAttribute("Unit_nature").toString()); + boCRT.setAttributeValue("main_income",customerBo.getAttribute("main_income").toString()); + boCRT.setAttributeValue("FAMILYMONTHINCOME",customerBo.getAttribute("FAMILYMONTHINCOME").toString()); + boCRT.setAttributeValue("EMERGENCY_CONTACT_PERSON",customerBo.getAttribute("EMERGENCY_CONTACT_PERSON").toString()); + boCRT.setAttributeValue("EMPLOYRECORD",customerBo.getAttribute("EMPLOYRECORD").toString()); + boCRT.setAttributeValue("EMERGENCY_CONTACT_TEL",customerBo.getAttribute("EMERGENCY_CONTACT_TEL").toString()); + boCRT.setAttributeValue("INTRO",customerBo.getAttribute("INTRO").toString()); + boCRT.setAttributeValue("EDUDEGREE",customerBo.getAttribute("EDUDEGREE").toString()); + boCRT.setAttributeValue("REMARK",customerBo.getAttribute("REMARK").toString()); + } + + /**自然人客户居住地址 + * @throws Exception + * @throws JBOException */ + public static void saveCustomerAddress(BizObject boCA,String serial) throws Exception{ + BizObject caBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_ADDRESS.CLASS_NAME,"SERIAL=:serial").setParameter("serial",serial).getSingleResult(false); + BizObject clBo = JBOFactory.createBizObjectQuery(CODE_LIBRARY.CLASS_NAME,"codeno='AreaCode' and itemno=:itemno").setParameter("itemno",caBo.getAttribute("province").toString()).getSingleResult(false); + boCA.setAttributeValue("addtype","0060"); + boCA.setAttributeValue("isadd","yes"); + boCA.setAttributeValue("isnew","yes"); + boCA.setAttributeValue("country","CHN"); + boCA.setAttributeValue("province",caBo.getAttribute("province").toString()); + boCA.setAttributeValue("dressdetail",caBo.getAttribute("dressdetail").toString()); + boCA.setAttributeValue("zipcode",caBo.getAttribute("zipcode").toString()); + boCA.setAttributeValue("FULLADDRESS",clBo.getAttribute("itemname").toString()+caBo.getAttribute("dressdetail").toString()); + } + + /** + * 自然人客户配偶信息 + */ + public static void saveSpouseInformation(BizObject boCFT,String serial) throws Exception{ + BizObject pcfBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_FAMILY.CLASS_NAME,"SERIAL=:serial and Spouse_='Y'").setParameter("serial",serial).getSingleResult(false); + boCFT.setAttributeValue("certtype",pcfBo.getAttribute("certtype").toString()); + boCFT.setAttributeValue("certid",pcfBo.getAttribute("certid").toString()); + boCFT.setAttributeValue("name",pcfBo.getAttribute("name").toString()); + boCFT.setAttributeValue("relative","01"); + boCFT.setAttributeValue("tel",pcfBo.getAttribute("tel").toString()); + boCFT.setAttributeValue("workunit",pcfBo.getAttribute("workunit").toString()); + boCFT.setAttributeValue("status","status"); + boCFT.setAttributeValue("Spouse_","Y"); + boCFT.setAttributeValue("Partner_",pcfBo.getAttribute("Partner_").toString()); + boCFT.setAttributeValue("shukou",pcfBo.getAttribute("shukou").toString()); + boCFT.setAttributeValue("suname",pcfBo.getAttribute("suname").toString()); + boCFT.setAttributeValue("suphone",pcfBo.getAttribute("suphone").toString()); + boCFT.setAttributeValue("sposition",pcfBo.getAttribute("sposition").toString()); + boCFT.setAttributeValue("smincome",pcfBo.getAttribute("smincome").toString()); + boCFT.setAttributeValue("SEX",pcfBo.getAttribute("SEX").toString()); + } + + /** + * 项目基本信息 + */ + public static void saveProjInfo(BizObject bo,String serial) throws Exception{ + BizObject ppiBo = JBOFactory.createBizObjectQuery(PF_PROJECT_INFO.CLASS_NAME,"SERIAL=:serial").setParameter("serial",serial).getSingleResult(false); + bo.setAttributeValue("inputName",ppiBo.getAttribute("inputName").toString()); + bo.setAttributeValue("inputTel",ppiBo.getAttribute("inputTel").toString()); + bo.setAttributeValue("IS_NETCAR",ppiBo.getAttribute("IS_NETCAR").toString()); + if("0".equals(ppiBo.getAttribute("IS_NETCAR").toString())) return ; + + bo.setAttributeValue("IS_OPERATION",ppiBo.getAttribute("IS_OPERATION").toString()); + bo.setAttributeValue("IS_AFFILIATED",ppiBo.getAttribute("IS_AFFILIATED").toString()); + bo.setAttributeValue("IS_OPERATION_QUALIFICATION",ppiBo.getAttribute("IS_OPERATION_QUALIFICATION").toString()); + bo.setAttributeValue("AFFILIATEDNAME",ppiBo.getAttribute("AFFILIATEDNAME").toString()); + bo.setAttributeValue("TRANSPORTCERTID",ppiBo.getAttribute("TRANSPORTCERTID").toString()); + bo.setAttributeValue("TRANSPORTDATE",ppiBo.getAttribute("TRANSPORTDATE").toString()); + bo.setAttributeValue("NETCERTID",ppiBo.getAttribute("NETCERTID").toString()); + bo.setAttributeValue("LEGALPERSONNAME",ppiBo.getAttribute("LEGALPERSONNAME").toString()); + bo.setAttributeValue("LEGALPERSONID",ppiBo.getAttribute("LEGALPERSONID").toString()); + bo.setAttributeValue("AFFILIATEDDATE",ppiBo.getAttribute("AFFILIATEDDATE").toString()); + bo.setAttributeValue("AFFILIATEDENDDATE",ppiBo.getAttribute("AFFILIATEDENDDATE").toString()); + bo.setAttributeValue("REGISTEREDMONEY",ppiBo.getAttribute("REGISTEREDMONEY").toString()); + bo.setAttributeValue("AFFILIATEDACTUALADDRESS",ppiBo.getAttribute("AFFILIATEDACTUALADDRESS").toString()); + bo.setAttributeValue("AFFILIATEDADDRESS",ppiBo.getAttribute("AFFILIATEDADDRESS").toString()); + } + + /**共同申请人 + * @param cftbo + * @param cftbom + * @param tx + * @param customerId */ + public static void savePartner(BizObject cftbo,BizObjectManager cftbom,String serial) throws Exception{ + BizObject pcfBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_FAMILY.CLASS_NAME,"SERIAL=:serial and Spouse_ IS NULL").setParameter("serial",serial).getSingleResult(false); + if(pcfBo==null)return; + + cftbo.setAttributeValue("name",pcfBo.getAttribute("name").toString()); + cftbo.setAttributeValue("ASSURE_RELATION",pcfBo.getAttribute("ASSURE_RELATION").toString()); + cftbo.setAttributeValue("certtype",pcfBo.getAttribute("certtype").toString()); + cftbo.setAttributeValue("certid",pcfBo.getAttribute("certid").toString()); + cftbo.setAttributeValue("SEX",pcfBo.getAttribute("SEX").toString()); + cftbo.setAttributeValue("tel",pcfBo.getAttribute("tel").toString()); + cftbo.setAttributeValue("Partner_",pcfBo.getAttribute("Partner_").toString()); + cftbo.setAttributeValue("shukou",pcfBo.getAttribute("shukou").toString()); + cftbo.setAttributeValue("suname",pcfBo.getAttribute("suname").toString()); + cftbo.setAttributeValue("suphone",pcfBo.getAttribute("suphone").toString()); + cftbo.setAttributeValue("smincome",pcfBo.getAttribute("smincome").toString()); + cftbo.setAttributeValue("sposition",pcfBo.getAttribute("sposition").toString()); + cftbo.setAttributeValue("workunit",pcfBo.getAttribute("workunit").toString()); + cftbom.saveObject(cftbo); + } +} \ No newline at end of file