ecap常见问题集锦

ecap常见问题集锦

1.交易不跳页面直接打印,有可能造成打印文件名变量重复累加的现象?

将输入输出属性设置为:输出

2.生成打印文件成功,客户端无法下载打印文件?
此问题与Fserver有关
查看相关进程
ps -ef |grep FS

查看端口是否监听
netstat -an |grep 12277

杀掉进程
kill -9 496120

启动Fserver
nohup fsvr.sh &



3.was启动停止脚本:
sh start.sh

/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/startManager.sh
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startNode.sh
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1

stop.sh

/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/stopNode.sh
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/stopServer.sh server1
/usr/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/stopManager.sh



4.凭证重打 用 200600 交易

5.补登折   用 000600 交易

将账号和凭证号码传入补登折界面

输入输出

accntNumber  TS_F_account
passbookNo   TS_F_vouno

补登折页面接收

值中的表达式

com.adtec.client.util.servlet.ServletTool.getRequestParam("accntNumber");
com.adtec.client.util.servlet.ServletTool.getRequestParam("passbookNo");

paymode TS_F_paymode
//补登折
var bdflag = document.@[email protected];
if(bdflag == '1')
{
  alert('请到600交易补登折!');
  openSubTran(document.@FormName@,'HZ_F2_921012_02','_B6_000600','_B6_000600_init');
}	


6.刷折
AccountLinkage(document.@[email protected],'1','@FormName@', '@PageName@');

AccountLinkage(document.@[email protected],'1','@FormName@', '@PageName@');



readCZHMcrWithPayWay(devObject,document.@[email protected],document.@[email protected],'');
document.form2.textaccount.focus();


readCZHMcrWithPayWay(devObject,document.@[email protected],document.@[email protected],'');
document.form2.textaccount.focus();

com.adtec.client.accountlinkage.AccountLinkage.init("HB_DefaultString11","textname");

if(document.@[email protected]!='')
{
  
AccountLinkage(document.@[email protected],'6','@FormName@', '@PageName@');

}

com.adtec.client.accountlinkage.AccountLinkage.init("HB_CustName|HB_custNo","accname|khno");



7.金额域校验技巧
var s1 = document.form2.number_price.value;
var s2 = Number(s1);

var s3 = s2 % 100;

alert(s3);
alert(s3 > 0);


if(s2 < 1000){
 document.form2.number_price.value = '';
 
 return '金额不能小于1000';
}
else if(s3 > 0)
{
  document.form2.number_price.value = '';
 
  return '金额只能是100的整数倍';
}


8.刷卡操作

刷卡
get37650Account_new(document.@[email protected],document.@[email protected],'A','K','1');

刷卡验密
get37650Account_new(document.form2.textaccount,document.form2.textcardno,'B','K','0');

不能手工输入
get37650Account_new(document.@[email protected],document.@[email protected],'B','B','0');

只能选主账号
get37650Account_new(document.form2.textaccount,document.form2.textcardno,'B','K','4');

9.截取下拉框的值发到后台

页面提交事件

var obj=document.form2.subjcode;
document.form2.businame.value = obj.options[obj.selectedIndex].text.substring(4,20);



10.柜员名称乱码问题解决:

/home/ecap/wasECAP/Template/foot.jsp
把字符编码改为gbk
<%@ page contentType="text/html; charset=gbk"

11.中文金额分开并补零
double amount=$TS_F_totalamount;
String[] map={ "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
int count=1;
String desStr="";
int tempAmount=(int)(amount*100);
desStr=map[tempAmount%10];
while((tempAmount/10)!=0){
	count++;			
	tempAmount=tempAmount/10;
	desStr=map[tempAmount%10]+"  "+desStr;
}
while(count<=9){
  desStr="零  "+desStr;
  count++;
}
return desStr;


double amount=$TS_F_amount;
String[] map={ "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
int count=1;
String desStr="";
int tempAmount=(int)(amount/100000);
int temp=(int)((amount-tempAmount*100000)/10000);
desStr=map[temp];

return desStr+" ";


12.日期分开
com.adtec.client.util.DateUtil.dateStrFormate($BkPlatDate, "yyyyMMdd", "yyyy      MM        dd");


13.要求12位,不足前面补零
var billNo = document.@[email protected];
var len = billNo.length;
if(len<12 && len>0) {
    for(var i = 0; i < (12-len); i++) {
       billNo  = '0'+ billNo;
    }
}
document.@[email protected] = billNo;


14.获取指定下标的值
com.adtec.client.util.DataPoolTool.getInfoFromDataPool("BkNum2",1);
com.adtec.client.util.DataPoolTool.getInfoFromDataPool("BkNum2",2);


15.返回上一页

history.back();

16.取机构名、核心日期
com.adtec.afc.datapool.EP.epGetValue(com.adtec.struct.ECAPTxRunInfo.getInstance().getSpID(), "HB_Branch_Name",0);


return com.adtec.client.util.DateUtil.dateStrFormate(com.adtec.afc.datapool.EP.epGetValue(com.adtec.struct.ECAPTxRunInfo.getInstance().getSpID(), "HB_Head_Date",0), "ddMMyyyy", "yyyyMMdd");


17.profile改变配置后生效

. .profile
env |grep Node



18.上传文件控件的使用

提交后事件
$ECAP_SEND_FILE = $TS_F_filename;

19.上传文件

onclick事件

DownLoadFile(document.@[email protected]);


隐含域

ECAP_RECE_FILE    filename

页面初始事件
String retcode=$__ERR_RET;
if((retcode!=null)&&(retcode.equals("00000"))){  
    com.adtec.client.ftp.FtpProxy.downLoadFile();
}
//原始文件
String srcfile=com.adtec.client.ftp.FtpProxy.getLocalFile();
if((srcfile==null)||(srcfile.equals("")))
{
   return false;
}else{
   String filename=$TS_F_number;
   filename=filename.trim();
   
   //下载类方法参数
   String recfile=filename+".txt";

   //目标文件
   String downfile=System.getenv("ECAPWORKDIR")+"/print/" + recfile;
   
   java.io.FileInputStream fis = new java.io.FileInputStream(srcfile);
   
   java.io.FileOutputStream fos = new java.io.FileOutputStream(downfile);
   byte[] buff = new byte[1024];
   int readed = -1;
   while((readed = fis.read(buff)) > 0)
     fos.write(buff, 0, readed);
     fis.close();
     fos.close();
   $ECAP_RECE_FILE=recfile;
}


20.把其他下标的文件放到0下标,便于解析
if("00000".equals($__ERR_RET)){
if("".equals($HB_FTP_FILES)){
   com.adtec.client.ftp.FtpProxy.downLoadFiles();
}
String Hb_ftp=com.adtec.afc.datapool.EP.epGetValue(com.adtec.struct.ECAPTxRunInfo.getInstance().getTpID(),"HB_FTP_FILES",1);
com.adtec.afc.datapool.EP.epPut(com.adtec.struct.ECAPTxRunInfo.getInstance().getTpID(),"HB_FTP_FILES", 0, Hb_ftp);

String downfile = com.adtec.client.ftp.FtpProxy.getLocalFile();


21.js计算一年后的日期
<script>
  var year = '2011-03-01';
  
  var date = new Date();
  
  var OneMonth = year.substring(5,7);  
  var OneDay = year.substring(8);  
  var OneYear = year.substring(0,4); 
      
  date.setFullYear(OneYear,OneMonth-1,OneDay);
  alert('date1: ' + date);  
    
  date.setFullYear(date.getFullYear()+1); 
  date.setDate(date.getDate()-1); //这里是改变的
    
  alert('date: ' + date);
  
  var TwoYear=String(date.getFullYear());//这里也是改变
  var TwoMonth=String(date.getMonth()+1);
  var TwoDay=String(date.getDate());
  
  if(TwoMonth.length<2){
       TwoMonth='0'+TwoMonth
   }
  if(TwoDay.length<2){
      TwoDay='0'+TwoDay;
  }

  var res = TwoYear+'-'+TwoMonth+'-'+TwoDay;
  
  alert(res);
  
</script>



22.内部帐回显户名
内部帐回显户名

021045

9开头,16位

HB_DefaultString90

$TS_F_taxpayername = $HB_DefaultString90;

getBGLAcctName('AccutNo','textbox95');

020400_JS

var acct = document.@[email protected];
if(acct !='')
{
  if(acct.substring(0,1) == '9' && acct.length == '16')
  {
    getBGLAcctName('acct','accname');
  }
  else
  {
    AccountLinkage(document.@[email protected],'1','@FormName@', '@PageName@');
  }
}


23.操作确认实现:OnSubmit事件中添加js代码
var opmode = document.form2.opmode.value;
if(opmode == '3')
{
  return confirm('确认要删除吗?');
}


24.弹出窗口,可以调用其他业务的子交易,注意子交易名字的大小写
myOpenSubTranWin('_L1_630020','_L1_630032_init','_L1_63003201','form2','height=600,width=900,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no',rValue)

<script>
function myOpenSubTranWin(tranName,subTranName,pageName,formName,features,winValue)
{
	var url = "TxRunAction.do?PageName="+pageName+"&FormName="+formName+"&TranName="+tranName+"&SubTranName="+subTranName+"&Rnd="+Math.round(Math.random()*100000000);
	try{
		openWin=window.showModalDialog(url,winValue, features);
	}
	catch(e){
	}
}
</script>

//弹出窗口的值赋给父窗口
setCustomeValue('radio55', 'textbox82','textbox83');

<script>
function setCustomeValue(varadio,vlable,alable) {
    var radios =  document.getElementsByName(varadio);
    if(radios.length == 1) {
        var obj = document.getElementById(vlable);
        var aaa = document.getElementById(alable);
        try {
            window.dialogArguments[0].value = obj.value;
            window.dialogArguments[1].value = aaa.value;
            window.close();
            return;
        } catch(e) { }
    }
    for(var i = 0; i < radios.length; i++) {
        if(radios[i].checked == true) {
          var obj = document.getElementById(vlable+'__'+i);
           var aaa = document.getElementById(alable+'__'+i);
           try {
               window.dialogArguments[0].value = obj.value;
               window.dialogArguments[1].value = aaa.value;
               window.close();
               return;
           } catch(e){ }
        }
     }
}
</script>


getBankInfo3(document.@[email protected],document.@[email protected],'','','_E1_400064_init');

getBankInfo3(document.@[email protected],document.@[email protected],'','','_L1_630032_init');

<script>
function     getBankInfo3(bankNumber,bankName,bankTel,bankAddress,subtransCode)
{
var obj = new Array();
var obj2=window.showModalDialog("TxRunAction.do?SubTranName=" + subtransCode + "&Rnd="+Math.round(Math.random()*100000000), obj, 'dialogWidth=800px;dialogHeight=600px,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no');
try{
  if((undefined != obj2[0]) && (undefined != bankNumber) && ('' != bankNumber)){
     bankNumber.value=obj2[0];
  }
   if((undefined != obj2[1]) && (undefined != bankName) && ('' != bankName)){
     bankName.value=obj2[1];
  }
   if((undefined != obj2[2]) && (undefined != bankTel) && ('' != bankTel)){
     bankName.value=obj2[2];
  }
   if((undefined != obj2[3]) && (undefined != bankAddress) && ('' != bankAddress)){
     bankName.value=obj2[3];
  }
}catch(e)
{}
}
</script>


25.取指定下标的值
int totalNum = com.adtec.client.util.DataPoolTool.getInfoSuffix("TS_F_Buff2");
if(totalNum > 3)
{
  com.adtec.client.util.DataPoolTool.setInfoToDataPool("TS_F_thirdno", 0,com.adtec.client.util.DataPoolTool.getInfoFromDataPool("TS_F_Buff2",3));
}


26.多维数据元素分页打印
List pagelist=com.adtec.client.returncode.OutPutCodeDispose.dispose("JM_F17_91280600_01","JM_F17_91280600_01","JM_F17_91280600_init");
int totalNum = com.adtec.client.util.DataPoolTool.getInfoSuffix("TS_F_account1");
String[] aselementName ={"BkBankBkFlg","TS_F_optype","TS_F_messdate","TS_F_account1","TS_F_account2","TS_F_amount","TS_F_name","BkPlatDate","TS_F_brchno","BkHostSeq","HB_Authorization_Teller","TS_F_tellerno"};

String[] fmt_name={"FMT_HOST_CLI_Public_JM_F17_91280600_01"};
com.adtec.client.print.LocalPrintDataElementDispose.initPrintPool();

for(int i=0; i<totalNum;i++){
  com.adtec.client.util.DataPoolTool.setInfoToDataPool("BkBankBkFlg", 0, i);
  com.adtec.client.print.LocalPrintDataElementDispose.copyIPDataPool2PrintData(aselementName);
  com.adtec.client.print.LocalPrintDataElementDispose.disposeLocalPrint(fmt_name,aselementName);
}
    
return pagelist;


<script type="text/JavaScript">  

  function  print_selection_JM_F17_91280600()
  {

		var returnNo = document.@[email protected];

		var prtfilename = document.@[email protected]("|");
		   
	
 		if(returnNo=="00000")
 		{	    
			//打印凭证

			for(var i=0;i<prtfilename.length;i++){
        FmtEngine('非税业务分成票据打印'+(i+1),'FMT_HOST_CLI_Public_JM_F17_91280600_01',prtfilename[i]);
		  }
			  
                                        
 		}		
		return;
 }

</script>


27.获取柜员机构类型
//获取柜员机构类型
String strBranNum = com.adtec.client.login.SessionTeller.tellerBranchNO();
com.adtec.client.bean.T_brhm tb = com.adtec.client.dao.T_brhmDao.load(strBranNum);
  if(tb!=null){
	  String brchType = tb.getBranch_type();
	  $MNGY_SequenceNum = brchType;
  }
  else
  {
  	String brchType = "";
  }


28.多sheet打印用
//多sheet打印用
function  printExcel2(obj)
{
//alert("just into printExcel2!");
   var xlsApp = null;    
    try{        
        xlsApp = new ActiveXObject('Excel.Application');    }catch(e) 
    { 
        alert(e+', 原因分析: 浏览器安全级别较高导致不能创建Excel对象或者客户端没有安装Excel软件'); 
          return; 
    }    
    var xlBook = xlsApp.Workbooks.Open('http://'+window.location.host+obj.value);

//alert("after open!");
    var sheetNum= 1;
    for(sheetNum=1;sheetNum<=xlBook.Sheets.Count;sheetNum++)
    {
        var xlsheet = xlBook.Worksheets(sheetNum);
        xlsApp.Application.Visible = false; 
        xlsApp.visible = false; 
        xlsheet.Printout; 
    }
    xlBook.Close(false);
// xlsApp.DisplayAlerts=false; // 如果关闭还会有提示,再加上这个
//  xlsApp.Close(false); 
    xlsApp.Quit(); 
    xlsApp=null;    
}


29.服务器分页
服务器分页
子交易开始前事件
$ECAP_PAGESIZE=10;

服务码请求前事件
com.adtec.client.head.HeadManage.setPage();

组件
pagination_NotBase

序号
Integer.parseInt(com.adtec.txrun.dataelement.SuffixOper.getSuffix()) + 1;


30.复选框
String res = (String)com.adtec.afc.datapool.EP.epGet(com.adtec.struct.ECAPTxRunInfo.getInstance().getIpID(), "BkFlag2",0);
String[] result = res.split("|");
int len = result.length; 
if(len != 0){
 //com.adtec.afc.datapool.EP.deleteDataElementValues(com.adtec.struct.ECAPTxRunInfo.getInstance().getIpID(), "BkFlag2");
 for(int i=0;i<len;i++){
    if(result[i] != ""){
      com.adtec.afc.datapool.EP.epPut(com.adtec.struct.ECAPTxRunInfo.getInstance().getIpID(), "BkFlag2",i, result[i]);
    }
  }
}


31.多个账号回显户名
多个账号回显户名
get020400Account_new(document.@[email protected],'1','form2','_V2_243118_init','0');

get020400Account_new(document.@[email protected],'1','form2','_V2_243118_init','1');


com.adtec.client.accountlinkage.AccountLinkage.init_020400("HB_DefaultString2","textbox136");
com.adtec.client.accountlinkage.AccountLinkage.init_020400("HB_DefaultString2","textbox139");


32.列表多选
<script>  
//复选框赋值
function Select_checkbox()
{
  var m=0;
  var t='';
  var check =  document.getElementsByName('checkbox91');
  for(var i = 0; i < check.length; i++)
   { 
     if(check[i].value=='1')
      {
        m = m + 1;
      }
       t = t + check[i].value;

    }
    //document.getElementById('Total_Records').value = check.length;
     document.getElementById('Identified_num').value = m;
    document.getElementById('Type_Flag').value = t;
}

//复选框全选和取消切换
function checkAll(e, itemName)
{
  var aa = document.getElementsByName(itemName);
  for (var i=0; i<aa.length; i++)
   {
    aa[i].checked = e.checked;
    if(aa[i].checked == true) aa[i].value = '1';
    else aa[i].value = '0';
   }
}
function checkItem(e, allName)
{
  var all = document.getElementsByName(allName)[0];
  if(!e.checked)
   {
     all.checked = false;
     e.value = '0';
   }
  else
  {
     e.value = '1';
    var aa = document.getElementsByName(e.name);
    for (var i=0; i<aa.length; i++)
     if(!aa[i].checked) return;
        all.checked = true;
  } 
    
}


</script>

checkbox90

RAD_SUFFIX
""

checkbox91

RAD_SUFFIX
"0"

checkAll(this, 'checkbox91');
checkItem(this, 'checkbox90');


33.获取交易名
com.adtec.struct.ECAPTxRunInfo.getInstance().getTran().getName();

String subtran=com.adtec.client.util.DataPoolTool.getInfoFromDataPool("ECAP_SUBTRAN_NAME",0);

String tranName= com.adtec.afc.datapool.EP.epGetValue(com.adtec.struct.ECAPTxRunInfo.getInstance().getSpID(), "HB_TRAN_CODE",0);
if("_D1_037998".equals(tranName)){
    return "交易名称:037998  取消卡与账户关联";
}

if(subtran.equals("_D1_037621")){
    return "交易名称:037620  取消卡与账户关联";
}else if(subtran.equals("_D8_037621")){
    return "交易名称:037999  取消卡与账户关联";
}


34.子窗口的值传到父窗口
var rValue = new Array(document.@[email protected],document.@[email protected]);// new Array(客户号对象,客户号类型对象,证件号对象,证件号类型对象);
openTranWin('_PubTran_060482', 'height=600,width=800,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no',rValue);

getCustInfo();


35.清楚金额中的逗号
var _format = window.eval("/,/g");
   var amt1 = '50,000.00';
   alert(amt1);
   
   var amt2 = amt1.replace(_format,"");
   
   alert(amt2);


36.指定操作机构
if('00101' != document.form2.hidden_brch.value)
{
    closeTran();
    alert('此交易只能由省中心00101机构操作');
}

com.adtec.client.login.SessionTeller.tellerBranchNO();


37.选择弹出框信息
var returnValues =window.showModalDialog('TxRunAction.do?TranName=_E12_1614019_query&SubTranName=_E12_1614019_qu_init&Rnd='+Math.round(Math.random()*100000000), obj, 'dialogWidth=800px;dialogHeight=600px,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no');

if(returnValues == null)
    return;
document.@[email protected] = returnValues[0];
document.@[email protected] = returnValues[1];
document.@[email protected] = returnValues[2];
document.@[email protected] = returnValues[3];
document.@[email protected] = returnValues[4];
document.@[email protected] = returnValues[5];


<script type="text/JavaScript">
function  returnVale()
  {
    window.returnValue = new Array();
     var radioObj = document.getElementsByName('radio29');
    if(undefined == radioObj.length){
	         window.returnValue[0]  = document.getElementById('hidden40__'+radioObj.value).value;
                 window.returnValue[1]  = document.getElementById('hidden43__'+radioObj.value).value;
                 window.returnValue[2]  = document.getElementById('hidden44__'+radioObj.value).value;
                 window.returnValue[3]  = document.getElementById('hidden45__'+radioObj.value).value;
                 window.returnValue[4]  = document.getElementById('hidden46__'+radioObj.value).value;
                 window.returnValue[5]  = document.getElementById('hidden47__'+radioObj.value).value;
                 window.close();
                 
    }else{
        for (i=0; i < radioObj.length; i++){
            if (radioObj[i].checked){   
                 window.returnValue[0] = document.getElementById('hidden40__'+radioObj[i].value).value;
                 window.returnValue[1] = document.getElementById('hidden43__'+radioObj[i].value).value;
                 window.returnValue[2] = document.getElementById('hidden44__'+radioObj[i].value).value;
                 window.returnValue[3] = document.getElementById('hidden45__'+radioObj[i].value).value;
                 window.returnValue[4] = document.getElementById('hidden46__'+radioObj[i].value).value;
                 window.returnValue[5] = document.getElementById('hidden47__'+radioObj[i].value).value;
                 window.close();
            }
       }
    
 
   }
}
 

</script>


38.清楚空值
com.adtec.client.util.NumberTool.elementFormatInt ("HB_GridCustNum");

int num = com.adtec.afc.datapool.EP.getSuffixNo(com.adtec.struct.ECAPTxRunInfo.getInstance().getIpID(), "HB_GridCustNum");
for(int i =0;i<num;i++){
 String strNum = com.adtec.client.util.DataPoolTool.getInfoFromDataPool("HB_GridCustNum", i);
  if ((!"".equals(strNum)) && (strNum != null)) {
   com.adtec.client.util.DataPoolTool.setInfoToDataPool("HB_FundAgreementNo",i, strNum);
 }
}


39.获取法人号
com.adtec.client.dao.T_brhmDao.getUnionCodeByBrachNo(com.adtec.afc.datapool.EP.epGetValue(com.adtec.struct.ECAPTxRunInfo.getInstance().getSpID(), "HB_Branch_Number",0));


40.js操作
根据已经输入的字符个数动态判断还可以输入多少
function chg_info()
{
    var str = document.@[email protected];
    var num = 256;
    var num2 = str.length
    if(str.match(/[^\u0000-\u00ff]/g) != null)
    {
        num2 += str.match(/[^\u0000-\u00ff]/g).length;
    }
    document.getElementById('label34').innerHTML = '&nbsp&nbsp&nbsp&nbsp最多可输入<font color=red><B>256</B></font>个字符,您已输入<font color=red><B>' + num2 + '</B></font>个字符,还可输入<font color=red><B>' + (num - num2) + '</B></font>个字符。';
}

下拉框全选或取消
var num = document.@[email protected];
if(this.checked==true)
{
    for(var j=0;j<num;j++)
    {
        document.@[email protected][j].selected=true; 
    }
}
else
{
    for(var j=0;j<num;j++)
    {
        document.@[email protected][j].selected = false; 
    }
}

猜你喜欢

转载自microjava.iteye.com/blog/737012