diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp index 6aac59572..4c9683c23 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp @@ -7,9 +7,12 @@ History Log: */ String sFlowUnid = CurPage.getParameter("FlowUnid"); + System.out.print(sFlowUnid); String sPrevUrl = CurPage.getParameter("PrevUrl"); String RightType= CurPage.getParameter("RightType"); + String ProjectId= CurPage.getParameter("ProjectId"); String id = CurPage.getParameter("ID"); + System.out.print(id); String userOrgId = CurUser.getOrgID(); String userId = CurUser.getUserID(); String customerid = UUIDUtil.getUUID(); @@ -17,8 +20,9 @@ String sTempletNo = "GuarantorInfo";//--模板号-- ASObjectModel doTemp = new ASObjectModel(sTempletNo); - doTemp.setDefaultValue("CUSTOMERID", customerid); - doTemp.setDefaultValue("flowunid", sFlowUnid); + doTemp.setDefaultValue("ASSUROR", customerid); + doTemp.setDefaultValue("PROJECT_ID", ProjectId); + doTemp.setDefaultValue("PAYACCOUNT", sFlowUnid);//将flowunid传入CUSTOMER_PERSON_TEMP保存 ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); dwTemp.Style = "2";//freeform //dwTemp.ReadOnly = "-2";//只读模式 @@ -37,7 +41,7 @@ function goBack(){ //要跳转的url var url="/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitList.jsp"; - var sparam="FlowUnid="+getItemValue(0,0,"flowunid")+"&RightType="+'<%=RightType%>'; + var sparam="FlowUnid="+getItemValue(0,0,"PAYACCOUNT")+"&RightType="+'<%=RightType%>'; AsControl.OpenView(url,sparam,"_self",""); } diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitList.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitList.jsp index 8d98e5127..6f5a70b10 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitList.jsp @@ -43,7 +43,7 @@ }) function newRecord(){ var sUrl = "Tenwa/Lease/Flow/Comm/LBGuaranteeUnit/LBGuaranteePerUnitInfo.jsp"; - var sparam = 'FlowUnid='+'<%=sFlowUnid%>'+"&ListTempletNo="+"<%=sTempletNo%>&TaskNo=<%=taskno%>";//流程编号 + var sparam = 'FlowUnid='+'<%=sFlowUnid%>'+'&ProjectId='+'<%=sProjectId%>'+"&ListTempletNo="+"<%=sTempletNo%>&TaskNo=<%=taskno%>";//流程编号 AsControl.OpenView(sUrl,sparam,"_self",""); } function viewAndEdit(){ diff --git a/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java b/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java index 5a53856bb..7910f6047 100644 --- a/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java +++ b/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java @@ -1,6 +1,5 @@ package com.tenwa.flow.comm.handler; -import jbo.app.tenwa.customer.CUSTOMER_INFO; import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; import com.amarsoft.are.jbo.BizObject; @@ -15,13 +14,47 @@ public class LBGuarantorPerUnitHandler extends CommonHandler{ @Override protected void afterInsert(JBOTransaction tx, BizObject bo) throws Exception { - String customerid = bo.getAttribute("customerid").getString(); - BizObjectManager mci = JBOFactory.getBizObjectManager(CUSTOMER_INFO.CLASS_NAME, tx); - BizObject ci = mci.newObject(); - ci.setAttributeValue("customerid", customerid); - ci.setAttributeValue("customername", "担保人"); - ci.setAttributeValue("customertype", "02"); - mci.saveObject(ci); + 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()); + ci.setAttributeValue("CERTID", bo.getAttribute("CERTID").getString()); + ci.setAttributeValue("mobile", bo.getAttribute("mobile").getString()); + ci.setAttributeValue("NATIVEPLACE", bo.getAttribute("NATIVEPLACE").getString()); + ci.setAttributeValue("Property_type", bo.getAttribute("Property_type").getString()); + ci.setAttributeValue("WORKCORP", bo.getAttribute("WORKCORP").getString()); + ci.setAttributeValue("WORKTEL", bo.getAttribute("WORKTEL").getString()); + ci.setAttributeValue("WORKADD", bo.getAttribute("WORKADD").getString()); + ci.setAttributeValue("other_income", bo.getAttribute("other_income").getString()); + ci.setAttributeValue("title", bo.getAttribute("title").getString()); + + cpt.saveObject(ci); + tx.commit(); + } + + @Override + protected void afterUpdate(JBOTransaction tx, BizObject bo) + throws Exception { + String customerid = bo.getAttribute("ASSUROR").getString(); + BizObjectManager cpt = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME, tx); + BizObject ci = cpt.createQuery("select * from O where CUSTOMERID=:customerid").setParameter("customerid", customerid).getSingleResult(true); + ci.setAttributeValue("FULLNAME", bo.getAttribute("FULLNAME").getString()); + ci.setAttributeValue("SEX", bo.getAttribute("SEX").getString()); + ci.setAttributeValue("CERTTYPE", bo.getAttribute("CERTTYPE").getString()); + ci.setAttributeValue("CERTID", bo.getAttribute("CERTID").getString()); + ci.setAttributeValue("mobile", bo.getAttribute("mobile").getString()); + ci.setAttributeValue("NATIVEPLACE", bo.getAttribute("NATIVEPLACE").getString()); + ci.setAttributeValue("Property_type", bo.getAttribute("Property_type").getString()); + ci.setAttributeValue("WORKCORP", bo.getAttribute("WORKCORP").getString()); + ci.setAttributeValue("WORKTEL", bo.getAttribute("WORKTEL").getString()); + ci.setAttributeValue("WORKADD", bo.getAttribute("WORKADD").getString()); + ci.setAttributeValue("other_income", bo.getAttribute("other_income").getString()); + ci.setAttributeValue("title", bo.getAttribute("title").getString()); + cpt.saveObject(ci); tx.commit(); } } 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 da84f6ca1..39ada06c7 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitTempToFormalBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitTempToFormalBusiness.java @@ -1,9 +1,19 @@ 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.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; @@ -11,15 +21,41 @@ 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); + /*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"; + */ + 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 cpt.flowunid=:flowUnid") + .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); + 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); + } + String sMessage="true"; return sMessage; } } \ No newline at end of file