From c5e4d8a6e0116af58b016f0f661a2b16ebde0d9d Mon Sep 17 00:00:00 2001 From: jianghongdong Date: Fri, 27 Jul 2018 18:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=8F=E9=94=80=E5=95=86?= =?UTF-8?q?=E4=BF=9D=E8=AF=81=E9=87=91=E6=94=B6=E5=8F=96=E4=B8=8E=E9=80=80?= =?UTF-8?q?=E5=9B=9E=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DealerDeposit/DDepositReturn_TempInfo.jsp | 43 +++++++++---------- .../DealerDeposit/DDepositReturn_TempList.jsp | 3 +- .../DealerDeposit/DMarginChargeInfo_Temp.jsp | 4 +- .../tenwa/flow/action/comm/SelectBalance.java | 20 ++++++--- 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/WebContent/DealerDeposit/DDepositReturn_TempInfo.jsp b/WebContent/DealerDeposit/DDepositReturn_TempInfo.jsp index ab6374b05..f8cf22f2b 100644 --- a/WebContent/DealerDeposit/DDepositReturn_TempInfo.jsp +++ b/WebContent/DealerDeposit/DDepositReturn_TempInfo.jsp @@ -9,28 +9,20 @@ String sPrevUrl = CurPage.getParameter("ID"); String ProjectName = CurPage.getParameter("ProjectName"); String DistributorNo = CurPage.getParameter("DistributorNo"); - /* if(sPrevUrl == null) sPrevUrl = ""; */ - BizObject flow=JBOFactory.createBizObjectQuery("jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT","flow_unid=:flowunid").setParameter("flowunid", sFlowUnid).getSingleResult(false); - String DISTRIBUTOR_NO=flow.getAttribute("Flow_Key").getString(); - //String CAUTION_MONEY=flow.getAttribute("Flow_Key").getString(); + String sTempletNo = "DDepositReturn_TempInfo";//--模板号-- ASObjectModel doTemp = new ASObjectModel(sTempletNo); doTemp.setDefaultValue("DISTRIBUTOR_ID", DistributorNo); - /* doTemp.setColTips("", "测试"); */ - doTemp.setHtmlEvent("CAUTION_MONEY", "onblur", "selectBalance"); + + doTemp.setHtmlEvent("CAUTION_MONEY", "onchange", "selectBalance"); ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); dwTemp.Style = "2";//freeform //dwTemp.ReadOnly = "-2";//只读模式 - String disno=""; - List nolist=JBOFactory.getBizObjectManager("jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT").createQuery("select di.distributor_no from O ,jbo.app.tenwa.customer.DISTRIBUTOR_INFO di where di.id=O.flow_key and flow_unid=:flowunid") - .setParameter("flowunid",sFlowUnid).getResultList(false); - if(nolist.size()>0){ - disno=nolist.get(0).getAttribute("distributor_no").getString(); - } - dwTemp.genHTMLObjectWindow(CurPage.getParameter("ID")); + + dwTemp.genHTMLObjectWindow(sFlowUnid); String acc_number = Sqlca.getString("select acc_number from OWN_ACCOUNT limit 0,1"); String acc_bank = Sqlca.getString("select acc_bank from OWN_ACCOUNT limit 0,1"); - //String acc = Sqlca.getString("select acc_number from DISTRIBUTOR_ACCOUNT where distributor_id="+"'"+DistributorNo+"'"+" limit 0,1"); + String acc = Sqlca.getString("select acc_number from DISTRIBUTOR_ACCOUNT where distributor_id='"+DistributorNo+"' limit 0,1"); String sButtons[][] = { {"true","All","Button","保存","保存所有修改","save()","","","",""}, {String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""} @@ -41,10 +33,9 @@ window.onload=function(){ setItemValue(0,0,"LOCAL_ACCOUNT",'<%=acc_number%>'); setItemValue(0,0,"LOCAL_BANK",'<%=acc_bank%>'); - <%-- setItemValue(0,0,"refund_number",'<%=acc%>'); --%> + setItemValue(0,0,"refund_number",'<%=acc%>'); } var sFlowUnid = "<%=sFlowUnid%>"; - setItemValue(0,0,"MONEY_TYPE","保证金退款"); setItemValue(0,0,"REFUND_PERSON","<%=ProjectName%>"); setItemValue(0,0,"InputUserID","<%=CurUser.getUserName()%>"); setItemValue(0,0,"InputOrgID","<%=CurUser.getOrgName()%>"); @@ -58,7 +49,7 @@ var returnValue = getItemValue(0,0,'ACCOUNT_BALANCE'); //alert(returnValue); - as_save("myiframe0","returnList()"); + as_save("myiframe0"); } function returnList(){ AsControl.OpenView("/DealerDeposit/DDepositReturn_TempList.jsp", "FlowUnid="+sFlowUnid,"_self",""); @@ -66,16 +57,22 @@ function selectBalance(){ var money = getItemValue(0,0,"CAUTION_MONEY"); //alert(" 输入的金额:"+money); - var sReturn=AsControl.RunJavaMethodTrans("com.tenwa.flow.action.comm.SelectBalance","runs","distributor_no=<%=DISTRIBUTOR_NO%>"); - //alert(" 总金额:"+sReturn); - setItemValue(0,0,"ACCOUNT_BALANCE",sReturn-money); + var sReturn=AsControl.RunJavaMethodTrans("com.tenwa.flow.action.comm.SelectBalance","runs","distributor_no=<%=DistributorNo%>,caution_money="+money); +// alert(" 总金额:"+sReturn); + sReturn = sReturn.split("@"); + if("SUCCESS"==sReturn[0]){ + setItemValue(0,0,"ACCOUNT_BALANCE",sReturn[1]); + setErrorTips('ACCOUNT_BALANCE',''); + }else{ +// AsDebug.showMessage('提示',sReturn[1],'','',true); + setErrorTips('ACCOUNT_BALANCE',sReturn[1]); + setItemValue(0,0,'CAUTION_MONEY',''); + } } function selectaccount(){ - var disno = getItemValue(0, 0, "disno"); -// alert(id); - AsDialog.OpenSelector("SelectReturn","distributorid,"+"<%=disno%>","dialogWidth=" + parseInt(window.screen.width * 0.4) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){ + AsDialog.OpenSelector("SelectReturn","distributorid,"+"<%=DistributorNo%>","dialogWidth=" + parseInt(window.screen.width * 0.4) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){ if(!sReturn||sReturn=="_CANCEL_"){ //alert(getHtmlMessage('1'));//请选择一条信息! return; diff --git a/WebContent/DealerDeposit/DDepositReturn_TempList.jsp b/WebContent/DealerDeposit/DDepositReturn_TempList.jsp index 630331525..582f8100f 100644 --- a/WebContent/DealerDeposit/DDepositReturn_TempList.jsp +++ b/WebContent/DealerDeposit/DDepositReturn_TempList.jsp @@ -6,6 +6,7 @@ History Log: */ String sFlowUnid = CurPage.getParameter("FlowUnid"); + String DistributorNo = CurPage.getParameter("DistributorNo"); String ProjectName = CurPage.getParameter("ProjectName"); String type = CurPage.getParameter("PhaseNo"); ASObjectModel doTemp = new ASObjectModel("DDepositReturn_TempList"); @@ -34,7 +35,7 @@ function newRecord(){ var sUrl = "/DealerDeposit/DDepositReturn_TempInfo.jsp"; var param = "<%=ProjectName%>"; - AsControl.OpenView(sUrl,'FlowUnid='+'<%=sFlowUnid%>'+'&ProjectName='+param,'_self',''); + AsControl.OpenView(sUrl,'FlowUnid='+'<%=sFlowUnid%>'+'&ProjectName='+param+'&DistributorNo=<%=DistributorNo%>','_self',''); } function viewAndEdit(){ var sUrl = "/DealerDeposit/DDepositReturn_TempInfo.jsp"; diff --git a/WebContent/DealerDeposit/DMarginChargeInfo_Temp.jsp b/WebContent/DealerDeposit/DMarginChargeInfo_Temp.jsp index 60e0f7e0f..e1fb3b0a0 100644 --- a/WebContent/DealerDeposit/DMarginChargeInfo_Temp.jsp +++ b/WebContent/DealerDeposit/DMarginChargeInfo_Temp.jsp @@ -15,6 +15,7 @@ String sTempletNo = "DMarginChargeInfo_Temp";//--模板号-- ASObjectModel doTemp = new ASObjectModel(sTempletNo); doTemp.setDefaultValue("DISTRIBUTOR_ID", DistributorNo); + doTemp.setDefaultValue("MONEY_TYPE", "bondCollect"); String disno=""; List nolist=JBOFactory.getBizObjectManager("jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT").createQuery("select di.distributor_no from O ,jbo.app.tenwa.customer.DISTRIBUTOR_INFO di where di.id=O.flow_key and flow_unid=:flowunid") .setParameter("flowunid",sFlowUnid).getResultList(false); @@ -63,9 +64,6 @@ function save(){ var sFlowUnid = "<%=sFlowUnid%>"; setItemValue(0,getRow(),"FlowUnid",sFlowUnid);//初始化流程编号 - - setItemValue(0,getRow(),"DISTRIBUTOR_ID","<%=sPrevUrl%>");//初始化流程编号 - as_save("myiframe0","returnList()"); } function returnList(){ diff --git a/src_sys/com/tenwa/flow/action/comm/SelectBalance.java b/src_sys/com/tenwa/flow/action/comm/SelectBalance.java index ed3576519..a84d96eb5 100644 --- a/src_sys/com/tenwa/flow/action/comm/SelectBalance.java +++ b/src_sys/com/tenwa/flow/action/comm/SelectBalance.java @@ -2,6 +2,7 @@ package com.tenwa.flow.action.comm; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -41,14 +42,21 @@ public class SelectBalance { Map params= new HashMap(); params.put("distributor_id", distributor_no); //params.put("caution_money", caution_money); - String sql="SELECT O.distributor_id,O.caution_money AS money " - + "FROM D_DEPOSITCHARGE_INFO O WHERE " - + "O.distributor_id=:distributor_id GROUP BY O.distributor_id"; + String sql="SELECT O.total AS money " + + "FROM DISTRIBUTOR_INFO O WHERE " + + "O.distributor_no=:distributor_id"; List> getSql = DataOperatorUtil.getDataBySql(scql, sql, params); - //if(aaa.size()>0){ + BigDecimal mm = new BigDecimal("0"); + if(getSql.size()>0){ money=getSql.get(0).get("money"); - //} - return money; + mm = mm.add(new BigDecimal(money)); + if(mm.subtract(new BigDecimal(caution_money)).doubleValue()>=0){ + return "SUCCESS@"+mm.subtract(new BigDecimal(caution_money)).doubleValue(); + }else{ + return "ERROR@剩余额度不足"; + } + } + return "ERROR@网络异常……"; } } \ No newline at end of file