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
0aadc129
Commit
0aadc129
authored
Nov 18, 2022
by
陈明豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邀访信息导出相关功能
parent
7476d50b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
216 additions
and
7 deletions
+216
-7
SysUser.java
src/main/java/org/rcisoft/sys/sysuser/entity/SysUser.java
+1
-1
VisitPersonController.java
...g/rcisoft/sys/visit/controller/VisitPersonController.java
+159
-0
VisitPerson.java
src/main/java/org/rcisoft/sys/visit/entity/VisitPerson.java
+47
-0
SysUserRepositorys.xml
src/main/resources/mapper/SysUserRepositorys.xml
+9
-6
No files found.
src/main/java/org/rcisoft/sys/sysuser/entity/SysUser.java
View file @
0aadc129
...
...
@@ -79,7 +79,7 @@ public class SysUser extends CyIdIncreEntity<SysUser> {
* @default
*/
@Excel
(
name
=
"用户类型(0内部员工 1外部访客)"
,
orderNum
=
"2"
,
width
=
20
)
private
Lo
ng
userType
;
private
Stri
ng
userType
;
/**
* @desc 用户姓名
...
...
src/main/java/org/rcisoft/sys/visit/controller/VisitPersonController.java
0 → 100644
View file @
0aadc129
package
org
.
rcisoft
.
sys
.
visit
.
controller
;
/*固定导入*/
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.core.anno.CyOpeLogAnno
;
import
org.rcisoft.core.constant.CyMessCons
;
import
org.rcisoft.core.controller.CyPaginationController
;
import
org.rcisoft.core.model.CyGridModel
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.operlog.enums.CyLogTypeEnum
;
import
org.rcisoft.core.result.CyResult
;
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.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
* Created by cy on 2022年11月16日 下午3:19:19.
*/
@RestController
@RequestMapping
(
"/visitPersonManage"
)
public
class
VisitPersonController
extends
CyPaginationController
<
SysUser
>
{
@Autowired
private
SysUserService
sysUserServiceImpl
;
//@PreAuthorize("@cyPerm.hasPerm('sys:user:add')")
@CyOpeLogAnno
(
title
=
"system-访客表管理-新增访客表"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@ApiOperation
(
value
=
"添加访客表"
,
notes
=
"添加访客表"
)
@PostMapping
(
value
=
"/add"
)
public
CyResult
add
(
@RequestBody
SysUser
sysUser
,
BindingResult
bindingResult
)
{
System
.
out
.
println
(
sysUser
);
CyPersistModel
data
=
sysUserServiceImpl
.
persist
(
sysUser
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
sysUser
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:user:delete')")
@CyOpeLogAnno
(
title
=
"system-访客表管理-删除访客表"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@ApiOperation
(
value
=
"逻辑删除访客表"
,
notes
=
"逻辑删除访客表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/deleteLogical/{businessId:\\w+}"
)
public
CyResult
deleteLogical
(
@PathVariable
int
businessId
,
SysUser
sysUser
)
{
sysUser
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
sysUserServiceImpl
.
removeLogical
(
sysUser
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
//逻辑删除
//@PreAuthorize("@cyPerm.hasPerm('sys:user:delete')")
@CyOpeLogAnno
(
title
=
"system-访客表管理-删除访客表"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@ApiOperation
(
value
=
"删除访客表"
,
notes
=
"删除访客表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/delete/{businessId:\\w+}"
)
public
CyResult
delete
(
@PathVariable
int
businessId
,
SysUser
sysUser
)
{
sysUser
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
sysUserServiceImpl
.
remove
(
sysUser
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
businessId
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:user:update')")
@CyOpeLogAnno
(
title
=
"system-访客表管理-修改访客表"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"修改访客表"
,
notes
=
"修改访客表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/update"
)
public
CyResult
update
(
@RequestBody
SysUser
sysUser
,
BindingResult
bindingResult
)
{
CyPersistModel
data
=
sysUserServiceImpl
.
merge
(
sysUser
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
sysUser
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:user:query')")
@CyOpeLogAnno
(
title
=
"system-访客表管理-查询访客表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询单一访客表"
,
notes
=
"查询单一访客表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@GetMapping
(
"/detail/{businessId:\\w+}"
)
public
CyResult
detail
(
@PathVariable
Long
businessId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
sysUserServiceImpl
.
findById
(
businessId
));
}
// //@PreAuthorize("@cyPerm.hasPerm('sys:user:list')")
@CyOpeLogAnno
(
title
=
"system-访客表管理-查询访客表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询访客表集合"
,
notes
=
"查询访客表集合"
)
@GetMapping
(
value
=
"/querySysUsers"
)
public
CyResult
querySysUsers
(
SysUser
sysUser
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
sysUserServiceImpl
.
findAll
(
sysUser
));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:user:list')")
@CyOpeLogAnno
(
title
=
"system-访客表管理-查询访客表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"分页查询访客表集合"
,
notes
=
"分页查询访客表集合"
)
@GetMapping
(
value
=
"/querySysUserByPagination"
)
public
CyGridModel
listByPagination
(
SysUser
sysUser
)
{
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
)
{
String
excelName
=
""
;
switch
(
excelId
){
case
"0"
:
excelName
=
"访客表信息.xls"
;
break
;
case
"1"
:
excelName
=
"访客表信息.xlsx"
;
break
;
case
"2"
:
excelName
=
"访客表信息.csv"
;
break
;
}
List
<
SysUser
>
sysUserList
=
sysUserServiceImpl
.
export
(
sysUser
);
CyEpExcelUtil
.
exportExcel
(
sysUserList
,
"访客表信息"
,
"访客表信息"
,
SysUser
.
class
,
excelName
,
response
);
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
sysUserList
);
}
}
src/main/java/org/rcisoft/sys/visit/entity/VisitPerson.java
0 → 100644
View file @
0aadc129
package
org
.
rcisoft
.
sys
.
visit
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
@Data
@TableName
(
"sys_user"
)
public
class
VisitPerson
{
@Excel
(
name
=
"姓名"
,
orderNum
=
"0"
,
width
=
20
)
private
String
name
;
@Excel
(
name
=
"手机号"
,
orderNum
=
"1"
,
width
=
20
)
private
String
phone
;
@Transient
@TableField
(
exist
=
false
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"首次到访时间"
,
orderNum
=
"2"
,
width
=
20
,
exportFormat
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
firstDate
;
@Transient
@TableField
(
exist
=
false
)
@Excel
(
name
=
"最近到访时间"
,
orderNum
=
"2"
,
width
=
20
,
exportFormat
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
lastDate
;
@Transient
@TableField
(
exist
=
false
)
@Excel
(
name
=
"到访次数"
,
orderNum
=
"3"
,
width
=
20
)
private
int
count
;
/**
* @desc 黑名单状态(0不存在1存在)
* @column blacklist_flag
* @default
* @default
*/
@Excel
(
name
=
"状态(0白名单1黑名单)"
,
orderNum
=
"4"
,
width
=
20
)
private
Long
blacklistFlag
;
}
src/main/resources/mapper/SysUserRepositorys.xml
View file @
0aadc129
...
...
@@ -40,13 +40,14 @@
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select
id=
"querySysUsers"
resultMap=
"BaseResultMap"
>
select distinct business_id,NAME,sex,phone,face_address,address,dept_id, position,nlt_bz,flag,user_type
from sys_user
where
del_flag = 0
select * from sys_user
where 1=1
<if
test=
"entity.userType !=null and entity.userType != '' "
>
and user_type = #{entity.userType}
</if>
<if
test=
"entity.delFlag !=null and entity.delFlag != '' "
>
and del_flag = #{entity.delFlag}
</if>
<if
test=
"entity.position !=null and entity.position != '' "
>
and position in
<foreach
collection=
"array"
item=
"position"
index=
"index"
open=
"("
close=
")"
separator=
","
>
...
...
@@ -83,11 +84,13 @@
</select>
<select
id=
"querySysUsersPaged"
resultMap=
"BaseResultMap"
>
select
distinct business_id,NAME,sex,phone,face_address,address,dept_id, position,nlt_bz,flag,user_type
select
*
from sys_user
where
del_flag = 0
and user_type = 0
<if
test=
"entity.userType !=null and entity.userType != '' "
>
and user_type = #{entity.userType}
</if>
<if
test=
"entity.position !=null and entity.position != '' "
>
and position in
<foreach
collection=
"array"
item=
"position"
index=
"index"
open=
"("
close=
")"
separator=
","
>
...
...
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