Commit d0adfad2 authored by panhong18943's avatar panhong18943

银企直连接口失联监控

parent 2c7d3f6f
......@@ -24,5 +24,16 @@
END;
]]></bm:query-sql>
</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:model>
......@@ -80,38 +80,47 @@
var KEY_PATH = AuthTypeMode.getProperties("KEY_PATH");
var AUTH_CODE = AuthTypeMode.getProperties("AUTH_CODE");
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');
if (send_code=='UPLOAD_SUCCESS'){
//解析XML文件2个,先修改下载状态。 建议还是解析XML和修改下载状态独立吧
send_bm.update({
reqsn: reqsn,
errMsg:''
});
}else{
//上传失败
send_bm.update({
reqsn: reqsn,
errMsg:send_code
});
try {
var sftpTool = new SftpTool(URL,USER_NAME,PORT);
var send_code = sftpTool.upload(ROOT_PATH, FilePath, new AuthTypeMode(AUTH_CODE,KEY_PATH));
} catch (e) {
var error_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
error_bm.update({
reqsn: reqsn
});
raise_app_error(e.message);
}
//插入日志表
//生成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() {
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