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
79fdc4b4
Commit
79fdc4b4
authored
Mar 26, 2021
by
wzp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交审核管理
parent
ba85d253
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
517 additions
and
33 deletions
+517
-33
MysqlGenerator.java
...energy/chnmuseum/party/common/mybatis/MysqlGenerator.java
+1
-1
AuditMapper.java
...java/cn/wisenergy/chnmuseum/party/mapper/AuditMapper.java
+22
-0
Audit.java
src/main/java/cn/wisenergy/chnmuseum/party/model/Audit.java
+112
-0
AuditService.java
...va/cn/wisenergy/chnmuseum/party/service/AuditService.java
+18
-0
AuditServiceImpl.java
...energy/chnmuseum/party/service/impl/AuditServiceImpl.java
+35
-0
TOrganServiceImpl.java
...nergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
+29
-2
AuditController.java
...nergy/chnmuseum/party/web/controller/AuditController.java
+191
-0
TUserController.java
...nergy/chnmuseum/party/web/controller/TUserController.java
+62
-30
AuditMapper.xml
src/main/resources/mapper/AuditMapper.xml
+47
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/mybatis/MysqlGenerator.java
View file @
79fdc4b4
...
...
@@ -5,7 +5,7 @@ public class MysqlGenerator {
private
static
final
String
[]
tableNames
=
new
String
[]{
"learning_content_board"
};
//
private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
//
private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
private
static
final
String
projectPath
=
"/opt/ss"
;
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/cn/wisenergy/chnmuseum/party/mapper/AuditMapper.java
0 → 100644
View file @
79fdc4b4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.data.querydsl.QPageRequest
;
import
java.util.List
;
/**
* <pre>
* 学习内容信息 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-03-26
*/
public
interface
AuditMapper
extends
BaseMapper
<
Audit
>
{
List
<
Audit
>
getUserList
(
Page
<
Audit
>
page
,
@Param
(
"name"
)
String
name
,
@Param
(
"status"
)
Integer
status
);
}
src/main/java/cn/wisenergy/chnmuseum/party/model/Audit.java
0 → 100644
View file @
79fdc4b4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.Version
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
com.baomidou.mybatisplus.annotation.TableField
;
/**
* <p>
* 学习内容信息
* </p>
*
* @author Danny Lee
* @since 2021-03-26
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"t_audit"
)
@ApiModel
(
value
=
"学习内容信息"
,
description
=
"学习内容信息"
)
public
class
Audit
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
@ApiModelProperty
(
"审核内容"
)
@TableField
(
"audit_content"
)
private
String
auditContent
;
@ApiModelProperty
(
"所属机构id"
)
@TableField
(
"organ_id"
)
private
String
organId
;
@ApiModelProperty
(
"关联表id"
)
@TableField
(
"rel_id"
)
private
String
relId
;
@ApiModelProperty
(
"提交人员"
)
@TableField
(
"user_id"
)
@NotBlank
(
message
=
"提交人员不能为空"
,
groups
=
{
Add
.
class
})
private
String
userId
;
@ApiModelProperty
(
"0,看板;1 视频;2 学习内容;3 账号禁用"
)
@NotNull
(
message
=
"type不能为空"
,
groups
=
{
Update
.
class
})
@TableField
(
"type"
)
private
Integer
type
;
@ApiModelProperty
(
"0 新增;1 修改;2 删除;3 禁用"
)
@TableField
(
"item"
)
private
Integer
item
;
@ApiModelProperty
(
"1待初审 2 驳回 3 待复审 4通过"
)
@NotNull
(
message
=
"type不能为空"
,
groups
=
{
Update
.
class
})
@TableField
(
"status"
)
private
Integer
status
;
@ApiModelProperty
(
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
@NotNull
(
message
=
"创建时间不能为空"
,
groups
=
{
Add
.
class
})
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"0:未删除,1:已删除"
)
@TableField
(
"is_deleted"
)
private
Boolean
isDeleted
;
@ApiModelProperty
(
"备注"
)
@TableField
(
"remarks"
)
private
String
remarks
;
@ApiModelProperty
(
"层级 1.初审 2.复审"
)
@TableField
(
"level"
)
private
Integer
level
;
@ApiModelProperty
(
"机构名"
)
@TableField
(
exist
=
false
)
private
String
orgName
;
@ApiModelProperty
(
"提交人名"
)
@TableField
(
exist
=
false
)
private
String
userName
;
}
src/main/java/cn/wisenergy/chnmuseum/party/service/AuditService.java
0 → 100644
View file @
79fdc4b4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 学习内容信息 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-03-26
*/
public
interface
AuditService
extends
IService
<
Audit
>
{
Page
<
Audit
>
getUserList
(
Page
<
Audit
>
page
,
String
name
,
Integer
status
);
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/AuditServiceImpl.java
0 → 100644
View file @
79fdc4b4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
import
cn.wisenergy.chnmuseum.party.mapper.AuditMapper
;
import
cn.wisenergy.chnmuseum.party.service.AuditService
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.annotation.Resource
;
/**
* <pre>
* 学习内容信息 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-03-26
*/
@Slf4j
@Service
public
class
AuditServiceImpl
extends
ServiceImpl
<
AuditMapper
,
Audit
>
implements
AuditService
{
@Resource
private
AuditMapper
auditMapper
;
@Override
public
Page
<
Audit
>
getUserList
(
Page
<
Audit
>
page
,
String
name
,
Integer
status
)
{
return
page
.
setRecords
(
auditMapper
.
getUserList
(
page
,
name
,
status
));
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
View file @
79fdc4b4
...
...
@@ -83,15 +83,21 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
organ
.
setParentId
(
map1
.
get
(
parent
).
getId
());
organ
.
setLevel
(
map1
.
get
(
parent
).
getLevel
()+
1
);
}
if
(
organ
.
getLevel
()>
3
){
return
false
;
}
String
organCode
=
getOrganCode
(
organ
.
getParentId
());
organ
.
setCode
(
organCode
);
organ
.
setAreaId
(
area
.
get
(
map
.
get
(
"区域"
)));
organ
.
setIcon
(
map
.
get
(
"icon"
));
organ
.
setRemarks
(
map
.
get
(
"备注"
));
organ
.
setIsDeleted
(
false
);
organ
.
setCreateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
organ
.
setUpdateTime
(
LocalDateTime
.
now
());
list
.
add
(
organ
);
flag
=
save
(
organ
);
// list.add(organ);
}
flag
=
saveBatch
(
list
);
//
flag = saveBatch(list);
return
flag
;
}
...
...
@@ -109,4 +115,25 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
public
TOrgan
selectCodeMax
(
String
parentId
)
{
return
organMapper
.
selectCodeMax
(
parentId
);
}
private
String
getOrganCode
(
String
parentId
)
{
TOrgan
max
=
selectCodeMax
(
parentId
);
if
(
max
==
null
){
max
=
getById
(
parentId
);
String
s
=
max
.
getCode
()
+
"001"
;
return
s
;
}
String
s
=
max
.
getCode
().
substring
(
max
.
getCode
().
length
()
-
3
);
String
s1
=
max
.
getCode
().
substring
(
0
,
max
.
getCode
().
length
()
-
3
);
Integer
integer
=
Integer
.
valueOf
(
s
)+
1
;
if
(
integer
<
10
){
s1
=
s1
+
"00"
+
integer
.
toString
();
}
else
if
(
integer
<
100
){
s1
=
s1
+
"0"
+
integer
.
toString
();
}
else
{
s1
=
s1
+
integer
.
toString
();
}
return
s1
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AuditController.java
0 → 100644
View file @
79fdc4b4
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
cn.wisenergy.chnmuseum.party.model.Audit
;
import
cn.wisenergy.chnmuseum.party.service.AuditService
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.stereotype.Controller
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.Map
;
/**
* <pre>
* 禁用审核 前端控制器
* </pre>
*
* @author Danny Lee
* @since 2021-03-26
*/
@Slf4j
@RestController
@RequestMapping
(
"/audit"
)
@Api
(
tags
=
{
"审核管理操作接口"
})
public
class
AuditController
extends
BaseController
{
@Resource
private
AuditService
auditService
;
@Resource
private
TUserServiceImpl
userService
;
@GetMapping
(
"/getUserList"
)
@RequiresPermissions
(
"/audit/getUserList"
)
@ApiOperation
(
value
=
"获取用户禁用审核列表"
,
notes
=
"获取用户禁用审核列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"name"
,
value
=
"账号名称或提交人"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"1待初审 2 驳回 3 待复审 4通过"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
getUserList
(
String
name
,
Integer
status
)
{
Page
<
Audit
>
auditList
=
null
;
try
{
auditList
=
auditService
.
getUserList
(
getPage
(),
name
,
status
);
return
getResult
(
auditList
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
getFailResult
();
}
@PostMapping
(
"/add"
)
@RequiresPermissions
(
"/audit/add"
)
@ApiOperation
(
value
=
"添加禁用审核"
,
notes
=
"添加禁用审核"
)
public
Map
<
String
,
Object
>
saveAudit
(
@Validated
(
value
=
{
Add
.
class
})
Audit
audit
)
{
// 保存业务节点信息
boolean
result
=
auditService
.
save
(
audit
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"/audit/update"
)
@ApiOperation
(
value
=
"修改禁用审核信息"
,
notes
=
"修改禁用审核信息"
)
public
Map
<
String
,
Object
>
updateAudit
(
@Validated
(
value
=
{
Update
.
class
})
Audit
audit
)
{
boolean
flag
=
false
;
if
(
audit
.
getStatus
()==
3
){
audit
.
setLevel
(
2
);
}
if
(
audit
.
getStatus
()!=
2
){
audit
.
setRemarks
(
""
);
}
try
{
if
(
audit
.
getType
()
==
3
)
{
Audit
audit1
=
auditService
.
getById
(
audit
.
getId
());
TUser
user
=
new
TUser
();
user
.
setId
(
audit1
.
getRelId
());
user
.
setAuditStatus
(
audit
.
getStatus
().
toString
());
if
(
audit
.
getStatus
()==
4
)
{
user
.
setStatus
(
"2"
);
}
flag
=
userService
.
updateById
(
user
);
}
flag
=
auditService
.
updateById
(
audit
);
if
(!
flag
)
{
return
getFailResult
();
}
return
getSuccessResult
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
getFailResult
();
}
@DeleteMapping
(
"/delete"
)
@RequiresPermissions
(
"/audit/delete"
)
@ApiOperation
(
value
=
"根据ID删除禁用审核"
,
notes
=
"根据ID删除禁用审核"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
deleteAudit
(
@PathVariable
(
"id"
)
String
id
)
{
boolean
result
=
auditService
.
removeById
(
id
);
if
(
result
)
{
return
getSuccessResult
();
}
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:
:
getAuditContent
,
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:
:
getAuditContent
,
Audit:
:
getCreateTime
);
Page
<
Audit
>
page
=
this
.
auditService
.
page
(
getPage
(),
queryWrapper
);
for
(
Audit
audit
:
page
.
getRecords
())
{
}
return
getResult
(
page
);
}
@ApiOperation
(
value
=
"获取禁用审核详情"
,
notes
=
"获取禁用审核详情"
)
@GetMapping
(
"/getById"
)
@RequiresPermissions
(
"/audit/getById"
)
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
Audit
audit
=
auditService
.
getById
(
id
);
return
getResult
(
audit
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TUserController.java
View file @
79fdc4b4
...
...
@@ -13,6 +13,7 @@ import cn.wisenergy.chnmuseum.party.core.annotations.OperationLog;
import
cn.wisenergy.chnmuseum.party.model.*
;
import
cn.wisenergy.chnmuseum.party.service.RoleService
;
import
cn.wisenergy.chnmuseum.party.service.TUserRoleService
;
import
cn.wisenergy.chnmuseum.party.service.impl.AuditServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.TBoxOperationServiceImpl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -64,6 +65,9 @@ public class TUserController extends BaseController {
@Resource
private
RoleService
roleService
;
@Resource
private
AuditServiceImpl
auditService
;
@Resource
private
TBoxOperationServiceImpl
boxOperationService
;
...
...
@@ -155,12 +159,17 @@ public class TUserController extends BaseController {
@RequiresPermissions
(
"/user/getById"
)
// @MethodLog(operModule = OperModule.USER, operType = OperType.SELECT)
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
try
{
TUser
tUser
=
userService
.
selectById
(
id
);
List
<
Role
>
list
=
roleService
.
selectRoleByUserId
(
id
);
List
<
String
>
list1
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
r
->
list1
.
add
(
r
.
getId
()));
tUser
.
setRoleList
(
list1
);
return
getResult
(
tUser
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
getFailResult
();
}
}
//新增
...
...
@@ -383,8 +392,24 @@ public class TUserController extends BaseController {
Integer
code
=
AuditStatusEnum
.
TBC
.
getCode
();
entity
.
setAuditStatus
(
code
.
toString
());
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
boolean
ret
=
this
.
userService
.
updateById
(
entity
);
//添加到审核记录表
TUser
user
=
userService
.
getById
(
userId
);
Audit
audit
=
new
Audit
();
audit
.
setAuditContent
(
user
.
getUserName
());
audit
.
setOrganId
(
user
.
getOrgId
());
audit
.
setRelId
(
userId
);
audit
.
setUserId
(
getcurUser
().
getId
());
audit
.
setType
(
3
);
audit
.
setItem
(
3
);
audit
.
setStatus
(
1
);
audit
.
setIsDeleted
(
false
);
audit
.
setLevel
(
1
);
audit
.
setCreateTime
(
LocalDateTime
.
now
());
auditService
.
save
(
audit
);
boolean
ret
=
this
.
userService
.
updateById
(
entity
);
//获取该用户的登陆token
String
userToken
=
stringRedisTemplate
.
opsForValue
().
get
(
SHIRO_JWT_TOKEN
+
userId
);
if
(
null
!=
userToken
)
{
...
...
@@ -406,6 +431,36 @@ public class TUserController extends BaseController {
}
@PutMapping
(
"/updateAuditStatus"
)
@RequiresPermissions
(
"/user/updateAuditStatus"
)
@ApiOperation
(
value
=
"更新用户审核状态"
,
notes
=
"更新用户审核状态"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
public
Map
<
String
,
Object
>
updateStatus
(
@NotNull
(
message
=
"机构用户不能为空"
)
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
AuditStatusEnum
status
)
{
boolean
flag
=
false
;
try
{
TUser
user
=
new
TUser
();
user
.
setId
(
id
);
user
.
setAuditStatus
(
status
.
getCode
().
toString
());
//当禁用审核通过后,真正禁用
if
(
"4"
.
equals
(
status
.
getCode
().
toString
()))
{
user
.
setStatus
(
"2"
);
}
flag
=
userService
.
updateById
(
user
);
if
(!
flag
)
{
return
getFailResult
();
}
return
getSuccessResult
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
getFailResult
();
}
// 启动
@OperationLog
(
"启用成员"
)
@ApiOperation
(
value
=
"启用"
)
...
...
@@ -514,29 +569,6 @@ public class TUserController extends BaseController {
}
@PutMapping
(
"/updateAuditStatus"
)
@RequiresPermissions
(
"/user/updateAuditStatus"
)
@ApiOperation
(
value
=
"更新用户审核状态"
,
notes
=
"更新用户审核状态"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
public
Map
<
String
,
Object
>
updateStatus
(
@NotNull
(
message
=
"机构用户不能为空"
)
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
AuditStatusEnum
status
)
{
UpdateWrapper
<
TUser
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
id
);
updateWrapper
.
eq
(
"audit_status"
,
status
.
getCode
());
//当禁用审核通过后,真正禁用
if
(
"4"
.
equals
(
status
.
getCode
().
toString
()))
{
updateWrapper
.
eq
(
"status"
,
"2"
);
}
boolean
flag
=
userService
.
update
(
updateWrapper
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
//新增
@OperationLog
(
"新增机顶盒账号"
)
...
...
src/main/resources/mapper/AuditMapper.xml
0 → 100644
View file @
79fdc4b4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.AuditMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.Audit"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"audit_content"
property=
"auditContent"
/>
<result
column=
"organ_id"
property=
"organId"
/>
<result
column=
"rel_id"
property=
"relId"
/>
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"type"
property=
"type"
/>
<result
column=
"item"
property=
"item"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"is_deleted"
property=
"isDeleted"
/>
<result
column=
"remarks"
property=
"remarks"
/>
<result
column=
"level"
property=
"level"
/>
<result
column=
"org_name"
property=
"orgName"
/>
<result
column=
"user_name"
property=
"userName"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, audit_content, organ_id, rel_id, user_id, type, item, status, create_time, is_deleted, remarks, level
</sql>
<select
id=
"getUserList"
resultMap=
"BaseResultMap"
>
select a.*,o.name org_name,u.user_name user_name
from t_audit a
left join t_organ o on o.id = a.organ_id
left join t_user u on u.id = a.user_id
where 1 = 1
<if
test=
" name != null and name != '' "
>
and (u.user_name LIKE concat('%', #{name}, '%') or a.audit_content LIKE concat('%', #{name}, '%'))
</if>
<if
test=
" status != null"
>
and a.status = #{status}
</if>
and a.is_deleted = false
and a.type = 3
and a.item = 3
order by a.create_time desc
</select>
</mapper>
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