From b188b1bc7275b86f878e9a7e2fdf2ac0e9bf0adc Mon Sep 17 00:00:00 2001 From: liuzhao Date: Fri, 21 Dec 2018 17:58:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=8F=E9=94=80=E5=95=86=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=92=8C=E8=87=AA=E5=8A=A8=E5=88=86=E6=B4=BE=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=92=8C=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DocList/LbCarLicensePlateInfoTemp.jsp | 27 ++++-- .../DistributorInfoFirstTrialInfo.jsp | 1 + .../DistributorInfoIBatchmportInfo.jsp | 1 + .../DistributorInfoImportfirstTrial.jsp | 2 +- .../overduedunning/OverdueDunningInfo.jsp | 38 +++++++-- .../tenwa/apzl/comm/PartdeptDistribute.java | 84 ++++++++++++++++++- .../distributor/DistributorImportManager.java | 13 +++ 7 files changed, 148 insertions(+), 18 deletions(-) diff --git a/WebContent/Tenwa/Comm/DocList/LbCarLicensePlateInfoTemp.jsp b/WebContent/Tenwa/Comm/DocList/LbCarLicensePlateInfoTemp.jsp index 77a01a9bf..28fb67452 100644 --- a/WebContent/Tenwa/Comm/DocList/LbCarLicensePlateInfoTemp.jsp +++ b/WebContent/Tenwa/Comm/DocList/LbCarLicensePlateInfoTemp.jsp @@ -11,7 +11,7 @@ String inputusername = CurUser.getUserName(); String inputorgid = CurOrg.getOrgID(); String inputorgname = CurOrg.getOrgName(); - + String FlowUnid = CurPage.getParameter("FlowUnid"); String ContractId = CurPage.getParameter("ContractId"); String ContractNumber = CurPage.getParameter("FlowKey"); @@ -70,26 +70,39 @@ setItemValue(0,0,"delay_date",""); } } + + - window.onload=function(){ - setItemValue(0,getRow(),"INPUTUSERID","<%=inputusername%>"); + window.onload=function(){ + var is_delay = getItemValue(0,0,"is_delay"); + if(is_delay=="Y"){ + setItemRequired(0,"delay_date",true); + setItemReadOnly(0,0,"delay_date",false); + }else{ + setItemReadOnly(0,0,"delay_date",true); + setItemRequired(0,"delay_date",false); + setItemValue(0,0,"delay_date",""); + } + + + <%-- setItemValue(0,getRow(),"INPUTUSERID","<%=inputusername%>"); setItemValue(0,getRow(),"UPDATEUSERID","<%=inputusername%>"); setItemValue(0,getRow(),"INPUTORGID","<%=inputorgname%>"); - setItemValue(0,getRow(),"UPDATEORGID","<%=inputorgname%>"); + setItemValue(0,getRow(),"UPDATEORGID","<%=inputorgname%>"); --%> setItemValue(0,getRow(),"FRAME_NUMBER","<%=framenumber%>"); setItemValue(0,getRow(),"contract_id","<%=ContractId%>"); setItemValue(0,getRow(),"contract_no","<%=ContractNumber%>"); setItemValue(0,getRow(),"flowunid","<%=FlowUnid%>"); - var date = new Date(); + /* var date = new Date(); var updatetime = date.toJSON().substring(0,10).replace(/-/g,"/")+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds(); var inputtime = date.toJSON().substring(0,10).replace(/-/g,"/")+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds(); var inputtimes = getItemValue(0,getRow(),"INPUTTIME"); if(inputtimes==null||inputtimes==""){ setItemValue(0,getRow(),"INPUTTIME",inputtime); } - setItemValue(0,getRow(),"UPDATETIME",updatetime); - } + setItemValue(0,getRow(),"UPDATETIME",updatetime); */ + } function returnList(){ AsControl.OpenView("<%=sPrevUrl%>", "","_self",""); } diff --git a/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoFirstTrialInfo.jsp b/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoFirstTrialInfo.jsp index 0ce950df9..0fda85361 100644 --- a/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoFirstTrialInfo.jsp +++ b/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoFirstTrialInfo.jsp @@ -36,6 +36,7 @@ } sReturn = sReturn.split("@");//"@"表示了向页面添加数据时的连续性 setItemValue(0,getRow(),"SUBSIDIARY_COMPANY",sReturn[0]);//向页面的框中添加数据 + setItemValue(0,getRow(),"LIMIT_APPROVAL_DATE",sReturn[1]); },"请选择经销商"); } var province="";//定义一个全局变量 diff --git a/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoIBatchmportInfo.jsp b/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoIBatchmportInfo.jsp index 617eb6174..28283c63c 100644 --- a/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoIBatchmportInfo.jsp +++ b/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoIBatchmportInfo.jsp @@ -36,6 +36,7 @@ } sReturn = sReturn.split("@");//"@"表示了向页面添加数据时的连续性 setItemValue(0,getRow(),"SUBSIDIARY_COMPANY",sReturn[0]);//向页面的框中添加数据 + setItemValue(0,getRow(),"LIMIT_APPROVAL_DATE",sReturn[1]); },"请选择经销商"); } var province="";//定义一个全局变量 diff --git a/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoImportfirstTrial.jsp b/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoImportfirstTrial.jsp index 2c0e2b3b6..6737f8bab 100644 --- a/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoImportfirstTrial.jsp +++ b/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/DistributorInfoImportfirstTrial.jsp @@ -31,7 +31,7 @@ //alert(sParm); if(typeof(sParm) == "undefined" || sParm.length == 0 ) { - alert("请选择查提交申请的数据!"); + alert("请选择提交申请的数据!"); return; } diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/overduedunning/OverdueDunningInfo.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/overduedunning/OverdueDunningInfo.jsp index 9d53c4451..55746e047 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/overduedunning/OverdueDunningInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/overduedunning/OverdueDunningInfo.jsp @@ -7,7 +7,27 @@ */ String sPrevUrl = CurPage.getParameter("PrevUrl"); if(sPrevUrl == null) sPrevUrl = ""; - + String overDays = CurPage.getParameter("overDays"); + //此功能如果需要再使用 + //获取天数配置表中中催组的开始结束天数 + BizObject dayDistribute = JBOFactory.createBizObjectQuery("jbo.com.tenwa.lease.comm.DAY_DISTRIBUTE", "id=:id") + .setParameter("id", "f7957025d1dc11e8a63e00163e0ad612").getSingleResult(false); + String begin_day = dayDistribute.getAttribute("begin_day").toString(); + String end_day = dayDistribute.getAttribute("end_day").toString(); + int beginDay = Integer.parseInt(begin_day); + int endDay = Integer.parseInt(end_day); + int overDay = Integer.parseInt(overDays); + //800R00000041 轻 + //800R00000042 中 + //800R00000043 重 + String roleId = ""; + if(overDayendDay){ + roleId="800R00000043";//重 + }else{ + roleId="800R00000042";//中 + } String sTempletNo = "OverdueDunningInfo";//--模板号-- ASObjectModel doTemp = new ASObjectModel(sTempletNo); ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); @@ -16,10 +36,10 @@ dwTemp.genHTMLObjectWindow(CurPage.getParameter("id")); String sButtons[][] = { - {"true","All","Button","保存","保存所有修改","as_save(0)","","","",""}, + //{"true","All","Button","保存","保存所有修改","as_save(0)","","","",""}, {"true","All","Button","返回","返回列表","goBack()","","","","btn_icon_return"} }; - sButtonPosition = "south"; + sButtonPosition = "north"; String orgCompany=CurUser.getOrgID(); if(orgCompany.length()>13){ orgCompany=orgCompany.substring(0,13); @@ -27,9 +47,9 @@ orgCompany=orgCompany.substring(0,orgCompany.length()-4); %><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src_tenwa/com/tenwa/apzl/comm/PartdeptDistribute.java b/src_tenwa/com/tenwa/apzl/comm/PartdeptDistribute.java index 54ad8c78b..eaab90b4a 100644 --- a/src_tenwa/com/tenwa/apzl/comm/PartdeptDistribute.java +++ b/src_tenwa/com/tenwa/apzl/comm/PartdeptDistribute.java @@ -1,5 +1,9 @@ package com.tenwa.apzl.comm; +import java.util.ArrayList; +import java.util.List; + +import jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT; import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; import jbo.sys.OVERDUE_DUNNING_INFO; @@ -12,7 +16,17 @@ import com.amarsoft.are.jbo.JBOTransaction; public class PartdeptDistribute { private String userid; private String contract_number; + private String ids; + private String distributorNo; + public String getDistributorNo() { + return distributorNo; + } + + public void setDistributorNo(String distributorNo) { + this.distributorNo = distributorNo; + } + public String getUserid() { return userid; } @@ -29,6 +43,15 @@ public class PartdeptDistribute { public void setContract_number(String contract_number) { this.contract_number = contract_number; } + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + /* * 选择催款员 */ @@ -40,12 +63,71 @@ public class PartdeptDistribute { String contractId = contractInfo.getAttribute("id").toString(); BizObjectManager overdueManager = JBOFactory.getBizObjectManager(OVERDUE_DUNNING_INFO.CLASS_NAME, tx); + BizObject overdue = overdueManager.createQuery("contract_id=:contract_id").setParameter("contract_id", contractId).getSingleResult(false); + if(overdue == null){ + BizObject overdue2 = overdueManager.newObject(); + overdue2.setAttributeValue("contract_id", contractId); + overdue2.setAttributeValue("part_dept", userid); + overdueManager.saveObject(overdue2); + }else{ overdueManager.createQuery("update O set part_dept=:part_dept where contract_id=:contract_id") .setParameter("contract_id", contractId).setParameter("part_dept", userid).executeUpdate(); - + } } catch (JBOException e) { e.printStackTrace(); } return ""; } + /** + * 批量修改催款员 + */ + public String selectPartdepts(JBOTransaction tx){ + String userid = this.getUserid(); + String[] arrIds = ids.split("@"); + BizObjectManager overdueManager; + try { + overdueManager = JBOFactory.getBizObjectManager(OVERDUE_DUNNING_INFO.CLASS_NAME, tx); + for (int i = 0; i < arrIds.length; i++) { + String contractId = arrIds[i]; + BizObject overdue = overdueManager.createQuery("contract_id=:contract_id").setParameter("contract_id", contractId).getSingleResult(false); + if(overdue == null){ + BizObject overdue2 = overdueManager.newObject(); + overdue2.setAttributeValue("contract_id", contractId); + overdue2.setAttributeValue("part_dept", userid); + overdueManager.saveObject(overdue2); + }else{ + overdueManager.createQuery("update O set part_dept=:part_dept where contract_id=:contract_id") + .setParameter("contract_id", contractId).setParameter("part_dept", userid).executeUpdate(); + } + } + } catch (JBOException e) { + e.printStackTrace(); + } + return ""; + } + /** + * 判断经销商账户主账户,只能存在一个主账户 + */ + public String isMainAccount(){ + String msg = ""; + try { + List list = new ArrayList(); + String isMain = ""; + @SuppressWarnings("unchecked") + List resultList = JBOFactory.createBizObjectQuery(DISTRIBUTOR_ACCOUNT.CLASS_NAME, "distributor_id=:distributor_id") + .setParameter("distributor_id", this.distributorNo).getResultList(false); + for (BizObject bo : resultList) { + isMain=bo.getAttribute("is_main")==null?"":bo.getAttribute("is_main").toString(); + list.add(isMain); + } + if(list.contains("Y")==true){ + msg = "一个经销商只能有一个主账户"; + return msg; + } + } catch (JBOException e) { + e.printStackTrace(); + } + return msg; + } + } diff --git a/src_tenwa/com/tenwa/apzl/distributor/DistributorImportManager.java b/src_tenwa/com/tenwa/apzl/distributor/DistributorImportManager.java index ef5f616c7..1d32947ed 100644 --- a/src_tenwa/com/tenwa/apzl/distributor/DistributorImportManager.java +++ b/src_tenwa/com/tenwa/apzl/distributor/DistributorImportManager.java @@ -41,6 +41,13 @@ public class DistributorImportManager { distributorInfoManager = JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO.CLASS_NAME, tx); for (int i = 0; i < ids.length; i++) { String id = ids[i]; + //必填项未填满不让提交申请 + BizObject dis = distributorInfoManager.createQuery("id=:id").setParameter("id", id).getSingleResult(false); + //集团类别 + String F_I_TYPE = dis.getAttribute("F_I_TYPE") == null?"":dis.getAttribute("F_I_TYPE").toString(); + if(F_I_TYPE==""){ + return "请将必填项填写完整!"; + } //修改为复审状态 distributorInfoManager.createQuery("update O set import_status='recheck' where id=:id") .setParameter("id", id).executeUpdate(); @@ -75,6 +82,12 @@ public class DistributorImportManager { distributorInfoManager = JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO.CLASS_NAME, tx); for (int i = 0; i < ids.length; i++) { String id = ids[i]; + //已经激活的不允许再提交 + BizObject dis = distributorInfoManager.createQuery("id=:id").setParameter("id", id).getSingleResult(false); + String distributor_status = dis.getAttribute("distributor_status")==null?"":dis.getAttribute("distributor_status").toString(); + if("distributor_status04".equals(distributor_status)){ + return "该经销商已经激活,不允许再次提交!"; + } //修改为激活状态 distributorInfoManager.createQuery("update O set distributor_status='distributor_status04' where id=:id") .setParameter("id", id).executeUpdate();