From 5c3b9afd0a477c0738769dc1e21ca2eccbd11675 Mon Sep 17 00:00:00 2001 From: tangfutang Date: Sat, 23 Jun 2018 10:44:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8B=85=E4=BF=9D=E4=BA=BA?= =?UTF-8?q?=E8=80=83=E8=A1=A8=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/LBGuarantorPerUnitHandler.java | 5 +- ...BGuaranteePerUnitTempToFormalBusiness.java | 58 +++++++++++++++++++ .../LBGuaranteeUnitFormalToTempBusiness.java | 6 +- 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteePerUnitTempToFormalBusiness.java diff --git a/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java b/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java index 4759069b5..63ca7481d 100644 --- a/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java +++ b/src_tenwa/com/tenwa/flow/comm/handler/LBGuarantorPerUnitHandler.java @@ -18,6 +18,7 @@ public class LBGuarantorPerUnitHandler extends CommonHandler{ BizObject ci = cpt.newObject(); ci.setAttributeValue("CUSTOMERID", bo.getAttribute("ASSUROR").getString()); ci.setAttributeValue("FULLNAME", bo.getAttribute("FULLNAME").getString()); + ci.setAttributeValue("FLOWUNID", bo.getAttribute("FLOWUNID").getString()); ci.setAttributeValue("SEX", bo.getAttribute("SEX").getString()); ci.setAttributeValue("CERTTYPE", bo.getAttribute("CERTTYPE").getString()); ci.setAttributeValue("CERTID", bo.getAttribute("CERTID").getString()); @@ -38,8 +39,9 @@ public class LBGuarantorPerUnitHandler extends CommonHandler{ protected void afterUpdate(JBOTransaction tx, BizObject bo) throws Exception { String customerid = bo.getAttribute("ASSUROR").getString(); + String flowunid = bo.getAttribute("FLOWUNID").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); + BizObject ci = cpt.createQuery("CUSTOMERID=:customerid and FLOWUNID=:flowunid").setParameter("customerid", customerid).setParameter("flowunid", flowunid).getSingleResult(true); ci.setAttributeValue("FULLNAME", bo.getAttribute("FULLNAME").getString()); ci.setAttributeValue("SEX", bo.getAttribute("SEX").getString()); ci.setAttributeValue("CERTTYPE", bo.getAttribute("CERTTYPE").getString()); @@ -53,6 +55,5 @@ public class LBGuarantorPerUnitHandler extends CommonHandler{ 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/LBGuaranteePerUnitTempToFormalBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteePerUnitTempToFormalBusiness.java new file mode 100644 index 000000000..fbbf5c36e --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteePerUnitTempToFormalBusiness.java @@ -0,0 +1,58 @@ +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; +import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp; + +public class LBGuaranteePerUnitTempToFormalBusiness extends BaseBussiness { + + @SuppressWarnings("unchecked") + @Override + public Object run(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + String flowunid = this.getAttribute("ObjectNo").toString(); + Map fromCondtion = new HashMap(); + Map toCondtion = 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(); + } + if(toCondtion.size()>0){ + toCondtion.clear(); + } + fromCondtion.put("id",lgu.getAttribute("id").toString()); + toCondtion.put("ASSUROR", lgu.getAttribute("ASSUROR").toString()); + DataOperatorUtil.copySingleJBO(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT.CLASS_NAME, toCondtion, null, Sqlca); + if(fromCondtion.size()>0){ + fromCondtion.clear(); + } + if(toCondtion.size()>0){ + toCondtion.clear(); + } + fromCondtion.put("CUSTOMERID",lgu.getAttribute("ASSUROR").toString()); + toCondtion.put("CUSTOMERID", lgu.getAttribute("ASSUROR").toString()); + DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON_TEMP.CLASS_NAME, fromCondtion, CUSTOMER_PERSON.CLASS_NAME, toCondtion, null, Sqlca); + } + String sMessage="true"; + return sMessage; + } +} \ No newline at end of file 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 41d8bfc66..a9a9d4275 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitFormalToTempBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBGuaranteeUnitFormalToTempBusiness.java @@ -54,8 +54,12 @@ public class LBGuaranteeUnitFormalToTempBusiness extends BaseBussiness { if(fromCondtion.size()>0){ fromCondtion.clear(); } + if(otherProperty.size()>0){ + otherProperty.clear(); + } fromCondtion.put("CUSTOMERID",lgu.getAttribute("ASSUROR").toString()); - DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, null, null, Sqlca); + otherProperty.put("FLOWUNID", flowUnid); + DataOperatorUtil.copySingleJBO(CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, null, otherProperty, Sqlca); } String sMessage="true";