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
22821983
Commit
22821983
authored
Nov 28, 2022
by
陈明豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改邀访管理添加
parent
10981624
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
131 additions
and
34 deletions
+131
-34
CheckUtil.java
src/main/java/org/rcisoft/sys/sysuser/util/CheckUtil.java
+2
-4
CyEpExcelUtil.java
...main/java/org/rcisoft/sys/sysuser/util/CyEpExcelUtil.java
+1
-1
VisitPersonRepositorys.java
...ava/org/rcisoft/sys/visit/dao/VisitPersonRepositorys.java
+1
-0
ExportVisitInfoDto.java
...in/java/org/rcisoft/sys/visit/dto/ExportVisitInfoDto.java
+22
-19
ExportVisitUserDTO.java
...in/java/org/rcisoft/sys/visit/dto/ExportVisitUserDTO.java
+1
-1
VisitInfomationServiceImpl.java
...ft/sys/visit/service/impl/VisitInfomationServiceImpl.java
+82
-5
VisitUserServiceImpl.java
.../rcisoft/sys/visit/service/impl/VisitUserServiceImpl.java
+14
-3
VisitPersonRepositorys.xml
src/main/resources/mapper/VisitPersonRepositorys.xml
+8
-1
No files found.
src/main/java/org/rcisoft/sys/sysuser/util/CheckUtil.java
View file @
22821983
...
...
@@ -86,10 +86,8 @@ public class CheckUtil {
errorDTO
.
setSuccess
(
0
);
if
(
StringUtils
.
isEmpty
(
visitInfoDto
.
getUserName
()))
notTrue
.
add
(
"发起人姓名不能为空"
);
if
(
StringUtils
.
isEmpty
(
visitInfoDto
.
getDeptName
()))
notTrue
.
add
(
"发起人所属部门不能为空"
);
if
(
StringUtils
.
isEmpty
(
visitInfoDto
.
getPostName
()))
notTrue
.
add
(
"发起人职务不能为空"
);
if
(
StringUtils
.
isEmpty
(
visitInfoDto
.
getPhone
()))
notTrue
.
add
(
"发起人手机号不能为空"
);
if
(
StringUtils
.
isEmpty
(
visitInfoDto
.
getVisitReason
()))
notTrue
.
add
(
"访问事由不能为空"
);
if
(
StringUtils
.
isEmpty
(
visitInfoDto
.
getVisitRegion
()))
...
...
src/main/java/org/rcisoft/sys/sysuser/util/CyEpExcelUtil.java
View file @
22821983
...
...
@@ -184,7 +184,7 @@ public class CyEpExcelUtil {
/* CellRangeAddress c = CellRangeAddress.valueOf("H3:H3");
workbook.getSheetAt(0).setAutoFilter(c);*/
//岗位
if
(
null
!=
excelDto
.
getShift
()
&&
excelDto
.
getShift
().
length
>
0
)
{
if
(
excelDto
!=
null
&&
null
!=
excelDto
.
getShift
()
&&
excelDto
.
getShift
().
length
>
0
)
{
CyEpExcelUtil
.
selectList
(
workbook
,
3
,
510
,
7
,
7
,
excelDto
.
getShift
());
}
if
(
workbook
!=
null
)
{
...
...
src/main/java/org/rcisoft/sys/visit/dao/VisitPersonRepositorys.java
View file @
22821983
...
...
@@ -39,6 +39,7 @@ public interface VisitPersonRepositorys extends CyBaseMapper<SysUser> {
List
<
SysUser
>
querySysUsersByPhone
(
String
phone
);
List
<
SysUser
>
queryVisitUsersByPhoneAndName
(
String
phone
,
String
name
);
List
<
SysUser
>
querySysUsersByUserName
(
String
username
);
List
<
SysUser
>
querySysUsersByDId
(
Integer
businessId
);
...
...
src/main/java/org/rcisoft/sys/visit/dto/ExportVisitInfoDto.java
View file @
22821983
...
...
@@ -17,28 +17,31 @@ public class ExportVisitInfoDto {
@Excel
(
name
=
"发起人姓名"
,
orderNum
=
"1"
,
width
=
20
)
private
String
userName
;
/**
* @desc 发起人所属部门
* @column dept_name
* @default
*/
@Excel
(
name
=
"发起人所属部门"
,
orderNum
=
"2"
,
width
=
20
)
private
String
deptName
;
// /**
// * @desc 发起人所属部门
// * @column dept_name
// * @default
// */
// @Excel(name = "发起人所属部门", orderNum = "2", width = 20)
// private String deptName;
//
// /**
// * @desc 发起人职务
// * @column post_name
// * @default
// */
// @Excel(name = "发起人职务", orderNum = "3", width = 20)
// private String postName;
/**
* @desc 发起人职务
* @column post_name
* @default
*/
@Excel
(
name
=
"发起人职务"
,
orderNum
=
"3"
,
width
=
20
)
private
String
postName
;
@Excel
(
name
=
"发起人手机号"
,
orderNum
=
"2"
,
width
=
20
)
private
String
phone
;
/**
* @desc 访问事由
* @column visit_reason
* @default
*/
@Excel
(
name
=
"访问事由"
,
orderNum
=
"
4
"
,
width
=
20
)
@Excel
(
name
=
"访问事由"
,
orderNum
=
"
3
"
,
width
=
20
)
private
String
visitReason
;
/**
...
...
@@ -46,7 +49,7 @@ public class ExportVisitInfoDto {
* @column visit_region
* @default
*/
@Excel
(
name
=
"访问区域
"
,
orderNum
=
"5
"
,
width
=
20
)
@Excel
(
name
=
"访问区域
(多个用','分割)"
,
orderNum
=
"4
"
,
width
=
20
)
private
String
visitRegion
;
/**
...
...
@@ -55,7 +58,7 @@ public class ExportVisitInfoDto {
* @default
*/
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"访问日期(格式
2022-11-19)"
,
orderNum
=
"6
"
,
width
=
30
)
@Excel
(
name
=
"访问日期(格式
yyyy-MM-dd)"
,
orderNum
=
"5
"
,
width
=
30
)
private
String
visitDate
;
/**
...
...
@@ -63,7 +66,7 @@ public class ExportVisitInfoDto {
* @column visit_time
* @default
*/
@Excel
(
name
=
"访问时间(格式
11:20
)"
,
orderNum
=
"6"
,
width
=
30
)
@Excel
(
name
=
"访问时间(格式
hh:mm
)"
,
orderNum
=
"6"
,
width
=
30
)
private
String
visitTime
;
/**
...
...
@@ -77,6 +80,6 @@ public class ExportVisitInfoDto {
* @desc 访客手机号
* @default
*/
@Excel
(
name
=
"访客手机号(多个用','分割,和访客姓名对应)"
,
orderNum
=
"
7
"
,
width
=
40
)
@Excel
(
name
=
"访客手机号(多个用','分割,和访客姓名对应)"
,
orderNum
=
"
8
"
,
width
=
40
)
private
String
visitPhone
;
}
src/main/java/org/rcisoft/sys/visit/dto/ExportVisitUserDTO.java
View file @
22821983
...
...
@@ -8,7 +8,7 @@ import lombok.Data;
public
class
ExportVisitUserDTO
{
@ApiModelProperty
(
name
=
"name"
,
value
=
"姓名"
,
required
=
true
,
dataType
=
"varchar"
)
@Excel
(
name
=
"姓名"
,
orderNum
=
"
1
"
,
width
=
20.0
)
@Excel
(
name
=
"姓名"
,
orderNum
=
"
0
"
,
width
=
20.0
)
private
String
name
;
@ApiModelProperty
(
name
=
"phone"
,
value
=
"手机号"
,
required
=
true
,
dataType
=
"varchar"
)
...
...
src/main/java/org/rcisoft/sys/visit/service/impl/VisitInfomationServiceImpl.java
View file @
22821983
...
...
@@ -11,6 +11,10 @@ import org.rcisoft.core.result.enums.CyResSvcExcEnum;
import
org.rcisoft.core.util.CyCompareToolUtils
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.sys.sysuser.dao.SysDeptRepositorys
;
import
org.rcisoft.sys.sysuser.dao.SysDictDataRepositorys
;
import
org.rcisoft.sys.sysuser.entity.SysDept
;
import
org.rcisoft.sys.sysuser.entity.SysDictData
;
import
org.rcisoft.sys.sysuser.entity.SysUser
;
import
org.rcisoft.sys.sysuser.service.impl.SysUserServiceImpl
;
import
org.rcisoft.sys.sysuser.util.CheckUtil
;
...
...
@@ -61,9 +65,15 @@ public class VisitInfomationServiceImpl extends ServiceImpl<VisitInfomationRepos
@Autowired
VisitUserRepository
visitUserRepository
;
@Autowired
SysDictDataRepositorys
sysDictDataRepositorys
;
@Autowired
VisitPersonRepositorys
sysUserRepositorys
;
@Autowired
SysDeptRepositorys
sysDeptRepositorys
;
@Autowired
VisitUserServiceImpl
userService
;
...
...
@@ -486,7 +496,7 @@ public class VisitInfomationServiceImpl extends ServiceImpl<VisitInfomationRepos
imOutSysUsers
.
add
(
exportUserDTO
);
}
CyEpExcelUtil
.
exportExcelSelect
(
imOutSysUsers
,
"邀访信息"
,
"邀访"
,
ExportVisitInfoDto
.
class
,
"模板.xls"
,
response
,
null
);
ExportVisitInfoDto
.
class
,
"
邀访信息
模板.xls"
,
response
,
null
);
return
1
;
}
...
...
@@ -501,6 +511,7 @@ public class VisitInfomationServiceImpl extends ServiceImpl<VisitInfomationRepos
boolean
flag
=
false
;
try
{
flag
=
CyEpExcelUtil
.
isFileInUser
(
file
,
exportVisitInfoDto
,
2
);
flag
=
true
;
}
catch
(
Exception
e
)
{
throw
new
CyServiceException
(
CyResSvcExcEnum
.
ERROR_NETWORK
);
}
...
...
@@ -565,16 +576,79 @@ public class VisitInfomationServiceImpl extends ServiceImpl<VisitInfomationRepos
SysUser
sysUserDTO
=
new
SysUser
();
sysUserDTO
.
setDeleted
();
sysUserDTO
.
setName
(
visitInfoDto
.
getUserName
());
sysUserDTO
.
setPhone
(
visitInfoDto
.
getPhone
());
sysUserDTO
.
setUserType
(
"0"
);
// 根据姓名查询员工数据
List
<
SysUser
>
sysUsers
=
sysUserRepositorys
.
querySysUsers
(
sysUserDTO
);
if
(
sysUsers
.
size
()
==
0
)
continue
;
visitInfoMation
.
setUserId
(
sysUsers
.
get
(
0
).
getBusinessId
());
SysUser
mainUser
=
sysUsers
.
get
(
0
);
visitInfoMation
.
setUserId
(
mainUser
.
getBusinessId
());
visitInfoMation
.
setUserName
(
visitInfoDto
.
getUserName
());
visitInfoMation
.
setDeptName
(
visitInfoDto
.
getDeptName
());
// 设置邀访信息部门名称
String
deptId
=
mainUser
.
getDeptId
();
if
(
deptId
!=
null
){
if
(
sysDeptRepositorys
.
queryDeptById
(
deptId
).
size
()>
0
){
SysDept
dept
=
sysDeptRepositorys
.
queryDeptById
(
deptId
).
get
(
0
);
if
(
dept
!=
null
){
String
deptName
=
dept
.
getDeptName
();
visitInfoMation
.
setDeptName
(
deptName
);
}
}
}
// 设置邀访信息职位名称
String
position
=
mainUser
.
getPosition
();
if
(
position
!=
null
){
SysDictData
sysDictData
=
new
SysDictData
();
sysDictData
.
setDictType
(
"position"
);
List
<
SysDictData
>
dictDataList
=
sysDictDataRepositorys
.
querySysDictDatas
(
sysDictData
);
String
postName
=
""
;
for
(
SysDictData
data:
dictDataList
){
if
(
data
.
getDictValue
().
equals
(
position
)){
postName
=
data
.
getDictLabel
();
}
}
visitInfoMation
.
setPostName
(
postName
);
}
// 设置邀访信息访问事由
String
reason
=
visitInfoDto
.
getVisitReason
();
if
(
reason
!=
null
){
SysDictData
sysDictData
=
new
SysDictData
();
sysDictData
.
setDictType
(
"visitReason"
);
List
<
SysDictData
>
dictDataList
=
sysDictDataRepositorys
.
querySysDictDatas
(
sysDictData
);
String
reasonCode
=
""
;
for
(
SysDictData
data:
dictDataList
){
if
(
data
.
getDictLabel
().
equals
(
reason
)){
reasonCode
=
data
.
getDictValue
();
}
}
if
(
reasonCode
.
equals
(
""
)){
visitInfoMation
.
setVisitReasonCode
(
"other"
);
visitInfoMation
.
setVisitReason
(
"其他"
);
visitInfoMation
.
setVisitReasonOther
(
reason
);
}
else
{
visitInfoMation
.
setVisitReason
(
reason
);
visitInfoMation
.
setVisitReasonCode
(
reasonCode
);
}
}
// 设置邀访信息访问区域
if
(
visitInfoDto
.
getVisitRegion
().
length
()>
0
){
String
[]
regions
=
visitInfoDto
.
getVisitRegion
().
split
(
","
);
visitInfoMation
.
setVisitRegion
(
visitInfoDto
.
getVisitRegion
());
String
regionCode
=
""
;
for
(
String
region:
regions
){
if
(
region
.
equals
(
"行政办公楼"
)){
regionCode
=
regionCode
+
"0"
+
","
;
}
else
{
regionCode
=
regionCode
+
"1"
+
","
;
}
}
if
(
regionCode
.
length
()>
0
){
regionCode
=
regionCode
.
substring
(
0
,
regionCode
.
length
()-
1
);
visitInfoMation
.
setVisitRegionCode
(
regionCode
);
}
}
visitInfoMation
.
setVisitRegion
(
visitInfoDto
.
getVisitRegion
());
visitInfoMation
.
setVisitReason
(
visitInfoDto
.
getVisitReason
());
SimpleDateFormat
date
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
visitInfoMation
.
setVisitDate
(
date
.
parse
(
visitInfoDto
.
getVisitDate
()));
visitInfoMation
.
setVisitTime
(
visitInfoDto
.
getVisitTime
());
...
...
@@ -589,7 +663,10 @@ public class VisitInfomationServiceImpl extends ServiceImpl<VisitInfomationRepos
.
filter
(
p
->
StringUtils
.
isNotEmpty
(
p
)).
distinct
()
.
collect
(
Collectors
.
toList
());
for
(
int
i
=
0
;
i
<
visitName
.
size
();
i
++)
{
userList
.
add
(
new
VisitUser
(
visitName
.
get
(
i
),
visitPhone
.
get
(
i
)));
VisitUser
visitUser
=
new
VisitUser
();
visitUser
.
setUserName
(
visitName
.
get
(
i
));
visitUser
.
setVisitPhone
(
visitPhone
.
get
(
i
));
userList
.
add
(
visitUser
);
}
visitInfoMation
.
setUserList
(
userList
);
// 新增
...
...
src/main/java/org/rcisoft/sys/visit/service/impl/VisitUserServiceImpl.java
View file @
22821983
...
...
@@ -2,6 +2,7 @@ package org.rcisoft.sys.visit.service.impl;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.rcisoft.common.component.CyGlobal
;
import
org.rcisoft.core.component.CyDownErrorTxtComp
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.core.result.enums.CyResSvcExcEnum
;
...
...
@@ -13,6 +14,7 @@ import org.rcisoft.sys.sysuser.entity.SysUser;
import
org.rcisoft.sys.sysuser.service.impl.SysUserServiceImpl
;
import
org.rcisoft.sys.sysuser.util.CheckUtil
;
import
org.rcisoft.sys.sysuser.util.CyEpExcelUtil
;
import
org.rcisoft.sys.visit.dao.VisitPersonRepositorys
;
import
org.rcisoft.sys.visit.dao.VisitUserRepository
;
import
org.rcisoft.sys.visit.dto.ExportVisitUserDTO
;
import
org.rcisoft.sys.visit.dto.ImportVistUserDTO
;
...
...
@@ -21,6 +23,7 @@ import org.rcisoft.sys.visit.service.VisitUserService;
import
org.rcisoft.sys.wbac.user.dto.ErrorDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
...
...
@@ -43,7 +46,10 @@ import javax.servlet.http.HttpServletResponse;
@Slf4j
public
class
VisitUserServiceImpl
extends
ServiceImpl
<
VisitUserRepository
,
VisitUser
>
implements
VisitUserService
{
@Autowired
private
PasswordEncoder
passwordEncoder
;
@Autowired
private
CyGlobal
global
;
@Autowired
private
SysUserRepositorys
sysUserRepositorys
;
@Autowired
...
...
@@ -51,6 +57,8 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
@Autowired
private
SysUserServiceImpl
sysUserService
;
@Autowired
private
VisitPersonRepositorys
visitPersonRepositorys
;
/**
* 保存 邀访访客信息表
*
...
...
@@ -258,11 +266,14 @@ public class VisitUserServiceImpl extends ServiceImpl<VisitUserRepository, Visit
user
.
setUserType
(
"1"
);
user
.
setPhone
(
sysUser
.
getPhone
());
// 判断当前访客是否存在
List
<
SysUser
>
sysUsers
=
sysUserRepositorys
.
querySysUsers
(
user
);
List
<
SysUser
>
sysUsers
=
visitPersonRepositorys
.
querySysUsers
(
user
);
user
.
setPassword
(
passwordEncoder
.
encode
(
global
.
getResetPassword
()));
user
.
setName
(
sysUser
.
getName
());
user
.
setUsername
(
sysUser
.
getPhone
());
if
(
sysUsers
.
size
()
==
0
)
if
(
sysUsers
.
size
()
==
0
)
{
user
.
setPersonId
(
UUID
.
randomUUID
().
toString
());
sysUserRepositorys
.
insert
(
user
);
}
else
{
sysUsers
.
get
(
0
).
setName
(
sysUser
.
getName
());
sysUserRepositorys
.
updateSysUser
(
sysUsers
.
get
(
0
));
...
...
src/main/resources/mapper/VisitPersonRepositorys.xml
View file @
22821983
...
...
@@ -79,6 +79,12 @@
<if
test=
"entity.phone != null and entity.phone != ''"
>
and phone = #{entity.phone}
</if>
<if
test=
"entity.name != null and entity.name !=''"
>
and name = #{entity.name}
</if>
<if
test=
"entity.userType != null and entity.userType!= ''"
>
and user_type = #{entity.userType}
</if>
</select>
<select
id=
"querySysUsersPaged"
resultMap=
"BaseResultMap"
>
...
...
@@ -260,11 +266,12 @@
and phone = #{phone}
</select>
<select
id=
"queryVisitUsersByPhone"
resultMap=
"BaseResultMap"
>
<select
id=
"queryVisitUsersByPhone
AndName
"
resultMap=
"BaseResultMap"
>
select *
from sys_user
where user_type = 1
and phone = #{phone}
and name = #{name}
</select>
<select
id=
"querySysUsersByUserName"
resultMap=
"BaseResultMap"
>
...
...
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