Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
QianQiXiang
haoban-manage3.0
Commits
829f764b
Commit
829f764b
authored
Jul 05, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审核鬓发控制
parent
bcbf3560
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+11
-9
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+7
-2
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
829f764b
...
@@ -207,20 +207,22 @@ public class AuditController extends WebBaseController{
...
@@ -207,20 +207,22 @@ public class AuditController extends WebBaseController{
if
(
null
==
loginStaffDTO
)
{
if
(
null
==
loginStaffDTO
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
return
resultResponse
(
HaoBanErrCode
.
ERR_4
);
}
}
Object
o
=
RedisUtil
.
getCache
(
"audit-"
+
auditId
);
if
(
o
!=
null
){
log
.
info
(
"请不要过于频繁点击"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10008
);
}
//设置缓存10秒
RedisUtil
.
setCache
(
"audit-"
+
auditId
,
"1"
,
10L
);
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffId
=
login
.
getStaffDTO
().
getStaffId
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
String
staffName
=
login
.
getStaffDTO
().
getStaffName
();
if
(
StringUtils
.
isAnyBlank
(
auditId
)){
if
(
StringUtils
.
isAnyBlank
(
auditId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
result
=
auditApiService
.
audit
(
""
,
auditId
,
staffName
,
staffId
);
String
key
=
"audit-"
+
auditId
;
if
(
StringUtils
.
isEmpty
(
result
)){
RedisUtil
.
lock
(
key
,
10L
);
AuditDTO
audit
=
auditApiService
.
findById
(
auditId
);
if
(
audit
==
null
||
audit
.
getAuditStatus
()
!=
0
)
{
RedisUtil
.
unlock
(
key
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10017
);
}
String
result
=
auditApiService
.
audit
(
""
,
auditId
,
staffName
,
staffId
);
RedisUtil
.
unlock
(
key
);
if
(
StringUtils
.
isEmpty
(
result
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
else
{
}
else
{
HaoBanErrCode
errCode
=
HaoBanErrCode
.
ERR_DEFINE
;
HaoBanErrCode
errCode
=
HaoBanErrCode
.
ERR_DEFINE
;
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
829f764b
...
@@ -6,6 +6,7 @@ import java.util.List;
...
@@ -6,6 +6,7 @@ import java.util.List;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -192,9 +193,12 @@ public class AuditController extends WebBaseController{
...
@@ -192,9 +193,12 @@ public class AuditController extends WebBaseController{
if
(
auditStatus
==
null
){
if
(
auditStatus
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
String
key
=
"audit-"
+
auditId
;
RedisUtil
.
lock
(
key
,
10L
);
AuditDTO
audit
=
auditApiService
.
findById
(
auditId
);
AuditDTO
audit
=
auditApiService
.
findById
(
auditId
);
if
(
audit
==
null
){
if
(
audit
==
null
||
audit
.
getAuditStatus
()
!=
0
)
{
RedisUtil
.
unlock
(
key
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10017
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10017
);
}
}
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
...
@@ -282,6 +286,7 @@ public class AuditController extends WebBaseController{
...
@@ -282,6 +286,7 @@ public class AuditController extends WebBaseController{
audit
.
setAuditStatus
(
3
);
audit
.
setAuditStatus
(
3
);
}
}
auditApiService
.
update
(
audit
);
auditApiService
.
update
(
audit
);
RedisUtil
.
unlock
(
key
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
...
...
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