diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/BusinessApplyApplyList.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/BusinessApplyApplyList.jsp index f770ebb1f..ef3bbf196 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/BusinessApplyApplyList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/BusinessApplyApplyList.jsp @@ -8,8 +8,9 @@ function newApply() { var CurOrgID=<%=CurOrg.getOrgID()%>; - var sReturn = AsControl.RunJsp("/Tenwa/Lease/Flow/Project/BusinessApplication/CheckDistributorStatus.jsp","CurOrgID="+CurOrgID); - if(sReturn!="true"){ + //var sReturn = AsControl.RunJsp("/Tenwa/Lease/Flow/Project/BusinessApplication/CheckDistributorStatus.jsp","CurOrgID="+CurOrgID); + var sReturn = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkDistributorStatus","id="+CurOrgID); + if(sReturn!="true"){ AsDebug.alert("警告","当前经销商未激活!"); return; } diff --git a/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java index 3dfe91f27..842ae5ce2 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java +++ b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoCheck.java @@ -6,6 +6,7 @@ import jbo.app.tenwa.customer.CUSTOMER_FAMILY; import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; import jbo.app.tenwa.customer.CUSTOMER_PERSON; import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; +import jbo.app.tenwa.customer.DISTRIBUTOR_INFO; import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT; import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; @@ -315,4 +316,20 @@ public class CustomerInfoCheck { this.id = id; } + public String checkDistributorStatus(JBOTransaction tx)throws Exception{ + String mas="false"; + Transaction Sqlca=null; + try { + Sqlca=Transaction.createTransaction(tx); + BizObjectManager disManage = JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO.CLASS_NAME, tx); + BizObject bo=disManage.createQuery("orgid=:orgid").setParameter("orgid",id).getSingleResult(false); + if(bo!=null&&"distributor_status04".equals(bo.getAttribute("distributor_status")==null?"":bo.getAttribute("distributor_status").getString())){ + mas="true"; + } + } catch (JBOException e) { + e.printStackTrace(); + return "false"; + } + return mas; + } }