arraycoy java,LifeAsia 功能通过Java转移到Web

主题思想,除了业务操作类以BO实现外,除非已有现成BO,查询/报表 不通过BO实现。

LIfeAsia文件的IO通过开发Java版本的IO来达到同样目的,LifeAsia的查询类程序通过PCML来调用,业务操作通过开发BO来实现。

(1)LifeAsia的Cobol版本的文件IO 以java版本来实现。最终调用代码类似。

Clnt clnt = new Clnt();

clnt.setClntpfx(Common.CLNTPFX);

clnt.setClntcoy(Common.CLNTCOY);

clnt.setClntnum(clntnum);

clnt.setIOF_(IOF.READR);

Clntio.io(clnt);

(2)PCML调用,通过IBM的PCML类调用LA的已有程序。比如HRTOTLON。

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-FUNCTION", loanCalCPY.getFunction());

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-STATUZ", Common.O_K);

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-CHDRCOY",loanCalCPY.getChdrcoy());

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-CHDRNUM",loanCalCPY.getChdrnum());

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-PRINCIPAL",new BigDecimal(0.0));

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-INTEREST",new BigDecimal(0.0));

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-LOAN-COUNT",new BigDecimal(0));

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-EFFECTIVE-DATE",loanCalCPY.getEffective_date());

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-BATCHKEY"," ");

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-TRANNO",new BigDecimal(0));

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-TRANID.TOTL-TRAN-TERM"," ");

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-TRANID.TOTL-TRAN-DATE",new BigDecimal(0));

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-TRANID.TOTL-TRAN-TIME",new BigDecimal(0));

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-TRANID.TOTL-TRAN-USER",new BigDecimal(0));

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-LANGUAGE","S");

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-POST-FLAG","N");

pcml.setValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-LOAN-NUMBER",loanCalCPY.getLoan_number());

// Request to call the API

rc = pcml.callProgram(pcmlfile);

// If return code is false, we received messages from the server

if(rc == false)

{

AS400Message[] msgs = pcml.getMessageList(pcmlfile);

// Iterate through messages and write them to standard output

for (int m = 0; m < msgs.length; m++)

{

msgId = msgs[m].getID();

msgText = msgs[m].getText();

System.out.println("    " + msgId + " - " + msgText);

}

System.out.println("** Call to PCMLTEST failed. See messages above **");

loanCalCPY.setStatuz(Common.BOMB);

loanCalCPY.setPrincipal(new BigDecimal(0.0));

loanCalCPY.setInterest (new BigDecimal(0.0));

loanCalCPY.setLoan_count(0);

}

else

{

loanCalCPY.setStatuz((String)pcml.getValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-STATUZ"));

loanCalCPY.setPrincipal((BigDecimal)pcml.getValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-PRINCIPAL"));

loanCalCPY.setInterest ((BigDecimal)pcml.getValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-INTEREST"));

loanCalCPY.setLoan_count(pcml.getIntValue("HRTOTLON.TOTL-TOTLOAN-REC.TOTL-LOAN-COUNT"));

}

(3)BO调用(没写好,待优化)

BORetPair boRetPair = new BORetPair();   String REQDATA = "";   String RESDATA = "";   ZSILCLTI icpy = new ZSILCLTI();   icpy = (ZSILCLTI)object;   //Get BO Leader_Heade&SessionI   String strBOHDR = BOrfmlUtil.getBOLDRHDRSESSIONIByClient(userId,                                                  BOrfmlUtil.VERB_ENQ,                                                  EnvParam.DEFAULTLANGUAGE                                                  );   //Get BO Message   RecordFormatDocument rfmlin = RFMLFactory.getRFML(rfmlfilein);   RecordFormatDocument rfmlout = RFMLFactory.getRFML(rfmlfileout);      icpy.setRfmlFields(rfmlin);   String strMSG = AS400CharConv.getInstance().byteArrayToString(rfmlin.toByteArray(BOrfmlUtil.MSGHDRREC)) +                   AS400CharConv.getInstance().byteArrayToString(rfmlin.toByteArray(BOrfmlUtil.MSGDTAREC));      REQDATA = strBOHDR + strMSG;      // BO   long a = System.currentTimeMillis();     BOHBOHCPY cpy = new BOHBOHCPY(REQDATA);     if(!BOHBOHCL.programCall(cpy)){    return boRetPair;   }   RESDATA = cpy.getRspdta();   System.out.println(RESDATA.length());   System.out.println("BO Use time "+(System.currentTimeMillis()-a) + " ms");   a = System.currentTimeMillis();      RfmlBase.setValues(rfmlout,BOrfmlUtil.MSGDTAREC,               AS400CharConv.getInstance().stringToByteArray(RESDATA.substring(130)));   System.out.println("BO Use time "+(System.currentTimeMillis()-a) + " ms");   a = System.currentTimeMillis();      RfmlBase.setValues(rfmlout,BOrfmlUtil.MSGDTAREC,               AS400CharConv.getInstance().stringToByteArray(RESDATA.substring(130,10000)));   System.out.println("rfml analy Use time "+(System.currentTimeMillis()-a) + " ms");   CltUwrO cltUwrO = new CltUwrO();   cltUwrO.loadValueFromRfmlFields(rfmlout);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值