Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
entrance_api
Project
Project
Details
Activity
Releases
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
王琮
entrance_api
Commits
dddf3f69
Commit
dddf3f69
authored
Nov 18, 2022
by
陈明豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
访客信息导出相关功能
parent
0aadc129
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
VisitPersonController.java
...g/rcisoft/sys/visit/controller/VisitPersonController.java
+16
-20
No files found.
src/main/java/org/rcisoft/sys/visit/controller/VisitPersonController.java
View file @
dddf3f69
...
...
@@ -17,11 +17,14 @@ import org.rcisoft.core.util.CyEpExcelUtil;
import
org.rcisoft.core.util.CyResultGenUtil
;
import
org.rcisoft.sys.sysuser.entity.SysUser
;
import
org.rcisoft.sys.sysuser.service.SysUserService
;
import
org.rcisoft.sys.visit.entity.VisitPerson
;
import
org.rcisoft.sys.visit.entity.VisitUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -40,7 +43,7 @@ public class VisitPersonController extends CyPaginationController<SysUser> {
@ApiOperation
(
value
=
"添加访客表"
,
notes
=
"添加访客表"
)
@PostMapping
(
value
=
"/add"
)
public
CyResult
add
(
@RequestBody
SysUser
sysUser
,
BindingResult
bindingResult
)
{
System
.
out
.
println
(
sysUser
);
sysUser
.
setUserType
(
"1"
);
CyPersistModel
data
=
sysUserServiceImpl
.
persist
(
sysUser
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -106,6 +109,7 @@ public class VisitPersonController extends CyPaginationController<SysUser> {
@ApiOperation
(
value
=
"查询访客表集合"
,
notes
=
"查询访客表集合"
)
@GetMapping
(
value
=
"/querySysUsers"
)
public
CyResult
querySysUsers
(
SysUser
sysUser
)
{
sysUser
.
setUserType
(
"1"
);
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
...
...
@@ -117,32 +121,16 @@ public class VisitPersonController extends CyPaginationController<SysUser> {
@ApiOperation
(
value
=
"分页查询访客表集合"
,
notes
=
"分页查询访客表集合"
)
@GetMapping
(
value
=
"/querySysUserByPagination"
)
public
CyGridModel
listByPagination
(
SysUser
sysUser
)
{
sysUser
.
setUserType
(
"1"
);
sysUserServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
sysUser
);
return
getGridModelResponse
();
}
//查询数据字典
@GetMapping
(
value
=
"/queryData/{dictType:\\w+}"
)
public
CyResult
queryData
(
SysUser
sysUser
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
sysUserServiceImpl
.
findAllByData
(
sysUser
));
}
//查询部门
@GetMapping
(
value
=
"/queryDept"
)
public
CyResult
queryDept
(
SysUser
sysUser
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
sysUserServiceImpl
.
findAllByDept
(
sysUser
));
}
@CyOpeLogAnno
(
title
=
"system-访客表管理-查询访客表"
,
businessType
=
CyLogTypeEnum
.
EXPORT
)
@ApiOperation
(
value
=
"导出访客表信息"
,
notes
=
"导出访客表信息"
)
@GetMapping
(
value
=
"/export"
)
public
CyResult
outSysUser
(
HttpServletResponse
response
,
SysUser
sysUser
,
@PathVariable
@RequestParam
(
defaultValue
=
"0"
)
String
excelId
)
{
sysUser
.
setUserType
(
"1"
);
String
excelName
=
""
;
switch
(
excelId
){
case
"0"
:
excelName
=
"访客表信息.xls"
;
break
;
...
...
@@ -150,7 +138,15 @@ public class VisitPersonController extends CyPaginationController<SysUser> {
case
"2"
:
excelName
=
"访客表信息.csv"
;
break
;
}
List
<
SysUser
>
sysUserList
=
sysUserServiceImpl
.
export
(
sysUser
);
CyEpExcelUtil
.
exportExcel
(
sysUserList
,
"访客表信息"
,
"访客表信息"
,
SysUser
.
class
,
excelName
,
response
);
List
<
VisitPerson
>
visitPersonList
=
new
ArrayList
<>();
for
(
SysUser
u:
sysUserList
)
{
VisitPerson
visitPerson
=
new
VisitPerson
();
visitPerson
.
setName
(
u
.
getName
());
visitPerson
.
setPhone
(
u
.
getPhone
());
visitPerson
.
setBlacklistFlag
(
u
.
getBlacklistFlag
());
visitPersonList
.
add
(
visitPerson
);
}
CyEpExcelUtil
.
exportExcel
(
visitPersonList
,
"访客表信息"
,
"访客表信息"
,
VisitPerson
.
class
,
excelName
,
response
);
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
...
...
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