Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
1c8e5c1f
提交
1c8e5c1f
authored
5月 16, 2022
作者:
17607474349
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:
1、通过角色查询相应用户 2、更改批量发卡 3、可视化相关接口
上级
7fe55eff
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
29 个修改的文件
包含
472 行增加
和
103 行删除
+472
-103
LocationTag.java
...main/java/com/yiring/app/domain/location/LocationTag.java
+1
-1
UserSendCardExcel.java
...ain/java/com/yiring/app/excel/user/UserSendCardExcel.java
+1
-1
KeyAlarmAddParam.java
.../main/java/com/yiring/app/param/key/KeyAlarmAddParam.java
+1
-8
LocationTagFindParam.java
...m/yiring/app/param/location/tag/LocationTagFindParam.java
+3
-0
BroadcastAudioServiceImpl.java
...app/service/broadcast/impl/BroadcastAudioServiceImpl.java
+0
-1
KeyAlarmService.java
...main/java/com/yiring/app/service/key/KeyAlarmService.java
+7
-0
KeyAlarmLogServiceImpl.java
...m/yiring/app/service/key/impl/KeyAlarmLogServiceImpl.java
+0
-1
KeyAlarmRuleServiceImpl.java
.../yiring/app/service/key/impl/KeyAlarmRuleServiceImpl.java
+0
-1
KeyAlarmServiceImpl.java
.../com/yiring/app/service/key/impl/KeyAlarmServiceImpl.java
+70
-1
LocationBeaconService.java
...ng/app/service/location/beacon/LocationBeaconService.java
+7
-0
LocationBeaconServiceImpl.java
...rvice/location/beacon/impl/LocationBeaconServiceImpl.java
+25
-0
LocationTagService.java
...m/yiring/app/service/location/tag/LocationTagService.java
+13
-13
LocationTagServiceImpl.java
...app/service/location/tag/impl/LocationTagServiceImpl.java
+0
-0
PositionMessageServiceImpl.java
.../app/service/message/impl/PositionMessageServiceImpl.java
+12
-2
PostService.java
...rc/main/java/com/yiring/app/service/post/PostService.java
+2
-2
PostServiceImpl.java
...ava/com/yiring/app/service/post/impl/PostServiceImpl.java
+23
-38
UserAppServiceImpl.java
.../com/yiring/app/service/user/impl/UserAppServiceImpl.java
+1
-1
ExportUtils.java
app/src/main/java/com/yiring/app/util/ExportUtils.java
+10
-0
LocationTagVo.java
...in/java/com/yiring/app/vo/location/tag/LocationTagVo.java
+8
-0
KeyAlarmController.java
.../main/java/com/yiring/app/web/key/KeyAlarmController.java
+7
-1
LocationBeaconController.java
...ing/app/web/location/beacon/LocationBeaconController.java
+6
-0
LocationTagController.java
...om/yiring/app/web/location/tag/LocationTagController.java
+12
-15
PostController.java
...src/main/java/com/yiring/app/web/post/PostController.java
+4
-4
UserExportExcel.java
...main/java/com/yiring/auth/excel/user/UserExportExcel.java
+85
-0
UserExportParam.java
...main/java/com/yiring/auth/param/user/UserExportParam.java
+37
-0
UserService.java
...c/main/java/com/yiring/auth/service/user/UserService.java
+16
-0
UserServiceImpl.java
...va/com/yiring/auth/service/user/impl/UserServiceImpl.java
+102
-6
AuthController.java
...rc/main/java/com/yiring/auth/web/auth/AuthController.java
+3
-3
UserController.java
...rc/main/java/com/yiring/auth/web/user/UserController.java
+16
-4
没有找到文件。
app/src/main/java/com/yiring/app/domain/location/LocationTag.java
浏览文件 @
1c8e5c1f
...
...
@@ -81,7 +81,7 @@ public class LocationTag extends BasicEntity implements Serializable {
@Comment
(
"静止/运动"
)
Boolean
silent
;
@
Many
ToOne
@
One
ToOne
@Comment
(
"绑定用户"
)
User
user
;
...
...
app/src/main/java/com/yiring/app/excel/user/UserSendCardExcel.java
浏览文件 @
1c8e5c1f
...
...
@@ -33,6 +33,6 @@ public class UserSendCardExcel implements Serializable {
String
uuid
;
// 标签号
@ExcelColumn
(
title
=
"标签
编号
"
)
@ExcelColumn
(
title
=
"标签"
)
String
code
;
}
app/src/main/java/com/yiring/app/param/key/KeyAlarmAddParam.java
浏览文件 @
1c8e5c1f
...
...
@@ -51,13 +51,6 @@ public class KeyAlarmAddParam implements Serializable {
BigDecimal
z
;
public
static
KeyAlarm
transform
(
KeyAlarmAddParam
param
)
{
return
KeyAlarm
.
builder
()
.
areaId
(
param
.
areaId
)
.
code
(
param
.
getTagId
())
.
x
(
param
.
getX
())
.
y
(
param
.
getY
())
.
z
(
param
.
getZ
())
.
build
();
return
KeyAlarm
.
builder
().
areaId
(
param
.
areaId
).
x
(
param
.
getX
()).
y
(
param
.
getY
()).
z
(
param
.
getZ
()).
build
();
}
}
app/src/main/java/com/yiring/app/param/location/tag/LocationTagFindParam.java
浏览文件 @
1c8e5c1f
...
...
@@ -37,4 +37,7 @@ public class LocationTagFindParam implements Serializable {
@ApiModelProperty
(
value
=
"绑卡状态"
,
example
=
"true"
)
Boolean
used
;
@ApiModelProperty
(
value
=
"是否在场外"
,
example
=
"true"
)
Boolean
out
;
}
app/src/main/java/com/yiring/app/service/broadcast/impl/BroadcastAudioServiceImpl.java
浏览文件 @
1c8e5c1f
...
...
@@ -106,7 +106,6 @@ public class BroadcastAudioServiceImpl implements BroadcastAudioService {
Page
<
BroadcastAudio
>
broadcastAudios
=
broadcastAudioRepository
.
findAll
(
specification
,
pageable
);
List
<
BroadcastAudioVo
>
broadcastAudioVos
=
broadcastAudios
.
getContent
()
.
stream
()
.
map
(
BroadcastAudioVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
...
...
app/src/main/java/com/yiring/app/service/key/KeyAlarmService.java
浏览文件 @
1c8e5c1f
...
...
@@ -29,4 +29,11 @@ public interface KeyAlarmService {
* @param response HttpServletResponse
*/
void
export
(
KeyAlarmFindParam
param
,
HttpServletResponse
response
);
/**
* 条件查询
* @param param KeyAlarmFindParam
* @return Result<PageVo<KeyAlarmVo>>
*/
Result
<
PageVo
<
KeyAlarmVo
>>
find
(
KeyAlarmFindParam
param
);
}
app/src/main/java/com/yiring/app/service/key/impl/KeyAlarmLogServiceImpl.java
浏览文件 @
1c8e5c1f
...
...
@@ -74,7 +74,6 @@ public class KeyAlarmLogServiceImpl implements KeyAlarmLogService {
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
KeyAlarmLog
>
keyAlarmLogs
=
keyAlarmLogRepository
.
findAll
(
specification
,
pageable
);
List
<
KeyAlarmLogVo
>
keyAlarmLogVos
=
keyAlarmLogs
.
getContent
()
.
stream
()
.
map
(
KeyAlarmLogVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
...
...
app/src/main/java/com/yiring/app/service/key/impl/KeyAlarmRuleServiceImpl.java
浏览文件 @
1c8e5c1f
...
...
@@ -223,7 +223,6 @@ public class KeyAlarmRuleServiceImpl implements KeyAlarmRuleService {
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
KeyAlarmRule
>
pages
=
keyAlarmRuleRepository
.
findAll
(
specification
,
pageable
);
List
<
KeyAlarmRuleVo
>
keyAlarmRuleVos
=
pages
.
getContent
()
.
stream
()
.
map
(
KeyAlarmRuleVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
...
...
app/src/main/java/com/yiring/app/service/key/impl/KeyAlarmServiceImpl.java
浏览文件 @
1c8e5c1f
...
...
@@ -94,7 +94,6 @@ public class KeyAlarmServiceImpl implements KeyAlarmService {
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
KeyAlarm
>
keyAlarms
=
keyAlarmRepository
.
findAll
(
specification
,
pageable
);
List
<
KeyAlarmVo
>
keyAlarmVos
=
keyAlarms
.
getContent
()
.
stream
()
.
map
(
keyAlarm
->
{
KeyAlarmVo
keyAlarmVo
=
KeyAlarmVo
.
transform
(
keyAlarm
);
...
...
@@ -121,6 +120,7 @@ public class KeyAlarmServiceImpl implements KeyAlarmService {
keyAlarmVo
.
setReceiver
(
StrUtil
.
join
(
","
,
names
));
keyAlarmVo
.
setTypes
(
keyAlarmRule
.
getTypes
().
split
(
","
));
}
return
keyAlarmVo
;
})
.
collect
(
Collectors
.
toList
());
...
...
@@ -219,4 +219,73 @@ public class KeyAlarmServiceImpl implements KeyAlarmService {
throw
new
RuntimeException
(
"导出按键报警信息失败: "
+
e
.
getMessage
());
}
}
@Override
public
Result
<
PageVo
<
KeyAlarmVo
>>
find
(
KeyAlarmFindParam
param
)
{
Specification
<
KeyAlarm
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getAreaId
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
KeyAlarm
.
Fields
.
areaId
),
param
.
getAreaId
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
KeyAlarm
.
Fields
.
leader
).
get
(
User
.
Fields
.
realName
),
"%"
+
param
.
getName
()
+
"%"
)
);
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
KeyAlarm
.
Fields
.
enable
),
param
.
getEnable
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getCreateTime
()))
{
predicates
.
add
(
cb
.
greaterThan
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
),
param
.
getCreateTime
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getEndTime
()))
{
predicates
.
add
(
cb
.
lessThan
(
root
.
get
(
BasicEntity
.
Fields
.
updateTime
),
param
.
getEndTime
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
KeyAlarm
>
keyAlarms
=
keyAlarmRepository
.
findAll
(
specification
);
List
<
KeyAlarmVo
>
keyAlarmVos
=
keyAlarms
.
stream
()
.
map
(
keyAlarm
->
{
KeyAlarmVo
keyAlarmVo
=
KeyAlarmVo
.
transform
(
keyAlarm
);
User
leader
=
keyAlarm
.
getLeader
();
if
(
ObjectUtil
.
isNotEmpty
(
leader
))
{
UserVo
userVo
=
UserVo
.
builder
()
.
id
(
leader
.
getId
())
.
realName
(
leader
.
getRealName
())
.
uuid
(
leader
.
getUuid
())
.
departmentId
(
leader
.
getDepartment
().
getId
())
.
build
();
keyAlarmVo
.
setUser
(
userVo
);
}
Optional
<
KeyAlarmRule
>
keyAlarmRuleOptional
=
keyAlarmRuleRepository
.
findOne
(
Example
.
of
(
KeyAlarmRule
.
builder
().
department
(
leader
.
getDepartment
()).
build
())
);
if
(
keyAlarmRuleOptional
.
isPresent
())
{
KeyAlarmRule
keyAlarmRule
=
keyAlarmRuleOptional
.
get
();
Set
<
User
>
users
=
keyAlarmRule
.
getUsers
();
List
<
String
>
names
=
users
.
stream
().
map
(
User:
:
getRealName
).
collect
(
Collectors
.
toList
());
keyAlarmVo
.
setReceiver
(
StrUtil
.
join
(
","
,
names
));
keyAlarmVo
.
setTypes
(
keyAlarmRule
.
getTypes
().
split
(
","
));
}
return
keyAlarmVo
;
})
.
collect
(
Collectors
.
toList
());
PageVo
<
KeyAlarmVo
>
pageVo
=
PageVo
.
build
(
keyAlarmVos
,
keyAlarmVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
}
app/src/main/java/com/yiring/app/service/location/beacon/LocationBeaconService.java
浏览文件 @
1c8e5c1f
...
...
@@ -38,4 +38,11 @@ public interface LocationBeaconService {
* @param response HttpServletResponse
*/
void
exportLocationBeacon
(
LocationBeaconExportParam
locationBeaconExportParam
,
HttpServletResponse
response
);
/**
* 条件查询
* @param locationBeaconFindParam LocationBeaconFindParam
* @return Result<PageVo<LocationBeaconVo>>
*/
Result
<
PageVo
<
LocationBeaconVo
>>
find
(
LocationBeaconFindParam
locationBeaconFindParam
);
}
app/src/main/java/com/yiring/app/service/location/beacon/impl/LocationBeaconServiceImpl.java
浏览文件 @
1c8e5c1f
...
...
@@ -182,6 +182,31 @@ public class LocationBeaconServiceImpl implements LocationBeaconService {
}
}
@Override
public
Result
<
PageVo
<
LocationBeaconVo
>>
find
(
LocationBeaconFindParam
locationBeaconFindParam
)
{
Specification
<
LocationBeacon
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
locationBeaconFindParam
.
getCode
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
LocationBeacon
.
Fields
.
code
),
"%"
+
locationBeaconFindParam
.
getCode
()
+
"%"
)
);
}
Order
order
=
cb
.
desc
(
root
.
get
(
LocationBeacon
.
Fields
.
time
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
LocationBeacon
>
locationBeacons
=
locationBeaconRepository
.
findAll
(
specification
);
List
<
LocationBeaconVo
>
locationBeaconVos
=
locationBeacons
.
stream
()
.
map
(
LocationBeaconVo:
:
transform
)
.
collect
(
Collectors
.
toList
());
PageVo
<
LocationBeaconVo
>
pageVo
=
PageVo
.
build
(
locationBeaconVos
,
locationBeaconVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
private
void
modifyLocationBeacon
(
LocationBeacon
locationBeacon
,
LocationBeaconAddParam
locationBeaconAddParam
)
{
locationBeacon
.
setCode
(
locationBeaconAddParam
.
getDeviceId
());
locationBeacon
.
setAreaId
(
locationBeaconAddParam
.
getAreaId
());
...
...
app/src/main/java/com/yiring/app/service/location/tag/LocationTagService.java
浏览文件 @
1c8e5c1f
...
...
@@ -26,10 +26,10 @@ public interface LocationTagService {
/**
* 分页查询
* @param
locationTagFindP
aram LocationTagFindParam
* @param
p
aram LocationTagFindParam
* @return Result<PageVo<LocationTagVo>>
*/
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
LocationTagFindParam
locationTagFindP
aram
,
PageParam
pageParam
);
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
LocationTagFindParam
p
aram
,
PageParam
pageParam
);
/**
* 销毁定位标签
...
...
@@ -40,10 +40,10 @@ public interface LocationTagService {
/**
* 导出定位标签
* @param
locationTagExportP
aram 入参
* @param
p
aram 入参
* @param response 响应信息
*/
void
exportLocationTagInfo
(
LocationTag
ExportParam
locationTagExportP
aram
,
HttpServletResponse
response
);
void
exportLocationTagInfo
(
LocationTag
FindParam
p
aram
,
HttpServletResponse
response
);
/**
* 导入定位标签
...
...
@@ -52,13 +52,6 @@ public interface LocationTagService {
*/
Result
<
String
>
importLocationTagInfo
(
MultipartFile
file
);
/* *//**
* 修改定位标签
* @param locationTagModifyParam 入参
* @return Result<String>
*//*
Result<String> modifyLocationTag(LocationTagModifyParam locationTagModifyParam);*/
/**
* 检索标签
* @param indexParam IndexParam
...
...
@@ -68,8 +61,15 @@ public interface LocationTagService {
/**
* 条件查询
* @param
locationTagFindP
aram LocationTagFindParam
* @param
p
aram LocationTagFindParam
* @return Result<PageVo<LocationTagVo>>
*/
Result
<
PageVo
<
LocationTagVo
>>
findLocationTag
(
LocationTagFindParam
locationTagFindParam
);
Result
<
PageVo
<
LocationTagVo
>>
findLocationTag
(
LocationTagFindParam
param
);
/**
* 标签详细信息
* @param param LocationTagFindParam
* @return Result<LocationTagVo>
*/
Result
<
LocationTagVo
>
info
(
LocationTagFindParam
param
);
}
app/src/main/java/com/yiring/app/service/location/tag/impl/LocationTagServiceImpl.java
浏览文件 @
1c8e5c1f
差异被折叠。
点击展开。
app/src/main/java/com/yiring/app/service/message/impl/PositionMessageServiceImpl.java
浏览文件 @
1c8e5c1f
...
...
@@ -447,7 +447,7 @@ public class PositionMessageServiceImpl implements PositionMessageService {
if
(
userRepositoryOne
.
isEmpty
())
{
// throw new RuntimeException("没找到该用户");
log
.
error
(
"没找到该用户"
);
log
.
warn
(
"Tag Not Found: {}"
,
"没找到该用户"
);
return
;
}
...
...
@@ -463,10 +463,20 @@ public class PositionMessageServiceImpl implements PositionMessageService {
if
(
keyAlarmRuleOptional
.
isEmpty
())
{
// throw new RuntimeException("该部门未设置报警规则");
log
.
error
(
"该部门未设置报警规则"
);
log
.
warn
(
"Tag Not Found: {}"
,
"该部门未设置报警规则"
);
return
;
}
Optional
<
LocationTag
>
locationTagOptional
=
locationTagRepository
.
findOne
(
Example
.
of
(
LocationTag
.
builder
().
code
(
keyAlarmAddParam
.
getTagId
()).
build
())
);
if
(
locationTagOptional
.
isEmpty
())
{
log
.
warn
(
"Tag Not Found: {}"
,
keyAlarmAddParam
.
getTagId
());
return
;
}
keyAlarm
.
setCode
(
locationTagOptional
.
get
().
getCode
());
final
KeyAlarm
finalKeyAlarm
=
keyAlarmRepository
.
save
(
keyAlarm
);
KeyAlarmRule
keyAlarmRule
=
keyAlarmRuleOptional
.
get
();
...
...
app/src/main/java/com/yiring/app/service/post/PostService.java
浏览文件 @
1c8e5c1f
...
...
@@ -63,10 +63,10 @@ public interface PostService {
/**
* 导出职位信息
* @param p
ostExportParam PostExport
Param
* @param p
aram PostFind
Param
* @param response HttpServletResponse
*/
void
exportPostInfo
(
Post
ExportParam
postExportP
aram
,
HttpServletResponse
response
);
void
exportPostInfo
(
Post
FindParam
p
aram
,
HttpServletResponse
response
);
/**
* 职位检索
...
...
app/src/main/java/com/yiring/app/service/post/impl/PostServiceImpl.java
浏览文件 @
1c8e5c1f
...
...
@@ -91,26 +91,9 @@ public class PostServiceImpl implements PostService {
@Override
public
Result
<
PageVo
<
PostVo
>>
findPostPage
(
PostFindParam
postFindParam
,
PageParam
pageParam
)
{
Specification
<
Post
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
postFindParam
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
postFindParam
.
getName
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
postFindParam
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
postFindParam
.
getEnable
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
// 分页
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
Post
>
page
=
postRepository
.
findAll
(
specification
,
pageable
);
List
<
PostVo
>
postVos
=
page
.
getContent
().
stream
().
map
(
PostVo:
:
transform
).
collect
(
Collectors
.
toList
());
Page
<
Post
>
page
=
postRepository
.
findAll
(
condition
(
postFindParam
)
,
pageable
);
List
<
PostVo
>
postVos
=
page
.
stream
().
map
(
PostVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
PostVo
>
pageVo
=
PageVo
.
build
(
postVos
,
page
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
...
...
@@ -129,24 +112,8 @@ public class PostServiceImpl implements PostService {
}
@Override
public
void
exportPostInfo
(
PostExportParam
postExportParam
,
HttpServletResponse
response
)
{
Specification
<
Post
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
postExportParam
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
postExportParam
.
getName
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
postExportParam
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
postExportParam
.
getEnable
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
Post
>
postList
=
postRepository
.
findAll
(
specification
);
public
void
exportPostInfo
(
PostFindParam
param
,
HttpServletResponse
response
)
{
List
<
Post
>
postList
=
postRepository
.
findAll
(
condition
(
param
));
List
<
PostExportExcel
>
postExcels
=
postList
.
stream
()
.
map
(
PostExportExcel:
:
transform
)
...
...
@@ -180,7 +147,7 @@ public class PostServiceImpl implements PostService {
out
.
close
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
"导出
岗
位信息失败: "
+
e
.
getMessage
());
throw
new
RuntimeException
(
"导出
职
位信息失败: "
+
e
.
getMessage
());
}
}
...
...
@@ -202,4 +169,22 @@ public class PostServiceImpl implements PostService {
PageVo
<
PostIndexVo
>
pageVo
=
PageVo
.
build
(
postIndexVos
,
postIndexVos
.
size
());
return
Result
.
ok
(
pageVo
);
}
public
Specification
<
Post
>
condition
(
PostFindParam
param
)
{
return
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
param
.
getName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
Post
.
Fields
.
name
),
"%"
+
param
.
getName
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getEnable
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
Post
.
Fields
.
enable
),
param
.
getEnable
()));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
}
}
app/src/main/java/com/yiring/app/service/user/impl/UserAppServiceImpl.java
浏览文件 @
1c8e5c1f
...
...
@@ -143,7 +143,7 @@ public class UserAppServiceImpl implements UserAppService {
user
.
getLinkId
(),
userBingTagParam
.
getCode
(),
FACTORY_ID
,
ZyUtil
.
manage
Login
()
ZyUtil
.
client
Login
()
);
if
(!
ObjectUtil
.
equals
(
jsonObject
.
get
(
"code"
),
200
))
{
throw
new
RuntimeException
(
StrUtil
.
toString
(
jsonObject
.
get
(
"msg"
)));
...
...
app/src/main/java/com/yiring/app/util/ExportUtils.java
0 → 100644
浏览文件 @
1c8e5c1f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
util
;
/**
* 部门信息控制器
*
* @author LJ-2204
* @date 2022/5/16
*/
public
class
ExportUtils
<
T
>
{}
app/src/main/java/com/yiring/app/vo/location/tag/LocationTagVo.java
浏览文件 @
1c8e5c1f
...
...
@@ -4,6 +4,8 @@ package com.yiring.app.vo.location.tag;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
com.yiring.app.domain.location.LocationTag
;
import
com.yiring.app.vo.user.UserVo
;
import
com.yiring.app.vo.visitor.CarVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
...
...
@@ -51,6 +53,12 @@ public class LocationTagVo implements Serializable {
@ApiModelProperty
(
value
=
"最近更新时间"
,
example
=
"2022-01-01 00:00:00"
)
LocalDateTime
updateTime
;
@ApiModelProperty
(
value
=
"用户"
,
example
=
"userVo"
)
UserVo
userVo
;
@ApiModelProperty
(
value
=
"车辆"
,
example
=
"carVo"
)
CarVo
carVo
;
public
static
LocationTagVo
transform
(
LocationTag
locationTag
)
{
return
LocationTagVo
.
builder
()
...
...
app/src/main/java/com/yiring/app/web/key/KeyAlarmController.java
浏览文件 @
1c8e5c1f
...
...
@@ -39,8 +39,14 @@ public class KeyAlarmController {
return
keyAlarmService
.
page
(
param
,
pageParam
);
}
@ApiOperation
(
"条件查询"
)
@GetMapping
(
"find"
)
public
Result
<
PageVo
<
KeyAlarmVo
>>
find
(
KeyAlarmFindParam
param
)
{
return
keyAlarmService
.
find
(
param
);
}
@ApiOperation
(
"导出"
)
@GetMapping
@GetMapping
(
"export"
)
public
void
export
(
KeyAlarmFindParam
param
,
HttpServletResponse
response
)
{
keyAlarmService
.
export
(
param
,
response
);
}
...
...
app/src/main/java/com/yiring/app/web/location/beacon/LocationBeaconController.java
浏览文件 @
1c8e5c1f
...
...
@@ -59,4 +59,10 @@ public class LocationBeaconController {
)
{
locationBeaconService
.
exportLocationBeacon
(
locationBeaconExportParam
,
response
);
}
@ApiOperation
(
"条件查询"
)
@GetMapping
(
"find"
)
public
Result
<
PageVo
<
LocationBeaconVo
>>
find
(
@Valid
LocationBeaconFindParam
locationBeaconFindParam
)
{
return
locationBeaconService
.
find
(
locationBeaconFindParam
);
}
}
app/src/main/java/com/yiring/app/web/location/tag/LocationTagController.java
浏览文件 @
1c8e5c1f
...
...
@@ -43,16 +43,16 @@ public class LocationTagController {
@ApiOperation
(
"分页查询"
)
@GetMapping
(
"findLocationTagPage"
)
public
Result
<
PageVo
<
LocationTagVo
>>
findLocationTagPage
(
@Valid
LocationTagFindParam
locationTagFindP
aram
,
@Valid
LocationTagFindParam
p
aram
,
@Valid
PageParam
pageParam
)
{
return
locationTagService
.
findLocationTagPage
(
locationTagFindP
aram
,
pageParam
);
return
locationTagService
.
findLocationTagPage
(
p
aram
,
pageParam
);
}
@ApiOperation
(
"条件查询"
)
@GetMapping
(
"findLocationTag"
)
public
Result
<
PageVo
<
LocationTagVo
>>
findLocationTag
(
@Valid
LocationTagFindParam
locationTagFindP
aram
)
{
return
locationTagService
.
findLocationTag
(
locationTagFindP
aram
);
public
Result
<
PageVo
<
LocationTagVo
>>
findLocationTag
(
@Valid
LocationTagFindParam
p
aram
)
{
return
locationTagService
.
findLocationTag
(
p
aram
);
}
@ApiOperation
(
"销毁定位标签"
)
...
...
@@ -63,11 +63,8 @@ public class LocationTagController {
@ApiOperation
(
"导出定位标签"
)
@GetMapping
(
"exportLocationTagInfo"
)
public
void
exportLocationTagInfo
(
@Valid
LocationTagExportParam
locationTagExportParam
,
HttpServletResponse
response
)
{
locationTagService
.
exportLocationTagInfo
(
locationTagExportParam
,
response
);
public
void
exportLocationTagInfo
(
@Valid
LocationTagFindParam
param
,
HttpServletResponse
response
)
{
locationTagService
.
exportLocationTagInfo
(
param
,
response
);
}
@ApiOperation
(
"导入定位标签"
)
...
...
@@ -76,15 +73,15 @@ public class LocationTagController {
return
locationTagService
.
importLocationTagInfo
(
file
);
}
/* @ApiOperation("修改定位标签")
@PutMapping("modifyLocationTag")
public Result<String> modifyLocationTag(@Valid LocationTagModifyParam locationTagModifyParam) {
return locationTagService.modifyLocationTag(locationTagModifyParam);
}*/
@ApiOperation
(
"标签检索"
)
@GetMapping
(
"indexLocationTag"
)
public
Result
<
PageVo
<
LocationTagIndexVo
>>
indexLocationTag
(
@Valid
IndexParam
indexParam
)
{
return
locationTagService
.
indexLocationTag
(
indexParam
);
}
@ApiOperation
(
"标签详细信息"
)
@GetMapping
(
"info"
)
public
Result
<
LocationTagVo
>
info
(
@Valid
LocationTagFindParam
param
)
{
return
locationTagService
.
info
(
param
);
}
}
app/src/main/java/com/yiring/app/web/post/PostController.java
浏览文件 @
1c8e5c1f
...
...
@@ -2,7 +2,6 @@
package
com
.
yiring
.
app
.
web
.
post
;
import
com.yiring.app.param.post.PostAddParam
;
import
com.yiring.app.param.post.PostExportParam
;
import
com.yiring.app.param.post.PostFindParam
;
import
com.yiring.app.param.post.PostModifyParam
;
import
com.yiring.app.service.post.PostService
;
...
...
@@ -19,6 +18,7 @@ import io.swagger.annotations.ApiOperation;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
org.springframework.http.MediaType
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -68,10 +68,10 @@ public class PostController {
return
postService
.
findPostById
(
idParam
);
}
@ApiOperation
(
value
=
"导出职位信息"
)
@ApiOperation
(
value
=
"导出职位信息"
,
produces
=
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
)
@GetMapping
(
"exportPostInfo"
)
public
void
exportPostInfo
(
@Valid
Post
ExportParam
postExportP
aram
,
HttpServletResponse
response
)
{
postService
.
exportPostInfo
(
p
ostExportP
aram
,
response
);
public
void
exportPostInfo
(
@Valid
Post
FindParam
p
aram
,
HttpServletResponse
response
)
{
postService
.
exportPostInfo
(
param
,
response
);
}
@ApiOperation
(
value
=
"职位检索"
)
...
...
basic-auth/src/main/java/com/yiring/auth/excel/user/UserExportExcel.java
0 → 100644
浏览文件 @
1c8e5c1f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
excel
.
user
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.github.liaochong.myexcel.core.annotation.ExcelColumn
;
import
com.github.liaochong.myexcel.core.annotation.ExcelModel
;
import
com.yiring.auth.domain.role.Role
;
import
com.yiring.auth.domain.user.User
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.util.Set
;
import
lombok.AccessLevel
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.experimental.FieldDefaults
;
/**
* 用户导出
*
* @author LJ-2204
* @date 2022/5/14
*/
@ExcelModel
@Data
@Builder
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserExportExcel
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
7198940635708381370L
;
@ApiModelProperty
(
value
=
"姓名"
,
example
=
"张三"
)
@ExcelColumn
(
title
=
"姓名"
)
String
realName
;
@ExcelColumn
(
title
=
"工号"
)
@ApiModelProperty
(
value
=
"工号"
,
example
=
"1234566"
)
String
uuid
;
@ExcelColumn
(
title
=
"部门名称"
)
@ApiModelProperty
(
value
=
"部门名称"
,
example
=
"研发"
)
String
deptName
;
@ExcelColumn
(
title
=
"手机号"
)
@ApiModelProperty
(
value
=
"手机号"
,
example
=
"13012345678"
)
String
mobile
;
@ExcelColumn
(
title
=
"角色"
)
@ApiModelProperty
(
value
=
"角色"
,
example
=
"系统管理员"
)
String
roles
;
@ExcelColumn
(
title
=
"最后登录时间"
)
@ApiModelProperty
(
value
=
"最后登录时间"
,
example
=
"2022-10-24 10:24:00"
)
String
lastLoginTime
;
@ExcelColumn
(
title
=
"状态"
)
@ApiModelProperty
(
value
=
"状态"
,
example
=
"true"
)
Boolean
enabled
;
public
static
UserExportExcel
transform
(
User
user
)
{
UserExportExcel
userExportExcel
=
UserExportExcel
.
builder
()
.
realName
(
user
.
getRealName
())
.
uuid
(
user
.
getUuid
())
.
deptName
(
user
.
getDepartment
().
getName
())
.
mobile
(
user
.
getMobile
())
.
lastLoginTime
(
LocalDateTimeUtil
.
format
(
user
.
getLastLoginTime
(),
"yyyy-MM-dd HH:mm:ss"
))
.
enabled
(
user
.
getEnabled
())
.
build
();
if
(
ObjectUtil
.
isNotEmpty
(
user
.
getRoles
()))
{
Set
<
Role
>
roles
=
user
.
getRoles
();
StringBuilder
stringBuilder
=
new
StringBuilder
();
roles
.
forEach
(
role
->
stringBuilder
.
append
(
role
.
getName
()).
append
(
","
));
String
substring
=
stringBuilder
.
substring
(
0
,
stringBuilder
.
length
()
-
1
);
userExportExcel
.
setRoles
(
substring
);
}
return
userExportExcel
;
}
}
basic-auth/src/main/java/com/yiring/auth/param/user/UserExportParam.java
0 → 100644
浏览文件 @
1c8e5c1f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
param
.
user
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
lombok.*
;
import
lombok.experimental.FieldDefaults
;
/**
* 导出参数
*
* @author LJ-2204
* @date 2022/5/14
*/
@ApiModel
(
"UserExportParam"
)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
public
class
UserExportParam
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
5861302386921496920L
;
@ApiModelProperty
(
value
=
"姓名"
,
example
=
"张三"
)
String
realName
;
@ApiModelProperty
(
value
=
"部门ID"
,
example
=
"100"
)
Long
deptId
;
@ApiModelProperty
(
value
=
"角色ID"
,
example
=
"100"
)
String
roles
;
}
basic-auth/src/main/java/com/yiring/auth/service/user/UserService.java
浏览文件 @
1c8e5c1f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
service
.
user
;
import
com.yiring.auth.param.user.UserExportParam
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.vo.user.UserVo
;
...
...
@@ -8,6 +9,7 @@ import com.yiring.common.core.Result;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
javax.servlet.http.HttpServletResponse
;
/**
* 用户
...
...
@@ -37,4 +39,18 @@ public interface UserService {
* @return Result<String>
*/
Result
<
String
>
reset
(
IdParam
idParam
);
/**
* 修改状态
* @param idParam IdParam
* @return Result<String>
*/
Result
<
String
>
upStatus
(
IdParam
idParam
);
/**
* 导出
* @param param UserExportParam
* @param response HttpServletResponse
*/
void
export
(
UserExportParam
param
,
HttpServletResponse
response
);
}
basic-auth/src/main/java/com/yiring/auth/service/user/impl/UserServiceImpl.java
浏览文件 @
1c8e5c1f
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
auth
.
service
.
user
.
impl
;
import
cn.dev33.satoken.secure.SaSecureUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.liaochong.myexcel.core.DefaultStreamExcelBuilder
;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.auth.excel.user.UserExportExcel
;
import
com.yiring.auth.param.user.UserExportParam
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.service.user.UserService
;
...
...
@@ -17,14 +21,20 @@ import com.yiring.common.domain.BasicEntity;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.concurrent.Executors
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
javax.servlet.http.HttpServletResponse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
...
...
@@ -58,8 +68,6 @@ public class UserServiceImpl implements UserService {
Specification
<
User
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
predicates
.
add
(
cb
.
isNotNull
(
root
.
get
(
User
.
Fields
.
username
)));
if
(
StrUtil
.
isNotEmpty
(
param
.
getRealName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
User
.
Fields
.
realName
),
"%"
+
param
.
getRealName
()
+
"%"
));
}
...
...
@@ -71,10 +79,12 @@ public class UserServiceImpl implements UserService {
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getRoles
()))
{
CriteriaBuilder
.
In
<
Object
>
in
=
cb
.
in
(
root
.
get
(
User
.
Fields
.
post
).
get
(
BasicEntity
.
Fields
.
id
));
CriteriaBuilder
.
In
<
Long
>
in
=
cb
.
in
(
root
.
join
(
User
.
Fields
.
roles
).
get
(
BasicEntity
.
Fields
.
id
));
String
[]
split
=
param
.
getRoles
().
split
(
","
);
Long
[]
roles
=
Convert
.
toLongArray
(
split
);
for
(
Long
role
:
roles
)
in
.
value
(
role
);
for
(
Long
roleId
:
roles
)
{
in
.
value
(
roleId
);
}
predicates
.
add
(
cb
.
and
(
in
));
}
...
...
@@ -86,7 +96,7 @@ public class UserServiceImpl implements UserService {
// 分页
Pageable
pageable
=
PageRequest
.
of
(
pageParam
.
getPageNo
()
-
1
,
pageParam
.
getPageSize
());
Page
<
User
>
users
=
userRepository
.
findAll
(
specification
,
pageable
);
List
<
UserVo
>
userVos
=
users
.
getContent
().
stream
().
map
(
UserVo:
:
transform
).
collect
(
Collectors
.
toList
());
List
<
UserVo
>
userVos
=
users
.
stream
().
map
(
UserVo:
:
transform
).
collect
(
Collectors
.
toList
());
PageVo
<
UserVo
>
pageVo
=
PageVo
.
build
(
userVos
,
users
.
getTotalElements
());
return
Result
.
ok
(
pageVo
);
}
...
...
@@ -97,11 +107,97 @@ public class UserServiceImpl implements UserService {
if
(
userOptional
.
isPresent
())
{
User
user
=
userOptional
.
get
();
user
.
setPassword
(
"123456"
);
user
.
setPassword
(
SaSecureUtil
.
sha256
(
"123456"
)
);
userRepository
.
save
(
user
);
return
Result
.
ok
();
}
return
Result
.
no
(
Status
.
BAD_REQUEST
);
}
@Override
public
Result
<
String
>
upStatus
(
IdParam
idParam
)
{
Optional
<
User
>
userOptional
=
userRepository
.
findById
(
idParam
.
getId
());
if
(
userOptional
.
isPresent
())
{
User
user
=
userOptional
.
get
();
if
(
ObjectUtil
.
isEmpty
(
user
.
getEnabled
()))
{
user
.
setEnabled
(
true
);
}
else
{
user
.
setEnabled
(!
user
.
getEnabled
());
}
userRepository
.
save
(
user
);
return
Result
.
ok
(
user
.
getEnabled
().
toString
());
}
return
Result
.
no
(
Status
.
BAD_REQUEST
);
}
@Override
public
void
export
(
UserExportParam
param
,
HttpServletResponse
response
)
{
Specification
<
User
>
specification
=
(
root
,
cq
,
cb
)
->
{
List
<
Predicate
>
predicates
=
ListUtil
.
toList
();
if
(
StrUtil
.
isNotEmpty
(
param
.
getRealName
()))
{
predicates
.
add
(
cb
.
like
(
root
.
get
(
User
.
Fields
.
realName
),
"%"
+
param
.
getRealName
()
+
"%"
));
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getDeptId
()))
{
predicates
.
add
(
cb
.
equal
(
root
.
get
(
User
.
Fields
.
department
).
get
(
BasicEntity
.
Fields
.
id
),
param
.
getDeptId
())
);
}
if
(
ObjectUtil
.
isNotEmpty
(
param
.
getRoles
()))
{
CriteriaBuilder
.
In
<
Long
>
in
=
cb
.
in
(
root
.
join
(
User
.
Fields
.
roles
).
get
(
BasicEntity
.
Fields
.
id
));
String
[]
split
=
param
.
getRoles
().
split
(
","
);
Long
[]
roles
=
Convert
.
toLongArray
(
split
);
for
(
Long
roleId
:
roles
)
{
in
.
value
(
roleId
);
}
predicates
.
add
(
cb
.
and
(
in
));
}
Order
order
=
cb
.
desc
(
root
.
get
(
BasicEntity
.
Fields
.
createTime
));
return
cq
.
orderBy
(
order
).
where
(
predicates
.
toArray
(
new
Predicate
[
0
])).
getRestriction
();
};
List
<
User
>
users
=
userRepository
.
findAll
(
specification
);
List
<
UserExportExcel
>
userExportExcels
=
users
.
stream
()
.
map
(
UserExportExcel:
:
transform
)
.
collect
(
Collectors
.
toList
());
try
(
DefaultStreamExcelBuilder
<
UserExportExcel
>
streamExcelBuilder
=
DefaultStreamExcelBuilder
.
of
(
UserExportExcel
.
class
)
.
threadPool
(
Executors
.
newFixedThreadPool
(
2
))
.
rowHeight
(
14
)
.
titleRowHeight
(
14
)
.
style
(
"cell->vertical-align:center;text-align:center"
,
"title->vertical-align:center;text-align:center;font-weight:bold;font-family:等线"
)
.
start
()
)
{
streamExcelBuilder
.
append
(
userExportExcels
);
String
fileName
=
URLEncoder
.
encode
(
"用户信息.xlsx"
,
StandardCharsets
.
UTF_8
);
response
.
setContentType
(
"application/octet-stream"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
fileName
);
OutputStream
out
=
response
.
getOutputStream
();
Workbook
workbook
=
streamExcelBuilder
.
fixedTitles
().
build
();
workbook
.
write
(
out
);
workbook
.
close
();
out
.
flush
();
out
.
close
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
"导出用户信息失败: "
+
e
.
getMessage
());
}
}
}
basic-auth/src/main/java/com/yiring/auth/web/auth/AuthController.java
浏览文件 @
1c8e5c1f
...
...
@@ -104,9 +104,9 @@ public class AuthController {
}
// 检查用户是否已被删除
if
(!
Boolean
.
FALSE
.
equals
(
user
.
getDeleted
()))
{
return
Result
.
no
(
Status
.
FORBIDDEN
,
"用户被禁用, 请联系管理员"
);
}
//
if (!Boolean.FALSE.equals(user.getDeleted())) {
//
return Result.no(Status.FORBIDDEN, "用户被禁用, 请联系管理员");
//
}
// 检查用户是否被允许登录
if
(!
Boolean
.
TRUE
.
equals
(
user
.
getEnabled
()))
{
...
...
basic-auth/src/main/java/com/yiring/auth/web/user/UserController.java
浏览文件 @
1c8e5c1f
...
...
@@ -8,6 +8,7 @@ import com.yiring.auth.domain.role.RoleRepository;
import
com.yiring.auth.domain.user.User
;
import
com.yiring.auth.domain.user.UserRepository
;
import
com.yiring.auth.param.IdsParam
;
import
com.yiring.auth.param.user.UserExportParam
;
import
com.yiring.auth.param.user.UserFindParam
;
import
com.yiring.auth.param.user.UserSaveParam
;
import
com.yiring.auth.service.user.UserService
;
...
...
@@ -29,13 +30,12 @@ import java.util.Optional;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.MediaType
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
/**
* 系统用户控制器
...
...
@@ -154,4 +154,16 @@ public class UserController {
public
Result
<
String
>
reset
(
@Valid
IdParam
idParam
)
{
return
userService
.
reset
(
idParam
);
}
@ApiOperation
(
"变更状态"
)
@PutMapping
(
"upStatus"
)
public
Result
<
String
>
upStatus
(
@Valid
IdParam
idParam
)
{
return
userService
.
upStatus
(
idParam
);
}
@ApiOperation
(
value
=
"导出"
,
produces
=
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
)
@GetMapping
(
"export"
)
public
void
export
(
@Valid
UserExportParam
param
,
HttpServletResponse
response
)
{
userService
.
export
(
param
,
response
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论