pinterbus.GjPdeclareQry外汇申报查询为例
GjPdeclareQry是路由的交易码,找到transaction
//GjPdeclareQry是个交易码 <!-- 跨境汇款申报查询 --> <transaction id="GjPdeclareQry" template="publicQueryTemplate"> <actions> <ref name="action">BaseQueryAction</ref> </actions> </transaction> <!-- 跨境汇款申报详细查询 -->
通过transactionxml找BaseTwoPhaseAction类
<action id="BaseQueryAction" class="com.csii.ibs.action.IbsQueryAction" > <ref name="trsCodeResolver">hostTrsCodeResolver</ref> <ref name="returnCodeValidator">hostReturnCodeValidator</ref> <param name="idFactoryName">${pcommon.BaseQueryAction.IdFactoryName}</param> <ref name="transportBean">TransformerTransport</ref> </action>
通过BaseQueryAction找ref ,注入的第一hostTrsCodeResolver是流程,第二是校验和返回错误信息,第三是beanfactory
第四个TransformerTransport
<transport id="TransformerTransport" class="com.csii.pe.service.comm.TransformTransport"> <ref name="transformerFactory">TransformerFactory</ref> <ref name="transport">${pcommon.TransformerTransport.transport}</ref> <param name="formatName">OutboundPacket</param> <param name="parseName">${pcommon.TransformerTransport.parseName}</param> <param name="debug">${pcommon.TransformerTransport.debug}</param> <param name="dumpPath">${pcommon.TransformerTransport.dumpPath}</param> <ref name="headFormatter">pinterbus.HeadFormatter</ref> <ref name="streamFormatter">pinterbus.StreamFormatter</ref> <ref name="streamParser">pinterbus.StreamParser</ref> <ref name="afterParser">pinterbus.AfterParser</ref> </transport>
注入的OutboundPacket是报文,注入的headFormatter打包上送
OutboundPacket:
//头文件 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE outboundPacket SYSTEM "packetutf8.dtd"> <outboundPacket parsePrefix="f" formatPrefix="f" nameOfBodyLength="BodyLength" > <segment> <fixNumber name="BodyLength" length="8" add="161" /> <fixString name="_HostTransactionCode" length="20" /> </segment> <include keyName="_TransName" /> </outboundPacket> //通过include引入报文体 /i2bRouter-o-pinterbus/src/config/pinterbus/outbound/ynrcb/packets/ppinterbus.GjPdeclareMakeup.xml
headFormatter:
<bean name="HeadFormatter" class="com.csii.ibs.i2brouter.ynrcb.pinterbus.HeadFormatter"> <param name="fileUploadPath">${common.HeadFormatter.fileUploadPath}</param> <ref name="fileTransformerFactory">fileTransformerFactory</ref> <ref name="fileUploadTransport">FileUploadTransport</ref> <set name="pinterbusGjServiceSet"> <param>pinterbus.getFrAcctTrxDtlQry</param><!--查询所有外币账户交易明细--> <param>pinterbus.GjSettlePurch</param><!-- 结售汇交易(国结) --> <param>pinterbus.GjRemittance</param><!-- 汇款(国结) --> <param>pinterbus.GjRemittanceDetailQry</param><!-- 汇款详情查询(国结) --> <param>pinterbus.getFrAcctForexTradTrxInfoQry</param><!--外币电子账户外汇买卖交易详情--> <param>pinterbus.getFrAcctSettlePurchTrxInfoQry</param><!--外币电子账户结售汇交易详情--> <param>pinterbus.GjPurchAppliMod</param><!--购汇申请书修改--> <param>pinterbus.GjPdeclareQry</param><!-- 申报查询 --> <param>pinterbus.GjPdeclarePre</param><!-- 申报查询 --> <param>pinterbus.GjPdeclareMakeup</param><!-- 申报补录 --> // <param>pinterbus.GjGetRecvbankInfo</param><!-- 收款行信息查询 --> </set> <map name="pinterbusGjTransTypeMaping"> <param name="pinterbus.GjSettlePurch">GW0007</param> <param name="pinterbus.GjRemittance">GW0006</param> <param name="pinterbus.GjRemittanceDetailQry">GW0015</param> <param name="pinterbus.getFrAcctForexTradTrxInfoQry">GW0020</param> <param name="pinterbus.getFrAcctSettlePurchTrxInfoQry">GW0019</param> <param name="pinterbus.getFrAcctTrxDtlQry">GW0016</param> <param name="pinterbus.GjPurchAppliMod">GW0017</param> <param name="pinterbus.GjPdeclareQry">GW0020</param>//交易名 <param name="pinterbus.GjPdeclarePre">GW0021</param> <param name="pinterbus.GjPdeclareMakeup">GW0022</param> <param name="pinterbus.GjGetRecvbankInfo">GW0003</param> </map> </bean> //com.csii.ibs.i2brouter.ynrcb.pinterbus.HeadFormatter if(pinterbusGjServiceSet.contains(transactionId)){ map.put("_CoreServiceName", "FrgnExcge");//FrgnExcge服务名 map.put("ChnlNo", map.get("ChnlNo")); map.put("ChnlType", map.get("ChannelId")); map.put("TrxCode", pinterbusGjTransTypeMaping.get(transactionId)); map.put("TrxDate", Util.getYYYYMMDD()); map.put("TrxTime", Util.getHHMMSS()); map.put("JnlNo",context.get("_JnlNo")); map.put("ReqSysCode", "0001"); } //服务、流程、交易,类似pweb这套下的 外汇服务下的申报流程下的申报补录接口