From d627a1466407b8efea2bba39d8f8716f0a00f1d3 Mon Sep 17 00:00:00 2001 From: tangfutang Date: Thu, 21 Jun 2018 19:14:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=85=E4=BF=9D=E4=BA=BA?= =?UTF-8?q?=E7=9A=84=E4=BF=9D=E5=AD=98=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LBGuaranteePerUnitInfo.jsp | 5 +- .../LBGuaranteeUnitInfo.jsp | 1 + .../handler/LBGuarantorPerUnitHandler.java | 2 - .../LBCustomerRelaProjToContractBusiness.java | 12 +++-- .../LBGuaranteeUnitFormalToTempBusiness.java | 49 ++++++++++++++++--- .../LBGuaranteeUnitTempToFormalBusiness.java | 8 +-- 6 files changed, 54 insertions(+), 23 deletions(-) diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp index 81f6b8cf8..b49c66e38 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp @@ -22,7 +22,8 @@ ASObjectModel doTemp = new ASObjectModel(sTempletNo); doTemp.setDefaultValue("ASSUROR", customerid); doTemp.setDefaultValue("PROJECT_ID", ProjectId); - doTemp.setDefaultValue("PAYACCOUNT", sFlowUnid);//将flowunid传入CUSTOMER_PERSON_TEMP保存 + doTemp.setDefaultValue("FLOWUNID", sFlowUnid); + doTemp.setDefaultValue("DATA_STATE", "guarantee");//标记该数据是担保人信息 ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); dwTemp.Style = "2";//freeform //dwTemp.ReadOnly = "-2";//只读模式 @@ -55,7 +56,7 @@ function goBack(){ //要跳转的url var url="/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitList.jsp"; - var sparam="FlowUnid="+getItemValue(0,0,"PAYACCOUNT")+"&RightType="+'<%=RightType%>'; + var sparam="FlowUnid="+getItemValue(0,0,"FLOWUNID")+"&RightType="+'<%=RightType%>'; AsControl.OpenView(url,sparam,"_self",""); } diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit_Car/LBGuaranteeUnitInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit_Car/LBGuaranteeUnitInfo.jsp index 4a7e65c95..aa14d5375 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit_Car/LBGuaranteeUnitInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit_Car/LBGuaranteeUnitInfo.jsp @@ -63,6 +63,7 @@ String sTempletNo = "LBGuaranteeUnitInfoTemp_Car";//--模板号-- ASObjectModel doTemp = new ASObjectModel(sTempletNo); doTemp.setDefaultValue("ASSUROR", customerid); + doTemp.setDefaultValue("DATA_STATE", "common");//标记该数据是共同申请人 doTemp.setHtmlEvent("CERTID","onChange","changeCertid"); //doTemp.setHtmlEvent("DRIVERLICENSE","onchange","checkDriver"); //doTemp.setDDDWJbo("ASSURE_METHOD","jbo.sys.CODE_LIBRARY,itemno,itemname,codeno='GuaranteeType' and itemno in ("+s+") "); diff --git a/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java b/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java index 7910f6047..4759069b5 100644 --- a/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java +++ b/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java @@ -17,8 +17,6 @@ public class LBGuarantorPerUnitHandler extends CommonHandler{ BizObjectManager cpt = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME, tx); BizObject ci = cpt.newObject(); ci.setAttributeValue("CUSTOMERID", bo.getAttribute("ASSUROR").getString()); - ci.setAttributeValue("FLOWUNID", bo.getAttribute("PAYACCOUNT").getString()); - ci.setAttributeValue("PAYACCOUNT", bo.getAttribute("PAYACCOUNT").getString()); ci.setAttributeValue("FULLNAME", bo.getAttribute("FULLNAME").getString()); ci.setAttributeValue("SEX", bo.getAttribute("SEX").getString()); ci.setAttributeValue("CERTTYPE", bo.getAttribute("CERTTYPE").getString()); diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBCustomerRelaProjToContractBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBCustomerRelaProjToContractBusiness.java index 9f52f68ee..d145f2ba6 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBCustomerRelaProjToContractBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBCustomerRelaProjToContractBusiness.java @@ -46,11 +46,13 @@ public class LBCustomerRelaProjToContractBusiness extends BaseBussiness { } for(BizObject unit:unitList){ fromCondtion.clear(); - fromCondtion.put("customerid", unit.getAttribute("ASSUROR").getString()); - DataOperatorUtil.copyJBOSet(CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, null, other, null, Sqlca); - DataOperatorUtil.copyJBOSet(CUSTOMER_CERT.CLASS_NAME, fromCondtion, CUSTOMER_CERT_TEMP.CLASS_NAME, null, other, null, Sqlca); - DataOperatorUtil.copyJBOSet(CUSTOMER_FAMILY.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY_TEMP.CLASS_NAME, null, other, null, Sqlca); - DataOperatorUtil.copyJBOSet(CUSTOMER_ADDRESS.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS_TEMP.CLASS_NAME, null, other, null, Sqlca); + if(!("guarantee".equals(unit.getAttribute("DATA_STATE").toString()))){ + fromCondtion.put("customerid", unit.getAttribute("ASSUROR").getString()); + DataOperatorUtil.copyJBOSet(CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, null, other, null, Sqlca); + DataOperatorUtil.copyJBOSet(CUSTOMER_CERT.CLASS_NAME, fromCondtion, CUSTOMER_CERT_TEMP.CLASS_NAME, null, other, null, Sqlca); + DataOperatorUtil.copyJBOSet(CUSTOMER_FAMILY.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY_TEMP.CLASS_NAME, null, other, null, Sqlca); + DataOperatorUtil.copyJBOSet(CUSTOMER_ADDRESS.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS_TEMP.CLASS_NAME, null, other, null, Sqlca); + } } String sMessage="true"; 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 e445f217b..41d8bfc66 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitFormalToTempBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitFormalToTempBusiness.java @@ -1,11 +1,20 @@ 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; @@ -17,14 +26,38 @@ public class LBGuaranteeUnitFormalToTempBusiness extends BaseBussiness { 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", ""); + 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(); + } + fromCondtion.put("CUSTOMERID",lgu.getAttribute("ASSUROR").toString()); + DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, null, null, Sqlca); } - MapotherProperty=this.getDefaultOtherProperty(); - service.copyOrLoadGuaranteeUnit(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.FormalToTemp, null); + String sMessage="true"; return sMessage; } 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 39ada06c7..4ea76af7a 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitTempToFormalBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitTempToFormalBusiness.java @@ -37,18 +37,14 @@ public class LBGuaranteeUnitTempToFormalBusiness extends BaseBussiness { 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 cpt.flowunid=:flowUnid") + + "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(); } - if(otherProperty.size()>0){ - otherProperty.clear(); - } fromCondtion.put("id",lgu.getAttribute("id").toString()); - otherProperty.put("DATA_STATE","guarantee"); - DataOperatorUtil.copySingleJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT.CLASS_NAME, null, otherProperty, Sqlca); + DataOperatorUtil.copySingleJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT.CLASS_NAME, null, null, Sqlca); if(fromCondtion.size()>0){ fromCondtion.clear(); }