Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
01f6cb32
Commit
01f6cb32
authored
Mar 24, 2021
by
wzp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加区域树
parent
c5208255
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
1575 additions
and
489 deletions
+1575
-489
OperType.java
...ava/cn/wisenergy/chnmuseum/party/common/log/OperType.java
+2
-1
SystemOperationLogService.java
...chnmuseum/party/common/log/SystemOperationLogService.java
+12
-4
MysqlGenerator.java
...energy/chnmuseum/party/common/mybatis/MysqlGenerator.java
+3
-15
BasePageOrderParam.java
...senergy/chnmuseum/party/common/vo/BasePageOrderParam.java
+3
-0
RunLogMapper.java
...ava/cn/wisenergy/chnmuseum/party/mapper/RunLogMapper.java
+5
-0
TAreaMapper.java
...java/cn/wisenergy/chnmuseum/party/mapper/TAreaMapper.java
+16
-0
TInteractionMapper.java
.../wisenergy/chnmuseum/party/mapper/TInteractionMapper.java
+16
-0
TOperationLogMapper.java
...wisenergy/chnmuseum/party/mapper/TOperationLogMapper.java
+21
-0
RunLog.java
src/main/java/cn/wisenergy/chnmuseum/party/model/RunLog.java
+19
-0
TArea.java
src/main/java/cn/wisenergy/chnmuseum/party/model/TArea.java
+103
-0
TInteraction.java
...java/cn/wisenergy/chnmuseum/party/model/TInteraction.java
+99
-0
TOperationLog.java
...ava/cn/wisenergy/chnmuseum/party/model/TOperationLog.java
+92
-0
TOrgan.java
src/main/java/cn/wisenergy/chnmuseum/party/model/TOrgan.java
+2
-12
TAreaService.java
...va/cn/wisenergy/chnmuseum/party/service/TAreaService.java
+20
-0
TInteractionService.java
...isenergy/chnmuseum/party/service/TInteractionService.java
+16
-0
TOperationLogService.java
...senergy/chnmuseum/party/service/TOperationLogService.java
+19
-0
RunLogServiceImpl.java
...nergy/chnmuseum/party/service/impl/RunLogServiceImpl.java
+5
-0
TAreaServiceImpl.java
...energy/chnmuseum/party/service/impl/TAreaServiceImpl.java
+53
-0
TInteractionServiceImpl.java
...chnmuseum/party/service/impl/TInteractionServiceImpl.java
+30
-0
TOperationLogServiceImpl.java
...hnmuseum/party/service/impl/TOperationLogServiceImpl.java
+34
-0
TOrganServiceImpl.java
...nergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
+3
-5
SysLogController.java
...ergy/chnmuseum/party/web/controller/SysLogController.java
+121
-12
TInteractionController.java
...hnmuseum/party/web/controller/TInteractionController.java
+175
-0
TOperationLogController.java
...nmuseum/party/web/controller/TOperationLogController.java
+175
-0
TOrganController.java
...ergy/chnmuseum/party/web/controller/TOrganController.java
+14
-0
TUserController.java
...nergy/chnmuseum/party/web/controller/TUserController.java
+434
-435
RunLogMapper.xml
src/main/resources/mapper/RunLogMapper.xml
+19
-0
TInteractionMapper.xml
src/main/resources/mapper/TInteractionMapper.xml
+23
-0
TOperationLogMapper.xml
src/main/resources/mapper/TOperationLogMapper.xml
+38
-0
TOrganMapper.xml
src/main/resources/mapper/TOrganMapper.xml
+3
-5
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/log/OperType.java
View file @
01f6cb32
...
@@ -12,7 +12,8 @@ public enum OperType {
...
@@ -12,7 +12,8 @@ public enum OperType {
DELETE
(
4
,
"删除"
),
DELETE
(
4
,
"删除"
),
UNABLE
(
5
,
"启用"
),
UNABLE
(
5
,
"启用"
),
DISABLE
(
6
,
"禁用"
),
DISABLE
(
6
,
"禁用"
),
IMPORT
(
7
,
"导入"
);
IMPORT
(
7
,
"导入"
),
LOGIN
(
8
,
"登录"
);
// 错误编码
// 错误编码
private
Integer
code
;
private
Integer
code
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/log/SystemOperationLogService.java
View file @
01f6cb32
...
@@ -3,8 +3,10 @@ package cn.wisenergy.chnmuseum.party.common.log;
...
@@ -3,8 +3,10 @@ package cn.wisenergy.chnmuseum.party.common.log;
import
cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil
;
import
cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil80
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil80
;
import
cn.wisenergy.chnmuseum.party.core.annotations.OperationLog
;
import
cn.wisenergy.chnmuseum.party.mapper.SysLogMapper
;
import
cn.wisenergy.chnmuseum.party.mapper.SysLogMapper
;
import
cn.wisenergy.chnmuseum.party.model.SysLog
;
import
cn.wisenergy.chnmuseum.party.model.SysLog
;
import
cn.wisenergy.chnmuseum.party.model.TOperationLog
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.model.TUser
;
import
cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -28,6 +30,7 @@ import javax.annotation.Resource;
...
@@ -28,6 +30,7 @@ import javax.annotation.Resource;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.net.InetAddress
;
import
java.net.InetAddress
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
...
@@ -103,10 +106,17 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
...
@@ -103,10 +106,17 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
// 异常处理记录日志..log.error(e);
// 异常处理记录日志..log.error(e);
throw
e
;
throw
e
;
}
}
if
(
methodLog
.
operModule
().
getMsg
().
contains
(
"运维"
))
{
TOperationLog
operationLog
=
new
TOperationLog
();
operationLog
.
setCreateTime
(
LocalDateTime
.
now
());
operationLog
.
setUserId
(
user
.
getId
());
operationLog
.
setOperationType
(
methodLog
.
operType
().
getMsg
());
return
object
;
}
SysLog
sysLog
=
new
SysLog
();
SysLog
sysLog
=
new
SysLog
();
if
(
"1"
.
equals
(
user
.
getId
()))
{
if
(
"1"
.
equals
(
user
.
getId
()))
{
sysLog
.
setType
(
1
);
sysLog
.
setType
(
1
);
}
else
{
}
else
{
sysLog
.
setType
(
2
);
sysLog
.
setType
(
2
);
}
}
sysLog
.
setOperator
(
user
.
getUserName
());
sysLog
.
setOperator
(
user
.
getUserName
());
...
@@ -117,10 +127,8 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
...
@@ -117,10 +127,8 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
// 处理设置注解上的参数
// 处理设置注解上的参数
getControllerMethodDescription
(
methodLog
,
sysLog
);
getControllerMethodDescription
(
methodLog
,
sysLog
);
baseMapper
.
insert
(
sysLog
);
sysLogMapper
.
insert
(
sysLog
);
// System.out.println("日志实体:"+sysLog.getLoginName()+sysLog.getMethodRemark()+sysLog.getOperationContent());
return
object
;
return
object
;
}
}
/**
/**
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/mybatis/MysqlGenerator.java
View file @
01f6cb32
...
@@ -3,22 +3,10 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
...
@@ -3,22 +3,10 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
public
class
MysqlGenerator
{
public
class
MysqlGenerator
{
private
static
final
String
[]
tableNames
=
new
String
[]{
private
static
final
String
[]
tableNames
=
new
String
[]{
"asset"
,
"t_area"
"asset_type"
,
"copyright_owner"
,
"copyright_owner_asset_type"
,
"copyright_owner_board_type"
,
"exhibition_board"
,
"exhibition_board_cat"
,
"learning_content"
,
"learning_content_board"
,
"learning_content_board_cat"
,
"learning_content_copyright_owner"
,
"learning_project"
};
};
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";
private
static
final
String
projectPath
=
"/opt/ss"
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
CodeGenerator
codeGenerator
=
new
CodeGenerator
();
CodeGenerator
codeGenerator
=
new
CodeGenerator
();
...
...
src/main/java/cn/wisenergy/chnmuseum/party/common/vo/BasePageOrderParam.java
View file @
01f6cb32
...
@@ -27,6 +27,9 @@ public abstract class BasePageOrderParam extends BasePageParam {
...
@@ -27,6 +27,9 @@ public abstract class BasePageOrderParam extends BasePageParam {
@ApiModelProperty
(
"类型"
)
@ApiModelProperty
(
"类型"
)
private
String
type
;
private
String
type
;
@ApiModelProperty
(
"操作类型"
)
private
String
operationType
;
@ApiModelProperty
(
"起始修改时间"
)
@ApiModelProperty
(
"起始修改时间"
)
private
LocalDate
startDate
;
private
LocalDate
startDate
;
...
...
src/main/java/cn/wisenergy/chnmuseum/party/mapper/RunLogMapper.java
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.RunLog
;
import
cn.wisenergy.chnmuseum.party.model.RunLog
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
/**
* <p>
* <p>
...
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
RunLogMapper
extends
BaseMapper
<
RunLog
>
{
public
interface
RunLogMapper
extends
BaseMapper
<
RunLog
>
{
List
<
RunLog
>
pageList
(
Page
<
RunLog
>
page
,
RunLog
runLog
);
}
}
src/main/java/cn/wisenergy/chnmuseum/party/mapper/TAreaMapper.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.wisenergy.chnmuseum.party.model.TArea
;
/**
* <pre>
* 区域表 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-03-24
*/
public
interface
TAreaMapper
extends
BaseMapper
<
TArea
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/mapper/TInteractionMapper.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.wisenergy.chnmuseum.party.model.TInteraction
;
/**
* <pre>
* 看板互动 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-03-23
*/
public
interface
TInteractionMapper
extends
BaseMapper
<
TInteraction
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/mapper/TOperationLogMapper.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
mapper
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
cn.wisenergy.chnmuseum.party.model.TOperationLog
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* <pre>
* 运维日志表 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-03-23
*/
public
interface
TOperationLogMapper
extends
BaseMapper
<
TOperationLog
>
{
List
<
TOperationLog
>
pageList
(
Page
<
TOperationLog
>
page
,
TOperationLog
operationLog
);
}
src/main/java/cn/wisenergy/chnmuseum/party/model/RunLog.java
View file @
01f6cb32
...
@@ -8,9 +8,11 @@ import io.swagger.annotations.ApiModel;
...
@@ -8,9 +8,11 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
/**
/**
* <p>
* <p>
...
@@ -52,4 +54,21 @@ public class RunLog implements Serializable {
...
@@ -52,4 +54,21 @@ public class RunLog implements Serializable {
@TableField
(
"end_time"
)
@TableField
(
"end_time"
)
private
LocalDateTime
endTime
;
private
LocalDateTime
endTime
;
@ApiModelProperty
(
value
=
"结束时间"
)
@TableField
(
exist
=
false
)
private
String
orgName
;
@ApiModelProperty
(
value
=
"学习内容名称"
)
@TableField
(
exist
=
false
)
private
String
learnName
;
@ApiModelProperty
(
"开始时间"
)
@TableField
(
exist
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd hh:mm:ss"
)
private
Date
startDate
;
@ApiModelProperty
(
"结束时间"
)
@TableField
(
exist
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd hh:mm:ss"
)
private
Date
endDate
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/model/TArea.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
import
java.math.BigDecimal
;
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
com.baomidou.mybatisplus.annotation.TableField
;
import
java.io.Serializable
;
import
java.util.List
;
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-24
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"t_area"
)
@ApiModel
(
value
=
"区域表"
,
description
=
"区域表"
)
public
class
TArea
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"ID"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"ID不能为空"
,
groups
=
{
Update
.
class
})
private
Integer
id
;
@ApiModelProperty
(
"名称"
)
@TableField
(
"name"
)
@NotBlank
(
message
=
"名称不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
name
;
@ApiModelProperty
(
"简称"
)
@TableField
(
"sname"
)
private
String
sname
;
@ApiModelProperty
(
"代码"
)
@TableField
(
"code"
)
@NotBlank
(
message
=
"代码不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
code
;
@ApiModelProperty
(
"类型"
)
@TableField
(
"type"
)
@NotBlank
(
message
=
"类型不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
type
;
@ApiModelProperty
(
"上级代码"
)
@TableField
(
"parent_id"
)
private
String
parentId
;
@ApiModelProperty
(
"排序"
)
@TableField
(
"sort_position"
)
private
Integer
sortPosition
;
@ApiModelProperty
(
"经度"
)
@TableField
(
"longitude"
)
private
BigDecimal
longitude
;
@ApiModelProperty
(
"维度"
)
@TableField
(
"latitude"
)
private
BigDecimal
latitude
;
@ApiModelProperty
(
"全称"
)
@TableField
(
"full_name"
)
private
String
fullName
;
@ApiModelProperty
(
"备注"
)
@TableField
(
"remarks"
)
private
String
remarks
;
@ApiModelProperty
(
"下级"
)
@TableField
(
exist
=
false
)
private
List
<
TArea
>
children
;
}
src/main/java/cn/wisenergy/chnmuseum/party/model/TInteraction.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
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
;
/**
* <p>
* 看板互动
* </p>
*
* @author Danny Lee
* @since 2021-03-23
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"t_interaction"
)
@ApiModel
(
value
=
"看板互动"
,
description
=
"看板互动"
)
public
class
TInteraction
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"idID不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
@ApiModelProperty
(
"机构id"
)
@TableField
(
"organ_id"
)
private
String
organId
;
@ApiModelProperty
(
"帐户名"
)
@TableField
(
"username"
)
@NotBlank
(
message
=
"帐户名不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
username
;
@ApiModelProperty
(
"展板ID"
)
@TableField
(
"board_id"
)
private
String
boardId
;
@ApiModelProperty
(
"学习时间"
)
@TableField
(
value
=
"study_time"
,
fill
=
FieldFill
.
INSERT
)
@NotNull
(
message
=
"创建时间不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
LocalDateTime
studyTime
;
@ApiModelProperty
(
"观影人数"
)
@TableField
(
"num"
)
private
Integer
num
;
@ApiModelProperty
(
"内容"
)
@TableField
(
"content"
)
private
String
content
;
@ApiModelProperty
(
"图片信息"
)
@TableField
(
"images"
)
private
String
images
;
@ApiModelProperty
(
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
@NotNull
(
message
=
"创建时间不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"管理员账号"
)
@TableField
(
exist
=
false
)
@NotNull
(
message
=
"管理员账号不能为空"
,
groups
=
{
Add
.
class
})
private
String
name
;
@ApiModelProperty
(
"密码"
)
@TableField
(
exist
=
false
)
@NotNull
(
message
=
"密码不能为空"
,
groups
=
{
Add
.
class
})
private
String
password
;
}
src/main/java/cn/wisenergy/chnmuseum/party/model/TOperationLog.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
model
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Add
;
import
cn.wisenergy.chnmuseum.party.common.validator.groups.Update
;
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
java.util.Date
;
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
com.baomidou.mybatisplus.annotation.TableField
;
import
org.springframework.format.annotation.DateTimeFormat
;
/**
* <p>
* 运维日志表
* </p>
*
* @author Danny Lee
* @since 2021-03-23
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"t_operation_log"
)
@ApiModel
(
value
=
"运维日志表"
,
description
=
"运维日志表"
)
public
class
TOperationLog
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
ASSIGN_ID
)
@NotNull
(
message
=
"ID不能为空"
,
groups
=
{
Update
.
class
})
private
String
id
;
@ApiModelProperty
(
"运维用户id"
)
@TableField
(
"user_id"
)
@NotNull
(
message
=
"运维用户id不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
userId
;
@ApiModelProperty
(
"运维区域"
)
@TableField
(
"area"
)
@NotBlank
(
message
=
"运维区域不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
area
;
@ApiModelProperty
(
"操作内容"
)
@TableField
(
"operation_type"
)
@NotBlank
(
message
=
"操作内容不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
String
operationType
;
@ApiModelProperty
(
"创建时间"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
@NotNull
(
message
=
"创建时间不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"运维用户账号"
)
@TableField
(
exist
=
false
)
private
String
userName
;
@ApiModelProperty
(
"开始时间"
)
@TableField
(
exist
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd hh:mm:ss"
)
private
Date
startDate
;
@ApiModelProperty
(
"结束时间"
)
@TableField
(
exist
=
false
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd hh:mm:ss"
)
private
Date
endDate
;
}
src/main/java/cn/wisenergy/chnmuseum/party/model/TOrgan.java
View file @
01f6cb32
...
@@ -75,19 +75,9 @@ public class TOrgan implements Serializable {
...
@@ -75,19 +75,9 @@ public class TOrgan implements Serializable {
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
"省"
)
@ApiModelProperty
(
"省"
)
@TableField
(
"
province
"
)
@TableField
(
"
area_id
"
)
@NotNull
(
message
=
"省不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
@NotNull
(
message
=
"省不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
Integer
province
;
private
String
areaId
;
@ApiModelProperty
(
"市"
)
@TableField
(
"city"
)
@NotNull
(
message
=
"市不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
Integer
city
;
@ApiModelProperty
(
"县"
)
@TableField
(
"country"
)
@NotNull
(
message
=
"县不能为空"
,
groups
=
{
Add
.
class
,
Update
.
class
})
private
Integer
country
;
@ApiModelProperty
(
"icon"
)
@ApiModelProperty
(
"icon"
)
@TableField
(
"icon"
)
@TableField
(
"icon"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/TAreaService.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.TArea
;
import
cn.wisenergy.chnmuseum.party.model.TOrgan
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 区域表 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-03-24
*/
public
interface
TAreaService
extends
IService
<
TArea
>
{
List
<
TArea
>
getAreaTree
();
}
src/main/java/cn/wisenergy/chnmuseum/party/service/TInteractionService.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.model.TInteraction
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 看板互动 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-03-23
*/
public
interface
TInteractionService
extends
IService
<
TInteraction
>
{
}
src/main/java/cn/wisenergy/chnmuseum/party/service/TOperationLogService.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.TOperationLog
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 运维日志表 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-03-23
*/
public
interface
TOperationLogService
extends
IService
<
TOperationLog
>
{
Page
<
TOperationLog
>
pageList
(
Page
<
TOperationLog
>
page
,
TOperationLog
operationLog
);
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/RunLogServiceImpl.java
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.RunLog
;
import
cn.wisenergy.chnmuseum.party.model.RunLog
;
import
cn.wisenergy.chnmuseum.party.mapper.RunLogMapper
;
import
cn.wisenergy.chnmuseum.party.mapper.RunLogMapper
;
import
cn.wisenergy.chnmuseum.party.service.RunLogService
;
import
cn.wisenergy.chnmuseum.party.service.RunLogService
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -27,4 +29,7 @@ public class RunLogServiceImpl extends ServiceImpl<RunLogMapper, RunLog> impleme
...
@@ -27,4 +29,7 @@ public class RunLogServiceImpl extends ServiceImpl<RunLogMapper, RunLog> impleme
return
save
;
return
save
;
}
}
public
Page
<
RunLog
>
pageList
(
Page
<
RunLog
>
page
,
RunLog
runLog
)
{
return
page
.
setRecords
(
runLogMapper
.
pageList
(
page
,
runLog
));
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TAreaServiceImpl.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.model.TArea
;
import
cn.wisenergy.chnmuseum.party.mapper.TAreaMapper
;
import
cn.wisenergy.chnmuseum.party.model.TOrgan
;
import
cn.wisenergy.chnmuseum.party.service.TAreaService
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
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
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <pre>
* 区域表 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-03-24
*/
@Slf4j
@Service
public
class
TAreaServiceImpl
extends
ServiceImpl
<
TAreaMapper
,
TArea
>
implements
TAreaService
{
@Autowired
private
TAreaMapper
tAreaMapper
;
@Override
public
List
<
TArea
>
getAreaTree
()
{
List
<
TArea
>
list
=
list
();
HashMap
<
String
,
TArea
>
map
=
new
HashMap
<>();
list
.
forEach
(
o
->
map
.
put
(
o
.
getId
().
toString
(),
o
));
for
(
TArea
o
:
list
)
{
TArea
area
=
map
.
get
(
o
.
getParentId
());
if
(
area
!=
null
){
//说明有值
if
(
area
.
getChildren
()==
null
){
area
.
setChildren
(
new
ArrayList
<>());
}
area
.
getChildren
().
add
(
o
);
}
}
list
=
list
.
stream
().
filter
(
o
->
o
.
getType
().
equals
(
"P"
)).
collect
(
Collectors
.
toList
());
return
list
;
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TInteractionServiceImpl.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.model.TInteraction
;
import
cn.wisenergy.chnmuseum.party.mapper.TInteractionMapper
;
import
cn.wisenergy.chnmuseum.party.service.TInteractionService
;
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-23
*/
@Slf4j
@Service
public
class
TInteractionServiceImpl
extends
ServiceImpl
<
TInteractionMapper
,
TInteraction
>
implements
TInteractionService
{
@Resource
private
TInteractionMapper
tInteractionMapper
;
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TOperationLogServiceImpl.java
0 → 100644
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
service
.
impl
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.TOperationLog
;
import
cn.wisenergy.chnmuseum.party.mapper.TOperationLogMapper
;
import
cn.wisenergy.chnmuseum.party.service.TOperationLogService
;
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
;
/**
* <pre>
* 运维日志表 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-03-23
*/
@Slf4j
@Service
public
class
TOperationLogServiceImpl
extends
ServiceImpl
<
TOperationLogMapper
,
TOperationLog
>
implements
TOperationLogService
{
@Autowired
private
TOperationLogMapper
tOperationLogMapper
;
@Override
public
Page
<
TOperationLog
>
pageList
(
Page
<
TOperationLog
>
page
,
TOperationLog
operationLog
)
{
return
page
.
setRecords
(
tOperationLogMapper
.
pageList
(
page
,
operationLog
));
}
}
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
View file @
01f6cb32
...
@@ -59,10 +59,10 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
...
@@ -59,10 +59,10 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
HashMap
<
String
,
TOrgan
>
map1
=
new
HashMap
<>();
HashMap
<
String
,
TOrgan
>
map1
=
new
HashMap
<>();
list1
.
stream
().
forEach
(
o
->
map1
.
put
(
o
.
getName
(),
o
));
list1
.
stream
().
forEach
(
o
->
map1
.
put
(
o
.
getName
(),
o
));
HashMap
<
String
,
Integer
>
area
=
new
HashMap
<>();
HashMap
<
String
,
String
>
area
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
mapList
=
organMapper
.
selectArea
();
List
<
Map
<
String
,
Object
>>
mapList
=
organMapper
.
selectArea
();
mapList
.
stream
().
forEach
(
m
->
area
.
put
(
m
.
get
(
"name"
).
toString
(),
Integer
.
valueOf
(
m
.
get
(
"id"
).
toString
()
)));
mapList
.
stream
().
forEach
(
m
->
area
.
put
(
m
.
get
(
"name"
).
toString
(),
m
.
get
(
"id"
).
toString
(
)));
for
(
int
i
=
0
;
i
<
excelList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
excelList
.
size
();
i
++)
{
Map
<
String
,
String
>
map
=
null
;
Map
<
String
,
String
>
map
=
null
;
...
@@ -77,9 +77,7 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
...
@@ -77,9 +77,7 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
organ
.
setParentId
(
map1
.
get
(
parent
).
getId
());
organ
.
setParentId
(
map1
.
get
(
parent
).
getId
());
organ
.
setLevel
(
map1
.
get
(
parent
).
getLevel
()+
1
);
organ
.
setLevel
(
map1
.
get
(
parent
).
getLevel
()+
1
);
}
}
organ
.
setProvince
(
area
.
get
(
map
.
get
(
"省"
)+
"P"
));
organ
.
setAreaId
(
area
.
get
(
map
.
get
(
"区域"
)));
organ
.
setCity
(
area
.
get
(
map
.
get
(
"市"
)+
"C"
));
organ
.
setCountry
(
area
.
get
(
map
.
get
(
"县"
)+
"T"
));
organ
.
setIcon
(
map
.
get
(
"icon"
));
organ
.
setIcon
(
map
.
get
(
"icon"
));
organ
.
setRemarks
(
map
.
get
(
"备注"
));
organ
.
setRemarks
(
map
.
get
(
"备注"
));
organ
.
setIsDeleted
(
false
);
organ
.
setIsDeleted
(
false
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/SysLogController.java
View file @
01f6cb32
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
package
cn
.
wisenergy
.
chnmuseum
.
party
.
web
.
controller
;
import
cn.wisenergy.chnmuseum.party.common.log.OperType
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil80
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil80
;
import
cn.wisenergy.chnmuseum.party.common.util.NetWorkUtil
;
import
cn.wisenergy.chnmuseum.party.common.util.NetWorkUtil
;
import
cn.wisenergy.chnmuseum.party.model.RunLog
;
import
cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam
;
import
cn.wisenergy.chnmuseum.party.model.SysLog
;
import
cn.wisenergy.chnmuseum.party.model.*
;
import
cn.wisenergy.chnmuseum.party.service.TOperationLogService
;
import
cn.wisenergy.chnmuseum.party.service.impl.RunLogServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.RunLogServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.SysLogServiceImpl
;
import
cn.wisenergy.chnmuseum.party.service.impl.SysLogServiceImpl
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
cn.wisenergy.chnmuseum.party.web.controller.base.BaseController
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
@@ -24,6 +29,11 @@ import org.springframework.web.context.request.ServletRequestAttributes;
...
@@ -24,6 +29,11 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RestController
@RequestMapping
(
"/sysLog"
)
@RequestMapping
(
"/sysLog"
)
...
@@ -35,12 +45,15 @@ public class SysLogController extends BaseController {
...
@@ -35,12 +45,15 @@ public class SysLogController extends BaseController {
@Resource
@Resource
private
RunLogServiceImpl
runLogService
;
private
RunLogServiceImpl
runLogService
;
@Resource
private
TOperationLogService
operationLogService
;
/**
/**
* 插入系统日志表
* 插入系统日志表
*/
*/
@ApiOperation
(
value
=
"插入系统日志"
,
notes
=
"插入系统日志"
)
@ApiOperation
(
value
=
"插入系统日志"
,
notes
=
"插入系统日志"
)
@PostMapping
(
value
=
"/insertSysLog"
)
@PostMapping
(
value
=
"/insertSysLog"
)
public
Boolean
insertSysLog
(
String
operationContent
,
String
username
,
String
id
)
{
public
Boolean
insertSysLog
(
String
operationContent
,
String
username
,
String
id
)
{
SysLog
sysLog
=
new
SysLog
();
SysLog
sysLog
=
new
SysLog
();
//日志时间
//日志时间
sysLog
.
setOperationTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
sysLog
.
setOperationTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
...
@@ -57,7 +70,7 @@ public class SysLogController extends BaseController {
...
@@ -57,7 +70,7 @@ public class SysLogController extends BaseController {
}
}
if
(
"1"
.
equals
(
id
))
{
if
(
"1"
.
equals
(
id
))
{
sysLog
.
setType
(
1
);
sysLog
.
setType
(
1
);
}
else
{
}
else
{
sysLog
.
setType
(
2
);
sysLog
.
setType
(
2
);
}
}
//日志内容
//日志内容
...
@@ -72,17 +85,38 @@ public class SysLogController extends BaseController {
...
@@ -72,17 +85,38 @@ public class SysLogController extends BaseController {
* 查询系统日志
* 查询系统日志
*/
*/
@ApiOperation
(
value
=
"查询系统日志"
,
notes
=
"查询系统日志"
)
@ApiOperation
(
value
=
"查询系统日志"
,
notes
=
"查询系统日志"
)
@ApiImplicitParams
({
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
required
=
false
,
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"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"日志类型"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"operationType"
,
value
=
"操作类型"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
value
=
"/querySysLogList"
)
@GetMapping
(
value
=
"/querySysLogList"
)
@RequiresPermissions
(
"/sysLog/querySysLogList"
)
@RequiresPermissions
(
"/sysLog/querySysLogList"
)
public
ResponseEntity
<
Page
<
SysLog
>>
querySysLogList
()
{
public
ResponseEntity
<
Page
<
SysLog
>>
querySysLogList
(
GenericPageParam
genericPageParam
)
{
try
{
try
{
QueryWrapper
<
SysLog
>
ew
=
new
QueryWrapper
<>();
LambdaQueryWrapper
<
SysLog
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
ew
.
orderByDesc
(
"operation_time"
);
// 对名称或编码模糊查询
Page
<
SysLog
>
page
=
getPage
();
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
page
=
sysLogService
.
page
(
page
,
ew
);
queryWrapper
.
like
(
SysLog:
:
getOperator
,
genericPageParam
.
getNameOrCode
());
}
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getType
()))
{
queryWrapper
.
eq
(
SysLog:
:
getType
,
genericPageParam
.
getType
());
}
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getOperationType
()))
{
queryWrapper
.
eq
(
SysLog:
:
getOperationType
,
genericPageParam
.
getOperationType
());
}
// 根据创建时间区间检索
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
queryWrapper
.
ge
(
SysLog:
:
getOperationTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
.
le
(
SysLog:
:
getOperationTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
}
// 设置排序规则
queryWrapper
.
orderByDesc
(
SysLog:
:
getOperationTime
);
Page
<
SysLog
>
page
=
sysLogService
.
page
(
getPage
(),
queryWrapper
);
return
ResponseEntity
.
ok
(
page
);
return
ResponseEntity
.
ok
(
page
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询系统日志列表出错!"
,
e
);
logger
.
error
(
"查询系统日志列表出错!"
,
e
);
...
@@ -100,5 +134,80 @@ public class SysLogController extends BaseController {
...
@@ -100,5 +134,80 @@ public class SysLogController extends BaseController {
return
b
;
return
b
;
}
}
/**
* 插入运维日志表
*/
@ApiOperation
(
value
=
"插入运维日志表"
,
notes
=
"插入运维日志表"
)
@PostMapping
(
value
=
"/insertOperationLog"
)
public
Boolean
insertOperationLog
(
TOperationLog
tOperationLog
)
{
tOperationLog
.
setCreateTime
(
LocalDateTime
.
now
());
boolean
b
=
operationLogService
.
save
(
tOperationLog
);
return
b
;
}
/**
* 查询运维日志
*/
@ApiOperation
(
value
=
"查询运维日志"
,
notes
=
"查询运维日志"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"运维账号"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
value
=
"/OperationLog"
)
@RequiresPermissions
(
"/sysLog/OperationLog"
)
public
ResponseEntity
<
Page
<
TOperationLog
>>
OperationLog
(
TOperationLog
operationLog
)
{
try
{
Page
<
TOperationLog
>
page
=
operationLogService
.
pageList
(
getPage
(),
operationLog
);
return
ResponseEntity
.
ok
(
page
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询系统日志列表出错!"
,
e
);
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
/**
* 查询机顶盒日志
*/
@ApiOperation
(
value
=
"查询机顶盒日志"
,
notes
=
"查询机顶盒日志"
)
@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"
)
})
@GetMapping
(
value
=
"/runLogList"
)
@RequiresPermissions
(
"/sysLog/runLogList"
)
public
ResponseEntity
<
Page
<
RunLog
>>
runLogList
(
RunLog
runLog
)
{
try
{
Page
<
RunLog
>
page
=
runLogService
.
pageList
(
getPage
(),
runLog
);
return
ResponseEntity
.
ok
(
page
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询系统日志列表出错!"
,
e
);
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
/**
* 返回日志操作类型
* @param
* @return
*/
@PostMapping
(
"/getOperationType"
)
@RequiresPermissions
(
"/sysLog/getOperationType"
)
@ApiOperation
(
value
=
"返回日志操作类型"
,
notes
=
"返回日志操作类型"
)
public
Map
<
String
,
Object
>
getTInteractionPageList
()
{
OperType
[]
values
=
OperType
.
values
();
ArrayList
<
String
>
list
=
new
ArrayList
<>();
for
(
OperType
value
:
values
)
{
list
.
add
(
value
.
getMsg
());
}
return
getResult
(
list
);
}
}
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TInteractionController.java
0 → 100644
View file @
01f6cb32
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.util.DateUtil80
;
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.TInteraction
;
import
cn.wisenergy.chnmuseum.party.service.TInteractionService
;
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.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
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.time.LocalDateTime
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* <pre>
* 看板互动 前端控制器
* </pre>
*
* @author Danny Lee
* @since 2021-03-23
*/
@Slf4j
@RestController
@RequestMapping
(
"/interaction"
)
@Api
(
tags
=
{
"看板互动操作接口"
})
public
class
TInteractionController
extends
BaseController
{
@Resource
private
TInteractionService
tInteractionService
;
@Resource
private
TUserServiceImpl
userService
;
@PostMapping
(
"/add"
)
@RequiresPermissions
(
"/interaction/add"
)
@ApiOperation
(
value
=
"添加看板互动"
,
notes
=
"添加看板互动"
)
public
Map
<
String
,
Object
>
saveTInteraction
(
TInteraction
tInteraction
)
{
Map
<
String
,
Object
>
resultMap
=
new
LinkedHashMap
<
String
,
Object
>();
if
(
StringUtils
.
isBlank
(
tInteraction
.
getName
())||
StringUtils
.
isBlank
(
tInteraction
.
getPassword
()))
{
resultMap
.
put
(
"code"
,
400
);
resultMap
.
put
(
"msg"
,
"请输入用户名和密码"
);
return
resultMap
;
}
TUser
user
=
userService
.
selectByUsername
(
tInteraction
.
getName
());
if
(
user
==
null
)
{
resultMap
.
put
(
"code"
,
500
);
resultMap
.
put
(
"msg"
,
"用户名错误"
);
return
resultMap
;
}
byte
[]
salt
=
user
.
getPasswordSalt
();
if
(!
new
String
(
SHA256PasswordEncryptionService
.
createPasswordHash
(
tInteraction
.
getPassword
(),
salt
))
.
equals
(
new
String
(
user
.
getPasswordHash
())))
{
resultMap
.
put
(
"code"
,
500
);
resultMap
.
put
(
"msg"
,
"密码错误"
);
return
resultMap
;
}
tInteraction
.
setCreateTime
(
LocalDateTime
.
now
());
// 保存业务节点信息
boolean
result
=
tInteractionService
.
save
(
tInteraction
);
// 返回操作结果
if
(
result
)
{
return
getSuccessResult
();
}
else
{
// 保存失败
return
getFailResult
();
}
}
@PutMapping
(
"/update"
)
@RequiresPermissions
(
"/interaction/update"
)
@ApiOperation
(
value
=
"修改看板互动信息"
,
notes
=
"修改看板互动信息"
)
public
Map
<
String
,
Object
>
updateTInteraction
(
@Validated
(
value
=
{
Update
.
class
})
TInteraction
tInteraction
)
{
boolean
flag
=
tInteractionService
.
updateById
(
tInteraction
);
if
(
flag
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@DeleteMapping
(
"/delete"
)
@RequiresPermissions
(
"/interaction/delete"
)
@ApiOperation
(
value
=
"根据ID删除看板互动"
,
notes
=
"根据ID删除看板互动"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
paramType
=
"path"
,
dataType
=
"String"
)
})
public
Map
<
String
,
Object
>
deleteTInteraction
(
@PathVariable
(
"id"
)
String
id
)
{
boolean
result
=
tInteractionService
.
removeById
(
id
);
if
(
result
)
{
return
getSuccessResult
();
}
return
getFailResult
();
}
@PostMapping
(
"/getList"
)
@RequiresPermissions
(
"/interaction/getList"
)
@ApiOperation
(
value
=
"获取看板互动列表"
,
notes
=
"获取看板互动列表"
)
public
Map
<
String
,
Object
>
getTInteractionPageList
(
String
orgId
)
{
List
<
TInteraction
>
list
=
tInteractionService
.
list
(
new
UpdateWrapper
<
TInteraction
>().
eq
(
"organ_id"
,
orgId
));
return
getResult
(
list
);
}
@ApiOperation
(
value
=
"获取看板互动详情"
,
notes
=
"获取看板互动详情"
)
@GetMapping
(
"/getById"
)
@RequiresPermissions
(
"/interaction/getById"
)
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
TInteraction
tInteraction
=
tInteractionService
.
getById
(
id
);
return
getResult
(
tInteraction
);
}
// @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("/interaction/getPageList")
// @ApiOperation(value = "获取看板互动分页列表", notes = "获取看板互动分页列表")
// public Map<String, Object> getTInteractionPageList(GenericPageParam genericPageParam) {
// LambdaQueryWrapper<TInteraction> queryWrapper = new LambdaQueryWrapper<>();
// // 对名称或编码模糊查询
// if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
// queryWrapper.like(TInteraction::getUsername, genericPageParam.getNameOrCode());
// }
// // 根据创建时间区间检索
// if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
// queryWrapper.ge(TInteraction::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
// .le(TInteraction::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
// }
// // 设置排序规则
// queryWrapper.orderByDesc(TInteraction::getCreateTime);
// Page<TInteraction> page = this.tInteractionService.page(getPage(), queryWrapper);
// for (TInteraction tInteraction : page.getRecords()) {
//
// }
// return getResult(page);
// }
}
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TOperationLogController.java
0 → 100644
View file @
01f6cb32
//package cn.wisenergy.chnmuseum.party.web.controller;
//
//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.TOperationLog;
//import cn.wisenergy.chnmuseum.party.service.TOperationLogService;
//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-23
// */
//@Slf4j
//@RestController
//@RequestMapping("/tOperationLog")
//@Api(tags = {"运维日志表操作接口"})
//public class TOperationLogController extends BaseController {
//
// @Resource
// private TOperationLogService tOperationLogService;
//
// @PostMapping("/batchSave")
// @RequiresPermissions("t:operation:log:batch:save")
// @ApiOperation(value = "批量添加运维日志表", notes = "批量添加运维日志表")
// public Map<String, Object> batchSaveTOperationLog(@Validated(value = {Add.class}) List<TOperationLog> tOperationLogList) {
// // 保存业务节点信息
// boolean result = tOperationLogService.saveBatch(tOperationLogList);
// // 返回操作结果
// if (result) {
// return getSuccessResult();
// } else {
// // 保存失败
// return getFailResult();
// }
// }
//
// @PostMapping("/save")
// @RequiresPermissions("t:operation:log:save")
// @ApiOperation(value = "添加运维日志表", notes = "添加运维日志表")
// public Map<String, Object> saveTOperationLog(@Validated(value = {Add.class}) TOperationLog tOperationLog) {
// // 保存业务节点信息
// boolean result = tOperationLogService.save(tOperationLog);
// // 返回操作结果
// if (result) {
// return getSuccessResult();
// } else {
// // 保存失败
// return getFailResult();
// }
// }
//
// @PutMapping("/update")
// @RequiresPermissions("t:operation:log:update")
// @ApiOperation(value = "修改运维日志表信息", notes = "修改运维日志表信息")
// public Map<String, Object> updateTOperationLog(@Validated(value = {Update.class}) TOperationLog tOperationLog) {
// boolean flag = tOperationLogService.updateById(tOperationLog);
// if (flag) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @PutMapping("/updateAuditStatus/{id}")
// @RequiresPermissions("t:operation:log:update:audit:status")
// @ApiOperation(value = "更新运维日志表审核状态", notes = "更新运维日志表审核状态")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
// @ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String")
// })
// public Map<String, Object> updateStatus(@NotNull(message = "运维日志表ID不能为空") @PathVariable("id") String id, @RequestParam("status") AuditStatusEnum status) {
// UpdateWrapper<TOperationLog> updateWrapper = new UpdateWrapper<>();
// updateWrapper.eq("id", id);
// updateWrapper.eq("audit_status", status.name());
// boolean flag = tOperationLogService.update(updateWrapper);
// if (flag) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @DeleteMapping("/delete/{id}")
// @RequiresPermissions("t:operation:log:delete")
// @ApiOperation(value = "根据ID删除运维日志表", notes = "根据ID删除运维日志表")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
// })
// public Map<String, Object> deleteTOperationLog(@PathVariable("id") String id) {
// boolean result = tOperationLogService.removeById(id);
// if (result) {
// return getSuccessResult();
// }
// return getFailResult();
// }
//
// @GetMapping("/getList")
// @RequiresPermissions("t:operation:log:list")
// @ApiOperation(value = "获取运维日志表全部列表(无分页)", notes = "获取运维日志表全部列表(无分页)")
// @ApiImplicitParams(value = {
// @ApiImplicitParam(name = "auditStatus", value = "审核状态", paramType = "query", dataType = "String")
// })
// public Map<String, Object> getTOperationLogList(@RequestParam(value = "auditStatus", defaultValue = "APPROVED_FINAL", required = false) AuditStatusEnum auditStatus) {
// List<TOperationLog> tOperationLogList = tOperationLogService.list();
// return getResult(tOperationLogList);
// }
//
// @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("t:operation:log:page")
// @ApiOperation(value = "获取运维日志表分页列表", notes = "获取运维日志表分页列表")
// public Map<String, Object> getTOperationLogPageList(GenericPageParam genericPageParam) {
// LambdaQueryWrapper<TOperationLog> queryWrapper = new LambdaQueryWrapper<>();
// // 对名称或编码模糊查询
// if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
// queryWrapper.like(TOperationLog::getUserId, genericPageParam.getNameOrCode());
// }
// // 根据创建时间区间检索
// if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
// queryWrapper.ge(TOperationLog::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
// .le(TOperationLog::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
// }
// // 设置排序规则
// queryWrapper.orderByDesc(TOperationLog::getCreateTime);
// Page<TOperationLog> page = this.tOperationLogService.page(getPage(), queryWrapper);
// for (TOperationLog tOperationLog : page.getRecords()) {
//
// }
// return getResult(page);
// }
//
// @ApiOperation(value = "获取运维日志表详情", notes = "获取运维日志表详情")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path")
// })
// @GetMapping("/get/{id}")
// @RequiresPermissions("t:operation:log:get:id")
// public Map<String, Object> getById(@PathVariable("id") String id) {
// TOperationLog tOperationLog = tOperationLogService.getById(id);
// return getResult(tOperationLog);
// }
//
//}
//
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TOrganController.java
View file @
01f6cb32
...
@@ -5,6 +5,8 @@ import cn.wisenergy.chnmuseum.party.common.log.OperModule;
...
@@ -5,6 +5,8 @@ import cn.wisenergy.chnmuseum.party.common.log.OperModule;
import
cn.wisenergy.chnmuseum.party.common.log.OperType
;
import
cn.wisenergy.chnmuseum.party.common.log.OperType
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil80
;
import
cn.wisenergy.chnmuseum.party.common.util.DateUtil80
;
import
cn.wisenergy.chnmuseum.party.common.util.ImportExcelUtil
;
import
cn.wisenergy.chnmuseum.party.common.util.ImportExcelUtil
;
import
cn.wisenergy.chnmuseum.party.model.TArea
;
import
cn.wisenergy.chnmuseum.party.service.TAreaService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
@@ -61,6 +63,9 @@ public class TOrganController extends BaseController {
...
@@ -61,6 +63,9 @@ public class TOrganController extends BaseController {
@Resource
@Resource
private
TOrganService
tOrganService
;
private
TOrganService
tOrganService
;
@Resource
private
TAreaService
tAreaService
;
@PostMapping
(
"/add"
)
@PostMapping
(
"/add"
)
@RequiresPermissions
(
"/organ/add"
)
@RequiresPermissions
(
"/organ/add"
)
...
@@ -176,6 +181,15 @@ public class TOrganController extends BaseController {
...
@@ -176,6 +181,15 @@ public class TOrganController extends BaseController {
return
getResult
(
list
);
return
getResult
(
list
);
}
}
@GetMapping
(
"/getAreaTree"
)
@RequiresPermissions
(
"/organ/getAreaTree"
)
@ApiOperation
(
value
=
"获取区域树"
,
notes
=
"获取机构树"
)
// @MethodLog(operModule = OperModule.ORG,operType = OperType.SELECT)
public
Map
<
String
,
Object
>
getAreaTree
()
{
List
<
TArea
>
list
=
tAreaService
.
getAreaTree
();
return
getResult
(
list
);
}
// 导入EXCEL
// 导入EXCEL
@ApiOperation
(
value
=
"导入EXCEL"
,
notes
=
"导入EXCEL"
,
httpMethod
=
"POST"
)
@ApiOperation
(
value
=
"导入EXCEL"
,
notes
=
"导入EXCEL"
,
httpMethod
=
"POST"
)
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TUserController.java
View file @
01f6cb32
...
@@ -62,140 +62,141 @@ public class TUserController extends BaseController {
...
@@ -62,140 +62,141 @@ public class TUserController extends BaseController {
private
TUserRoleService
tUserRoleService
;
private
TUserRoleService
tUserRoleService
;
@Resource
@Resource
private
RoleService
roleService
;
private
RoleService
roleService
;
@Resource
@Resource
private
StringRedisTemplate
stringRedisTemplate
;
private
StringRedisTemplate
stringRedisTemplate
;
private
static
final
String
SHIRO_JWT_TOKEN
=
"shiro:jwt:token"
;
private
static
final
String
SHIRO_JWT_TOKEN
=
"shiro:jwt:token"
;
//用户登录是否被锁定 一小时 redisKey 前缀
//用户登录是否被锁定 一小时 redisKey 前缀
private
String
SHIRO_IS_LOCK
=
"shiro_is_lock_"
;
private
String
SHIRO_IS_LOCK
=
"shiro_is_lock_"
;
/**
* 查询成员列表
/**
*
* 查询成员列表
* @param userName (用户名称)
*
* @return
* @param userName (用户名称)
*/
* @return
@ApiOperation
(
value
=
"查询成员列表"
)
*/
@RequestMapping
(
value
=
"/getUserList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
value
=
"查询成员列表"
)
@RequiresPermissions
(
"/user/getUserList"
)
@RequestMapping
(
value
=
"/getUserList"
,
method
=
RequestMethod
.
GET
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
SELECT
)
@RequiresPermissions
(
"/user/getUserList"
)
public
ResponseEntity
<
Page
<
TUser
>>
queryUserList
(
String
userName
)
{
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
SELECT
)
try
{
public
ResponseEntity
<
Page
<
TUser
>>
queryUserList
(
String
userName
)
{
userName
=
StringUtils
.
trimToNull
(
userName
);
try
{
Page
<
TUser
>
page
=
getPage
();
userName
=
StringUtils
.
trimToNull
(
userName
);
Page
<
TUser
>
userPage
=
userService
.
selectList
(
page
,
userName
);
Page
<
TUser
>
page
=
getPage
();
return
ResponseEntity
.
ok
(
userPage
);
Page
<
TUser
>
userPage
=
userService
.
selectList
(
page
,
userName
);
}
catch
(
Exception
e
)
{
return
ResponseEntity
.
ok
(
userPage
);
logger
.
error
(
"查询成员列表出错!"
,
e
);
}
catch
(
Exception
e
)
{
}
logger
.
error
(
"查询成员列表出错!"
,
e
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"_index"
,
value
=
"分页起始偏移量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"_size"
,
value
=
"返回条数"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"nameOrCode"
,
value
=
"名称或编码"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"创建时间-开始"
,
paramType
=
"query"
,
dataType
=
"String"
),
})
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"创建时间-结束"
,
paramType
=
"query"
,
dataType
=
"String"
)
@PostMapping
(
"/getPageList"
)
})
@RequiresPermissions
(
"/user/getPageList"
)
@PostMapping
(
"/getPageList"
)
@ApiOperation
(
value
=
"获取用户分页列表"
,
notes
=
"获取用户分页列表"
)
@RequiresPermissions
(
"/user/getPageList"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
SELECT
)
@ApiOperation
(
value
=
"获取用户分页列表"
,
notes
=
"获取用户分页列表"
)
public
Map
<
String
,
Object
>
getPageList
(
GenericPageParam
genericPageParam
)
{
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
SELECT
)
LambdaQueryWrapper
<
TUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
public
Map
<
String
,
Object
>
getPageList
(
GenericPageParam
genericPageParam
)
{
// 对名称或编码模糊查询
LambdaQueryWrapper
<
TUser
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
// 对名称或编码模糊查询
queryWrapper
.
like
(
TUser:
:
getUserName
,
genericPageParam
.
getNameOrCode
());
if
(
StringUtils
.
isNotBlank
(
genericPageParam
.
getNameOrCode
()))
{
}
queryWrapper
.
like
(
TUser:
:
getUserName
,
genericPageParam
.
getNameOrCode
());
// 根据创建时间区间检索
}
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
// 根据创建时间区间检索
queryWrapper
.
ge
(
TUser:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
if
(
genericPageParam
.
getStartDate
()
!=
null
&&
genericPageParam
.
getEndDate
()
!=
null
)
{
.
le
(
TUser:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
queryWrapper
.
ge
(
TUser:
:
getCreateTime
,
genericPageParam
.
getStartDate
().
atTime
(
0
,
0
,
0
))
}
.
le
(
TUser:
:
getCreateTime
,
genericPageParam
.
getEndDate
().
atTime
(
23
,
59
,
59
));
// 设置排序规则
}
queryWrapper
.
orderByDesc
(
TUser:
:
getCreateTime
);
// 设置排序规则
Page
<
TUser
>
page
=
userService
.
page
(
getPage
(),
queryWrapper
);
queryWrapper
.
orderByDesc
(
TUser:
:
getCreateTime
);
return
getResult
(
page
);
Page
<
TUser
>
page
=
userService
.
page
(
getPage
(),
queryWrapper
);
}
return
getResult
(
page
);
}
@ApiOperation
(
value
=
"获取用户详情"
,
notes
=
"获取用户详情"
)
@GetMapping
(
"/getById"
)
@ApiOperation
(
value
=
"获取用户详情"
,
notes
=
"获取用户详情"
)
@RequiresPermissions
(
"/user/getById"
)
@GetMapping
(
"/getById"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
SELECT
)
@RequiresPermissions
(
"/user/getById"
)
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
SELECT
)
TUser
tUser
=
userService
.
getById
(
id
);
public
Map
<
String
,
Object
>
getById
(
String
id
)
{
List
<
Role
>
list
=
roleService
.
selectRoleByUserId
(
id
);
TUser
tUser
=
userService
.
getById
(
id
);
tUser
.
setRoleList
(
list
);
List
<
Role
>
list
=
roleService
.
selectRoleByUserId
(
id
);
return
getResult
(
tUser
);
tUser
.
setRoleList
(
list
);
}
return
getResult
(
tUser
);
}
//新增
@OperationLog
(
"新增成员"
)
//新增
@ApiOperation
(
value
=
"新增成员"
)
@OperationLog
(
"新增成员"
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
value
=
"新增成员"
)
@RequiresPermissions
(
"/user/add"
)
@RequestMapping
(
value
=
"/add"
,
method
=
RequestMethod
.
POST
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
ADD
)
@RequiresPermissions
(
"/user/add"
)
public
ResponseEntity
<
Map
<
String
,
Object
>>
add
(
@RequestBody
TUser
user
)
{
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
ADD
)
Map
<
String
,
Object
>
resultMap
=
new
LinkedHashMap
<
String
,
Object
>();
public
ResponseEntity
<
Map
<
String
,
Object
>>
add
(
@RequestBody
TUser
user
)
{
try
{
Map
<
String
,
Object
>
resultMap
=
new
LinkedHashMap
<
String
,
Object
>();
if
(
StringUtils
.
isBlank
(
user
.
getUserName
()))
{
try
{
resultMap
.
put
(
"status"
,
400
);
if
(
StringUtils
.
isBlank
(
user
.
getUserName
()))
{
resultMap
.
put
(
"message"
,
"账号不能为空!"
);
resultMap
.
put
(
"status"
,
400
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
resultMap
.
put
(
"message"
,
"账号不能为空!"
);
}
else
{
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
user
.
setUserName
(
StringUtils
.
trimToNull
(
user
.
getUserName
()));
}
else
{
}
user
.
setUserName
(
StringUtils
.
trimToNull
(
user
.
getUserName
()));
if
(
StringUtils
.
isBlank
(
user
.
getPassword
()))
{
}
resultMap
.
put
(
"status"
,
400
);
if
(
StringUtils
.
isBlank
(
user
.
getPassword
()))
{
resultMap
.
put
(
"message"
,
"密码不能为空!"
);
resultMap
.
put
(
"status"
,
400
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
resultMap
.
put
(
"message"
,
"密码不能为空!"
);
}
else
{
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
user
.
setPassword
(
StringUtils
.
trimToNull
(
user
.
getPassword
()));
}
else
{
}
user
.
setPassword
(
StringUtils
.
trimToNull
(
user
.
getPassword
()));
if
(
StringUtils
.
isBlank
(
user
.
getRealName
()))
{
}
resultMap
.
put
(
"status"
,
400
);
if
(
StringUtils
.
isBlank
(
user
.
getRealName
()))
{
resultMap
.
put
(
"message"
,
"姓名不能为空!"
);
resultMap
.
put
(
"status"
,
400
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
resultMap
.
put
(
"message"
,
"姓名不能为空!"
);
}
else
{
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
user
.
setRealName
(
StringUtils
.
trimToNull
(
user
.
getRealName
()));
}
else
{
}
user
.
setRealName
(
StringUtils
.
trimToNull
(
user
.
getRealName
()));
}
if
(
user
.
getRoleList
()==
null
||
user
.
getRoleList
().
size
()<
1
)
{
resultMap
.
put
(
"status"
,
400
);
if
(
user
.
getRoleList
()
==
null
||
user
.
getRoleList
().
size
()
<
1
)
{
resultMap
.
put
(
"message"
,
"请选择角色!"
);
resultMap
.
put
(
"status"
,
400
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
resultMap
.
put
(
"message"
,
"请选择角色!"
);
}
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
if
(
StringUtils
.
isBlank
(
user
.
getOrgId
()))
{
}
resultMap
.
put
(
"status"
,
400
);
if
(
StringUtils
.
isBlank
(
user
.
getOrgId
()))
{
resultMap
.
put
(
"message"
,
"请选择机构!"
);
resultMap
.
put
(
"status"
,
400
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
resultMap
.
put
(
"message"
,
"请选择机构!"
);
}
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
QueryWrapper
<
TUser
>
ew
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNoneBlank
(
user
.
getUserName
()))
{
QueryWrapper
<
TUser
>
ew
=
new
QueryWrapper
<>();
user
.
setUserName
(
user
.
getUserName
().
trim
());
if
(
StringUtils
.
isNoneBlank
(
user
.
getUserName
()))
{
ew
.
eq
(
"is_deleted"
,
0
);
user
.
setUserName
(
user
.
getUserName
().
trim
());
ew
.
eq
(
"user_name"
,
user
.
getUserName
());
ew
.
eq
(
"is_deleted"
,
0
);
TUser
one
=
this
.
userService
.
getOne
(
ew
);
ew
.
eq
(
"user_name"
,
user
.
getUserName
());
if
(
one
!=
null
)
{
TUser
one
=
this
.
userService
.
getOne
(
ew
);
resultMap
.
put
(
"status"
,
400
);
if
(
one
!=
null
)
{
resultMap
.
put
(
"message"
,
"账号已存在!"
);
resultMap
.
put
(
"status"
,
400
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
resultMap
.
put
(
"message"
,
"账号已存在!"
);
}
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
}
}
byte
[]
passwordSalt
=
SecureRandomSaltService
.
generateSalt
();
byte
[]
passwordHash
=
SHA256PasswordEncryptionService
byte
[]
passwordSalt
=
SecureRandomSaltService
.
generateSalt
();
.
createPasswordHash
(
user
.
getPassword
(),
passwordSalt
);
byte
[]
passwordHash
=
SHA256PasswordEncryptionService
user
.
setPasswordSalt
(
passwordSalt
);
.
createPasswordHash
(
user
.
getPassword
(),
passwordSalt
);
user
.
setPasswordHash
(
passwordHash
);
user
.
setPasswordSalt
(
passwordSalt
);
user
.
setCreateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
user
.
setPasswordHash
(
passwordHash
);
user
.
setUpdateTime
(
user
.
getCreateTime
());
user
.
setCreateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
user
.
setIsDeleted
(
false
);
user
.
setUpdateTime
(
user
.
getCreateTime
());
user
.
setIsDeleted
(
false
);
boolean
ret
=
this
.
userService
.
save
(
user
);
boolean
ret
=
this
.
userService
.
save
(
user
);
List
<
Role
>
list
=
user
.
getRoleList
();
List
<
Role
>
list
=
user
.
getRoleList
();
List
<
TUserRole
>
list1
=
new
ArrayList
<>();
List
<
TUserRole
>
list1
=
new
ArrayList
<>();
...
@@ -207,307 +208,305 @@ public class TUserController extends BaseController {
...
@@ -207,307 +208,305 @@ public class TUserController extends BaseController {
list1
.
add
(
entity
);
list1
.
add
(
entity
);
}
}
this
.
tUserRoleService
.
saveBatch
(
list1
);
this
.
tUserRoleService
.
saveBatch
(
list1
);
if
(!
ret
)
{
if
(!
ret
)
{
// 新增失败, 500
// 新增失败, 500
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
"服务器忙"
);
resultMap
.
put
(
"message"
,
"服务器忙"
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
)
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
)
.
body
(
resultMap
);
.
body
(
resultMap
);
}
}
resultMap
.
put
(
"status"
,
200
);
resultMap
.
put
(
"status"
,
200
);
resultMap
.
put
(
"message"
,
"添加成功"
);
resultMap
.
put
(
"message"
,
"添加成功"
);
// 201
// 201
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
resultMap
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
"服务器忙"
);
resultMap
.
put
(
"message"
,
"服务器忙"
);
logger
.
error
(
"新增成员错误!"
,
e
);
logger
.
error
(
"新增成员错误!"
,
e
);
}
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
}
// 编辑用户信息
// 编辑用户信息
@OperationLog
(
"修改成员信息"
)
@OperationLog
(
"修改成员信息"
)
@ApiOperation
(
value
=
"编辑用户信息(必须传 1username 2name 3roleId)"
)
@ApiOperation
(
value
=
"编辑用户信息(必须传 1username 2name 3roleId)"
)
@PutMapping
(
value
=
"/update"
)
@PutMapping
(
value
=
"/update"
)
@RequiresPermissions
(
"/user/update"
)
@RequiresPermissions
(
"/user/update"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
public
ResponseEntity
<
Map
<
String
,
Object
>>
edit
(
@RequestBody
TUser
user
)
{
public
ResponseEntity
<
Map
<
String
,
Object
>>
edit
(
@RequestBody
TUser
user
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
try
{
try
{
boolean
ret
=
false
;
boolean
ret
=
false
;
if
(
user
.
getId
()
!=
null
)
{
if
(
user
.
getId
()
!=
null
)
{
if
(
"1"
.
equals
(
user
.
getId
())
&&
user
.
getStatus
()
==
"2"
)
{
if
(
"1"
.
equals
(
user
.
getId
())
&&
user
.
getStatus
()
==
"2"
)
{
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"message"
,
"该账号不能被禁用"
);
resultMap
.
put
(
"message"
,
"该账号不能被禁用"
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
}
user
.
setUserName
(
StringUtils
.
trimToNull
(
user
.
getUserName
()));
user
.
setUserName
(
StringUtils
.
trimToNull
(
user
.
getUserName
()));
user
.
setPassword
(
StringUtils
.
trimToNull
(
user
.
getPassword
()));
user
.
setPassword
(
StringUtils
.
trimToNull
(
user
.
getPassword
()));
user
.
setRealName
(
StringUtils
.
trimToNull
(
user
.
getRealName
()));
user
.
setRealName
(
StringUtils
.
trimToNull
(
user
.
getRealName
()));
user
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
user
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
ret
=
userService
.
updateById
(
user
);
ret
=
userService
.
updateById
(
user
);
//查询当前用户拥有的角色
//查询当前用户拥有的角色
QueryWrapper
<
TUserRole
>
userRoleWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
TUserRole
>
userRoleWrapper
=
new
QueryWrapper
<>();
userRoleWrapper
.
eq
(
"user_id"
,
user
.
getId
());
userRoleWrapper
.
eq
(
"user_id"
,
user
.
getId
());
boolean
remove
=
tUserRoleService
.
remove
(
userRoleWrapper
);
boolean
remove
=
tUserRoleService
.
remove
(
userRoleWrapper
);
List
<
Role
>
list
=
user
.
getRoleList
();
List
<
Role
>
list
=
user
.
getRoleList
();
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
ArrayList
<
TUserRole
>
list1
=
new
ArrayList
<>();
ArrayList
<
TUserRole
>
list1
=
new
ArrayList
<>();
for
(
Role
r
:
list
)
{
for
(
Role
r
:
list
)
{
TUserRole
userRole
=
new
TUserRole
();
TUserRole
userRole
=
new
TUserRole
();
userRole
.
setUserId
(
user
.
getId
());
userRole
.
setUserId
(
user
.
getId
());
userRole
.
setRoleId
(
r
.
getId
());
userRole
.
setRoleId
(
r
.
getId
());
userRole
.
setIsDeleted
(
false
);
userRole
.
setIsDeleted
(
false
);
list1
.
add
(
userRole
);
list1
.
add
(
userRole
);
}
}
ret
=
this
.
tUserRoleService
.
saveBatch
(
list1
);
ret
=
this
.
tUserRoleService
.
saveBatch
(
list1
);
}
}
}
else
{
}
else
{
// 更新失败, 400
// 更新失败, 400
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"message"
,
"请选择用户"
);
resultMap
.
put
(
"message"
,
"请选择用户"
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
}
if
(!
ret
)
{
if
(!
ret
)
{
// 更新失败, 500
// 更新失败, 500
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
"服务器忙"
);
resultMap
.
put
(
"message"
,
"服务器忙"
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
}
// 204
// 204
resultMap
.
put
(
"status"
,
201
);
resultMap
.
put
(
"status"
,
201
);
resultMap
.
put
(
"message"
,
"更新成功"
);
resultMap
.
put
(
"message"
,
"更新成功"
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
resultMap
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"更新错误!"
,
e
);
logger
.
error
(
"更新错误!"
,
e
);
}
}
// 500
// 500
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
build
();
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
build
();
}
}
/**
/**
* 删除
* 删除
*
*
* @param userId
* @param userId
* @return
* @return
*/
*/
@OperationLog
(
"删除成员"
)
@OperationLog
(
"删除成员"
)
@ApiOperation
(
value
=
"删除成员"
)
@ApiOperation
(
value
=
"删除成员"
)
@DeleteMapping
(
value
=
"/delete"
)
@DeleteMapping
(
value
=
"/delete"
)
@RequiresPermissions
(
"/user/delete"
)
@RequiresPermissions
(
"/user/delete"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
DELETE
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
DELETE
)
public
ResponseEntity
<
Map
<
String
,
Object
>>
delete
(
String
userId
)
{
public
ResponseEntity
<
Map
<
String
,
Object
>>
delete
(
String
userId
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
try
{
try
{
if
(
"1"
.
equals
(
userId
))
{
if
(
"1"
.
equals
(
userId
))
{
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"message"
,
"该账号不能被删除"
);
resultMap
.
put
(
"message"
,
"该账号不能被删除"
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
}
TUser
entity
=
new
TUser
();
TUser
entity
=
new
TUser
();
entity
.
setId
(
userId
);
entity
.
setId
(
userId
);
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
entity
.
setIsDeleted
(
true
);
entity
.
setIsDeleted
(
true
);
boolean
ret1
=
this
.
userService
.
updateById
(
entity
);
boolean
ret1
=
this
.
userService
.
updateById
(
entity
);
QueryWrapper
<
TUserRole
>
userRoleWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
TUserRole
>
userRoleWrapper
=
new
QueryWrapper
<>();
userRoleWrapper
.
eq
(
"user_id"
,
userId
);
userRoleWrapper
.
eq
(
"user_id"
,
userId
);
boolean
ret2
=
this
.
tUserRoleService
.
remove
(
userRoleWrapper
);
boolean
ret2
=
this
.
tUserRoleService
.
remove
(
userRoleWrapper
);
if
(!
ret1
||
!
ret2
)
{
if
(!
ret1
||
!
ret2
)
{
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"message"
,
"删除失败"
);
resultMap
.
put
(
"message"
,
"删除失败"
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
}
resultMap
.
put
(
"status"
,
201
);
resultMap
.
put
(
"status"
,
201
);
resultMap
.
put
(
"message"
,
"删除成功"
);
resultMap
.
put
(
"message"
,
"删除成功"
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
resultMap
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"删除用户出错!"
,
e
);
logger
.
error
(
"删除用户出错!"
,
e
);
}
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
}
/**
/**
* 禁用
* 禁用
*
*
* @param userId
* @param userId
* @return
* @return
*/
*/
@OperationLog
(
"禁用成员"
)
@OperationLog
(
"禁用成员"
)
@ApiOperation
(
value
=
"禁用"
)
@ApiOperation
(
value
=
"禁用"
)
@RequestMapping
(
value
=
"/disable"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/disable"
,
method
=
RequestMethod
.
PUT
)
@RequiresPermissions
(
"/user/disable"
)
@RequiresPermissions
(
"/user/disable"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
DISABLE
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
DISABLE
)
public
ResponseEntity
<
Map
<
String
,
Object
>>
disableTUser
(
String
userId
)
{
public
ResponseEntity
<
Map
<
String
,
Object
>>
disableTUser
(
String
userId
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
try
{
try
{
TUser
entity
=
new
TUser
();
TUser
entity
=
new
TUser
();
entity
.
setId
(
userId
);
entity
.
setId
(
userId
);
entity
.
setStatus
(
"2"
);
entity
.
setStatus
(
"2"
);
Integer
code
=
AuditStatusEnum
.
TBC
.
getCode
();
Integer
code
=
AuditStatusEnum
.
TBC
.
getCode
();
entity
.
setAuditStatus
(
code
.
toString
());
entity
.
setAuditStatus
(
code
.
toString
());
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
boolean
ret
=
this
.
userService
.
updateById
(
entity
);
boolean
ret
=
this
.
userService
.
updateById
(
entity
);
//获取该用户的登陆token
//获取该用户的登陆token
String
userToken
=
stringRedisTemplate
.
opsForValue
().
get
(
SHIRO_JWT_TOKEN
+
userId
);
String
userToken
=
stringRedisTemplate
.
opsForValue
().
get
(
SHIRO_JWT_TOKEN
+
userId
);
if
(
null
!=
userToken
)
{
if
(
null
!=
userToken
)
{
stringRedisTemplate
.
delete
(
userToken
);
stringRedisTemplate
.
delete
(
userToken
);
stringRedisTemplate
.
delete
(
SHIRO_JWT_TOKEN
+
userId
);
stringRedisTemplate
.
delete
(
SHIRO_JWT_TOKEN
+
userId
);
}
}
if
(!
ret
)
{
if
(!
ret
)
{
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"message"
,
"禁用失败"
);
resultMap
.
put
(
"message"
,
"禁用失败"
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
}
resultMap
.
put
(
"status"
,
201
);
resultMap
.
put
(
"status"
,
201
);
resultMap
.
put
(
"message"
,
"禁用成功"
);
resultMap
.
put
(
"message"
,
"禁用成功"
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
resultMap
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"禁用用户出错!"
,
e
);
logger
.
error
(
"禁用用户出错!"
,
e
);
}
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
}
// 启动
// 启动
@OperationLog
(
"启用成员"
)
@OperationLog
(
"启用成员"
)
@ApiOperation
(
value
=
"启用"
)
@ApiOperation
(
value
=
"启用"
)
@RequestMapping
(
value
=
"/enable"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/enable"
,
method
=
RequestMethod
.
PUT
)
@RequiresPermissions
(
"/user/enable"
)
@RequiresPermissions
(
"/user/enable"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UNABLE
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UNABLE
)
public
ResponseEntity
<
Map
<
String
,
Object
>>
enableUser
(
String
userId
)
{
public
ResponseEntity
<
Map
<
String
,
Object
>>
enableUser
(
String
userId
)
{
try
{
try
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
TUser
entity
=
new
TUser
();
TUser
entity
=
new
TUser
();
entity
.
setId
(
userId
);
entity
.
setId
(
userId
);
entity
.
setStatus
(
"1"
);
entity
.
setStatus
(
"1"
);
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
entity
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
boolean
ret
=
this
.
userService
.
updateById
(
entity
);
boolean
ret
=
this
.
userService
.
updateById
(
entity
);
if
(!
ret
)
{
if
(!
ret
)
{
map
.
put
(
"status"
,
"500"
);
map
.
put
(
"status"
,
"500"
);
map
.
put
(
"message"
,
"服务器错误"
);
map
.
put
(
"message"
,
"服务器错误"
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
map
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
map
);
}
}
map
.
put
(
"status"
,
"201"
);
map
.
put
(
"status"
,
"201"
);
map
.
put
(
"message"
,
"启用成功"
);
map
.
put
(
"message"
,
"启用成功"
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
map
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"用户启用出错!"
,
e
);
logger
.
error
(
"用户启用出错!"
,
e
);
}
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
null
);
}
}
@OperationLog
(
"修改密码"
)
@OperationLog
(
"修改密码"
)
@ApiOperation
(
value
=
"管理员更改自己的登录密码"
,
notes
=
"管理员更改自己的登录密码"
)
@ApiOperation
(
value
=
"管理员更改自己的登录密码"
,
notes
=
"管理员更改自己的登录密码"
)
@RequestMapping
(
value
=
"/editPwd"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/editPwd"
,
method
=
RequestMethod
.
PUT
)
@RequiresPermissions
(
"/user/editPwd"
)
@RequiresPermissions
(
"/user/editPwd"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
public
ResponseEntity
<
Map
<
String
,
Object
>>
editPwd
(
@RequestParam
(
value
=
"oldPassWord"
,
required
=
true
)
String
oldPassWord
,
public
ResponseEntity
<
Map
<
String
,
Object
>>
editPwd
(
@RequestParam
(
value
=
"oldPassWord"
,
required
=
true
)
String
oldPassWord
,
@RequestParam
(
value
=
"password"
,
required
=
true
)
String
password
)
{
@RequestParam
(
value
=
"password"
,
required
=
true
)
String
password
)
{
Map
<
String
,
Object
>
resultMap
=
new
LinkedHashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
resultMap
=
new
LinkedHashMap
<
String
,
Object
>();
try
{
try
{
boolean
ret
=
false
;
boolean
ret
=
false
;
TUser
user
=
this
.
userService
.
getById
(
this
.
getUserId
());
TUser
user
=
this
.
userService
.
getById
(
this
.
getUserId
());
byte
[]
salt
=
user
.
getPasswordSalt
();
byte
[]
salt
=
user
.
getPasswordSalt
();
if
(
new
String
(
SHA256PasswordEncryptionService
.
createPasswordHash
(
oldPassWord
,
salt
))
if
(
new
String
(
SHA256PasswordEncryptionService
.
createPasswordHash
(
oldPassWord
,
salt
))
.
equals
(
new
String
(
user
.
getPasswordHash
())))
{
.
equals
(
new
String
(
user
.
getPasswordHash
())))
{
salt
=
SecureRandomSaltService
.
generateSalt
();
salt
=
SecureRandomSaltService
.
generateSalt
();
user
.
setPasswordSalt
(
salt
);
user
.
setPasswordSalt
(
salt
);
user
.
setPasswordHash
((
SHA256PasswordEncryptionService
.
createPasswordHash
(
password
,
salt
)));
user
.
setPasswordHash
((
SHA256PasswordEncryptionService
.
createPasswordHash
(
password
,
salt
)));
user
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
user
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
ret
=
this
.
userService
.
updateById
(
user
);
ret
=
this
.
userService
.
updateById
(
user
);
}
else
{
}
else
{
logger
.
error
(
"旧密码不正确"
);
logger
.
error
(
"旧密码不正确"
);
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"status"
,
400
);
resultMap
.
put
(
"message"
,
"旧密码不正确"
);
resultMap
.
put
(
"message"
,
"旧密码不正确"
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
body
(
resultMap
);
}
}
if
(!
ret
)
{
if
(!
ret
)
{
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
"修改失败"
);
resultMap
.
put
(
"message"
,
"修改失败"
);
// 更新失败, 500
// 更新失败, 500
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
}
resultMap
.
put
(
"status"
,
200
);
resultMap
.
put
(
"status"
,
200
);
resultMap
.
put
(
"message"
,
"修改成功"
);
resultMap
.
put
(
"message"
,
"修改成功"
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
resultMap
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"更新密码错误!"
,
e
);
logger
.
error
(
"更新密码错误!"
,
e
);
}
}
// 500
// 500
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"status"
,
500
);
resultMap
.
put
(
"message"
,
"修改失败"
);
resultMap
.
put
(
"message"
,
"修改失败"
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
}
// 管理员重置密码
// 管理员重置密码
@OperationLog
(
"重置密码"
)
@OperationLog
(
"重置密码"
)
@ApiOperation
(
value
=
"管理员重置密码"
,
notes
=
"管理员重置密码"
)
@ApiOperation
(
value
=
"管理员重置密码"
,
notes
=
"管理员重置密码"
)
@RequestMapping
(
value
=
"/resetPassword"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/resetPassword"
,
method
=
RequestMethod
.
PUT
)
@RequiresPermissions
(
"/user/resetPassword"
)
@RequiresPermissions
(
"/user/resetPassword"
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
public
ResponseEntity
<
Map
<
Object
,
String
>>
resetPassword
(
String
userId
)
{
public
ResponseEntity
<
Map
<
Object
,
String
>>
resetPassword
(
String
userId
)
{
try
{
try
{
Map
<
Object
,
String
>
map
=
new
LinkedHashMap
<>();
Map
<
Object
,
String
>
map
=
new
LinkedHashMap
<>();
TUser
user
=
new
TUser
();
TUser
user
=
new
TUser
();
user
.
setId
(
userId
);
user
.
setId
(
userId
);
String
newPassword
=
"123456"
;
String
newPassword
=
"123456"
;
byte
[]
passwordSalt
=
SecureRandomSaltService
.
generateSalt
();
byte
[]
passwordSalt
=
SecureRandomSaltService
.
generateSalt
();
byte
[]
passwordHash
=
SHA256PasswordEncryptionService
.
createPasswordHash
(
newPassword
,
passwordSalt
);
byte
[]
passwordHash
=
SHA256PasswordEncryptionService
.
createPasswordHash
(
newPassword
,
passwordSalt
);
user
.
setPasswordSalt
(
passwordSalt
);
user
.
setPasswordSalt
(
passwordSalt
);
user
.
setPasswordHash
(
passwordHash
);
user
.
setPasswordHash
(
passwordHash
);
user
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
user
.
setUpdateTime
(
DateUtil80
.
getDateTimeOfTimestamp
(
System
.
currentTimeMillis
()));
boolean
ret
=
userService
.
updateById
(
user
);
boolean
ret
=
userService
.
updateById
(
user
);
if
(!
ret
)
{
if
(!
ret
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
build
();
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
).
build
();
}
}
stringRedisTemplate
.
delete
(
SHIRO_IS_LOCK
+
userService
.
getById
(
userId
).
getUserName
());
stringRedisTemplate
.
delete
(
SHIRO_IS_LOCK
+
userService
.
getById
(
userId
).
getUserName
());
map
.
put
(
"status"
,
"201"
);
map
.
put
(
"status"
,
"201"
);
map
.
put
(
"message"
,
"重置密码成功"
);
map
.
put
(
"message"
,
"重置密码成功"
);
map
.
put
(
"password"
,
newPassword
);
map
.
put
(
"password"
,
newPassword
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
map
);
return
ResponseEntity
.
status
(
HttpStatus
.
CREATED
).
body
(
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"重置密码出错!"
,
e
);
logger
.
error
(
"重置密码出错!"
,
e
);
}
}
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
null
);
}
}
@PutMapping
(
"/updateAuditStatus"
)
@RequiresPermissions
(
"/user/updateAuditStatus"
)
@PutMapping
(
"/updateAuditStatus"
)
@ApiOperation
(
value
=
"更新用户审核状态"
,
notes
=
"更新用户审核状态"
)
@RequiresPermissions
(
"/user/updateAuditStatus"
)
@ApiImplicitParams
(
value
=
{
@ApiOperation
(
value
=
"更新用户审核状态"
,
notes
=
"更新用户审核状态"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"标识ID"
,
dataType
=
"String"
,
paramType
=
"path"
),
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态"
,
paramType
=
"query"
,
dataType
=
"String"
)
@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
)
{
@MethodLog
(
operModule
=
OperModule
.
USER
,
operType
=
OperType
.
UPDATE
)
UpdateWrapper
<
TUser
>
updateWrapper
=
new
UpdateWrapper
<>();
public
Map
<
String
,
Object
>
updateStatus
(
@NotNull
(
message
=
"机构用户不能为空"
)
@PathVariable
(
"id"
)
String
id
,
@RequestParam
(
"status"
)
AuditStatusEnum
status
)
{
updateWrapper
.
eq
(
"id"
,
id
);
UpdateWrapper
<
TUser
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"audit_status"
,
status
.
name
());
updateWrapper
.
eq
(
"id"
,
id
);
boolean
flag
=
userService
.
update
(
updateWrapper
);
updateWrapper
.
eq
(
"audit_status"
,
status
.
name
());
if
(
flag
)
{
boolean
flag
=
userService
.
update
(
updateWrapper
);
return
getSuccessResult
();
if
(
flag
)
{
}
return
getSuccessResult
();
return
getFailResult
();
}
return
getFailResult
();
}
}
}
}
...
...
src/main/resources/mapper/RunLogMapper.xml
View file @
01f6cb32
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
<result
column=
"learning_content_id"
property=
"learningContentId"
/>
<result
column=
"learning_content_id"
property=
"learningContentId"
/>
<result
column=
"start_time"
property=
"startTime"
/>
<result
column=
"start_time"
property=
"startTime"
/>
<result
column=
"end_time"
property=
"endTime"
/>
<result
column=
"end_time"
property=
"endTime"
/>
<result
column=
"org_name"
property=
"orgName"
/>
<result
column=
"learn_name"
property=
"learnName"
/>
</resultMap>
</resultMap>
<!-- 通用查询结果列 -->
<!-- 通用查询结果列 -->
...
@@ -17,4 +19,21 @@
...
@@ -17,4 +19,21 @@
id, mac_addr, organ_id, learning_content_id, start_time, end_time
id, mac_addr, organ_id, learning_content_id, start_time, end_time
</sql>
</sql>
<select
id=
"pageList"
resultMap=
"BaseResultMap"
>
SELECT r.*,o.name org_name,l.name learn_name
FROM run_log r
left join t_organ o on o.id = r.organ_id
left join learning_content l on l.id =r.learning_content_id
where 1=1
<if
test=
" runLog.organId != null and runLog.organId != '' "
>
and r.organ_id = #{runLog.organId}
</if>
<if
test=
" runLog.startDate != null"
>
and r.start_time
<![CDATA[>=]]>
#{runLog.startDate}
</if>
<if
test=
" runLog.endDate != null"
>
and r.start_time
<![CDATA[<=]]>
#{runLog.endDate}
</if>
</select>
</mapper>
</mapper>
src/main/resources/mapper/TInteractionMapper.xml
0 → 100644
View file @
01f6cb32
<?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.TInteractionMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.TInteraction"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"organ_id"
property=
"organId"
/>
<result
column=
"username"
property=
"username"
/>
<result
column=
"board_id"
property=
"boardId"
/>
<result
column=
"study_time"
property=
"studyTime"
/>
<result
column=
"num"
property=
"num"
/>
<result
column=
"content"
property=
"content"
/>
<result
column=
"images"
property=
"images"
/>
<result
column=
"create_time"
property=
"createTime"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, organ_id, username, board_id, study_time, num, content, images, create_time
</sql>
</mapper>
src/main/resources/mapper/TOperationLogMapper.xml
0 → 100644
View file @
01f6cb32
<?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.TOperationLogMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.wisenergy.chnmuseum.party.model.TOperationLog"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"area"
property=
"area"
/>
<result
column=
"operation_type"
property=
"operationType"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"user_name"
property=
"userName"
/>
<result
column=
"start_date"
property=
"startDate"
/>
<result
column=
"end_date"
property=
"endDate"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, user_id, area, operation_type, create_time
</sql>
<select
id=
"pageList"
resultMap=
"BaseResultMap"
>
SELECT o.*,u.user_name
FROM t_operation_log o
left join t_user u on o.user_id = u.id
where 1=1
<if
test=
" operationLog.userName != null and operationLog.userName != '' "
>
and u.user_name like concat('%', #{operationLog.userName}, '%')
</if>
<if
test=
" operationLog.startDate != null"
>
and o.create_time
<![CDATA[>=]]>
#{operationLog.startDate}
</if>
<if
test=
" operationLog.endDate != null"
>
and o.create_time
<![CDATA[<=]]>
#{operationLog.endDate}
</if>
</select>
</mapper>
src/main/resources/mapper/TOrganMapper.xml
View file @
01f6cb32
...
@@ -10,9 +10,7 @@
...
@@ -10,9 +10,7 @@
<result
column=
"is_deleted"
property=
"isDeleted"
/>
<result
column=
"is_deleted"
property=
"isDeleted"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"province"
property=
"province"
/>
<result
column=
"area_id"
property=
"areaId"
/>
<result
column=
"city"
property=
"city"
/>
<result
column=
"country"
property=
"country"
/>
<result
column=
"icon"
property=
"icon"
/>
<result
column=
"icon"
property=
"icon"
/>
<result
column=
"remarks"
property=
"remarks"
/>
<result
column=
"remarks"
property=
"remarks"
/>
<result
column=
"level"
property=
"level"
/>
<result
column=
"level"
property=
"level"
/>
...
@@ -20,12 +18,12 @@
...
@@ -20,12 +18,12 @@
<!-- 通用查询结果列 -->
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, name, parent_id, is_deleted, create_time, update_time,
province, city, country
, icon, remarks, level
id, name, parent_id, is_deleted, create_time, update_time,
area_id
, icon, remarks, level
</sql>
</sql>
<select
id=
"selectArea"
resultType=
"java.util.HashMap"
>
<select
id=
"selectArea"
resultType=
"java.util.HashMap"
>
select
concat(name,type)
name,id from t_area
select
full_name
name,id from t_area
</select>
</select>
</mapper>
</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