Commit a563c93e authored by panhong18943's avatar panhong18943

银企直连接口失联监控

parent 9709d057
...@@ -24,5 +24,16 @@ ...@@ -24,5 +24,16 @@
END; END;
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
<bm:operation name="update">
<bm:query-sql><![CDATA[
BEGIN
hl_hsbc_interface_pkg.hl_hsbc_error(
p_reqsn => ${@reqsn},
p_user_id => '-1'
);
END;
]]></bm:query-sql>
</bm:operation>
</bm:operations> </bm:operations>
</bm:model> </bm:model>
...@@ -80,38 +80,47 @@ ...@@ -80,38 +80,47 @@
var KEY_PATH = AuthTypeMode.getProperties("KEY_PATH"); var KEY_PATH = AuthTypeMode.getProperties("KEY_PATH");
var AUTH_CODE = AuthTypeMode.getProperties("AUTH_CODE"); var AUTH_CODE = AuthTypeMode.getProperties("AUTH_CODE");
var DOWN_FILEDIR = AuthTypeMode.getProperties("DOWN_FILEDIR"); var DOWN_FILEDIR = AuthTypeMode.getProperties("DOWN_FILEDIR");
var sftpTool = new SftpTool(URL,USER_NAME,PORT);
var send_code = sftpTool.upload(ROOT_PATH, FilePath, new AuthTypeMode(AUTH_CODE,KEY_PATH));
//插入日志表
//生成log_id
var log_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
var res = log_bm.queryAsMap();
var arr = res.getChildren();
var log_id = arr[0].log_id;
log_bm.insert({
log_id: log_id,
interface_code:'HSBC_SEND',
reqsn:reqsn,
request:xml_content,
send_return_code:send_code
});
var send_bm = $bm('hsbc.HSBC110.upload_interface_process'); try {
if (send_code=='UPLOAD_SUCCESS'){ var sftpTool = new SftpTool(URL,USER_NAME,PORT);
//解析XML文件2个,先修改下载状态。 建议还是解析XML和修改下载状态独立吧 var send_code = sftpTool.upload(ROOT_PATH, FilePath, new AuthTypeMode(AUTH_CODE,KEY_PATH));
send_bm.update({ } catch (e) {
reqsn: reqsn, var error_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
errMsg:'' error_bm.update({
}); reqsn: reqsn
}else{ });
//上传失败 raise_app_error(e.message);
send_bm.update({
reqsn: reqsn,
errMsg:send_code
});
} }
//插入日志表
//生成log_id
var log_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
var res = log_bm.queryAsMap();
var arr = res.getChildren();
var log_id = arr[0].log_id;
log_bm.insert({
log_id: log_id,
interface_code:'HSBC_SEND',
reqsn:reqsn,
request:xml_content,
send_return_code:send_code
});
var send_bm = $bm('hsbc.HSBC110.upload_interface_process');
if (send_code=='UPLOAD_SUCCESS'){
//解析XML文件2个,先修改下载状态。 建议还是解析XML和修改下载状态独立吧
send_bm.update({
reqsn: reqsn,
errMsg:''
});
}else{
//上传失败
send_bm.update({
reqsn: reqsn,
errMsg:send_code
});
}
} }
function main() { function main() {
println('main'); println('main');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment