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
19d9f89e
Commit
19d9f89e
authored
Aug 08, 2024
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】点击区间时间范围
parent
935101cc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
GLNOutController.java
...io/office/modules/manage/controller/GLNOutController.java
+16
-3
No files found.
src/main/java/io/office/modules/manage/controller/GLNOutController.java
View file @
19d9f89e
...
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import
io.office.common.utils.IPUtils
;
import
io.office.common.utils.IPUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.common.utils.R
;
import
io.office.common.utils.RedisUtils
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.SearchgtinlogEntity
;
import
io.office.modules.manage.entity.SearchgtinlogEntity
;
import
io.office.modules.manage.service.SearchgtinlogService
;
import
io.office.modules.manage.service.SearchgtinlogService
;
...
@@ -50,6 +51,8 @@ public class GLNOutController {
...
@@ -50,6 +51,8 @@ public class GLNOutController {
private
SearchgtinlogService
searchgtinlogService
;
private
SearchgtinlogService
searchgtinlogService
;
@Autowired
@Autowired
private
SearchLimitUtil
searchLimitUtil
;
private
SearchLimitUtil
searchLimitUtil
;
@Autowired
private
RedisUtils
redisUtils
;
/**
/**
* 境外条码查询--验证产品--通过GTIN查询
* 境外条码查询--验证产品--通过GTIN查询
...
@@ -60,7 +63,7 @@ public class GLNOutController {
...
@@ -60,7 +63,7 @@ public class GLNOutController {
*/
*/
@Login
@Login
@RequestMapping
(
"/api/verified"
)
@RequestMapping
(
"/api/verified"
)
public
R
verified
(
@RequestBody
VbgOutVerifiedVo
vo
,
HttpServletRequest
request
)
{
public
R
verified
(
@RequestBody
VbgOutVerifiedVo
vo
,
HttpServletRequest
request
)
throws
InterruptedException
{
if
(
StringUtils
.
isBlank
(
vo
.
getGtin
()))
{
if
(
StringUtils
.
isBlank
(
vo
.
getGtin
()))
{
return
R
.
error
(
"请输入GTIN"
);
return
R
.
error
(
"请输入GTIN"
);
}
}
...
@@ -70,15 +73,25 @@ public class GLNOutController {
...
@@ -70,15 +73,25 @@ public class GLNOutController {
if
(
vo
.
getGtin
().
length
()
==
13
)
{
if
(
vo
.
getGtin
().
length
()
==
13
)
{
vo
.
setGtin
(
"0"
+
vo
.
getGtin
());
vo
.
setGtin
(
"0"
+
vo
.
getGtin
());
}
}
if
(!
sysCaptchaService
.
validate
(
vo
.
getUuid
(),
vo
.
getCaptcha
()))
{
return
R
.
error
(
"验证码不正确"
);
//使用redis缓存,做一次接口校验,
String
verified
=
redisUtils
.
get
(
"verified"
);
if
(
StringUtils
.
isNotBlank
(
verified
))
{
return
R
.
error
(
"当前访问人数过多!请换个时间尝试"
);
}
else
{
redisUtils
.
set
(
"verified"
,
"1"
,
1
/
2
);
}
}
SearchgtinlogEntity
searchgtinlogEntity
=
new
SearchgtinlogEntity
();
SearchgtinlogEntity
searchgtinlogEntity
=
new
SearchgtinlogEntity
();
searchgtinlogEntity
.
setCreatedate
(
new
Date
());
searchgtinlogEntity
.
setCreatedate
(
new
Date
());
searchgtinlogEntity
.
setIp
(
IPUtils
.
getIpAddr
(
request
));
searchgtinlogEntity
.
setIp
(
IPUtils
.
getIpAddr
(
request
));
searchgtinlogEntity
.
setClassStr
(
"境外条码查询验证产品"
);
searchgtinlogEntity
.
setClassStr
(
"境外条码查询验证产品"
);
searchgtinlogEntity
.
setKeyword
(
vo
.
getGtin
());
searchgtinlogEntity
.
setKeyword
(
vo
.
getGtin
());
searchgtinlogEntity
.
setSearchsource
(
0
);
searchgtinlogEntity
.
setSearchsource
(
0
);
//校验是否开启
//校验是否开启
String
searchLimitStr
=
searchLimitUtil
.
checkSearchLimit
(
request
,
searchgtinlogEntity
.
getClassStr
());
String
searchLimitStr
=
searchLimitUtil
.
checkSearchLimit
(
request
,
searchgtinlogEntity
.
getClassStr
());
if
(
StringUtils
.
isNotBlank
(
searchLimitStr
))
{
if
(
StringUtils
.
isNotBlank
(
searchLimitStr
))
{
...
...
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