Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
Details
Activity
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
吴迪
gs1-office-web-sit
Commits
fb2683f3
Commit
fb2683f3
authored
Jan 19, 2022
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】添加查询限制
parent
de31818e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletions
+21
-1
GLNController.java
...va/io/office/modules/manage/controller/GLNController.java
+21
-1
No files found.
src/main/java/io/office/modules/manage/controller/GLNController.java
View file @
fb2683f3
...
...
@@ -114,6 +114,13 @@ public class GLNController {
@Login
@PostMapping
(
"/api/domesticCode"
)
public
R
domesticCode
(
@RequestBody
DomesticCodeVo
domesticCodeVo
,
HttpServletRequest
request
)
{
if
(
StringUtils
.
isBlank
(
domesticCodeVo
.
getCode
()))
{
return
R
.
error
(
"请输入查询条件!"
);
}
boolean
captcha
=
sysCaptchaService
.
validate
(
domesticCodeVo
.
getUuid
(),
domesticCodeVo
.
getCaptcha
());
if
(!
captcha
){
return
R
.
error
(
"验证码不正确"
);
...
...
@@ -132,7 +139,11 @@ public class GLNController {
searchgtinlogEntity
.
setSearchsource
(
0
);
//新增查询日志
searchgtinlogService
.
save
(
searchgtinlogEntity
);
//校验是否开启
String
searchLimitStr
=
searchLimitUtil
.
checkSearchLimit
(
request
,
searchgtinlogEntity
.
getClassStr
());
if
(
StringUtils
.
isNotBlank
(
searchLimitStr
))
{
return
R
.
error
(
searchLimitStr
);
}
if
(
domesticCodeVo
.
getType
().
equals
(
"1"
))
{
DomesticCodeResponse
infoByCode
=
ESSearchUtils
.
getInfoByCode
(
searchgtinlogEntity
.
getKeyword
());
if
(
infoByCode
!=
null
)
{
...
...
@@ -228,6 +239,10 @@ public class GLNController {
@RequestMapping
(
"/api/domesticCodeProductionNews"
)
public
R
domesticCodeProductionNews
(
@RequestBody
DomesticCodeVo
domesticCodeVo
,
HttpServletRequest
request
)
{
if
(
StringUtils
.
isBlank
(
domesticCodeVo
.
getCode
()))
{
return
R
.
error
(
"请输入查询条件!"
);
}
if
(
StringUtils
.
isNotBlank
(
domesticCodeVo
.
getCode
()))
{
if
(
domesticCodeVo
.
getCode
().
length
()<
13
)
{
return
R
.
error
(
"商品条码卡位数太少!请输入正确的13位或14位商品条码!"
);
...
...
@@ -241,6 +256,11 @@ public class GLNController {
searchgtinlogEntity
.
setSearchsource
(
0
);
//新增查询日志
searchgtinlogService
.
save
(
searchgtinlogEntity
);
//校验是否开启
String
searchLimitStr
=
searchLimitUtil
.
checkSearchLimit
(
request
,
searchgtinlogEntity
.
getClassStr
());
if
(
StringUtils
.
isNotBlank
(
searchLimitStr
))
{
return
R
.
error
(
searchLimitStr
);
}
String
urlMac
=
"/AAQI/v1/ProductData/gtin/${code}?targetMarket=156&dataVersion=1.1&clientGln=6901234503814"
;
String
macStr
=
MacUtils
.
getMac
(
urlMac
.
replaceAll
(
"\\$\\{code\\}"
,
domesticCodeVo
.
getCode
()));
...
...
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