Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
dc3bac9b
Commit
dc3bac9b
authored
Apr 07, 2024
by
陆正友
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
农行修改--job改按钮功能
parent
bb985bb0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
297 additions
and
233 deletions
+297
-233
att_import_bank.lwm
...ebapp/WEB-INF/classes/efile/EFILE1100/att_import_bank.lwm
+9
-0
csh_agricultural_bank_check.lview
...app/modules/csh/CSH1400/csh_agricultural_bank_check.lview
+29
-0
efile_doc_import_new.lsc
...n/webapp/modules/efile/EFILE1100/efile_doc_import_new.lsc
+259
-233
No files found.
src/main/webapp/WEB-INF/classes/efile/EFILE1100/att_import_bank.lwm
View file @
dc3bac9b
...
@@ -2,6 +2,15 @@
...
@@ -2,6 +2,15 @@
<bm:model
xmlns:f=
"leaf.database.features"
xmlns:bm=
"http://www.leaf-framework.org/schema/bm"
>
<bm:model
xmlns:f=
"leaf.database.features"
xmlns:bm=
"http://www.leaf-framework.org/schema/bm"
>
<bm:operations>
<bm:operations>
<bm:operation
name=
"query"
>
<bm:query-sql>
<![CDATA[
SELECT *
FROM hlcm_ele_abc_bank_slip_bacth b
WHERE b.start_date = TO_DATE('${:@parameter_code}', 'YYYY-MM-DD')
and b.slip_batch_id = nvl(${@batch_id},0)
ORDER BY b.slip_batch_id desc
]]>
</bm:query-sql>
</bm:operation>
<bm:operation
name=
"insert"
>
<bm:operation
name=
"insert"
>
<bm:update-sql>
<![CDATA[
<bm:update-sql>
<![CDATA[
...
...
src/main/webapp/modules/csh/CSH1400/csh_agricultural_bank_check.lview
View file @
dc3bac9b
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
url=
"${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_save.lsc"
/>
url=
"${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_save.lsc"
/>
<a:link
id=
"csh_abc_import_transaction_link"
<a:link
id=
"csh_abc_import_transaction_link"
url=
"${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_transaction.lsc"
/>
url=
"${/request/@context_path}/modules/csh/CSH1400/csh_abc_import_transaction.lsc"
/>
<a:link
id=
"ocr_query_link_id"
url=
"${/request/@context_path}/modules/efile/EFILE1100/efile_doc_import_new.lsc"
/>
<script
type=
"text/javascript"
>
<![CDATA[
<script
type=
"text/javascript"
>
<![CDATA[
Leaf.onReady(function () {
Leaf.onReady(function () {
//只开放按钮权限给债权内勤
//只开放按钮权限给债权内勤
...
@@ -22,10 +24,12 @@
...
@@ -22,10 +24,12 @@
$('agricultural_bank_save_id').enable(); // 启用按钮
$('agricultural_bank_save_id').enable(); // 启用按钮
$('agricultural_bank_import_id').enable(); // 启用按钮
$('agricultural_bank_import_id').enable(); // 启用按钮
$('agricultural_bank_submit_id').enable(); // 启用按钮
$('agricultural_bank_submit_id').enable(); // 启用按钮
$('query_ocr').enable(); // 启用按钮
} else {
} else {
$('agricultural_bank_save_id').disable(); // 禁用按钮
$('agricultural_bank_save_id').disable(); // 禁用按钮
$('agricultural_bank_import_id').disable(); // 禁用按钮
$('agricultural_bank_import_id').disable(); // 禁用按钮
$('agricultural_bank_submit_id').disable(); // 禁用按钮
$('agricultural_bank_submit_id').disable(); // 禁用按钮
$('query_ocr').disable(); // 禁用按钮
}
}
});
});
...
@@ -227,6 +231,30 @@
...
@@ -227,6 +231,30 @@
});
});
}
}
//获取OCR数据
function query_ocr(){
Leaf.Masker.mask(Ext.getBody(), '获取OCR数据中');
var ocr_query_link ='ocr_query_link_id';
Leaf.request({
url: $(ocr_query_link ).getUrl(),
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.SideBar.show({
msg:'获取数据'+res.result.page_number+'页'+'共'+res.result.total+'条',
duration: 10000
})
$("OcrQueryDs").query();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
]]>
</script>
]]>
</script>
...
@@ -284,6 +312,7 @@
...
@@ -284,6 +312,7 @@
<a:screenTitle/>
<a:screenTitle/>
<a:gridButton
id=
"Ocr_Bank_Query"
click=
"agricultural_bank_query"
text=
"HLS.QUERY"
/>
<a:gridButton
id=
"Ocr_Bank_Query"
click=
"agricultural_bank_query"
text=
"HLS.QUERY"
/>
<a:gridButton
id=
"agricultural_bank_save_id"
click=
"agricultural_bank_save"
text=
"保存"
/>
<a:gridButton
id=
"agricultural_bank_save_id"
click=
"agricultural_bank_save"
text=
"保存"
/>
<a:gridButton
id=
"query_ocr"
click=
"query_ocr"
text=
"获取数据"
/>
<a:gridButton
id=
"agricultural_bank_import_id"
click=
"agricultural_bank_import"
text=
"收款导入"
/>
<a:gridButton
id=
"agricultural_bank_import_id"
click=
"agricultural_bank_import"
text=
"收款导入"
/>
<a:gridButton
id=
"agricultural_bank_submit_id"
click=
"agricultural_bank_submit"
text=
"提交"
/>
<a:gridButton
id=
"agricultural_bank_submit_id"
click=
"agricultural_bank_submit"
text=
"提交"
/>
</a:screenTopToolbar>
</a:screenTopToolbar>
...
...
src/main/webapp/modules/efile/EFILE1100/efile_doc_import_new.lsc
View file @
dc3bac9b
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<a:service
xmlns:p=
"uncertain.proc"
xmlns:a=
"http://www.leaf-framework.org/application"
xmlns:s=
"leaf.plugin.script"
<a:service
xmlns:p=
"uncertain.proc"
xmlns:a=
"http://www.leaf-framework.org/application"
xmlns:s=
"leaf.plugin.script"
trace=
"true"
>
trace=
"true"
>
<a:init-procedure>
<a:init-procedure>
<s:server-script
import=
"token_record.js"
>
<![CDATA[
<s:server-script
import=
"token_record.js"
>
<![CDATA[
importPackage(java.io);
importPackage(java.io);
importPackage(java.util);
importPackage(java.util);
importPackage(Packages.com.hand.hlcm);
importPackage(Packages.com.hand.hlcm);
importPackage(Packages.com.hand.hl);
importPackage(Packages.com.hand.hl);
var logger = $logger('server-script');
var logger = $logger('server-script');
// 获取当前日期
function query_next_query(batch_id){
var currentDate = new Date();
send_query(batch_id);
// 设置开始时间为明天的凌晨整点
}
var startdate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()
, 0, 0, 0));
function send_query (batch_id){
// 获取当前日期
// 设置结束时间为后天的凌晨整点
var currentDate = new Date();
var enddate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() +
// 设置开始时间为明天的凌晨整点
1, 0, 0, 0));
var startdate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()
, 0, 0, 0));
// 格式化日期为字符串
// 设置结束时间为后天的凌晨整点
var startdate = startdate_n.toISOString().slice(0, 19).replace('T', ' ');
var enddate_n = new Date(Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate() +
var enddate = enddate_n.toISOString().slice(0, 19).replace('T', ' ');
1, 0, 0, 0));
//var startdate = '2023-12-13 00:00:00';
//var enddate = '2023-12-20 00:00:00';
// 提取开始时间的日期部分
// 格式化日期为字符串
var starttime = startdate_n.toISOString().slice(0, 10);
var startdate = startdate_n.toISOString().slice(0, 19).replace('T', ' ');
//var starttime = '2023-12-13';
var enddate = enddate_n.toISOString().slice(0, 19).replace('T', ' ');
var att_import_bank_bm=$bm('efile.EFILE1100.att_import_bank');
//var startdate = '2023-12-13 00:00:00';
var att_import_bank_trx_bm=$bm('efile.EFILE1100.att_import_bank_trx');
//var enddate = '2023-12-20 00:00:00';
var init_page_number=20; //每次请求当前页条数
// 提取开始时间的日期部分
var starttime = startdate_n.toISOString().slice(0, 10);
try {
//var starttime = '2023-12-13';
var sys_url_bm = $bm('cont.CON4000.get_sys_url');
var att_import_bank_bm=$bm('efile.EFILE1100.att_import_bank');
var parameter_code = 'TOKEN_POSTURL';
var att_import_bank_trx_bm=$bm('efile.EFILE1100.att_import_bank_trx');
var SysposturlQuery = sys_url_bm.queryAsMap({
var init_page_number=100; //每次请求当前页条数
parameter_code: parameter_code
});
try {
var posturl = SysposturlQuery.getChildren()[0].parameter_value;
var sys_url_bm = $bm('cont.CON4000.get_sys_url');
var parameter_code = 'TOKEN_POSTURL';
var parameter_code = 'TOKEN_APPID';
var SysposturlQuery = sys_url_bm.queryAsMap({
var SysappidQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
parameter_code: parameter_code
});
});
var posturl = SysposturlQuery.getChildren()[0].parameter_value;
var token_appid = SysappidQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_APPID';
var parameter_code = 'TOKEN_APPSECRET';
var SysappidQuery = sys_url_bm.queryAsMap({
var SysappsecretQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
parameter_code: parameter_code
});
});
var token_appid = SysappidQuery.getChildren()[0].parameter_value;
var token_appsecret = SysappsecretQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_APPSECRET';
var parameter_code = 'OCR_AGRICULTURAL_BANK';
var SysappsecretQuery = sys_url_bm.queryAsMap({
var FileQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
parameter_code: parameter_code
});
});
var token_appsecret = SysappsecretQuery.getChildren()[0].parameter_value;
var docUrl = FileQuery.getChildren()[0].parameter_value;
var parameter_code = 'OCR_AGRICULTURAL_BANK';
var parameter_code = 'TOKEN_TYPE';
var FileQuery = sys_url_bm.queryAsMap({
var tokenTypeyQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
parameter_code: parameter_code
});
});
var docUrl = FileQuery.getChildren()[0].parameter_value;
var token_type = tokenTypeyQuery.getChildren()[0].parameter_value;
var parameter_code = 'TOKEN_TYPE';
var bank_list_bm = $bm('efile.EFILE1100.get_bank_list');
var tokenTypeyQuery = sys_url_bm.queryAsMap({
var parameter_code = starttime;
parameter_code: parameter_code
var response_json_list = bank_list_bm.queryAsMap({
});
parameter_code: parameter_code
var token_type = tokenTypeyQuery.getChildren()[0].parameter_value;
});
var list =response_json_list.getChildren().length;
var bank_list_bm = $bm('efile.EFILE1100.att_import_bank');
var record = response_json_list.getChildren();
var parameter_code = starttime;
logger.info(typeof (record));
var response_json_list = bank_list_bm.queryAsMap({
parameter_code: parameter_code,
var token_savelogs_bm = $bm('efile.EFILE1000.efile_get_token');
batch_id : batch_id
//token是否在有效期内,在有效期内直接获取表中的token
});
var check_token_valid_bm = $bm('efile.EFILE1000.check_token_valid');
var list =response_json_list.getChildren().length;
var checkTokenQuery = check_token_valid_bm.queryAsMap();
var record = response_json_list.getChildren();
var is_valid = checkTokenQuery.getChildren()[0].is_valid;
logger.info(typeof (record));
println('is_valid = ' + is_valid);
var token_savelogs_bm = $bm('efile.EFILE1000.efile_get_token');
if (is_valid == 'true') {
//token是否在有效期内,在有效期内直接获取表中的token
println("=======有效期内======");
var check_token_valid_bm = $bm('efile.EFILE1000.check_token_valid');
var SystokenQuery = token_savelogs_bm.queryAsMap();
var checkTokenQuery = check_token_valid_bm.queryAsMap();
var access_token = SystokenQuery.getChildren()[0].access_token;
var is_valid = checkTokenQuery.getChildren()[0].is_valid;
var files = '{"startCreatedDate": ' + '"' +startdate +'"'
println('is_valid = ' + is_valid);
if (is_valid == 'true') {
println("=======有效期内======");
var SystokenQuery = token_savelogs_bm.queryAsMap();
var access_token = SystokenQuery.getChildren()[0].access_token;
var files = '{"startCreatedDate": ' + '"' +startdate +'"'
+ ',"endCreatedDate":'+ '"' +enddate + '"'
+ ',"endCreatedDate":'+ '"' +enddate + '"'
+',"documentTypeCodeList": '+'["receiptD"]}';
+',"documentTypeCodeList": '+'["receiptD"]}';
access_token = access_token;
access_token = access_token;
var request_files_n = files + access_token + token_type ;
var request_files_n = files + access_token + token_type ;
var request_files = JSON.stringify(request_files_n);
var request_files = JSON.stringify(request_files_n);
var token_type = token_type;
var token_type = token_type;
var page_number = 1;
var page_number = 1;
if(list==0){
if(list==0){
// 说明当前没有发起查询,从第一页开始查
// 说明当前没有发起查询,从第一页开始查
page_number=1;
page_number=1;
} else{
} else{
if(record[0].RETURN_PAGE_SIZE>
=record[0].PAGE_SIZE){
if(record[0].RETURN_PAGE_SIZE>
=record[0].PAGE_SIZE){
page_number=record[0].PAGE_NUMBER+1;
page_number=record[0].PAGE_NUMBER+1;
}
}
else{
else{
page_number=record[0].PAGE_NUMBER;
page_number=record[0].PAGE_NUMBER;
}
}
};
};
var page = page_number;
var page = page_number;
var size = init_page_number;
var size = init_page_number;
var doc = "http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/documents/query?page=" + page +
var doc = "http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/documents/query?page=" + page +
"
&size="+size;
"
&size="+size;
var docUrl = doc.toString();
var docUrl = doc.toString();
att_import_bank_bm.insert({
att_import_bank_bm.insert({
'start_date' : startdate,
'start_date' : startdate,
'end_date' : enddate,
'end_date' : enddate,
'request_json' : request_files,
'request_json' : request_files,
'page_number' : page_number,
'page_number' : page_number,
'request_url' : docUrl
'request_url' : docUrl
})
})
var bank_list_bm = $bm('efile.EFILE1100.get_bank_list');
var bank_list_bm = $bm('efile.EFILE1100.get_bank_list');
var parameter_code = starttime;
var parameter_code = starttime;
var response_json_list = bank_list_bm.queryAsMap({
var response_json_list = bank_list_bm.queryAsMap({
parameter_code: parameter_code
parameter_code: parameter_code
});
});
var list =response_json_list.getChildren().length;
var list =response_json_list.getChildren().length;
var record = response_json_list.getChildren();
var record = response_json_list.getChildren();
logger.info(typeof (record));
logger.info(typeof (record));
var doc_import=new com.hand.hlcm.HttpPostDocQuery();
var doc_import=new com.hand.hlcm.HttpPostDocQuery();
var data_result_n = doc_import.httpPostDocImport(docUrl,files,access_token,token_type);
var data_result_n = doc_import.httpPostDocImport(docUrl,files,access_token,token_type);
var json_data = JSON.parse(data_result_n);
var json_data = JSON.parse(data_result_n);
var statusCode = json_data.statusCode;
var statusCode = json_data.statusCode;
var message = json_data.message;
var message = json_data.message;
var total = json_data.total;
var total = json_data.total;
$ctx.parameter.page_number = page_number;
var result=json_data.result;
$ctx.parameter.total = total;
// var result_list=JSON.stringify(result);
var result_list = result.length;
var result=json_data.result;
var return_page_size = JSON.stringify(result_list);
// var result_list=JSON.stringify(result);
var result_list = result.length;
att_import_bank_bm.update({
var return_page_size = JSON.stringify(result_list);
att_import_bank_bm.update({
'code' : statusCode,
'code' : statusCode,
'message' : message,
'message' : message,
'response_json' : data_result_n,
'response_json' : data_result_n,
'return_page_size' : return_page_size,
'return_page_size' : return_page_size,
'page_size' : size,
'page_size' : size,
'slip_batch_id' : record[0].SLIP_BATCH_ID
'slip_batch_id' : record[0].SLIP_BATCH_ID
})
})
for (var i = 0; i
< result_list
;
i++)
{
for (var i = 0; i
< result_list
;
i++)
{
var
docFormFieldValueVOList =
result[i].docFormFieldValueVOList;
var
docFormFieldValueVOList =
result[i].docFormFieldValueVOList;
var
fieldValueMap =
{};
var
fieldValueMap =
{};
//
构建字段映射
//
构建字段映射
for
(var
j =
0;
j
<
docFormFieldValueVOList.length;
j++)
{
for
(var
j =
0;
j
<
docFormFieldValueVOList.length;
j++)
{
var
fieldCode =
docFormFieldValueVOList[j].fieldCode;
var
fieldCode =
docFormFieldValueVOList[j].fieldCode;
var
fieldValue =
docFormFieldValueVOList[j].fieldValue;
var
fieldValue =
docFormFieldValueVOList[j].fieldValue;
fieldValueMap[fieldCode]
=
fieldValue;
fieldValueMap[fieldCode]
=
fieldValue;
}
}
if
(fieldValueMap['BENEFICIARY_ACCOUNT']
==
'216084872610001')
{
if
(fieldValueMap['BENEFICIARY_ACCOUNT']
==
'216084872610001')
{
att_import_bank_trx_bm.insert({
att_import_bank_trx_bm.insert({
'bank_receipt_date':
fieldValueMap['BANK_RECEIPT_DATE'],//回单时间
'bank_receipt_date':
fieldValueMap['BANK_RECEIPT_DATE'],//回单时间
'total_amount':
fieldValueMap['TOTAL_AMOUNT'],//收入金额
'total_amount':
fieldValueMap['TOTAL_AMOUNT'],//收入金额
'payer_bank':
fieldValueMap['PAYER_BANK'],//付款方银行
'payer_bank':
fieldValueMap['PAYER_BANK'],//付款方银行
'payer_number':
fieldValueMap['PAYER_ACCOUNT'],//付款方账户
'payer_number':
fieldValueMap['PAYER_ACCOUNT'],//付款方账户
'payer_name':
fieldValueMap['PAYER_NAME'],//付款方户名
'payer_name':
fieldValueMap['PAYER_NAME'],//付款方户名
'zy':
fieldValueMap['ZY'],//摘要
'zy':
fieldValueMap['ZY'],//摘要
'receipt_no':
fieldValueMap['DOC_CODE'].substring(4,
13),//回单编号
'receipt_no':
fieldValueMap['DOC_CODE'].substring(4,
13),//回单编号
'beneficiary_bank':
fieldValueMap['BENEFICIARY_BANK'],//收款方银行
'beneficiary_bank':
fieldValueMap['BENEFICIARY_BANK'],//收款方银行
'bank_num':
fieldValueMap['BENEFICIARY_ACCOUNT'],//收款方账户
'bank_num':
fieldValueMap['BENEFICIARY_ACCOUNT'],//收款方账户
'beneficiary_name':
fieldValueMap['BENEFICIARY_NAME'],//收款方户名
'beneficiary_name':
fieldValueMap['BENEFICIARY_NAME'],//收款方户名
//'receipt_no':
fieldValueMap['RECEIPT_NO'].substring(4,
13),
//'receipt_no':
fieldValueMap['RECEIPT_NO'].substring(4,
13),
'slip_batch_id':
record[0].SLIP_BATCH_ID,
'slip_batch_id':
record[0].SLIP_BATCH_ID,
});
});
}
}
}
}
}
else
{
}
else
{
println("=======有效期外======");
println("=======有效期外======");
var
token_get=
new
com.hand.hlcm.HttpPostUtil();
var
token_get=
new
com.hand.hlcm.HttpPostUtil();
var
data =
token_get.httpPostGetToken(posturl,
token_appid,
token_appsecret);
var
data =
token_get.httpPostGetToken(posturl,
token_appid,
token_appsecret);
println('
data =
' + data);
println('
data =
' + data);
var json = JSON.parse(data);
var json = JSON.parse(data);
var access_token = json.access_token;
var access_token = json.access_token;
println('
access_token =
' + access_token);
println('
access_token =
' + access_token);
//如果获取 access_token 成功,则 不会返回 status,即 status = undefined
//如果获取 access_token 成功,则 不会返回 status,即 status = undefined
var status = json.status;
var status = json.status;
println('
status =
' + status);
println('
status =
' + status);
if (access_token) {
if (access_token) {
token_savelogs_bm.insert({
token_savelogs_bm.insert({
'
json':
data,
'
json':
data,
'status':
'success'
'status':
'success'
});
});
//
这个
expires_in
是从
access_token
接口获取过来的数据
有效持续时间
//
这个
expires_in
是从
access_token
接口获取过来的数据
有效持续时间
token_savelogs_bm.update({
token_savelogs_bm.update({
'system_source':
'hlcm',
'system_source':
'hlcm',
'expires_in':
json.expires_in,
'expires_in':
json.expires_in,
'access_token':
access_token
'access_token':
access_token
});
});
}
}
if
(status)
{
if
(status)
{
//这里为什么一个
传
json,一个传
data,可能是一样的
//这里为什么一个
传
json,一个传
data,可能是一样的
var
token_savelogs_bm =
$bm('efile.EFILE1000.efile_get_token');
var
token_savelogs_bm =
$bm('efile.EFILE1000.efile_get_token');
token_savelogs_bm.insert({
token_savelogs_bm.insert({
'json':
data,
'json':
data,
'status':
'fail'
'status':
'fail'
});
});
}
}
logger.info('--------------------------------------------------------------------------------------------');
logger.info('--------------------------------------------------------------------------------------------');
var
SystokenQuery =
token_savelogs_bm.queryAsMap();
var
SystokenQuery =
token_savelogs_bm.queryAsMap();
var
access_token =
SystokenQuery.getChildren()[0].access_token;
var
access_token =
SystokenQuery.getChildren()[0].access_token;
var
files =
'{"startCreatedDate": '
+
'"'
+startdate
+'"'
var
files =
'{"startCreatedDate": '
+
'"'
+startdate
+'"'
+
',"endCreatedDate":'+
'"'
+enddate
+
'"'
+
',"endCreatedDate":'+
'"'
+enddate
+
'"'
+',"documentTypeCodeList":
'+'["receiptD"]}';
+',"documentTypeCodeList":
'+'["receiptD"]}';
access_token =
access_token;
access_token =
access_token;
var
request_files_n =
files
+
access_token
+
token_type
;
var
request_files_n =
files
+
access_token
+
token_type
;
var
request_files =
JSON.stringify(request_files_n);
var
request_files =
JSON.stringify(request_files_n);
var
token_type =
token_type;
var
token_type =
token_type;
var
page_number =
1;
var
page_number =
1;
if(
list=
=0){
if(
list=
=0){
//
说明当前没有发起查询,从第一页开始查
//
说明当前没有发起查询,从第一页开始查
page_number=
1;
page_number=
1;
}
else{
}
else{
if(record[0].RETURN_PAGE_SIZE
>
=record[0].PAGE_SIZE){
if(record[0].RETURN_PAGE_SIZE
>
=record[0].PAGE_SIZE){
page_number=record[0].PAGE_NUMBER+1;
page_number=record[0].PAGE_NUMBER+1;
}
}
else{
else{
page_number=record[0].PAGE_NUMBER;
page_number=record[0].PAGE_NUMBER;
}
}
};
};
var page = page_number;
var page = page_number;
var size = init_page_number;
var size = init_page_number;
var doc = "http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/documents/query?page=" + page +
var doc = "http://apistage.huilianyi.com/gateway/e-archives/api/open/v1/documents/query?page=" + page +
"
&size="+size;
"
&size="+size;
var docUrl = doc.toString();
var docUrl = doc.toString();
att_import_bank_bm.insert({
att_import_bank_bm.insert({
'start_date' : startdate,
'start_date' : startdate,
'end_date' : enddate,
'end_date' : enddate,
'request_json' : request_files,
'request_json' : request_files,
'page_number' : page_number,
'page_number' : page_number,
'request_url' : docUrl
'request_url' : docUrl
})
})
var bank_list_bm = $bm('efile.EFILE1100.get_bank_list');
var bank_list_bm = $bm('efile.EFILE1100.get_bank_list');
var parameter_code = starttime;
var parameter_code = starttime;
var response_json_list = bank_list_bm.queryAsMap({
var response_json_list = bank_list_bm.queryAsMap({
parameter_code: parameter_code
parameter_code: parameter_code
});
});
var list =response_json_list.getChildren().length;
var list =response_json_list.getChildren().length;
var record = response_json_list.getChildren();
var record = response_json_list.getChildren();
logger.info(typeof (record));
logger.info(typeof (record));
var doc_import=new com.hand.hlcm.HttpPostDocQuery();
var doc_import=new com.hand.hlcm.HttpPostDocQuery();
var data_result_n = doc_import.httpPostDocImport(docUrl,files,access_token,token_type);
var data_result_n = doc_import.httpPostDocImport(docUrl,files,access_token,token_type);
var json_data = JSON.parse(data_result_n);
var json_data = JSON.parse(data_result_n);
var statusCode = json_data.statusCode;
var statusCode = json_data.statusCode;
var message = json_data.message;
var message = json_data.message;
var total = json_data.total;
var total = json_data.total;
var result=json_data.result;
$ctx.parameter.page_number = page_number;
var result_list = result.length;
$ctx.parameter.total = total;
var return_page_size = JSON.stringify(result_list);
var result=json_data.result;
att_import_bank_bm.update({
var result_list = result.length;
var return_page_size = JSON.stringify(result_list);
att_import_bank_bm.update({
'code' : statusCode,
'code' : statusCode,
'message' : message,
'message' : message,
'response_json' : data_result_n,
'response_json' : data_result_n,
'return_page_size' : return_page_size,
'return_page_size' : return_page_size,
'page_size' : size,
'page_size' : size,
'slip_batch_id' : record[0].SLIP_BATCH_ID,
'slip_batch_id' : record[0].SLIP_BATCH_ID,
})
})
for (var i = 0; i
< result_list
;i++)
{
for (var i = 0; i
< result_list
;i++)
{
var
docFormFieldValueVOList =
result[i].docFormFieldValueVOList;
var
docFormFieldValueVOList =
result[i].docFormFieldValueVOList;
var
fieldValueMap =
{};
var
fieldValueMap =
{};
logger.info(docFormFieldValueVOList);
logger.info(docFormFieldValueVOList);
//
构建字段映射
//
构建字段映射
for
(var
j =
0;
j
<
docFormFieldValueVOList.length;
j++)
{
for
(var
j =
0;
j
<
docFormFieldValueVOList.length;
j++)
{
var
fieldCode =
docFormFieldValueVOList[j].fieldCode;
var
fieldCode =
docFormFieldValueVOList[j].fieldCode;
var
fieldValue =
docFormFieldValueVOList[j].fieldValue;
var
fieldValue =
docFormFieldValueVOList[j].fieldValue;
fieldValueMap[fieldCode]
=
fieldValue;
fieldValueMap[fieldCode]
=
fieldValue;
}
}
if
(fieldValueMap['BENEFICIARY_ACCOUNT']
==
'216084872610001')
{
if
(fieldValueMap['BENEFICIARY_ACCOUNT']
==
'216084872610001')
{
att_import_bank_trx_bm.insert({
att_import_bank_trx_bm.insert({
'bank_receipt_date':
fieldValueMap['BANK_RECEIPT_DATE'],//回单时间
'bank_receipt_date':
fieldValueMap['BANK_RECEIPT_DATE'],//回单时间
'total_amount':
fieldValueMap['TOTAL_AMOUNT'],//收入金额
'total_amount':
fieldValueMap['TOTAL_AMOUNT'],//收入金额
'payer_bank':
fieldValueMap['PAYER_BANK'],//付款方银行
'payer_bank':
fieldValueMap['PAYER_BANK'],//付款方银行
'payer_number':
fieldValueMap['PAYER_ACCOUNT'],//付款方账户
'payer_number':
fieldValueMap['PAYER_ACCOUNT'],//付款方账户
'payer_name':
fieldValueMap['PAYER_NAME'],//付款方户名
'payer_name':
fieldValueMap['PAYER_NAME'],//付款方户名
'zy':
fieldValueMap['ZY'],//摘要
'zy':
fieldValueMap['ZY'],//摘要
'receipt_no':
fieldValueMap['DOC_CODE'].substring(4,
13),//回单编号
'receipt_no':
fieldValueMap['DOC_CODE'].substring(4,
13),//回单编号
'beneficiary_bank':
fieldValueMap['BENEFICIARY_BANK'],//收款方银行
'beneficiary_bank':
fieldValueMap['BENEFICIARY_BANK'],//收款方银行
'bank_num':
fieldValueMap['BENEFICIARY_ACCOUNT'],//收款方账户
'bank_num':
fieldValueMap['BENEFICIARY_ACCOUNT'],//收款方账户
'beneficiary_name':
fieldValueMap['BENEFICIARY_NAME'],//收款方户名
'beneficiary_name':
fieldValueMap['BENEFICIARY_NAME'],//收款方户名
//'receipt_no':
fieldValueMap['RECEIPT_NO'].substring(4,
13),
//'receipt_no':
fieldValueMap['RECEIPT_NO'].substring(4,
13),
'slip_batch_id':
record[0].SLIP_BATCH_ID,
'slip_batch_id':
record[0].SLIP_BATCH_ID,
});
});
}
}
}
}catch
(e)
{
println('e:'
+
e);
}
if
(total/100
>
page_number){
var batch_id = record[0].SLIP_BATCH_ID;
logger.info('19981988');
logger.info(batch_id);
logger.info('19981988');
query_next_query(batch_id);
}
}
}
}
}
}catch
(e)
{
function main(){
println('e:'
+
e);
send_query();
}
}
]]
>
</s:server-script>
main();
</a:init-procedure>
<a:service-output
output=
"/parameter"
/>
]]>
</s:server-script>
</a:init-procedure>
<a:service-output
output=
"/parameter"
/>
</a:service>
</a:service>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment