From d553f8122995db24a32f83b08d1f3e464022e79b Mon Sep 17 00:00:00 2001 From: tangfutang Date: Mon, 3 Sep 2018 19:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=95=E4=BA=BA=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=9B=B8=E5=85=B3=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Lessee/Company/CustomerCompany.jsp | 2 +- .../Lessee/Company/CustomerCompanyList.jsp | 2 +- .../Company/CustomerCompanyRegister.jsp | 39 ++++++++++++++++++- src_core/com/tenwa/flow/util/FlowUtil.java | 5 ++- .../company/NewCustomerCompanyController.java | 10 +++++ 5 files changed, 53 insertions(+), 5 deletions(-) diff --git a/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompany.jsp b/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompany.jsp index bb8b27fa6..3f1ae10be 100644 --- a/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompany.jsp +++ b/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompany.jsp @@ -28,7 +28,7 @@ dwTemp.genHTMLObjectWindow(customerId); String compClientID = request.getParameter("CompClientID"); dwTemp.replaceColumn("invoicelist", "", CurPage.getObjectWindowOutput()); - dwTemp.replaceColumn("othercertlist", "", CurPage.getObjectWindowOutput()); +// dwTemp.replaceColumn("othercertlist", "", CurPage.getObjectWindowOutput()); dwTemp.replaceColumn("addresslist", "", CurPage.getObjectWindowOutput()); dwTemp.replaceColumn("tellist", "", CurPage.getObjectWindowOutput()); dwTemp.replaceColumn("accountlist", "", CurPage.getObjectWindowOutput()); diff --git a/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompanyList.jsp b/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompanyList.jsp index 4b62710e8..ee0c56103 100644 --- a/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompanyList.jsp +++ b/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompanyList.jsp @@ -11,7 +11,7 @@ if(customerListTemplet==null)customerListTemplet=""; ASObjectModel doTemp = new ASObjectModel(customerListTemplet); String otherWhere=DataRightManager.getRightCondition(CurUser,"O","cust"); - doTemp.appendJboWhere(otherWhere); +// doTemp.appendJboWhere(otherWhere); //doTemp.setJboWhereWhenNoFilter("ct.custstatus = 'status02' "); ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); dwTemp.setPageSize(20); diff --git a/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompanyRegister.jsp b/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompanyRegister.jsp index d1b1c75d1..40f660e64 100644 --- a/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompanyRegister.jsp +++ b/WebContent/Tenwa/Customer/Lessee/Company/CustomerCompanyRegister.jsp @@ -9,7 +9,11 @@ doTemp.setDDDWJbo("certtype","jbo.sys.CODE_LIBRARY,itemNo,ItemName,Codeno='CertType' and SortNo like 'Ent%' and itemno<>'Ent03' and IsInuse='1' "); doTemp.setDDDWJbo("status","jbo.sys.CODE_LIBRARY,itemNo,ItemName,Codeno='customer_status' and itemno in('status01','status02') "); doTemp.setDefaultValue("nationcode","CHN"); + doTemp.setColInnerBtEvent("NATIONCODENAME", ""); doTemp.setHtmlEvent("certtype","onchange","changeCertidRequired"); + doTemp.setColInnerBtEvent("customername", "changeCustomername()"); + doTemp.setHtmlEvent("customername","onchange","changeCustomerName"); + doTemp.setHtmlEvent("customer_num","onchange","changeCustomerNum"); ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); dwTemp.Style = "2"; dwTemp.genHTMLObjectWindow(""); @@ -90,8 +94,8 @@ include file="/Frame/resources/include/ui/include_info.jspf"%> var certid = getItemValue(0,getRow(),"certid"); //判断组织机构代码合法性 if(certType =='Ent02'){ - if(!checkORGRight1(certid) ){ - setErrorTips("certid","组织机构代码格式错误!"); + if(!checkORGRight(certid) ){ + setErrorTips("certid","社会统一信用代码格式错误!"); return false; } } @@ -119,6 +123,37 @@ include file="/Frame/resources/include/ui/include_info.jspf"%> } }); } + var customername ; + var customer_num ; + function changeCustomername(){ + AsDialog.OpenSelector("selectCustomerList", "","dialogWidth=500px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px", function(sReturn){ + if(!sReturn||sReturn=="_CANCEL_"){ + return; + } + sReturn = sReturn.split("@"); + customername = sReturn[1]; + customer_num = sReturn[0]; + setItemValue(0, 0, "CUSTOMERNAME", customername); + setItemValue(0, 0, "CUSTOMER_NUM", customer_num); + }, "客户信息"); + } + function changeCustomerName(){ + var customerName = getItemValue(0,0,"CUSTOMERNAME"); + alert("新:"+customerName+"===旧:"+customername); + if(customername!=customerName){ + setItemValue(0, 0, "CUSTOMER_NUM", ""); + customername= customerName; + } + } + +// function changeCustomerNum(){ +// var customernum = getItemValue(0,0,"CUSTOMER_NUM"); +// alert("新:"+customernum+"===旧:"+customer_num); +// if(customernum!=customer_num){ +// setItemValue(0, 0, "CUSTOMERNAME", ""); +// customer_num=customernum; +// } +// } <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src_core/com/tenwa/flow/util/FlowUtil.java b/src_core/com/tenwa/flow/util/FlowUtil.java index 8c2f8d34d..97fa80859 100644 --- a/src_core/com/tenwa/flow/util/FlowUtil.java +++ b/src_core/com/tenwa/flow/util/FlowUtil.java @@ -51,7 +51,10 @@ public class FlowUtil { public static synchronized String getCustomer_Number(JBOTransaction tx) throws Exception{ return String.valueOf(Integer.parseInt(FlowUtil.getSerialNumber("{maxOrderNumber}",15,null, "客户编号", Integer.parseInt(DateAssistant.getTodayNow().substring(0,4)), tx))); } - + //获取法人customerid(--1、2、3) + public static synchronized String getCustomer_Id(JBOTransaction tx) throws Exception{ + return String.valueOf(Integer.parseInt(FlowUtil.getSerialNumber("{maxOrderNumber}",15,null, "法人客户编号", Integer.parseInt(DateAssistant.getTodayNow().substring(0,4)), tx))); + } //获取经销商编号 public static synchronized String getDistributorSerialNumber(JBOTransaction tx) throws Exception{ diff --git a/src_tenwa/com/tenwa/customer/controller/company/NewCustomerCompanyController.java b/src_tenwa/com/tenwa/customer/controller/company/NewCustomerCompanyController.java index 6faff0b53..bfd07a0fd 100644 --- a/src_tenwa/com/tenwa/customer/controller/company/NewCustomerCompanyController.java +++ b/src_tenwa/com/tenwa/customer/controller/company/NewCustomerCompanyController.java @@ -5,6 +5,7 @@ import com.amarsoft.are.jbo.BizObjectManager; import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.are.jbo.JBOTransaction; import com.tenwa.comm.util.date.DateAssistant; +import com.tenwa.flow.util.FlowUtil; public class NewCustomerCompanyController{ @@ -148,8 +149,17 @@ public class NewCustomerCompanyController{ return "FAIl@客户证件号码\""+certId+"\"在"+certfrom+"中已注册,不能重复注册!"; }else{ + //获取编码规则 + String serinum=FlowUtil.getCustomer_Id(tx); + String serin=""; + if(serinum.length()<15){ + for(int i=0;i<15-serinum.length();i++){ + serin+="0"; + } + } //新增客户 BizObject newCustomer = custManager.newObject(); + newCustomer.setAttributeValue("customerid", "APZLC"+serin+serinum); newCustomer.setAttributeValue("nationcode", nationCode); newCustomer.setAttributeValue("customername", customerName); newCustomer.setAttributeValue("certtype", certType);