From 7000436b3ce56d66ced833cc188081340b2a9dfd Mon Sep 17 00:00:00 2001 From: tangfutang Date: Thu, 30 Aug 2018 20:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=94=B3=E8=AF=B7=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commcheck/BasicInformationCheck.java | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 src_tenwa/com/tenwa/lease/flow/project/commcheck/BasicInformationCheck.java diff --git a/src_tenwa/com/tenwa/lease/flow/project/commcheck/BasicInformationCheck.java b/src_tenwa/com/tenwa/lease/flow/project/commcheck/BasicInformationCheck.java new file mode 100644 index 000000000..456af0b44 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/commcheck/BasicInformationCheck.java @@ -0,0 +1,86 @@ +/** + * + */ +package com.tenwa.lease.flow.project.commcheck; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jbo.app.tenwa.customer.CUSTOMER_COMPANY_TEMP; +import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; +import jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP; +import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; + +import org.apache.jasper.tagplugins.jstl.core.When; + + + + + + + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.BizObjectQuery; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.awe.util.Transaction; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.template.check.DefaultBussinessCheck; + +/** + * 二手车添加校验 + * + */ +public class BasicInformationCheck extends DefaultBussinessCheck { + @Override + public Object run(Transaction Sqlca) throws Exception { + StringBuffer Message = new StringBuffer(); + boolean falg = false; + String flowunid=this.getAttribute("ObjectNo").toString(); + BizObjectManager citManage = JBOFactory.getBizObjectManager(CUSTOMER_INFO_TEMP.CLASS_NAME, Sqlca); + BizObjectManager cptManage = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME, Sqlca); + BizObjectManager cctManage = JBOFactory.getBizObjectManager(CUSTOMER_COMPANY_TEMP.CLASS_NAME, Sqlca); + BizObjectManager cftManage = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME, Sqlca); + + BizObject cit = citManage.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false); + if(cit!=null){ + if(cit.getAttribute("customertype").getString().equals("01")){//法人校验 + BizObject cct = cctManage.createQuery("customerid=:customerid").setParameter("customerid", cit.getAttribute("customerid").getString()).getSingleResult(false); + if(cct!=null){ + if(cct.getAttribute("enterprisename").getString().length()>0){ + BizObject cft = cftManage.createQuery("flowunid=:flowunid and (Partner_='y' or Partner_='Y') ").setParameter("flowunid", flowunid).getSingleResult(false); + if(cft!=null){ + putMsg("企业信息已填写!!"); + setPass(true); + }else{ + putMsg("共同申请人信息未填写!!"); + setPass(false); + } + }else{ + putMsg("企业信息未填写!!"); + setPass(false); + } + }else{ + putMsg("企业信息未填写!!"); + setPass(false); + } + }else{//校验自然人信息 + BizObject cpt = cptManage.createQuery("customerid=:customerid ").setParameter("customerid", cit.getAttribute("customerid").getString()).getSingleResult(false); + if(cpt!=null){ + if(cpt.getAttribute("mobile").getString().length()>0){ + putMsg("个人信息已填写!!"); + setPass(true); + }else{ + putMsg("个人信息未填写!!"); + setPass(false); + } + }else{ + putMsg("个人信息未填写!!"); + setPass(false); + } + } + } + return null; + } +} \ No newline at end of file