From fa4fd833d99c65245181a35caf5fa8b42c0a9340 Mon Sep 17 00:00:00 2001 From: user Date: Sun, 1 Jul 2018 17:21:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=94=B3=E8=AF=B7=EF=BC=8C?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E4=BD=9C=E4=B8=BA=E5=85=B1=E5=90=8C=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E4=BA=BA=E6=8C=89=E9=92=AE=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomerFamilyTempInfo.jsp | 13 +++-- .../businessapply/CustomerPartnerCheck.java | 51 +++++++++++++++++++ .../LBProjectIntoTempInitCarBusiness.java | 2 +- 3 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerPartnerCheck.java diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp index 15aa30b3b..842cc6060 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp @@ -26,9 +26,16 @@ var name = getItemValue(0,0,"name"); var certid = getItemValue(0,0,"certid"); var tel = getItemValue(0,0,"tel"); -// var suname = getItemValue(0,0,"suname"); -// var partner = getItemValue(0,0,"Partner_"); -// var partner = getItemValue(0,getRow(0),"Partner_"); + var partner = getItemValue(0,getRow(0),"Partner_"); + + if(partner=="Y"){ + var result = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerPartnerCheck","CheckPartnerInfo","flowunid=<%=flowunid%>"); + if(result=="1"){ + alert("共同申请人已存在!"); + return; + } + } + if(name.length > 0){ if(certid.length > 0){ if(CheckLicense(certid)){ diff --git a/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerPartnerCheck.java b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerPartnerCheck.java new file mode 100644 index 000000000..c2a70fa79 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerPartnerCheck.java @@ -0,0 +1,51 @@ +package com.tenwa.lease.flow.project.businessapply; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOException; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; + +public class CustomerPartnerCheck { + + private String flowunid; + + public String CheckPartnerInfo(JBOTransaction tx) throws JBOException{ + BizObjectManager bm = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME,tx); + List bos = bm.createQuery("flowunid=:flowunid").setParameter("flowunid",this.flowunid).getResultList(false); + if(bos==null){ + return "2"; + } + Map partners = new HashMap(); + for(BizObject bo:bos){ + String partner = bo .getAttribute("Partner_").toString(); + partners.put(partner, partner); + } + + Set set = partners.keySet(); + + boolean res = set.contains("Y"); + if(res==true){ + return "1"; + }else{ + return "2"; + } + + } + + public String getFlowunid() { + return flowunid; + } + + public void setFlowunid(String flowunid) { + this.flowunid = flowunid; + } + +} diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java index c80d83d73..d38661d73 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java @@ -75,7 +75,7 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness { bmLEC.setAttributeValue("car_series", this.getAttribute("carSeries")); bmLEC.setAttributeValue("modelId", this.getAttribute("modelid")); bmLEC.setAttributeValue("NOW_TOTAL", this.getAttribute("price")); - bmLEC.setAttributeValue("VNDR_NAME", asUser.getUserID()); + bmLEC.setAttributeValue("VNDR_NAME", asUser.getUserName()); bmLEC.setAttributeValue("DISPLACEMENT", this.getAttribute("liter")); bmLEC.setAttributeValue("gears", this.getAttribute("geartype"));