diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/DistributorInfoChangeToFormalBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/DistributorInfoChangeToFormalBusiness.java new file mode 100644 index 000000000..26d4c7fd5 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/DistributorInfoChangeToFormalBusiness.java @@ -0,0 +1,57 @@ +package com.tenwa.lease.flow.project.commbusiness; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP; +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_FAMILY; +import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; +import jbo.app.tenwa.customer.CUSTOMER_PERSON; +import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; +import jbo.app.tenwa.customer.DISTRIBUTOR_INFO; +import jbo.app.tenwa.customer.DISTRIBUTOR_INFO_TEMP; +import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT; +import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; +import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE; +import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP; +import jbo.sys.ORG_INFO; + +import com.amarsoft.app.util.ASOrgObject; +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.lang.DataElement; +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; +import com.tenwa.lease.flow.project.businessapply.CustomerCompare; +import com.tenwa.lease.flow.project.businessapply.DistributorCompare; + +public class DistributorInfoChangeToFormalBusiness extends BaseBussiness { + + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + String flowunid = this.getAttribute("ObjectNo").toString(); + String dno = this.getAttribute("distributor_no").toString(); + Map fromCondtion = new HashMap(); + fromCondtion.put(DISTRIBUTOR_INFO_TEMP.FLOWUNID, flowunid); + Map toCondtion = new HashMap(); + toCondtion.put(DISTRIBUTOR_INFO_TEMP.DISTRIBUTOR_NO,dno); + BizObject ditbo = JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO_TEMP.CLASS_NAME).createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(false); + String orgname = ditbo.getAttribute(DISTRIBUTOR_INFO_TEMP.DISTRIBUTOR_NAME).getString(); + String orgid = ditbo.getAttribute(DISTRIBUTOR_INFO_TEMP.ORGID).getString(); + DataOperatorUtil.copySingleJBO(DISTRIBUTOR_INFO_TEMP.CLASS_NAME, fromCondtion, DISTRIBUTOR_INFO.CLASS_NAME, toCondtion, null, Sqlca); + BizObjectManager PM=JBOFactory.getBizObjectManager(ORG_INFO.CLASS_NAME,Sqlca); + PM.createQuery("UPDATE o set orgname=:orgname where ORGID=:orgid").setParameter("orgname",orgname).setParameter("orgid", orgid).executeUpdate(); + String sMessage="true"; + return sMessage; + } +} \ No newline at end of file