业务申请存量客户

This commit is contained in:
liyang 2018-08-17 11:13:51 +08:00
parent 5560b4471b
commit 0ff904671d
5 changed files with 399 additions and 52 deletions

View File

@ -112,6 +112,9 @@
var price = getItemValue(0,getRow(),"price");//车辆指导价
var liter = getItemValue(0,getRow(),"liter");//排量
var geartype = getItemValue(0,getRow(),"geartype");//档位
var CustomerId="";
var ceckRes = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkNameAndCertId","certid="+certid+",certtype="+certtype);
CustomerId=ceckRes;
if(carAttributes==""){
alert("请选择车辆属性");
@ -152,7 +155,7 @@
}
var sParams = "ApplyType=<%=sApplyType%>,CurUserID=<%=CurUser.getUserID()%>";
sParams =sParams+",ProductId="+productId+",ProductName="+productname+",CustomerType="+customerType+",carAttributes="+carAttributes+",leasehold="+leasehold+",carSystem="+carSystem+",custname="+custname+",certtype="+certtype+",certid="+certid+",productModel="+productModel+",carSeries="+carSeries+",versionid="+versionid+",modelid="+modelid+",businessType="+businessType+",price="+price+",liter="+liter+",geartype="+geartype+",sourcetype=web";
sParams =sParams+",ProductId="+productId+",ProductName="+productname+",CustomerType="+customerType+",carAttributes="+carAttributes+",leasehold="+leasehold+",carSystem="+carSystem+",custname="+custname+",certtype="+certtype+",certid="+certid+",CustomerId="+CustomerId+",productModel="+productModel+",carSeries="+carSeries+",versionid="+versionid+",modelid="+modelid+",businessType="+businessType+",price="+price+",liter="+liter+",geartype="+geartype+",sourcetype=web";
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.projectapproval.BusinessApprovalStartAction","initFLow",sParams);//定义流程中需要的参数
if(typeof(sReturnInfo)=="undefined" || sReturnInfo=="" || sReturnInfo=="_CANCEL_" )
{

View File

@ -4350,6 +4350,161 @@
</managerProperties>
</manager>
</class>
<class name="CUST_PERSON_HIS" label="" keyAttributes="">
<attributes>
<attribute name="project_id" label="project_id" type="STRING" length="40"/>
<attribute name="contract_id" label="contract_id" type="STRING" length="40"/>
<attribute name="customerid" label="客户编号" type="STRING" length="40"/>
<attribute name="customername" label="客户名称" type="STRING" length="200"/>
<attribute name="customertype" label="客户类别" type="STRING" length="20"/>
<attribute name="certtype" label="证件类型" type="STRING" length="20"/>
<attribute name="certid" label="证件号" type="STRING" length="40"/>
<attribute name="sex" label="性别" type="STRING" length="18"/>
<attribute name="mobile" label="手机号" type="STRING" length="32"/>
<attribute name="LICENSENAME" label="驾驶证姓名" type="STRING" length="200"/>
<attribute name="LICENSENAMENAME" label="LICENSENAMENAME" type="STRING" length="250"/>
<attribute name="WORKCORP" label="单位名称" type="STRING" length="80"/>
<attribute name="WORKADD" label="单位地址" type="STRING" length="200"/>
<attribute name="WORKTEL" label="单位电话" type="STRING" length="32"/>
<attribute name="ENTRYTIME" label="入职时间" type="STRING" length="32"/>
<attribute name="Mailing_Address" label="邮寄地址" type="STRING" length="200"/>
<attribute name="NATIVEPLACE" label="户籍地址" type="STRING" length="200"/>
<attribute name="EMERGENCY_CONTACT_PERSON" label="紧急联系人" type="STRING" length="32"/>
<attribute name="EMPLOYRECORD" label="工作履历" type="STRING" length="200"/>
<attribute name="EMERGENCY_CONTACT_TEL" label="紧急联系电话" type="STRING" length="32"/>
<attribute name="INTRO" label="个人情况简介" type="STRING" length="200"/>
<attribute name="EDUDEGREE" label="最高学位" type="STRING" length="18"/>
<attribute name="REMARK" label="备注" type="STRING" length="500"/>
<attribute name="MARRIAGE" label="婚姻状况" type="STRING" length="18"/>
<attribute name="MARRIAGENAME" label="MARRIAGENAME" type="STRING" length="250"/>
<attribute name="POPULATION" label="家庭人口数" type="INT" length="10"/>
<attribute name="childrens_number" label="子女人数" type="STRING" length="32"/>
<attribute name="telephone" label="固定电话" type="STRING" length="32"/>
<attribute name="EDUEXPERIENCE" label="最高学历" type="STRING" length="18"/>
<attribute name="EDUEXPERIENCENAME" label="EDUEXPERIENCENAME" type="STRING" length="250"/>
<attribute name="Property_type" label="房产类型" type="STRING" length="32"/>
<attribute name="Property_typeNAME" label="Property_typeNAME" type="STRING" length="250"/>
<attribute name="Unit_nature" label="单位性质" type="STRING" length="32"/>
<attribute name="Unit_natureNAME" label="Unit_natureNAME" type="STRING" length="250"/>
<attribute name="OCCUPATION" label="职业" type="STRING" length="18"/>
<attribute name="main_income" label="主要收入" type="STRING" length="32"/>
<attribute name="main_incomeNAME" label="main_incomeNAME" type="STRING" length="250"/>
<attribute name="before_unit_name" label="前工作单位名称" type="STRING" length="60"/>
<attribute name="FAMILYMONTHINCOME" label="家庭月收入" type="DOUBLE" length="24" scale="6"/>
<attribute name="other_income" label="其他收入" type="DOUBLE" length="22" scale="2"/>
<attribute name="fulladdress" label="地址全名" type="STRING" length="400"/>
<attribute name="custtype" label="客户类别" type="STRING" length="32"/>
<attribute name="custtypeNAME" label="custtypeNAME" type="STRING" length="250"/>
<attribute name="Partner_name" label="姓名" type="STRING" length="32"/>
<attribute name="Partner_ASSURE_RELATION" label="关系" type="STRING" length="10"/>
<attribute name="Partner_certid" label="证件号码" type="STRING" length="32"/>
<attribute name="Partner_SEX" label="性别" type="STRING" length="3"/>
<attribute name="Partner_tel" label="联系电话" type="STRING" length="40"/>
<attribute name="Partner_shukou" label="户口-配偶" type="STRING" length="32"/>
<attribute name="Partner_suname" label="单位名称-配偶" type="STRING" length="60"/>
<attribute name="Partner_suphone" label="单位电话-配偶" type="STRING" length="32"/>
<attribute name="Partner_sposition" label="职位—配偶" type="STRING" length="32"/>
<attribute name="Partner_smincome" label="月收入——配偶" type="DOUBLE" length="22" scale="2"/>
<attribute name="Partner_workunit" label="工作单位" type="STRING" length="100"/>
<attribute name="SPOUSE_name" label="姓名" type="STRING" length="32"/>
<attribute name="SPOUSE_certid" label="证件号码" type="STRING" length="32"/>
<attribute name="SPOUSE_SEX" label="性别" type="STRING" length="3"/>
<attribute name="SPOUSE_tel" label="联系电话" type="STRING" length="40"/>
<attribute name="SPOUSE_Partner" label="是否共同申请人" type="STRING" length="32"/>
<attribute name="SPOUSE_shukou" label="户口-配偶" type="STRING" length="32"/>
<attribute name="SPOUSE_shukouNAME" label="SPOUSE_shukouNAME" type="STRING" length="250"/>
<attribute name="SPOUSE_suname" label="单位名称-配偶" type="STRING" length="60"/>
<attribute name="SPOUSE_suphone" label="单位电话-配偶" type="STRING" length="32"/>
<attribute name="SPOUSE_sposition" label="职位—配偶" type="STRING" length="32"/>
<attribute name="SPOUSE_smincome" label="月收入——配偶" type="DOUBLE" length="22" scale="2"/>
<attribute name="SPOUSE_workunit" label="工作单位" type="STRING" length="100"/>
<attribute name="STATUS" label="STATUS" type="STRING" length="32"/>
<attribute name="inputtime" label="inputtime" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="cust_person_his" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
<class name="VI_CUST_TENANT" label="" keyAttributes="">
<attributes>
<attribute name="project_id" label="project_id" type="STRING"/>
<attribute name="contract_id" label="contract_id" type="STRING"/>
<attribute name="customerid" label="customerid" type="STRING"/>
<attribute name="customername" label="customername" type="STRING"/>
<attribute name="customertype" label="customertype" type="STRING"/>
<attribute name="certtype" label="certtype" type="STRING"/>
<attribute name="certid" label="certid" type="STRING"/>
<attribute name="sex" label="sex" type="STRING"/>
<attribute name="mobile" label="mobile" type="STRING"/>
<attribute name="LICENSENAME" label="LICENSENAME" type="STRING"/>
<attribute name="LICENSENAMENAME" label="LICENSENAMENAME" type="STRING"/>
<attribute name="WORKCORP" label="WORKCORP" type="STRING"/>
<attribute name="WORKADD" label="WORKADD" type="STRING"/>
<attribute name="WORKTEL" label="WORKTEL" type="STRING"/>
<attribute name="ENTRYTIME" label="ENTRYTIME" type="STRING"/>
<attribute name="Mailing_Address" label="Mailing_Address" type="STRING"/>
<attribute name="NATIVEPLACE" label="NATIVEPLACE" type="STRING"/>
<attribute name="EMERGENCY_CONTACT_PERSON" label="EMERGENCY_CONTACT_PERSON" type="STRING"/>
<attribute name="EMPLOYRECORD" label="EMPLOYRECORD" type="STRING"/>
<attribute name="EMERGENCY_CONTACT_TEL" label="EMERGENCY_CONTACT_TEL" type="STRING"/>
<attribute name="INTRO" label="INTRO" type="STRING"/>
<attribute name="EDUDEGREE" label="EDUDEGREE" type="STRING"/>
<attribute name="REMARK" label="REMARK" type="STRING"/>
<attribute name="MARRIAGE" label="MARRIAGE" type="STRING"/>
<attribute name="MARRIAGENAME" label="MARRIAGENAME" type="STRING"/>
<attribute name="POPULATION" label="POPULATION" type="STRING"/>
<attribute name="childrens_number" label="childrens_number" type="STRING"/>
<attribute name="telephone" label="telephone" type="STRING"/>
<attribute name="EDUEXPERIENCE" label="EDUEXPERIENCE" type="STRING"/>
<attribute name="EDUEXPERIENCENAME" label="EDUEXPERIENCENAME" type="STRING"/>
<attribute name="Property_type" label="Property_type" type="STRING"/>
<attribute name="Property_typeNAME" label="Property_typeNAME" type="STRING"/>
<attribute name="Unit_nature" label="Unit_nature" type="STRING"/>
<attribute name="Unit_natureNAME" label="Unit_natureNAME" type="STRING"/>
<attribute name="OCCUPATION" label="OCCUPATION" type="STRING"/>
<attribute name="main_income" label="main_income" type="STRING"/>
<attribute name="main_incomeNAME" label="main_incomeNAME" type="STRING"/>
<attribute name="before_unit_name" label="before_unit_name" type="STRING"/>
<attribute name="FAMILYMONTHINCOME" label="FAMILYMONTHINCOME" type="STRING"/>
<attribute name="other_income" label="other_income" type="STRING"/>
<attribute name="fulladdress" label="fulladdress" type="STRING"/>
<attribute name="custtype" label="custtype" type="STRING"/>
<attribute name="custtypeNAME" label="custtypeNAME" type="STRING"/>
<attribute name="Partner_name" label="Partner_name" type="STRING"/>
<attribute name="Partner_ASSURE_RELATION" label="Partner_ASSURE_RELATION" type="STRING"/>
<attribute name="Partner_certid" label="Partner_certid" type="STRING"/>
<attribute name="Partner_SEX" label="Partner_SEX" type="STRING"/>
<attribute name="Partner_tel" label="Partner_tel" type="STRING"/>
<attribute name="Partner_shukou" label="Partner_shukou" type="STRING"/>
<attribute name="Partner_suname" label="Partner_suname" type="STRING"/>
<attribute name="Partner_suphone" label="Partner_suphone" type="STRING"/>
<attribute name="Partner_sposition" label="Partner_sposition" type="STRING"/>
<attribute name="Partner_smincome" label="Partner_smincome" type="STRING"/>
<attribute name="Partner_workunit" label="Partner_workunit" type="STRING"/>
<attribute name="SPOUSE_name" label="SPOUSE_name" type="STRING"/>
<attribute name="SPOUSE_certid" label="SPOUSE_certid" type="STRING"/>
<attribute name="SPOUSE_SEX" label="SPOUSE_SEX" type="STRING"/>
<attribute name="SPOUSE_tel" label="SPOUSE_tel" type="STRING"/>
<attribute name="SPOUSE_Partner" label="SPOUSE_Partner" type="STRING"/>
<attribute name="SPOUSE_shukou" label="SPOUSE_shukou" type="STRING"/>
<attribute name="SPOUSE_shukouNAME" label="SPOUSE_shukouNAME" type="STRING"/>
<attribute name="SPOUSE_suname" label="SPOUSE_suname" type="STRING"/>
<attribute name="SPOUSE_suphone" label="SPOUSE_suphone" type="STRING"/>
<attribute name="SPOUSE_sposition" label="SPOUSE_sposition" type="STRING"/>
<attribute name="SPOUSE_smincome" label="SPOUSE_smincome" type="STRING"/>
<attribute name="SPOUSE_workunit" label="SPOUSE_workunit" type="STRING"/>
<attribute name="inputtime" label="inputtime" type="STRING"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="vi_cust_tenant" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
</package>
<package name="jbo.com.tenwa.lease.carbrand" >
<class name="LB_CLAIMS_BOOK_DETAIL" label="索赔申请书详情表" keyAttributes="ID">

View File

@ -14,6 +14,9 @@ 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.amarsoft.awe.util.ASResultSet;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
public class CustomerInfoCheck {
@ -26,7 +29,34 @@ public class CustomerInfoCheck {
private String mobileResult;
private String repeatResult;
private String flowunid;
private String custname;
private String certtype;
private String certid;
public String getCerttype() {
return certtype;
}
public void setCerttype(String certtype) {
this.certtype = certtype;
}
public String getCertid() {
return certid;
}
public void setCertid(String certid) {
this.certid = certid;
}
public String getCustname() {
return custname;
}
public void setCustname(String custname) {
this.custname = custname;
}
public String checkName(JBOTransaction tx) throws JBOException{//校验姓名是否存在
if(customerType.equals("03")){//自然人
BizObject fullname = JBOFactory.createBizObjectQuery(CUSTOMER_PERSON.CLASS_NAME,"FULLNAME=:CustomerName").setParameter("CustomerName", this.CustomerName).getSingleResult(false);
@ -155,6 +185,24 @@ public class CustomerInfoCheck {
return "error";
}
public String checkNameAndCertId(JBOTransaction tx)throws Exception{
String CustomerId="";
Transaction Sqlca=null;
try {
Sqlca=Transaction.createTransaction(tx);
String sql = "select c.CUSTOMERID from customer_cert c where exists ( select 1 from customer_type c1 where c1.custtype='cust_type.cust' and c1.customerid=c.customerid)and c.certid='"+certid+"' and c.certtype='"+certtype+"'";
ASResultSet res = Sqlca.getASResultSet(new SqlObject(sql));
while (res.next()) {
CustomerId=res.getString("CUSTOMERID");
}
} catch (JBOException e) {
e.printStackTrace();
return "ERROR";
}
return CustomerId;
}
public String getFlowunid() {
return flowunid;
}

View File

@ -19,8 +19,16 @@ import jbo.app.tenwa.customer.CUSTOMER_PERSON;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_TYPE;
import jbo.app.tenwa.customer.CUSTOMER_TYPE_TEMP;
import jbo.com.tenwa.lease.comm.VI_CUST_TENANT;
import jbo.com.tenwa.lease.comm.CUST_PERSON_HIS;
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.util.Transaction;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.flow.baseBussion.BaseBussiness;
@ -31,48 +39,111 @@ public class LBCustomerRelaTempToFormalBusiness extends BaseBussiness {
@Override
public Object run(Transaction Sqlca) throws Exception {
this.initBussinessParam(Sqlca);
String custType1 = "";
String customeridForCust = "";
// String custType = this.getAttribute("custType").toString();
String ProjectId = this.getAttribute("ProjectId").toString();
String CustomerId = this.getAttribute("CustomerId").toString();
String flowunid = this.getAttribute("FlowUnid").toString();
//String certType = this.getAttribute("certType").toString();
String certType = this.getAttribute("certtype").toString();
//String certId = this.getAttribute("certNo").toString();
String certId = this.getAttribute("certid").toString();
BizObjectManager bomCT1 = JBOFactory.getBizObjectManager(CUSTOMER_CERT.CLASS_NAME,Sqlca);
BizObjectManager bomCTT1 = JBOFactory.getBizObjectManager(CUSTOMER_TYPE.CLASS_NAME,Sqlca); //客户类型临时表
List<BizObject> boCT1 = bomCT1.createQuery("certtype='"+certType+"' and certid='"+certId+"'").getResultList(false);
if(boCT1.size()>0){
for(BizObject CT1:boCT1){
customeridForCust = CT1.getAttribute("customerid").getString();
BizObject boCTT1 = bomCTT1.createQuery("customerid='"+customeridForCust+"'").getSingleResult(false);
if(boCTT1!=null){
custType1 = boCTT1.getAttribute("CUSTTYPE").getString();
if("cust_type.cust".equals(custType1)){
break;
}
}
}
}
Map<String,String>fromCondtion=new HashMap<String, String>();
fromCondtion.put("flowunid",this.getAttribute("FlowUnid").toString());
List<BizObject> unionList= DataOperatorUtil.getSetJBO(CUSTOMER_INFO_TEMP.CLASS_NAME, fromCondtion, Sqlca);
Map<String,String>toCondtion=new HashMap<String, String>();
CustomerCompare cc=new CustomerCompare();
Map<String,String>otherProperty=new HashMap<String,String>();
otherProperty.put("customerid", unionList.size()>0?unionList.get(0).getAttribute("customerid").toString():UUID.randomUUID().toString().replaceAll("-", ""));
DataOperatorUtil.copyJBOSet(CUSTOMER_INFO_TEMP.CLASS_NAME, fromCondtion,CUSTOMER_INFO.CLASS_NAME, null,otherProperty,cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_TYPE_TEMP.CLASS_NAME, fromCondtion,CUSTOMER_TYPE.CLASS_NAME, null,otherProperty,cc, Sqlca);
for(BizObject union:unionList){
Map<String,String>otherProperty=new HashMap<String, String>();
//1.处理存量客户 还是用之前的客户id 存到 关联表中只有自然人能做存量客户
if("cust_type.cust".equals(custType1)){
String CustId1 = customeridForCust;
otherProperty.put(LB_UNION_LESSEE.CUSTOMER_ID, CustId1);
otherProperty.put(LB_UNION_LESSEE.PROJECT_ID, ProjectId);
DataOperatorUtil.copySingleJBO(LB_UNION_LESSEE_TEMP.CLASS_NAME, fromCondtion, LB_UNION_LESSEE.CLASS_NAME, null, otherProperty, Sqlca);
//VI_CUST_PERSON视图查出来6张表的所有信息
fromCondtion.clear();
fromCondtion.put("customerid",CustId1);
//正式表中只存储客户的最新的信息 所以通过 CustomerId 会查到唯一的一条 承租人
otherProperty.clear();
otherProperty.put("STATUS","02");
DataOperatorUtil.copySingleJBO(VI_CUST_TENANT.CLASS_NAME, fromCondtion, CUST_PERSON_HIS.CLASS_NAME, null, otherProperty, Sqlca);
//将客户上一次的信息导入历史表之后正式表做update操作
//更新CUSTOMER_INFO信息
fromCondtion.clear();
fromCondtion.put("flowunid",flowunid);
BizObject cibo = DataOperatorUtil.getJBOBySQL("flowunid=:flowunid", LB_UNION_LESSEE_TEMP.CLASS_NAME, fromCondtion, Sqlca);
String custid2 = cibo.getAttribute("customer_id").toString();
fromCondtion.put("customerid", custid2);//区别担保人和承租人
otherProperty.clear();
otherProperty.put("customerid", CustId1);
DataOperatorUtil.copySingleJBO(CUSTOMER_INFO_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_INFO.CLASS_NAME, otherProperty, otherProperty, Sqlca);
DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_PERSON.CLASS_NAME, otherProperty, otherProperty, Sqlca);
DataOperatorUtil.copySingleJBO(CUSTOMER_ADDRESS_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS.CLASS_NAME, otherProperty, otherProperty, Sqlca);
DataOperatorUtil.copySingleJBO(CUSTOMER_CERT_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_CERT.CLASS_NAME, otherProperty, otherProperty, Sqlca);
DataOperatorUtil.copySingleJBO(CUSTOMER_FAMILY_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY.CLASS_NAME, otherProperty, otherProperty, Sqlca);
DataOperatorUtil.copySingleJBO(CUSTOMER_TYPE_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_TYPE.CLASS_NAME, otherProperty, otherProperty, Sqlca);
/* CustomerCompare cc= new CustomerCompare();
otherProperty.clear();
otherProperty.put(LB_GUARANTEE_UNIT.PROJECT_ID,ProjectId);
//将担保人信息导入正式表担保人和承租人在相同的表中为了保证这些表中的数据的唯一每一次都校验身份证并将信息存储在历史表中
this.copyGuarantee(Sqlca, flowunid, cc, otherProperty);*/
return "true";
}else{
fromCondtion.clear();
fromCondtion.put("customerid", union.getAttribute("customerid").getString());
fromCondtion.put("flowunid",this.getAttribute("FlowUnid").toString());
toCondtion.clear();
toCondtion.put("customerid", union.getAttribute("customerid").getString());
if("03".equals(union.getAttribute(CUSTOMER_INFO_TEMP.CUSTOMERTYPE).toString())){
DataOperatorUtil.copyJBOSet(CUSTOMER_PERSON_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_PERSON.CLASS_NAME, toCondtion, null, cc, Sqlca);
}else{
DataOperatorUtil.copyJBOSet(CUSTOMER_COMPANY_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_COMPANY.CLASS_NAME, toCondtion, null, cc, Sqlca);
List<BizObject> unionList= DataOperatorUtil.getSetJBO(CUSTOMER_INFO_TEMP.CLASS_NAME, fromCondtion, Sqlca);
Map<String,String>toCondtion=new HashMap<String, String>();
CustomerCompare cc=new CustomerCompare();
otherProperty.clear();
otherProperty.put("customerid", unionList.size()>0?unionList.get(0).getAttribute("customerid").toString():UUID.randomUUID().toString().replaceAll("-", ""));
DataOperatorUtil.copyJBOSet(CUSTOMER_INFO_TEMP.CLASS_NAME, fromCondtion,CUSTOMER_INFO.CLASS_NAME, null,otherProperty,cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_TYPE_TEMP.CLASS_NAME, fromCondtion,CUSTOMER_TYPE.CLASS_NAME, null,otherProperty,cc, Sqlca);
for(BizObject union:unionList){
fromCondtion.clear();
fromCondtion.put("customerid", union.getAttribute("customerid").getString());
fromCondtion.put("flowunid",this.getAttribute("FlowUnid").toString());
toCondtion.clear();
toCondtion.put("customerid", union.getAttribute("customerid").getString());
if("03".equals(union.getAttribute(CUSTOMER_INFO_TEMP.CUSTOMERTYPE).toString())){
DataOperatorUtil.copyJBOSet(CUSTOMER_PERSON_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_PERSON.CLASS_NAME, toCondtion, null, cc, Sqlca);
}else{
DataOperatorUtil.copyJBOSet(CUSTOMER_COMPANY_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_COMPANY.CLASS_NAME, toCondtion, null, cc, Sqlca);
}
DataOperatorUtil.copyJBOSet(CUSTOMER_CERT_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_CERT.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_FAMILY_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_ADDRESS_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS.CLASS_NAME, toCondtion, null, cc, Sqlca);
}
DataOperatorUtil.copyJBOSet(CUSTOMER_CERT_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_CERT.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_FAMILY_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_ADDRESS_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS.CLASS_NAME, toCondtion, null, cc, Sqlca);
//List<BizObject> unitList=DataOperatorUtil.getSetJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, Sqlca);
/* for(BizObject unit:unitList){
fromCondtion.clear();
fromCondtion.put("id",unit.getAttribute("id").toString());
DataOperatorUtil.copySingleJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT.CLASS_NAME, null, null, Sqlca);
fromCondtion.clear();
fromCondtion.put("customerid",unit.getAttribute("ASSUROR").getString());
fromCondtion.put("flowunid",this.getAttribute("FlowUnid").toString());
toCondtion.clear();
toCondtion.put("customerid", unit.getAttribute("ASSUROR").getString());
DataOperatorUtil.copyJBOSet(CUSTOMER_PERSON_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_PERSON.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_CERT_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_CERT.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_FAMILY_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_ADDRESS_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS.CLASS_NAME, toCondtion, null, cc, Sqlca);
}*/
}
//List<BizObject> unitList=DataOperatorUtil.getSetJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, Sqlca);
/* for(BizObject unit:unitList){
fromCondtion.clear();
fromCondtion.put("id",unit.getAttribute("id").toString());
DataOperatorUtil.copySingleJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT.CLASS_NAME, null, null, Sqlca);
fromCondtion.clear();
fromCondtion.put("customerid",unit.getAttribute("ASSUROR").getString());
fromCondtion.put("flowunid",this.getAttribute("FlowUnid").toString());
toCondtion.clear();
toCondtion.put("customerid", unit.getAttribute("ASSUROR").getString());
DataOperatorUtil.copyJBOSet(CUSTOMER_PERSON_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_PERSON.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_CERT_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_CERT.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_FAMILY_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY.CLASS_NAME, toCondtion, null, cc, Sqlca);
DataOperatorUtil.copyJBOSet(CUSTOMER_ADDRESS_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS.CLASS_NAME, toCondtion, null, cc, Sqlca);
}*/
String sMessage="true";
return sMessage;
String sMessage="true";
return sMessage;
}
}

View File

@ -2,15 +2,29 @@ package com.tenwa.lease.flow.project.commbusiness;
import jbo.app.tenwa.customer.CUSTOMER_ADDRESS;
import jbo.app.tenwa.customer.CUSTOMER_ADDRESS_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_CERT;
import jbo.app.tenwa.customer.CUSTOMER_CERT_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_COMPANY_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_FAMILY;
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_INFO;
import jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_PERSON;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_TYPE;
import jbo.app.tenwa.customer.CUSTOMER_TYPE_TEMP;
import jbo.app.tenwa.customer.DISTRIBUTOR_INFO;
import jbo.com.tenwa.lease.carbrand.BUSINESS_STATUS;
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
@ -19,6 +33,7 @@ import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.context.ASUser;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.flow.baseBussion.BaseBussiness;
/**
* 项目基本信息初始化
@ -38,6 +53,11 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
public String initBusinessApply(JBOTransaction tx,ASUser asUser) throws Exception {
String className = "";
String colName = "";
//String certId = this.getAttribute("certNo").toString();
String certId = this.getAttribute("certid").toString();
//String certType = this.getAttribute("certType").toString();
String certType = this.getAttribute("certtype").toString();
String flowunid = this.getAttribute("ObjectNo").toString();
if("03".equals(this.getAttribute("CustomerType"))){ // 自然人
className = CUSTOMER_PERSON_TEMP.CLASS_NAME;
colName = "FULLNAME";
@ -56,21 +76,71 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
String deptid = asUser.getOrgID();
String distributoIid="";
String vndrName="";
if(deptid.startsWith("8006")) {
BizObject distributor_bo=JBOFactory.createBizObjectQuery(DISTRIBUTOR_INFO.CLASS_NAME,"orgid=:orgid").setParameter("orgid",deptid).getSingleResult(false);
if(distributor_bo!=null){
distributoIid=distributor_bo.getAttribute("distributor_no").toString();
vndrName=distributor_bo.getAttribute("distributor_name").toString();
}
String custType = "";
//通过证件号码和客户类型查询是否为存量客户
BizObjectManager bomCT1 = JBOFactory.getBizObjectManager(CUSTOMER_CERT.CLASS_NAME,tx);
BizObjectManager bomCTT1 = JBOFactory.getBizObjectManager(CUSTOMER_TYPE.CLASS_NAME,tx); //客户类型临时表
//证件表中如果这个人做过承租人也做过担保有 相同的证件号码就有2条信息一个作为担保人一个承租人
List<BizObject> boCT1 = bomCT1.createQuery("certtype='"+certType+"' and certid='"+certId+"'").getResultList(false);
if(boCT1.size()>0){
for(BizObject CT1:boCT1){
String customeridForCust = CT1.getAttribute("customerid").getString();
BizObject boCTT1 = bomCTT1.createQuery("customerid='"+customeridForCust+"'").getSingleResult(false);
if(boCTT1!=null){
custType = boCTT1.getAttribute("CUSTTYPE").getString();
if("cust_type.cust".equals(custType)){
break;
}
}
}
}
String custName="";
String customerId = "";
if("cust_type.cust".equals(custType)){
if(deptid.startsWith("8006")) {
BizObject distributor_bo=JBOFactory.createBizObjectQuery(DISTRIBUTOR_INFO.CLASS_NAME,"orgid=:orgid").setParameter("orgid",deptid).getSingleResult(false);
if(distributor_bo!=null){
distributoIid=distributor_bo.getAttribute("distributor_no").toString();
vndrName=distributor_bo.getAttribute("distributor_name").toString();
}
}
custName = this.getAttribute("custname").toString();
customerId = this.getAttribute("CustomerId").toString();
Map<String,String>otherProperty=new HashMap<String, String>();
Map<String,String>fromCondtion=new HashMap<String, String>();
fromCondtion.put("CUSTOMERID",customerId);
otherProperty.put("FLOWUNID", flowunid);
otherProperty.put(CUSTOMER_INFO_TEMP.customerid, customerId);
//otherProperty.put(CUSTOMER_INFO_TEMP.distributor_id, distributoIid);
//拷到临时表
DataOperatorUtil.copySingleJBO(CUSTOMER_INFO.CLASS_NAME, fromCondtion, CUSTOMER_INFO_TEMP.CLASS_NAME, null, otherProperty, tx);
DataOperatorUtil.copySingleJBO(CUSTOMER_CERT.CLASS_NAME, fromCondtion, CUSTOMER_CERT_TEMP.CLASS_NAME, null, otherProperty, tx);
DataOperatorUtil.copySingleJBO(CUSTOMER_FAMILY.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY_TEMP.CLASS_NAME, null, otherProperty, tx);
DataOperatorUtil.copySingleJBO(CUSTOMER_ADDRESS.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS_TEMP.CLASS_NAME, null, otherProperty, tx);
DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, null, otherProperty, tx);
DataOperatorUtil.copySingleJBO(CUSTOMER_TYPE.CLASS_NAME, fromCondtion, CUSTOMER_TYPE_TEMP.CLASS_NAME, null, otherProperty, tx);
//无论是不是存量客户都在 项目表 客户和项目关联表 中都新增一条数据客户和项目是一对多的
this.saveProjInfo(bm, tx, asUser,distributoIid);
this.saveEquipmentCar(bmLECT, tx, asUser,vndrName); //车辆租赁物信息表
this.saveUnionLessee(bmLULT,tx,customerId,asUser);
this.saveBusinessStatus(bsbom, tx, asUser);//项目进度表
}else{
if(deptid.startsWith("8006")) {
BizObject distributor_bo=JBOFactory.createBizObjectQuery(DISTRIBUTOR_INFO.CLASS_NAME,"orgid=:orgid").setParameter("orgid",deptid).getSingleResult(false);
if(distributor_bo!=null){
distributoIid=distributor_bo.getAttribute("distributor_no").toString();
vndrName=distributor_bo.getAttribute("distributor_name").toString();
}
}
BizObject bmC = this.saveCustomerInfo(bmCI, tx, asUser,distributoIid);//新增主表客户信息
customerId = bmC.getAttribute("customerid").getString();
this.saveCustomerType(bmCTT, tx, customerId,asUser);//证件类型临时表
this.savePersonOrCompany(bomC, tx, colName,customerId,asUser);//自然人||法人
this.saveEquipmentCar(bmLECT, tx, asUser,vndrName); //车辆租赁物信息表
this.saveUnionLessee(bmLULT, tx, customerId, asUser);//union表
this.saveProjInfo(bm, tx, asUser,distributoIid);//保存项目信息表
this.saveBusinessStatus(bsbom, tx, asUser);//项目进度表
}
BizObject bmC = this.saveCustomerInfo(bmCI, tx, asUser,distributoIid);//新增主表客户信息
String customerId = bmC.getAttribute("customerid").getString();
this.saveCustomerType(bmCTT, tx, customerId,asUser);//证件类型临时表
this.savePersonOrCompany(bomC, tx, colName,customerId,asUser);//自然人||法人
this.saveEquipmentCar(bmLECT, tx, asUser,vndrName); //车辆租赁物信息表
this.saveUnionLessee(bmLULT, tx, customerId, asUser);//union表
this.saveProjInfo(bm, tx, asUser,distributoIid);//保存项目信息表
this.saveBusinessStatus(bsbom, tx, asUser);//项目进度表
String sMessage="true";
return sMessage;
}