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
b434fb6e
Commit
b434fb6e
authored
Mar 28, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
7d5a761b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
107 additions
and
206 deletions
+107
-206
MysqlGenerator.java
...energy/chnmuseum/party/common/mybatis/MysqlGenerator.java
+1
-1
Audit.java
src/main/java/cn/wisenergy/chnmuseum/party/model/Audit.java
+40
-55
AuditController.java
...nergy/chnmuseum/party/web/controller/AuditController.java
+33
-63
TUserController.java
...nergy/chnmuseum/party/web/controller/TUserController.java
+23
-74
AuditMapper.xml
src/main/resources/mapper/AuditMapper.xml
+10
-13
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/mybatis/MysqlGenerator.java
View file @
b434fb6e
...
...
@@ -3,7 +3,7 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
public
class
MysqlGenerator
{
private
static
final
String
[]
tableNames
=
new
String
[]{
"
learning_content_board
"
"
t_audit
"
};
// private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
private
static
final
String
projectPath
=
"/opt/ss"
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/model/Audit.java
View file @
b434fb6e
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
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
com.baomidou.mybatisplus.annotation.*
;
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.*
;
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
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
...
...
@@ -45,68 +33,65 @@ public class Audit implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"
id
"
)
@ApiModelProperty
(
"
审核ID
"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"
id
不能为空"
,
groups
=
{
Update
.
class
})
@NotNull
(
message
=
"
审核ID
不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
@ApiModelProperty
(
"审核内容"
)
@TableField
(
"
audit_
content"
)
private
String
auditC
ontent
;
@ApiModelProperty
(
"所属机构
id
"
)
@TableField
(
"content"
)
private
String
c
ontent
;
@ApiModelProperty
(
"所属机构
ID
"
)
@TableField
(
"organ_id"
)
private
String
organId
;
@ApiModelProperty
(
"关联表id"
)
@TableField
(
"rel_id"
)
private
String
relId
;
@ApiModelProperty
(
"审核项ID"
)
@TableField
(
"ref_item_id"
)
@NotBlank
(
message
=
"审核项ID不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
refItemId
;
@ApiModelProperty
(
"提交人员"
)
@TableField
(
"user_id"
)
@NotBlank
(
message
=
"提交人员不能为空"
,
groups
=
{
Add
.
class
})
private
String
userId
;
@NotBlank
(
message
=
"提交人员不能为空"
,
groups
=
{
Add
.
class
,
Update
.
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
}
)
@NotBlank
(
message
=
"0,看板;1 视频;2 学习内容;3 账号禁用不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
type
;
@
ApiModelProperty
(
"操作类型
"
)
@TableField
(
"operation"
)
private
String
operation
;
@
ApiModelProperty
(
"审核状态"
)
@TableField
(
"status"
)
private
Integer
status
;
@ApiModelProperty
(
"创建
时间
"
)
private
String
status
;
@ApiModelProperty
(
"创建
日期
"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
@NotNull
(
message
=
"创建时间不能为空"
,
groups
=
{
Add
.
class
})
private
LocalDateTime
createTime
;
@NotNull
(
message
=
"创建日期不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"更新日期"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
@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/web/controller/AuditController.java
View file @
b434fb6e
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
cn.wisenergy.chnmuseum.party.model.Audit
;
import
cn.wisenergy.chnmuseum.party.service.AuditService
;
import
cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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
;
...
...
@@ -51,7 +43,6 @@ public class AuditController extends BaseController {
@Resource
private
TUserServiceImpl
userService
;
@GetMapping
(
"/getUserList"
)
@RequiresPermissions
(
"/audit/getUserList"
)
@ApiOperation
(
value
=
"获取用户禁用审核列表"
,
notes
=
"获取用户禁用审核列表"
)
...
...
@@ -60,7 +51,7 @@ public class AuditController extends BaseController {
@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
;
Page
<
Audit
>
auditList
;
try
{
auditList
=
auditService
.
getUserList
(
getPage
(),
name
,
status
);
return
getResult
(
auditList
);
...
...
@@ -70,52 +61,34 @@ public class AuditController extends BaseController {
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
();
}
boolean
flag
;
//todo 禁止使用整形值标识状态值,应使用enum来标识
// if (audit.getStatus() != 2){
// audit.setRemarks("");
// }
// try {
// if (audit.getType() == 3) {
// Audit audit1 = auditService.getById(audit.getId());
// TUser user = new TUser();
// user.setId(audit1.getRefItemId());
// user.setAuditStatus(audit.getStatus());
// if (audit.getStatus()==4) {
// user.setStatus("2");
// }
// userService.updateById(user);
// }
// flag = auditService.updateById(audit);
// if (!flag) {
// return getFailResult();
// }
// return getSuccessResult();
// } catch (Exception e) {
// e.printStackTrace();
// }
return
getFailResult
();
}
...
...
@@ -158,7 +131,7 @@ public class AuditController extends BaseController {
LambdaQueryWrapper
<
Audit
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
// 对名称或编码模糊查询
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
queryWrapper
.
like
(
Audit:
:
get
Audit
Content
,
genericPageParam
.
getNameOrCode
());
queryWrapper
.
like
(
Audit:
:
getContent
,
genericPageParam
.
getNameOrCode
());
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
...
...
@@ -170,12 +143,9 @@ public class AuditController extends BaseController {
// 设置查询内容
queryWrapper
.
select
(
Audit:
:
getId
,
Audit:
:
get
Audit
Content
,
Audit:
:
getContent
,
Audit:
:
getCreateTime
);
Page
<
Audit
>
page
=
this
.
auditService
.
page
(
getPage
(),
queryWrapper
);
for
(
Audit
audit
:
page
.
getRecords
())
{
}
return
getResult
(
page
);
}
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TUserController.java
View file @
b434fb6e
...
...
@@ -2,32 +2,29 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import
cn.wisenergy.chnmuseum.party.auth.SHA256PasswordEncryptionService
;
import
cn.wisenergy.chnmuseum.party.auth.SecureRandomSaltService
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum
;
import
cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum
;
import
cn.wisenergy.chnmuseum.party.common.log.MethodLog
;
import
cn.wisenergy.chnmuseum.party.common.log.OperModule
;
import
cn.wisenergy.chnmuseum.party.common.log.OperType
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil80
;
import
cn.wisenergy.chnmuseum.party.common.util.RandomUtil
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
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.TUserService
;
import
cn.wisenergy.chnmuseum.party.service.impl.AuditServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.TBoxOperationServiceImpl
;
import
c
om.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapp
er
;
import
c
n.wisenergy.chnmuseum.party.web.controller.base.BaseControll
er
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
cn.wisenergy.chnmuseum.party.service.TUserService
;
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
;
...
...
@@ -36,7 +33,6 @@ import org.springframework.http.HttpStatus;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.NotNull
;
import
java.time.LocalDateTime
;
...
...
@@ -77,12 +73,6 @@ public class TUserController extends BaseController {
//用户登录是否被锁定 一小时 redisKey 前缀
private
String
SHIRO_IS_LOCK
=
"shiro_is_lock_"
;
/**
* 获取用户分页列表
*
* @param
* @return
*/
@ApiOperation
(
value
=
"获取用户分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
...
...
@@ -91,7 +81,7 @@ public class TUserController extends BaseController {
@RequestMapping
(
value
=
"/getPageList"
,
method
=
RequestMethod
.
GET
)
@RequiresPermissions
(
"/user/getPageList"
)
// @MethodLog(operModule = OperModule.USER, operType = OperType.SELECT)
public
Map
<
String
,
Object
>
getPageList
(
String
userName
,
String
status
,
String
type
,
String
orgId
,
String
areaId
)
{
public
Map
<
String
,
Object
>
getPageList
(
String
userName
,
String
status
,
String
type
,
String
orgId
,
String
areaId
)
{
TUser
user1
=
getcurUser
();
TUser
user
=
new
TUser
();
if
(
StringUtils
.
isNotBlank
(
userName
))
{
...
...
@@ -107,14 +97,14 @@ public class TUserController extends BaseController {
user
.
setAreaId
(
areaId
);
}
if
(
StringUtils
.
isNotBlank
(
status
))
{
if
(
"1"
.
equals
(
status
)
||
"2"
.
equals
(
status
))
{
if
(
"1"
.
equals
(
status
)
||
"2"
.
equals
(
status
))
{
user
.
setStatus
(
status
);
}
else
{
}
else
{
user
.
setAuditStatus
(
status
);
}
}
List
<
String
>
roleList
=
user1
.
getRoleList
();
if
(
roleList
!=
null
&&!
roleList
.
contains
(
"1"
)&&
roleList
.
contains
(
"2"
))
{
if
(
roleList
!=
null
&&
!
roleList
.
contains
(
"1"
)
&&
roleList
.
contains
(
"2"
))
{
user
.
setOId
(
user1
.
getOrgId
());
user
.
setType
(
"2"
);
}
...
...
@@ -127,12 +117,6 @@ public class TUserController extends BaseController {
return
getFailResult
();
}
/**
* 查询成员列表
*
* @param
* @return
*/
@ApiOperation
(
value
=
"获取用户列表"
)
@RequestMapping
(
value
=
"/getUserList"
,
method
=
RequestMethod
.
GET
)
@RequiresPermissions
(
"/user/getUserList"
)
...
...
@@ -159,7 +143,6 @@ public class TUserController extends BaseController {
return
getFailResult
();
}
@ApiOperation
(
value
=
"获取用户详情"
,
notes
=
"获取用户详情"
)
@GetMapping
(
"/getById"
)
@RequiresPermissions
(
"/user/getById"
)
...
...
@@ -168,9 +151,9 @@ public class TUserController extends BaseController {
try
{
TUser
tUser
=
userService
.
selectById
(
id
);
List
<
Role
>
list
=
roleService
.
selectRoleByUserId
(
id
);
if
(
list
!=
null
&&
list
.
get
(
0
)!=
null
)
{
if
(
list
!=
null
&&
list
.
get
(
0
)
!=
null
)
{
List
<
String
>
list1
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
r
->
list1
.
add
(
r
.
getId
()));
list
.
forEach
(
r
->
list1
.
add
(
r
.
getId
()));
tUser
.
setRoleList
(
list1
);
}
return
getResult
(
tUser
);
...
...
@@ -180,7 +163,6 @@ public class TUserController extends BaseController {
}
}
//新增
@OperationLog
(
"新增成员"
)
@ApiOperation
(
value
=
"新增成员"
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -203,10 +185,10 @@ public class TUserController extends BaseController {
}
if
(
user
.
getRoleList
()
==
null
||
user
.
getRoleList
().
size
()
<
1
)
{
if
(
"2"
.
equals
(
user
.
getType
())){
if
(
"2"
.
equals
(
user
.
getType
()))
{
user
.
setRoleList
(
new
ArrayList
<>());
user
.
getRoleList
().
add
(
"1"
);
}
else
{
}
else
{
resultMap
.
put
(
"resultCode"
,
400
);
resultMap
.
put
(
"message"
,
"请选择角色!"
);
return
resultMap
;
...
...
@@ -217,14 +199,14 @@ public class TUserController extends BaseController {
resultMap
.
put
(
"message"
,
"请选择机构!"
);
return
resultMap
;
}
if
(
"2"
.
equals
(
user
.
getType
())){
if
(
"2"
.
equals
(
user
.
getType
()))
{
QueryWrapper
<
TUser
>
ew
=
new
QueryWrapper
<>();
user
.
setUserName
(
user
.
getUserName
().
trim
());
ew
.
eq
(
"is_deleted"
,
0
);
ew
.
eq
(
"type"
,
"2"
);
ew
.
eq
(
"org_id"
,
user
.
getOrgId
());
List
<
TUser
>
list
=
userService
.
list
(
ew
);
if
(
list
.
size
()
>=
3
)
{
if
(
list
.
size
()
>=
3
)
{
resultMap
.
put
(
"resultCode"
,
200
);
resultMap
.
put
(
"message"
,
"机构已存在三个单位管理员!"
);
return
resultMap
;
...
...
@@ -287,8 +269,6 @@ public class TUserController extends BaseController {
return
resultMap
;
}
// 编辑用户信息
@OperationLog
(
"修改成员信息"
)
@ApiOperation
(
value
=
"编辑用户信息"
)
@PutMapping
(
value
=
"/update"
)
...
...
@@ -299,7 +279,7 @@ public class TUserController extends BaseController {
try
{
boolean
ret
=
false
;
if
(
user
.
getId
()
!=
null
)
{
if
(
"1"
.
equals
(
user
.
getId
())
&&
user
.
getStatus
()
==
"2"
)
{
if
(
"1"
.
equals
(
user
.
getId
())
&&
"2"
.
equals
(
user
.
getStatus
())
)
{
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"message"
,
"该账号不能被禁用"
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
...
...
@@ -353,12 +333,6 @@ public class TUserController extends BaseController {
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
build
();
}
/**
* 删除
*
* @param userId
* @return
*/
@OperationLog
(
"删除成员"
)
@ApiOperation
(
value
=
"删除成员"
)
@DeleteMapping
(
value
=
"/delete"
)
...
...
@@ -396,13 +370,6 @@ public class TUserController extends BaseController {
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
/**
* 禁用
*
* @param userId
* @return
*/
@OperationLog
(
"禁用成员"
)
@ApiOperation
(
value
=
"禁用"
)
@RequestMapping
(
value
=
"/disable"
,
method
=
RequestMethod
.
PUT
)
...
...
@@ -419,19 +386,17 @@ public class TUserController extends BaseController {
entity
.
setAuditStatus
(
code
.
toString
());
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
//添加到审核记录表
TUser
user
=
userService
.
getById
(
userId
);
Audit
audit
=
new
Audit
();
audit
.
set
Audit
Content
(
user
.
getUserName
());
audit
.
setContent
(
user
.
getUserName
());
audit
.
setOrganId
(
user
.
getOrgId
());
audit
.
setRe
l
Id
(
userId
);
audit
.
setRe
fItem
Id
(
userId
);
audit
.
setUserId
(
getcurUser
().
getId
());
audit
.
setType
(
3
);
audit
.
set
Item
(
3
);
audit
.
setStatus
(
1
);
audit
.
setType
(
AuditTypeEnum
.
ACCOUNT
.
name
()
);
audit
.
set
Operation
(
AuditOperationEnum
.
DISABLE
.
name
()
);
audit
.
setStatus
(
AuditStatusEnum
.
TBC
.
name
()
);
audit
.
setIsDeleted
(
false
);
audit
.
setLevel
(
1
);
audit
.
setCreateTime
(
LocalDateTime
.
now
());
auditService
.
save
(
audit
);
...
...
@@ -456,7 +421,6 @@ public class TUserController extends BaseController {
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
@PutMapping
(
"/updateAuditStatus"
)
@RequiresPermissions
(
"/user/updateAuditStatus"
)
@ApiOperation
(
value
=
"更新用户审核状态"
,
notes
=
"更新用户审核状态"
)
...
...
@@ -486,8 +450,6 @@ public class TUserController extends BaseController {
return
getFailResult
();
}
// 启动
@OperationLog
(
"启用成员"
)
@ApiOperation
(
value
=
"启用"
)
@RequestMapping
(
value
=
"/enable"
,
method
=
RequestMethod
.
PUT
)
...
...
@@ -513,18 +475,16 @@ public class TUserController extends BaseController {
}
catch
(
Exception
e
)
{
logger
.
error
(
"用户启用出错!"
,
e
);
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
@OperationLog
(
"修改密码"
)
@ApiOperation
(
value
=
"管理员更改自己的登录密码"
,
notes
=
"管理员更改自己的登录密码"
)
@RequestMapping
(
value
=
"/editPwd"
,
method
=
RequestMethod
.
PUT
)
@RequiresPermissions
(
"/user/editPwd"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
public
ResponseEntity
<
Map
<
String
,
Object
>>
editPwd
(
@RequestParam
(
value
=
"oldPassWord"
,
required
=
true
)
String
oldPassWord
,
@RequestParam
(
value
=
"password"
,
required
=
true
)
String
password
)
{
public
ResponseEntity
<
Map
<
String
,
Object
>>
editPwd
(
@RequestParam
(
value
=
"oldPassWord"
)
String
oldPassWord
,
@RequestParam
(
value
=
"password"
)
String
password
)
{
Map
<
String
,
Object
>
resultMap
=
new
LinkedHashMap
<
String
,
Object
>();
try
{
boolean
ret
=
false
;
...
...
@@ -561,8 +521,6 @@ public class TUserController extends BaseController {
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
// 管理员重置密码
@OperationLog
(
"重置密码"
)
@ApiOperation
(
value
=
"管理员重置密码"
,
notes
=
"管理员重置密码"
)
@RequestMapping
(
value
=
"/resetPassword"
,
method
=
RequestMethod
.
PUT
)
...
...
@@ -594,9 +552,6 @@ public class TUserController extends BaseController {
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
//新增
@OperationLog
(
"新增机顶盒账号"
)
@ApiOperation
(
value
=
"新增机顶盒账号"
)
@RequestMapping
(
value
=
"/boxAdd"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -671,9 +626,6 @@ public class TUserController extends BaseController {
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
//新增
@OperationLog
(
"新增运维账号"
)
@ApiOperation
(
value
=
"新增运维账号"
)
@RequestMapping
(
value
=
"/operationAdd"
,
method
=
RequestMethod
.
POST
)
...
...
@@ -739,9 +691,6 @@ public class TUserController extends BaseController {
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
//新增
@OperationLog
(
"新增统计账号"
)
@ApiOperation
(
value
=
"新增统计账号"
)
@RequestMapping
(
value
=
"/statisticsAdd"
,
method
=
RequestMethod
.
POST
)
...
...
src/main/resources/mapper/AuditMapper.xml
View file @
b434fb6e
...
...
@@ -3,26 +3,24 @@
<mapper
namespace=
"cn.wisenergy.chnmuseum.party.mapper.AuditMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.Audit"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.
T
Audit"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"
audit_content"
property=
"auditC
ontent"
/>
<result
column=
"
content"
property=
"c
ontent"
/>
<result
column=
"organ_id"
property=
"organId"
/>
<result
column=
"re
l_id"
property=
"rel
Id"
/>
<result
column=
"re
f_item_id"
property=
"refItem
Id"
/>
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"type"
property=
"type"
/>
<result
column=
"
item"
property=
"item
"
/>
<result
column=
"
operation"
property=
"operation
"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<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
id,
content, organ_id, ref_item_id, user_id, type, operation, status, create_time, update_time, is_deleted, remarks
</sql>
<select
id=
"getUserList"
resultMap=
"BaseResultMap"
>
...
...
@@ -31,17 +29,16 @@
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 != ''
"
>
<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"
>
<if
test=
"status != null"
>
and a.status = #{status}
</if>
and a.is_deleted = false
and a.type =
3
and a.
item = 3
and a.type =
'ACCOUNT'
and a.
operation = 'DISABLE'
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