Files
2021-08-11 16:59:59 +08:00

141 lines
6.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<Package>
<Function name="GET_DISK_RESULT_FILE">
<Input>RTR_IN</Input>
<Output>MSG_CD|RTR_OUT</Output>
<!--查询文件是否入库 -->
<DynSentence name="QRY_CAPDSKINF">
<Sentence>
SELECT DSK_STS,ORN_CNT TOTAL_COUNT,ORN_AMT TOTAL_AMOUNT,SUC_CNT SUCC_COUNT,SUC_AMT SUCC_AMOUNT,FAL_CNT
FAIL_COUNT,FAL_AMT FAIL_AMOUNT,TITLE_ID,CUSTOMER_ID,ORD_DT FROM CAPDSKINF
WHERE DSK_NAM = ?
</Sentence>
<Fields>DSK_NAM|</Fields>
</DynSentence>
<DynSentence name="QRY_CAPBATINF">
<Sentence>
SELECT count(1) BAT_NUM FROM CAPBATINF
WHERE DSK_NAM = ? AND BAT_STS not in('4','2')
</Sentence>
<Fields>DSK_NAM|</Fields>
</DynSentence>
<DynSentence name="QRY_CAPTXNJNL">
<Sentence>
select t.ORD_DT,t.tm_smp LAST_TIME,t.CRD_FLG ACCT_TYPE,t.AC_NO ACCT_NO,t.CUS_NAM ACCT_NAME,t.CAP_ORD_NO TRANS_ID,
t.MERC_ORD_NO REF_ID,t.CORG_JRN_NO BANK_REF_ID, t.TXN_AMT AMOUNT,a.CORG_NM BANK_TYPE,t.POSTSCRIPT,
t.TAC_NO PAYER_ACCT_NO,t.TAC_NAM PAYER_ACCT_NAME, t.CORG_NO ORG_NO,t.RMK REMARK,
t.TXN_STS TRANS_STS,t.RSP_MSG RESP_MESSAGE
from CAPTXNJNL t,CMMTORGN a where t.dsk_nam = '%s' and ORD_DT = '%s' and t.CORG_NO = a.CORP_ORG(+) order by MERC_ORD_NO
</Sentence>
<Fields>DSK_NAM|ORD_DT|</Fields>
</DynSentence>
<Process>
<Set>DSK_NAM=$RTR_IN.DSK_NAM</Set>
<!--查询大批批次表-->
<Exec func="PUB:ReadRecord" error="IGNORE">
<Arg name="SqlCmd" value="QRY_CAPDSKINF"/>
</Exec>
<If condition="~RetCod!=0">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=批次不存在</Set>
<Return/>
</If>
<!--<If condition="IS_NOEQUAL_STRING($DSK_STS,4)">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=批次未完成</Set>
<Return/>
</If>-->
<!--查询小批是否处理完成-->
<Exec func="PUB:ReadRecord" error="IGNORE">
<Arg name="SqlCmd" value="QRY_CAPBATINF"/>
</Exec>
<If condition="~RetCod!=0">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=系统异常</Set>
<Return/>
</If>
<If condition="IS_NOEQUAL_STRING($BAT_NUM,0)">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=批次未完成</Set>
<Return/>
</If>
<!--生成文件-->
<Set>SRC_FIL_PATH=STRCAT(GETENV(WORKDIR),/dat/cap/send/)</Set>
<Set>SRC_FIL_NAM=STRCAT($SRC_FIL_PATH,$ORD_DT,/,$DSK_NAM)</Set>
<Set>FIL_CMD=STRCAT("cd ",$SRC_FIL_PATH," ",\46\46," mkdir ",$ORD_DT)
</Set>
<Exec func="PUB:SystemAndWait" error="IGNORE">
<Arg name="cmd" value="$FIL_CMD" />
<Arg name="FIL_NM" value="" />
</Exec>
<!--导出文件-->
<Exec func="PUB:ExportFromDB">
<Arg name="FormatName" value="HroFmt02"></Arg>
<Arg name="FileName" value="$SRC_FIL_NAM"></Arg>
<Arg name="TableName" value="CAPTXNJNL"></Arg>
<Arg name="SqlName" value="QRY_CAPTXNJNL"></Arg>
</Exec>
<If condition="~RetCod=-1">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=失败</Set>
<Exec func="PUB:GWASetMsg">
<Arg name="MsgCd" value="CAP99999"/>
</Exec>
<Return/>
</If>
<If condition="~RetCod=1">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=数据不存在</Set>
<Exec func="PUB:GWASetMsg">
<Arg name="MsgCd" value="CAP88888"/>
</Exec>
<Return/>
</If>
<ElseIf condition="~RetCod!=0">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=生成文件失败</Set>
<Exec func="PUB:GWASetMsg">
<Arg name="MsgCd" value="CAP88888"/>
</Exec>
<Return/>
</ElseIf>
<!--文件压缩-->
<Set>ZIP_FIL_NAME=STRCAT($SRC_FIL_NAM,.zip)</Set>
<Exec func="PUB:PARAM_GRP_GET" error="IGNORE">
<Arg name="ParamNam" value="CAPPARAMTER"/>
<Arg name="KeyNam" value="FIL_ZIP_PWD"/>
<Arg name="GrpNam" value="PWD"/>
</Exec>
<Set>FIL_PWD=$PWD.P_VALUES</Set>
<Exec func="CTG:zip">
<Arg name="srcFileName" value="$SRC_FIL_NAM"/>
<Arg name="zipFileName" value="$ZIP_FIL_NAME"/>
<Arg name="password" value="$FIL_PWD"/>
</Exec>
<!--判断文件是否存在-->
<Exec func="PUB:IsValidFile" error="IGNORE">
<Arg name="FileName" value="$ZIP_FIL_NAME"/>
</Exec>
<If condition="OR( INTCMP($FIL_BYT,3,0), INTCMP(~RetCod,4,0) )">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=文件压缩失败</Set>
<Return/>
</If>
<Set>RTR_OUT.ZIP_FIL_NAME=$ZIP_FIL_NAME</Set><!--压缩文件-->
<!--生成MD5值-->
<Exec func="ENC:EncryptFilByMD5" error="IGNORE">
<Arg name="fileName" value="$ZIP_FIL_NAME"/>
<Arg name="nodeName" value="BSIG_VAL"/>
</Exec>
<Set>RTR_OUT.MD5=$BSIG_VAL</Set><!--文件校验值-->
<Exec func="PUB:CmpSetMsg">
<Arg name="MsgCd" value="AGW00000"/>
</Exec>
</Process>
</Function>
</Package>