更新担保人信息

This commit is contained in:
tangfutang 2018-06-20 21:10:48 +08:00
parent 6ab5489a8c
commit 46eaceaff4
4 changed files with 87 additions and 14 deletions

View File

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

View File

@ -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(){

View File

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

View File

@ -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();
Map<String,String>fromCondtion=this.getDefaultTempToFormalFromCondtion();
Map<String,String>toCondtion=this.getDefaultTempToFormalToCondtion();
Map<String,String>otherProperty=this.getDefaultOtherProperty();
service.copyOrLoadGuaranteeUnit(Sqlca, fromCondtion, toCondtion, otherProperty, ServiceOperatorEnum.TempToFormal, null);
String sMessage="true";
*/
this.initBussinessParam(Sqlca);
String flowunid = this.getAttribute("ObjectNo").toString();
Map<String,String> fromCondtion = new HashMap<String,String>();
Map<String,String> otherProperty = 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 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;
}
}