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
8ec14f8f
Commit
8ec14f8f
authored
Apr 07, 2023
by
TIANZHI.HU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
农行回单初始化调整 add by 39135 HuTianzhi
parent
2ae5bbdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
30 deletions
+31
-30
HttpPostDocQuery.java
src/main/java/com/hand/hlcm/HttpPostDocQuery.java
+1
-1
efile_doc_import.lsc
src/main/webapp/modules/efile/EFILE1100/efile_doc_import.lsc
+30
-29
No files found.
src/main/java/com/hand/hlcm/HttpPostDocQuery.java
View file @
8ec14f8f
...
...
@@ -15,7 +15,7 @@ public class HttpPostDocQuery {
postMethod
.
setRequestHeader
(
"Authorization"
,
token
);
entity
=
new
StringRequestEntity
(
data
,
"application/json"
,
"UTF-8"
);
postMethod
.
setRequestEntity
(
entity
);
System
.
out
.
println
(
data
);
//
System.out.println(data);
httpClient
.
executeMethod
(
postMethod
);
String
result
=
postMethod
.
getResponseBodyAsString
();
return
result
;
...
...
src/main/webapp/modules/efile/EFILE1100/efile_doc_import.lsc
View file @
8ec14f8f
<?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"
trace=
"true"
>
<a:init-procedure>
<s:server-script
import=
"token_record.js
;file_query.js
"
>
<![CDATA[
<s:server-script
import=
"token_record.js"
>
<![CDATA[
importPackage(java.io);
importPackage(java.util);
importPackage(Packages.com.hand.hlcm);
importPackage(Packages.com.hand.hlcm);
var startdate = '2022-04-01 12:30:00';
var enddate = '2023-04-01 12:30:00';
try {
var sys_url_bm = $bm('cont.CON4000.get_sys_url');
var parameter_code = 'TOKEN_POSTURL';
...
...
@@ -24,57 +27,59 @@
var token_appsecret = SysappsecretQuery.getChildren()[0].parameter_value;
var parameter_code = 'FILE_QUERY_URL';
var FileQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var docUrl = FileQuery.getChildren()[0].parameter_value;
var parameter_code = 'FILE_QUERY_URL';
var FileQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var docUrl = FileQuery.getChildren()[0].parameter_value;
var token_savelogs_bm = $bm('efile.EFILE1000.efile_get_token');
//token是否在有效期内,在有效期内直接获取表中的token
var check_token_valid_bm = $bm('efile.EFILE1000.check_token_valid');
var checkTokenQuery = check_token_valid_bm.queryAsMap();
var is_valid = checkTokenQuery.getChildren()[0].is_valid;
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 doc_data=[];
var startdate = '2022-04-01 12:30:00';
var enddate = '2022-07-01 12:30:00';
var files = '{"startCreatedDate": ' + '"' +startdate +'"'
+ ',"endCreatedDate":'+ '"' +enddate + '"'
+',"documentTypeCodeList": '+'["类型code
1","类型code2","类型code
3"]}';
+',"documentTypeCodeList": '+'["类型code3"]}';
access_token_n = 'Bearer'+ access_token;
println('access_token_n' + access_token_n);
println('access_token_n
=
' + access_token_n);
var data_result_n = HttpPostDocQuery.httpPostDocImport(docUrl,files,access_token_n);
println(22333333);
println('请求资料的结果:');
println('data_result_n = ' + data_result_n);
var json_data = JSON.parse(data_result_n);
var statusCode =json_data.statusCode;
var message =json_data.message;
} else {
println("=======有效期外======");
var data = httpPostGetToken(posturl, token_appid, token_appsecret);
println(
data);
println('data = ' +
data);
var json = JSON.parse(data);
var access_token = json.access_token;
println('access_token = ' + access_token);
//如果获取 access_token 成功,则 不会返回 status,即 status = undefined
var status = json.status;
println('status = ' + status);
if (access_token) {
token_savelogs_bm.insert({
'json': data,
'status': 'success'
})
})
;
// 这个 expires_in 是从 access_token 接口获取过来的数据 有效持续时间
token_savelogs_bm.update({
'system_source': 'hlcm',
'expires_in': json.expires_in,
'access_token': access_token
})
});
}
if (status) {
//这里为什么一个 传 json,一个传 data,可能是一样的
var token_savelogs_bm = $bm('efile.EFILE1000.token_savelogs');
token_savelogs_bm.insert({
'json': json,
...
...
@@ -82,23 +87,19 @@
});
}
var doc_data=[];
var startdate = '2022-04-01 12:30:00';
var enddate = '2022-07-01 12:30:00';
var files = '{"startCreatedDate": ' + '"' +startdate +'"'
+ ',"endCreatedDate":'+ '"' +enddate + '"'
+',"documentTypeCodeList": '+'["类型code
1","类型code2","类型code
3"]}';
+',"documentTypeCodeList": '+'["类型code3"]}';
access_token_n = 'Bearer'+ access_token;
println('access_token_n' + access_token_n);
println('access_token_n
=
' + access_token_n);
var data_result_n = HttpPostDocQuery.httpPostDocImport(docUrl,files,access_token_n);
println(22333333);
println('请求资料的结果:');
println('data_result_n = ' + data_result_n);
var json_data = JSON.parse(data_result_n);
var statusCode =json_data.statusCode;
var message =json_data.message;
println('data_result_n = ' + data_result_n);
println('data_result_n = ' + data_result_n);
}
}
} catch (e) {
println('e:' + e);
...
...
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