Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-api
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tao.mo
2021-09-01 15:37:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1d164af5c0cf9402702d3ab7ed3661e8d4cc868
f1d164af
1 parent
cdea8fe4
任务后取token调整
mt 2021年9月1日15:35:49
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
45 deletions
src/main/java/com/erry/iclear/dateInterface/task/IClearApiTask.java
src/main/java/com/erry/iclear/dateInterface/task/IClearApiTask.java
View file @
f1d164a
...
...
@@ -25,20 +25,8 @@ public class IClearApiTask {
public
void
pushCustomsTask
(){
try
{
log
.
info
(
"pushCustomsTask start>>>>>>>>>>>>"
);
if
(
token
==
null
){
try
{
//获取token
TokenResult
tokenResult
=
apiService
.
getToken
();
if
(
tokenResult
.
getErrorcode
().
equals
(
Constants
.
ApiResponseKeys
.
SUCCESS
)){
this
.
token
=
tokenResult
.
getData
().
getToken
();
}
}
catch
(
Exception
ex
){
ex
.
printStackTrace
();
}
}
if
(
this
.
token
==
null
){
throw
new
Exception
(
"获取token失败!"
);
}
getToken
();
//获取token成功则进行海关回执推送
apiService
.
pushCustoms
(
this
.
token
);
log
.
info
(
"pushCustomsTask end>>>>>>>>>>>>"
);
...
...
@@ -54,20 +42,8 @@ public class IClearApiTask {
public
void
pushMawbTask
(){
try
{
log
.
info
(
"pushMawbTask start>>>>>>>>>>>>"
);
if
(
token
==
null
){
try
{
//获取token
TokenResult
tokenResult
=
apiService
.
getToken
();
if
(
tokenResult
.
getErrorcode
().
equals
(
Constants
.
ApiResponseKeys
.
SUCCESS
)){
this
.
token
=
tokenResult
.
getData
().
getToken
();
}
}
catch
(
Exception
ex
){
ex
.
printStackTrace
();
}
}
if
(
this
.
token
==
null
){
throw
new
Exception
(
"获取token失败!"
);
}
getToken
();
//获取token成功则进行海关回执推送
apiService
.
pushMawb
(
this
.
token
);
log
.
info
(
"pushMawbTask end>>>>>>>>>>>>"
);
...
...
@@ -82,20 +58,8 @@ public class IClearApiTask {
public
void
pushErrorReturnDate
(){
try
{
log
.
info
(
"pushErrorReturnDate start>>>>>>>>>>>>"
);
if
(
token
==
null
){
try
{
//获取token
TokenResult
tokenResult
=
apiService
.
getToken
();
if
(
tokenResult
.
getErrorcode
().
equals
(
Constants
.
ApiResponseKeys
.
SUCCESS
)){
this
.
token
=
tokenResult
.
getData
().
getToken
();
}
}
catch
(
Exception
ex
){
ex
.
printStackTrace
();
}
}
if
(
this
.
token
==
null
){
throw
new
Exception
(
"获取token失败!"
);
}
getToken
();
//获取token成功则进行海关回执推送
apiService
.
pushErrorReturnDate
(
this
.
token
);
log
.
info
(
"pushErrorReturnDate end>>>>>>>>>>>>"
);
...
...
@@ -110,6 +74,21 @@ public class IClearApiTask {
public
void
pushErrorData
(){
try
{
log
.
info
(
"pushErrorDeclareDate start>>>>>>>>>>>>"
);
//获取token
getToken
();
//获取token成功则进行海关回执推送
apiService
.
pushErrorDeclareDate
(
this
.
token
);
log
.
info
(
"pushErrorDeclareDate end>>>>>>>>>>>>"
);
}
catch
(
Exception
e
){
log
.
error
(
"pushErrorDeclareDate() error:"
+
e
.
getMessage
());
}
}
/**
* 获取token
* @throws Exception
*/
private
void
getToken
()
throws
Exception
{
if
(
token
==
null
){
try
{
//获取token
...
...
@@ -124,11 +103,5 @@ public class IClearApiTask {
if
(
this
.
token
==
null
){
throw
new
Exception
(
"获取token失败!"
);
}
//获取token成功则进行海关回执推送
apiService
.
pushErrorDeclareDate
(
this
.
token
);
log
.
info
(
"pushErrorDeclareDate end>>>>>>>>>>>>"
);
}
catch
(
Exception
e
){
log
.
error
(
"pushErrorDeclareDate() error:"
+
e
.
getMessage
());
}
}
}
...
...
Please
register
or
login
to post a comment