Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
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
liqin
chnmuseum-party
Commits
f3d535dc
Commit
f3d535dc
authored
Apr 01, 2021
by
wzp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
e6644b21
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
48 deletions
+86
-48
SystemOperationLogService.java
...chnmuseum/party/common/log/SystemOperationLogService.java
+3
-2
AuditController.java
...nergy/chnmuseum/party/web/controller/AuditController.java
+78
-46
BaseController.java
...y/chnmuseum/party/web/controller/base/BaseController.java
+5
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/log/SystemOperationLogService.java
View file @
f3d535dc
...
...
@@ -15,6 +15,7 @@ import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
javassist.util.HotSwapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
...
...
@@ -60,7 +61,7 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
public
TUser
getCurAdmin
(
HttpServletRequest
request
)
{
String
header
=
request
.
getHeader
(
"Authorization"
);
if
(
StringUtils
.
isBlank
(
header
))
{
return
null
;
throw
new
AuthenticationException
(
"token失效,请重新登录"
)
;
}
String
username
=
JwtTokenUtil
.
getUsername
(
header
);
TUser
user
=
userService
.
selectByUsername
(
username
);
...
...
@@ -95,7 +96,7 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
}
catch
(
Exception
e
)
{
HashMap
<
Object
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"message"
,
"token失效"
);
resultMap
.
put
(
"message"
,
e
.
getMessage
()
);
return
resultMap
;
}
// if (user==null){
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AuditController.java
View file @
f3d535dc
...
...
@@ -66,6 +66,7 @@ public class AuditController extends BaseController {
public
Map
<
String
,
Object
>
getUserList
(
String
name
,
String
status
,
String
level
)
{
Page
<
Audit
>
auditList
;
try
{
TUser
user1
=
getcurUser
();
TUser
user
=
new
TUser
();
if
(
StringUtils
.
isNotBlank
(
name
))
{
user
.
setUserName
(
name
);
...
...
@@ -76,6 +77,12 @@ public class AuditController extends BaseController {
if
(
StringUtils
.
isNotBlank
(
level
))
{
user
.
setAuditStatus
(
level
);
}
//如果是账号禁用初审员,设置层级为初审
if
(
user1
.
getRoleList
().
contains
(
"15"
)){
user
.
setAuditStatus
(
AuditStatusEnum
.
TBC
.
name
());
}
else
{
user
.
setAuditStatus
(
AuditStatusEnum
.
TBCA
.
name
());
}
auditList
=
auditService
.
getUserList
(
getPage
(),
user
);
return
getResult
(
auditList
);
}
catch
(
Exception
e
)
{
...
...
@@ -149,48 +156,48 @@ public class AuditController extends BaseController {
return
getFailResult
();
}
@GetMapping
(
"/getList"
)
@RequiresPermissions
(
"/audit/getList"
)
@ApiOperation
(
value
=
"获取禁用审核全部列表(无分页)"
,
notes
=
"获取禁用审核全部列表(无分页)"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
getAuditList
(
@RequestParam
(
value
=
"auditStatus"
,
defaultValue
=
"APPROVED_FINAL"
,
required
=
false
)
AuditStatusEnum
auditStatus
)
{
List
<
Audit
>
auditList
=
auditService
.
list
();
return
getResult
(
auditList
);
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@PostMapping
(
"/getPageList"
)
@RequiresPermissions
(
"/audit/getPageList"
)
@ApiOperation
(
value
=
"获取禁用审核分页列表"
,
notes
=
"获取禁用审核分页列表"
)
public
Map
<
String
,
Object
>
getAuditPageList
(
GenericPageParam
genericPageParam
)
{
LambdaQueryWrapper
<
Audit
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(
Audit:
:
getContent
,
genericPageParam
.
getNameOrCode
());
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
queryWrapper
.
ge
(
Audit:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
.
le
(
Audit:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
}
// 设置排序规则
queryWrapper
.
orderByDesc
(
Audit:
:
getCreateTime
);
// 设置查询内容
queryWrapper
.
select
(
Audit:
:
getId
,
Audit:
:
getContent
,
Audit:
:
getCreateTime
);
Page
<
Audit
>
page
=
this
.
auditService
.
page
(
getPage
(),
queryWrapper
);
return
getResult
(
page
);
}
//
@GetMapping("/getList")
//
@RequiresPermissions("/audit/getList")
//
@ApiOperation(value = "获取禁用审核全部列表(无分页)", notes = "获取禁用审核全部列表(无分页)")
//
@ApiImplicitParams(value = {
//
@ApiImplicitParam(name = "auditStatus", value = "审核状态", paramType = "query", dataType = "String")
//
})
//
public Map<String, Object> getAuditList(@RequestParam(value = "auditStatus", defaultValue = "APPROVED_FINAL", required = false) AuditStatusEnum auditStatus) {
//
List<Audit> auditList = auditService.list();
//
return getResult(auditList);
//
}
//
//
@ApiImplicitParams(value = {
//
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
//
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
//
@ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
//
@ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
//
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
//
})
//
@PostMapping("/getPageList")
//
@RequiresPermissions("/audit/getPageList")
//
@ApiOperation(value = "获取禁用审核分页列表", notes = "获取禁用审核分页列表")
//
public Map<String, Object> getAuditPageList(GenericPageParam genericPageParam) {
//
LambdaQueryWrapper<Audit> queryWrapper = new LambdaQueryWrapper<>();
//
// 对名称或编码模糊查询
//
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
//
queryWrapper.like(Audit::getContent, genericPageParam.getNameOrCode());
//
}
//
// 根据创建时间区间检索
//
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
//
queryWrapper.ge(Audit::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
//
.le(Audit::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
//
}
//
// 设置排序规则
//
queryWrapper.orderByDesc(Audit::getCreateTime);
//
// 设置查询内容
//
queryWrapper.select(
//
Audit::getId,
//
Audit::getContent,
//
Audit::getCreateTime);
//
Page<Audit> page = this.auditService.page(getPage(), queryWrapper);
//
return getResult(page);
//
}
@ApiOperation
(
value
=
"获取禁用审核详情"
,
notes
=
"获取禁用审核详情"
)
@GetMapping
(
"/getById"
)
...
...
@@ -224,17 +231,42 @@ public class AuditController extends BaseController {
@ApiImplicitParam
(
name
=
"level"
,
value
=
"审核级别:TBC,TBCA"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"视频内容:ASSET,展板内容:EXHIBITION_BOARD,学习内容:LEARNING_CONTENT"
,
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
)
})
public
Map
<
String
,
Object
>
getPageAllList
(
String
name
,
String
status
,
@NotBlank
(
message
=
"level参数不能为空"
)
String
level
,
public
Map
<
String
,
Object
>
getPageAllList
(
String
name
,
String
status
,
String
level
,
@NotBlank
(
message
=
"type参数不能为空"
)
String
type
)
{
//分页
Page
<
Object
>
page
=
getPage
();
AuditStatusEnum
auditStatus
=
null
;
AuditStatusEnum
auditStatusLevel
=
AuditStatusEnum
.
valueOf
(
level
)
;
AuditStatusEnum
auditStatusLevel
=
null
;
AuditTypeEnum
auditTypeEnum
=
AuditTypeEnum
.
valueOf
(
type
);
TUser
user
=
getcurUser
();
switch
(
auditTypeEnum
){
case
ASSET:
if
(
user
.
getRoleList
().
contains
(
"9"
)){
auditStatusLevel
=
AuditStatusEnum
.
TBC
;
}
else
{
auditStatusLevel
=
AuditStatusEnum
.
TBCA
;
}
break
;
case
EXHIBITION_BOARD:
if
(
user
.
getRoleList
().
contains
(
"11"
)){
auditStatusLevel
=
AuditStatusEnum
.
TBC
;
}
else
{
auditStatusLevel
=
AuditStatusEnum
.
TBCA
;
}
break
;
case
LEARNING_CONTENT:
if
(
user
.
getRoleList
().
contains
(
"13"
)){
auditStatusLevel
=
AuditStatusEnum
.
TBC
;
}
else
{
auditStatusLevel
=
AuditStatusEnum
.
TBCA
;
}
break
;
}
if
(
auditTypeEnum
==
null
||
auditStatusLevel
==
null
)
{
return
getFailResult
(
"type
或level
参数不正确"
);
return
getFailResult
(
"type参数不正确"
);
}
if
(
StringUtils
.
isNotBlank
(
status
))
{
auditStatus
=
AuditStatusEnum
.
valueOf
(
status
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/base/BaseController.java
View file @
f3d535dc
...
...
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.alibaba.fastjson.serializer.SimplePropertyPreFilter
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -189,6 +190,8 @@ public class BaseController implements Serializable {
if
(
authorization
.
startsWith
(
"Bearer "
))
{
authorization
=
authorization
.
substring
(
7
);
}
}
else
{
throw
new
AuthenticationException
(
"token失效,请重新登录"
);
}
return
JwtTokenUtil
.
getEmployeeId
(
authorization
);
}
...
...
@@ -204,6 +207,8 @@ public class BaseController implements Serializable {
if
(
authorization
.
startsWith
(
"Bearer "
))
{
authorization
=
authorization
.
substring
(
7
);
}
}
else
{
throw
new
AuthenticationException
(
"token失效,请重新登录"
);
}
return
JwtTokenUtil
.
getUsername
(
authorization
);
}
...
...
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