Files
ctg-app-cap/cap/etc/batch/BAT_TIMEOUT_TIMER_CTL.XML
2021-01-15 18:40:45 +08:00

150 lines
6.8 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version='1.0' encoding='UTF-8'?>
<Tran>
<Transaction code="BAT_TIMEOUT_TIMER" log_switch='1' desc="获取批量回盘">
<Attributes>
<Attribute name="nodatabase" value="2"/> <!--数据库长连接-->
</Attributes>
<DynSentence name="QryTimeoutRove"> <!-- 超时没审批 -->
<Sentence>
SELECT MERC_ID,CORG_DSK_NO,BAT_ORN_CNT,BAT_ORN_AMT FROM CAPBATINF WHERE TM_SMP &lt;= TO_CHAR(SYSDATE-20/24/60,'YYYYMMDDHH24MISS') AND BAT_STS='U'
</Sentence>
<Fields></Fields>
</DynSentence>
<DynSentence name="QryTimeoutPlat"> <!-- 超时没回盘 -->
<Sentence>
SELECT MERC_ID,CORG_DSK_NO,SND_DT,SND_TM FROM CAPBATINF WHERE SND_TM &lt;= TO_CHAR(SYSDATE-20/24/60,'YYYYMMDDHH24MISS') AND BAT_STS in('1','3')
</Sentence>
<Fields></Fields>
</DynSentence>
<FlowCtrl>
<!-- 超时没审批事务推送 -->
<Set>MSG_INF=批次号为</Set>
<Set>FLG=F</Set>
<Exec func="PUB:OpenCursor" error="IGNORE">
<Arg name="SqlCmd" value="QryTimeoutRove"/>
<Arg name="CursorName" value="CURSOR_1"/>
</Exec>
<If condition="~RetCod=-1">
<Exec func="PUB:GWASetMsg">
<Arg name="MsgCd" value="LPS00001"/>
<Arg name="MsgDat" value="数据库操作错误"/>
</Exec>
</If>
<While>
<Exec func="PUB:FetchCursor" error="IGNORE"/>
<If condition="~RetCod=2">
<Exec func="PUB:CloseCursor"/>
<Break/>
</If>
<ElseIf condition="~RetCod!=0">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=循环游标失败</Set>
<Exec func="PUB:RollbackWork"/>
</ElseIf>
<Set>FLG=T</Set>
<!--<Set>MSG_INF=STRCAT($MSG_INF,-,$CORG_DSK_NO)</Set>
<Set>MSG_INF=STRCAT($MSG_INF,待审批时间过长)</Set>-->
<Set>MSG_INF=STRCAT(代收付系统中存有批次号:,$CORG_DSK_NO,的批量代付交易()</Set>
<Set>MSG_INF1=STRCAT($BAT_ORN_CNT,笔,,,$BAT_ORN_AMT,元)</Set>
<Set>MSG_INF=STRCAT($MSG_INF,$MSG_INF1,)尚未处理,请核实无误后,尽快点击发送批次。)</Set>
<If condition="IS_EQUAL_STRING($FLG,T)">
<!-- 事物推送 -->
<Set>EVT_TYP=EVT_BAT_TIM_FAL</Set>
<Set>MERC_ID=$MERC_ID</Set>
<Call package="CEL" function="PUSH_EVENT">
<Input>EVT_TYP|MERC_ID|MSG_INF|</Input>
<Output>MSG_CD|</Output>
</Call>
<If condition="SUBSTR(@O.MSG_CD,4,5)!=00000">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=事务推送失败</Set>
</If>
<Else>
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=$MSG_INF</Set>
</Else>
</If>
</While>
<Exec func="PUB:CloseCursor"> <!-- 关闭游标 -->
<Arg name="CursorName" value="CURSOR_1" />
</Exec>
<If condition="~RetCod!=0">
<!-- @msg 关闭游标失败 -->
<Exec func="PUB:CmpSetMsg">
<Arg name="MsgCd" value="PWM25804" />
</Exec>
</If>
<Set>MSG_INF1=批次号为</Set>
<Set>FLG1=F</Set>
<!-- 超时没回盘事务推送 -->
<Exec func="PUB:OpenCursor" error="IGNORE">
<Arg name="SqlCmd" value="QryTimeoutPlat"/>
<Arg name="CursorName" value="CURSOR_1"/>
</Exec>
<If condition="~RetCod=-1">
<Exec func="PUB:GWASetMsg">
<Arg name="MsgCd" value="LPS00001"/>
<Arg name="MsgDat" value="数据库操作错误"/>
</Exec>
</If>
<While>
<Delete>MSG_INF</Delete>
<Exec func="PUB:FetchCursor" error="IGNORE"/>
<If condition="~RetCod=2">
<Exec func="PUB:CloseCursor"/>
<Break/>
</If>
<ElseIf condition="~RetCod!=0">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=循环游标失败</Set>
<Exec func="PUB:RollbackWork"/>
</ElseIf>
<Set>FLG1=T</Set>
<!--<Set>MSG_INF1=STRCAT($MSG_INF,-,$CORG_DSK_NO)</Set>-->
<Set>MSG_INF1=STRCAT(代收付系统中批次号:,$CORG_DSK_NO,的批量(代收、代付)交易已于)</Set>
<Set>MSG_INF2=STRCAT(FMTDATE($SND_DT,0,5),SUBSTR($SND_TM,1,2),:,SUBSTR($SND_TM,3,2),:,SUBSTR($SND_TM,5,2))</Set>
<Set>MSG_INF1=STRCAT($MSG_INF1,$MSG_INF2,发送处理完成,但目前尚未接收到回盘结果,请核实。)</Set>
<If condition="IS_EQUAL_STRING($FLG1,T)">
<!-- 事物推送 -->
<Set>MSG_INF=STRCAT($MSG_INF,待回盘时间过长)</Set>
<Set>EVT_TYP=EVT_BAT_TIM_FAL</Set>
<Set>MERC_ID=$MERC_ID</Set>
<Call package="CEL" function="PUSH_EVENT">
<Input>EVT_TYP|MERC_ID|MSG_INF1|</Input>
<Output>MSG_CD|</Output>
</Call>
<If condition="SUBSTR(@O.MSG_CD,4,5)!=00000">
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=事务推送失败</Set>
</If>
<Else>
<Set>Rsp_Cd=80</Set>
<Set>Rsp_Msg=$MSG_INF</Set>
</Else>
</If>
</While>
<Exec func="PUB:CloseCursor"> <!-- 关闭游标 -->
<Arg name="CursorName" value="CURSOR_1" />
</Exec>
<If condition="~RetCod!=0">
<!-- @msg 关闭游标失败 -->
<Exec func="PUB:CmpSetMsg">
<Arg name="MsgCd" value="PWM25804" />
</Exec>
</If>
<Set>Rsp_Cd=00</Set>
<Set>Rsp_Msg=交易成功</Set>
</FlowCtrl>
</Transaction>
</Tran>