修改经销商保证金收取与退回相关问题

This commit is contained in:
jianghongdong 2018-07-27 18:41:46 +08:00
parent ccb7ae0c6e
commit c5e4d8a6e0
4 changed files with 37 additions and 33 deletions

View File

@ -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<BizObject> 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;

View File

@ -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";

View File

@ -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<BizObject> 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(){

View File

@ -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<String,String> params= new HashMap<String,String>();
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<Map<String,String>> 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@网络异常……";
}
}