package com.tenwa.flow.comm.handler; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.are.jbo.BizObjectManager; import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.are.jbo.JBOTransaction; public class SelectCustController{ public String Customer_ID; public String FlowUnid; public String Is_Main; public String id; public String getCustomer_ID() { return Customer_ID; } public void setCustomer_ID(String customer_ID) { Customer_ID = customer_ID; } public String getFlowUnid() { return FlowUnid; } public void setFlowUnid(String flowUnid) { FlowUnid = flowUnid; } public String getIs_Main() { return Is_Main; } public void setIs_Main(String is_Main) { Is_Main = is_Main; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String isexsit(JBOTransaction tx) throws Exception { BizObjectManager bom = JBOFactory.getBizObjectManager(jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP.CLASS_NAME); //根据承租人的Customer_ID查询承租人名称 BizObject bo1 = bom.createQuery("Customer_ID=:Customer_ID and flowUnid=:flowUnid").setParameter("Customer_ID",Customer_ID).setParameter("FlowUnid",FlowUnid).getSingleResult(false); if(bo1 != null){ return "yes"; } return "no"; } public String isMain(JBOTransaction tx) throws Exception { BizObjectManager bom = JBOFactory.getBizObjectManager(jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP.CLASS_NAME); //检查主承租人的唯一性 BizObject bo2 = bom.createQuery("Is_Main='Y' and flowUnid=:flowUnid").setParameter("Is_Main",Is_Main).setParameter("FlowUnid",FlowUnid).getSingleResult(false); String custname=""; if(bo2 !=null){ custname=bo2.getAttribute("customer_name").toString(); return custname; } return "no"; } public String ischange(JBOTransaction tx) throws Exception { BizObjectManager bom = JBOFactory.getBizObjectManager(jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP.CLASS_NAME); //根据承租人的Customer_ID查询承租人名称 BizObject bo1 = bom.createQuery("Customer_ID=:Customer_ID and flowUnid=:flowUnid").setParameter("Customer_ID",Customer_ID).setParameter("FlowUnid",FlowUnid).getSingleResult(false); if(bo1 != null){ String id=bo1.getAttribute("id").toString(); return id; } return "no"; } public String selectMainCustId(JBOTransaction tx) throws Exception { BizObjectManager bom = JBOFactory.getBizObjectManager(jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP.CLASS_NAME); //查寻主承租人的Customer_ID BizObject bo1 = bom.createQuery(" IS_MAIN='Y' and flowUnid=:flowUnid").setParameter("FlowUnid",FlowUnid).getSingleResult(false); if(bo1 != null){ String custid=bo1.getAttribute("customer_id").toString(); return custid; } return "no"; } }