更新担保人考表操作

This commit is contained in:
tangfutang 2018-06-23 10:44:08 +08:00
parent 25b78f7409
commit 5c3b9afd0a
3 changed files with 66 additions and 3 deletions

View File

@ -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();
}
}

View File

@ -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<String,String> fromCondtion = new HashMap<String,String>();
Map<String,String> toCondtion = new HashMap<String,String>();
BizObjectManager lgut = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,Sqlca);
List<BizObject> 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;
}
}

View File

@ -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";