Commit 3b9a3a68 authored by panhong18943's avatar panhong18943

汇丰银企直连优化

parent 2a52cf52
......@@ -34,6 +34,7 @@
select t2.reqsn
from hl_hsbc_paying_batch t2
where t2.status = 'SEND_MID'
and t2.errcode is null
order by 1
]]></bm:query-sql>
</bm:operation>
......
......@@ -26,6 +26,8 @@
tranfer_dir.mkdirs();//创建文件夹
}
var send_flag;
function batch_send(reqsn) {
var fileName = reqsn;
......@@ -81,45 +83,49 @@
var AUTH_CODE = AuthTypeMode.getProperties("AUTH_CODE");
var DOWN_FILEDIR = AuthTypeMode.getProperties("DOWN_FILEDIR");
send_flag = 'N';
try {
var sftpTool = new SftpTool(URL,USER_NAME,PORT);
var send_code = sftpTool.upload(ROOT_PATH, FilePath, new AuthTypeMode(AUTH_CODE,KEY_PATH));
send_flag = 'Y';
} catch (e) {
var error_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
error_bm.update({
reqsn: reqsn
});
raise_app_error(e.message);
var logger = $logger("server-script");
logger.severe('上传失败' + e);
}
if (send_flag == 'Y' && send_code=='UPLOAD_SUCCESS') {
//插入日志表
//生成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
});
//插入日志表
//生成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和修改下载状态独立吧
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:''
});
}else{
//上传失败
send_bm.update({
reqsn: reqsn,
errMsg:send_code
});
reqsn: reqsn,
errMsg:send_code
});
}
}
}
function 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