diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitFormalToTempBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitFormalToTempBusiness.java index a9a9d4275..06853cfa5 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitFormalToTempBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitFormalToTempBusiness.java @@ -1,68 +1,31 @@ -package com.tenwa.lease.flow.project.commbusiness; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import jbo.app.tenwa.customer.CUSTOMER_PERSON; -import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; -import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT; -import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; - -import com.amarsoft.app.lc.workflow.action.GetFlowAction; -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; -import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService; -import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum; -import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp; - -public class LBGuaranteeUnitFormalToTempBusiness extends BaseBussiness { - - @Override - public Object run(Transaction Sqlca) throws Exception { - this.initBussinessParam(Sqlca); - String flowUnid=this.getAttribute("ObjectNo").toString(); - String ProjectId=this.getAttribute("ProjectId").toString(); -// Map map=GetFlowAction.getFlowParamByFlowUnidAndTransaction(flowUnid,Sqlca); -// LeaseFlowBaseService service=new LeaseFlowBaseServiceImp(); -// MapfromCondtion=this.getDefaultFormalToTempFromCondtion(); -// if(map.containsKey("IsMakeContract")){ -// fromCondtion.put("CONTRACT_ID", ""); -// } -// MapotherProperty=this.getDefaultOtherProperty(); -// service.copyOrLoadGuaranteeUnit(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.FormalToTemp, null); - - Map fromCondtion = new HashMap(); - Map otherProperty = new HashMap(); - BizObjectManager lgut = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT.CLASS_NAME,Sqlca); - List lguts = lgut.createQuery("select * from O where DATA_STATE='guarantee' and PROJECT_ID=:projectid") - .setParameter("projectid", ProjectId).getResultList(false); - for (BizObject lgu:lguts) { - if(fromCondtion.size()>0){ - fromCondtion.clear(); - } - if(otherProperty.size()>0){ - otherProperty.clear(); - } - fromCondtion.put("id",lgu.getAttribute("id").toString()); - otherProperty.put("FLOWUNID", flowUnid); - DataOperatorUtil.copySingleJBO(LB_GUARANTEE_UNIT.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, null, otherProperty, Sqlca); - if(fromCondtion.size()>0){ - fromCondtion.clear(); - } - if(otherProperty.size()>0){ - otherProperty.clear(); - } - fromCondtion.put("CUSTOMERID",lgu.getAttribute("ASSUROR").toString()); - otherProperty.put("FLOWUNID", flowUnid); - DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, null, otherProperty, Sqlca); - } - - String sMessage="true"; - return sMessage; - } +package com.tenwa.lease.flow.project.commbusiness; + +import java.util.HashMap; + +import java.util.Map; + +import com.amarsoft.app.lc.workflow.action.GetFlowAction; +import com.amarsoft.awe.util.Transaction; +import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService; +import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum; +import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp; + +public class LBGuaranteeUnitFormalToTempBusiness extends BaseBussiness { + + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + String flowUnid=this.getAttribute("ObjectNo").toString(); + Map map=GetFlowAction.getFlowParamByFlowUnidAndTransaction(flowUnid,Sqlca); + LeaseFlowBaseService service=new LeaseFlowBaseServiceImp(); + MapfromCondtion=this.getDefaultFormalToTempFromCondtion(); + if(map.containsKey("IsMakeContract")){ + fromCondtion.put("CONTRACT_ID", ""); + } + MapotherProperty=this.getDefaultOtherProperty(); + service.copyOrLoadGuaranteeUnit(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.FormalToTemp, null); + String sMessage="true"; + return sMessage; + } } \ No newline at end of file diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitTempToFormalBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitTempToFormalBusiness.java index 165d7a35f..fb969ba8f 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitTempToFormalBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitTempToFormalBusiness.java @@ -1,80 +1,25 @@ -package com.tenwa.lease.flow.project.commbusiness; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -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_PERSON; -import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; -import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT; -import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_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; -import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService; -import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum; -import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp; - -public class LBGuaranteeUnitTempToFormalBusiness extends BaseBussiness { - - @SuppressWarnings("unchecked") - @Override - public Object run(Transaction Sqlca) throws Exception { - /*this.initBussinessParam(Sqlca); - LeaseFlowBaseService service=new LeaseFlowBaseServiceImp(); - MapfromCondtion=this.getDefaultTempToFormalFromCondtion(); - MaptoCondtion=this.getDefaultTempToFormalToCondtion(); - MapotherProperty=this.getDefaultOtherProperty(); - service.copyOrLoadGuaranteeUnit(Sqlca, fromCondtion, toCondtion, otherProperty, ServiceOperatorEnum.TempToFormal, null); - */ - this.initBussinessParam(Sqlca); - String flowunid = this.getAttribute("ObjectNo").toString(); - Map fromCondtion = new HashMap(); - Map otherProperty = new HashMap(); - BizObjectManager lgut = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,Sqlca); - //担保人从临时表导正式表 - List lguts = lgut.createQuery("select * from O left join jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP cpt " - + "on O.ASSUROR=cpt.CUSTOMERID where O.flowunid=:flowUnid and O.DATA_STATE='guarantee'") - .setParameter("flowUnid", flowunid).getResultList(false); - for (BizObject lgu:lguts) { - if(fromCondtion.size()>0){ - fromCondtion.clear(); - } - fromCondtion.put("id",lgu.getAttribute("id").toString()); - DataOperatorUtil.copySingleJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT.CLASS_NAME, null, null, Sqlca); - if(fromCondtion.size()>0){ - fromCondtion.clear(); - } - fromCondtion.put("CUSTOMERID",lgu.getAttribute("ASSUROR").toString()); - DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_PERSON.CLASS_NAME, null, null, Sqlca); - } - //共同申请人从 - List lgutc = lgut.createQuery("select * from O where O.flowunid=:flowUnid and O.DATA_STATE='guarantee'") - .setParameter("flowUnid", flowunid).getResultList(false); - for (BizObject lgu:lguts) { - if(fromCondtion.size()>0){ - fromCondtion.clear(); - } - fromCondtion.put("id",lgu.getAttribute("id").toString()); - DataOperatorUtil.copySingleJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT.CLASS_NAME, null, null, Sqlca); - if(fromCondtion.size()>0){ - fromCondtion.clear(); - } - fromCondtion.put("CUSTOMERID",lgu.getAttribute("ASSUROR").toString()); - fromCondtion.put("flowunid",flowunid); - DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_PERSON.CLASS_NAME, null, null, Sqlca); - DataOperatorUtil.copySingleJBO(CUSTOMER_CERT_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_CERT.CLASS_NAME, null, null, Sqlca); - DataOperatorUtil.copySingleJBO(CUSTOMER_ADDRESS_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS.CLASS_NAME, null, null, Sqlca); - } - String sMessage="true"; - return sMessage; - } +package com.tenwa.lease.flow.project.commbusiness; + +import java.util.HashMap; +import java.util.Map; + +import com.amarsoft.awe.util.Transaction; +import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService; +import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum; +import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp; + +public class LBGuaranteeUnitTempToFormalBusiness extends BaseBussiness { + + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + LeaseFlowBaseService service=new LeaseFlowBaseServiceImp(); + MapfromCondtion=this.getDefaultTempToFormalFromCondtion(); + MaptoCondtion=this.getDefaultTempToFormalToCondtion(); + MapotherProperty=this.getDefaultOtherProperty(); + service.copyOrLoadGuaranteeUnit(Sqlca, fromCondtion, toCondtion, otherProperty, ServiceOperatorEnum.TempToFormal, null); + String sMessage="true"; + return sMessage; + } } \ No newline at end of file