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
2023-06-09 15:03:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5ba41a55f42d2381b7b35a7a33a54fd74ac64563
5ba41a55
1 parent
433a7946
增加公章图样接口需求
mt 2023年6月9日15:02:56
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
24 deletions
doc/FedEx在线申报系统API - iKnowU.docx
src/main/java/com/erry/iclear/dateInterface/api/IKnowUInterface.java
src/main/java/com/erry/iclear/dateInterface/api/response/StampResult.java
doc/FedEx在线申报系统API - iKnowU.docx
View file @
5ba41a5
No preview for this file type
src/main/java/com/erry/iclear/dateInterface/api/IKnowUInterface.java
View file @
5ba41a5
...
...
@@ -2,6 +2,7 @@ package com.erry.iclear.dateInterface.api;
import
com.erry.iclear.dateInterface.api.request.HsCodeParam
;
import
com.erry.iclear.dateInterface.api.response.ResultHsCode
;
import
com.erry.iclear.dateInterface.api.response.StampResult
;
import
com.erry.iclear.dateInterface.entity.IClearApiHsCodeLog
;
import
com.erry.iclear.dateInterface.enums.ErrorCodeEnum
;
import
com.erry.iclear.dateInterface.service.HsCodeService
;
...
...
@@ -33,47 +34,31 @@ public class IKnowUInterface {
@ApiOperation
(
value
=
"抠图后的公章查询"
,
httpMethod
=
"POST"
,
notes
=
"ex: http://192.168.1.71:8080/iknowU/stampQuery"
)
@PostMapping
(
"/stampQuery"
)
@ResponseBody
public
ResultHsCode
stampQuery
(
HttpServletRequest
request
public
StampResult
stampQuery
(
HttpServletRequest
request
,
@RequestBody
String
consignmentCode
)
{
log
.
info
(
"接收到请求数据
hsc
ode:【"
+
consignmentCode
+
"】"
);
log
.
info
(
"接收到请求数据
consignmentC
ode:【"
+
consignmentCode
+
"】"
);
String
appId
=
(
String
)
request
.
getHeader
(
"Appid"
);
String
appkey
=
(
String
)
request
.
getHeader
(
"Appkey"
);
IClearApiHsCodeLog
iclearApiHsCodeLog
=
new
IClearApiHsCodeLog
();
ResultHsCode
resultHsCode
=
null
;
StampResult
stampResult
=
null
;
long
begin
=
System
.
currentTimeMillis
();
try
{
iclearApiHsCodeLog
.
setAppId
(
appId
);
iclearApiHsCodeLog
.
setAppKey
(
appkey
);
iclearApiHsCodeLog
.
setCreateTime
(
new
Date
());
iclearApiHsCodeLog
.
setCode
(
consignmentCode
);
if
(!
StringUtil
.
isEmpty
(
consignmentCode
))
{
resultHsCode
=
hsCodeService
.
findHsCodeListByCode
(
consignmentCode
);
return
resultHsCode
;
}
else
{
//如果没有传hscode需要限制10分钟只能查询一次
boolean
rs
=
iClearApiHsCodeLogService
.
findIClearApiHsCodeLog
(
appId
);
if
(
rs
==
true
){
resultHsCode
=
new
ResultHsCode
(
Boolean
.
FALSE
,
ErrorCodeEnum
.
ERROR_10019
.
getCode
(),
ErrorCodeEnum
.
ERROR_10019
.
getName
(),
null
);
}
else
{
resultHsCode
=
hsCodeService
.
findAllHsCodeList
();
}
return
resultHsCode
;
}
}
catch
(
Exception
ex
){
log
.
error
(
ex
.
getMessage
(),
ex
);
resultHsCode
=
new
ResultHsCode
(
Boolean
.
FALSE
,
ErrorCodeEnum
.
ERROR_30101
.
getCode
(),
ErrorCodeEnum
.
ERROR_30101
.
getName
(),
null
);
return
resultHsCode
;
stampResult
=
new
StampResult
(
Boolean
.
FALSE
,
ErrorCodeEnum
.
ERROR_30101
.
getCode
(),
ErrorCodeEnum
.
ERROR_30101
.
getName
(),
null
);
return
stampResult
;
}
finally
{
iclearApiHsCodeLog
.
setReceiveResult
(
resultHsCode
.
getMsg
());
iclearApiHsCodeLog
.
setErrorCode
(
resultHsCode
.
getCode
());
iclearApiHsCodeLog
.
setReceiveResult
(
stampResult
.
getMsg
());
iclearApiHsCodeLog
.
setErrorCode
(
stampResult
.
getCode
());
iclearApiHsCodeLog
.
setResponseTime
(
new
Date
());
long
end
=
System
.
currentTimeMillis
();
iclearApiHsCodeLog
.
setSpendTime
(
end
-
begin
);
//如果异常为hscode长度超过2000,将截取0到2000字符
if
(
resultHsCode
.
getCode
().
equals
(
ErrorCodeEnum
.
ERROR_30102
.
getCode
())){
iclearApiHsCodeLog
.
setCode
(
consignmentCode
.
substring
(
0
,
2000
));
}
iClearApiHsCodeLogService
.
saveIClearApiHsCodeLog
(
iclearApiHsCodeLog
);
}
return
stampResult
;
}
}
...
...
src/main/java/com/erry/iclear/dateInterface/api/response/StampResult.java
View file @
5ba41a5
...
...
@@ -17,4 +17,6 @@ public class StampResult implements Serializable {
private
String
code
;
//错误信息
private
String
msg
;
//公章图样base64位字符
private
String
base64Image
;
}
...
...
Please
register
or
login
to post a comment