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
8be94c8c
Commit
8be94c8c
authored
Jan 19, 2022
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】查询限制
parent
5cfdc283
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
BikefirmController.java
.../office/modules/manage/controller/BikefirmController.java
+20
-1
GlossaryController.java
.../office/modules/manage/controller/GlossaryController.java
+9
-1
ShortCodeController.java
...office/modules/manage/controller/ShortCodeController.java
+8
-0
No files found.
src/main/java/io/office/modules/manage/controller/BikefirmController.java
View file @
8be94c8c
...
...
@@ -3,15 +3,18 @@ package io.office.modules.manage.controller;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
io.office.common.utils.IPUtils
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.SearchgtinlogEntity
;
import
io.office.modules.manage.service.SearchgtinlogService
;
import
io.office.modules.manage.utils.SearchLimitUtil
;
import
io.office.modules.manage.vo.request.BikeFirmVo
;
import
io.office.modules.manage.vo.request.DomesticCodeDetailRequest
;
import
io.office.modules.sys.service.SysCaptchaService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -42,6 +45,8 @@ public class BikefirmController {
private
SysCaptchaService
sysCaptchaService
;
@Autowired
private
SearchgtinlogService
searchgtinlogService
;
@Autowired
private
SearchLimitUtil
searchLimitUtil
;
/**
* 列表
...
...
@@ -103,6 +108,11 @@ public class BikefirmController {
@Login
@PostMapping
(
"/api/getBikeFirm"
)
public
R
getBikeFirm
(
@RequestBody
BikeFirmVo
bikeFirmVo
,
HttpServletRequest
request
)
{
if
(
StringUtils
.
isBlank
(
bikeFirmVo
.
getCode
())
&&
StringUtils
.
isBlank
(
bikeFirmVo
.
getFirmName
()))
{
return
R
.
error
(
"请输入查询条件!"
);
}
boolean
captcha
=
sysCaptchaService
.
validate
(
bikeFirmVo
.
getUuid
(),
bikeFirmVo
.
getCaptcha
());
if
(!
captcha
)
{
return
R
.
error
(
"验证码不正确"
);
...
...
@@ -127,8 +137,17 @@ public class BikefirmController {
searchgtinlogEntity
.
setSearchsource
(
0
);
//新增查询日志
searchgtinlogService
.
save
(
searchgtinlogEntity
);
//校验是否开启
String
searchLimitStr
=
searchLimitUtil
.
checkSearchLimit
(
request
,
searchgtinlogEntity
.
getClassStr
());
if
(
StringUtils
.
isNotBlank
(
searchLimitStr
))
{
return
R
.
error
(
searchLimitStr
);
}
return
R
.
ok
().
put
(
"data"
,
bikefirmService
.
getBikeFirm
(
bikeFirmVo
));
List
<
BikeFirmVo
>
bikeFirm
=
bikefirmService
.
getBikeFirm
(
bikeFirmVo
);
if
(
CollectionUtils
.
isEmpty
(
bikeFirm
))
{
return
R
.
error
(
"没有符合条件的记录!"
);
}
return
R
.
ok
().
put
(
"data"
,
bikeFirm
);
}
...
...
src/main/java/io/office/modules/manage/controller/GlossaryController.java
View file @
8be94c8c
...
...
@@ -18,6 +18,7 @@ import io.office.modules.manage.vo.request.TopicNewsPartyRequestVo;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.service.SysCaptchaService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -120,6 +121,9 @@ public class GlossaryController extends AbstractController {
public
R
terminology
(
@RequestBody
TerminologyVo
terminologyVo
,
HttpServletRequest
request
)
{
try
{
if
(
StringUtils
.
isBlank
(
terminologyVo
.
getKeyword
()))
{
return
R
.
error
(
"请输入查询条件!"
);
}
boolean
captcha
=
sysCaptchaService
.
validate
(
terminologyVo
.
getUuid
(),
terminologyVo
.
getCaptcha
());
if
(!
captcha
){
return
R
.
error
(
"验证码不正确"
);
...
...
@@ -150,7 +154,11 @@ public class GlossaryController extends AbstractController {
searchgtinlogEntity
.
setSearchsource
(
0
);
//新增查询日志
searchgtinlogService
.
save
(
searchgtinlogEntity
);
return
R
.
ok
().
put
(
"data"
,
glossaryService
.
list
(
queryWrapper
));
List
<
GlossaryEntity
>
list
=
glossaryService
.
list
(
queryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
R
.
error
(
"没有符合条件的记录!"
);
}
return
R
.
ok
().
put
(
"data"
,
list
);
}
catch
(
Exception
e
)
{
log
.
error
(
"get4PartyTopNews error: {}"
,
e
);
return
R
.
error
(
e
.
getMessage
());
...
...
src/main/java/io/office/modules/manage/controller/ShortCodeController.java
View file @
8be94c8c
...
...
@@ -11,6 +11,7 @@ import io.office.modules.manage.entity.SearchgtinlogEntity;
import
io.office.modules.manage.entity.ShortCodeEntity
;
import
io.office.modules.manage.service.SearchgtinlogService
;
import
io.office.modules.manage.service.ShortCodeService
;
import
io.office.modules.manage.utils.SearchLimitUtil
;
import
io.office.modules.manage.vo.request.ShortCodeVo
;
import
io.office.modules.sys.service.SysCaptchaService
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -44,6 +45,8 @@ public class ShortCodeController {
@Autowired
private
SysCaptchaService
sysCaptchaService
;
@Autowired
private
SearchLimitUtil
searchLimitUtil
;
/**
* 列表
...
...
@@ -144,6 +147,11 @@ public class ShortCodeController {
searchgtinlogEntity
.
setSearchsource
(
0
);
//新增查询日志
searchgtinlogService
.
save
(
searchgtinlogEntity
);
//校验是否开启
String
searchLimitStr
=
searchLimitUtil
.
checkSearchLimit
(
request
,
searchgtinlogEntity
.
getClassStr
());
if
(
StringUtils
.
isNotBlank
(
searchLimitStr
))
{
return
R
.
error
(
searchLimitStr
);
}
return
R
.
ok
().
put
(
"data"
,
shortCodeService
.
getList
(
shortCodeVo
));
}
...
...
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