Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
2ae17a30
Commit
2ae17a30
authored
May 18, 2020
by
邓实川
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
员工管理添加员工优化,组织管理部门树结构优化
parent
36400bd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
97 deletions
+64
-97
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+59
-83
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
+5
-14
No files found.
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
2ae17a30
...
@@ -51,6 +51,7 @@ import cn.hutool.core.date.DateUtil;
...
@@ -51,6 +51,7 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.TreeNodeConfig
;
import
cn.hutool.core.lang.tree.TreeNodeConfig
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.IdcardUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
...
@@ -123,7 +124,7 @@ public class YgglController {
...
@@ -123,7 +124,7 @@ public class YgglController {
@Value
(
value
=
"${config-8timer.init-password}"
)
@Value
(
value
=
"${config-8timer.init-password}"
)
private
String
pwd
;
private
String
pwd
;
@Autowired
@Autowired
private
YgglMainEmpMapper
ygglMainEmpMapper
;
private
YgglMainEmpMapper
ygglMainEmpMapper
;
...
@@ -168,12 +169,14 @@ public class YgglController {
...
@@ -168,12 +169,14 @@ public class YgglController {
if
(
ygglMainEmp
!=
null
)
{
if
(
ygglMainEmp
!=
null
)
{
Integer
gw
=
ygglMainEmp
.
getBmgwId
();
Integer
gw
=
ygglMainEmp
.
getBmgwId
();
ZzglBmgwM
gwObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
select
(
ZzglBmgwM:
:
getUpId
,
ZzglBmgwM:
:
getName
)
ZzglBmgwM
gwObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
eq
(
ZzglBmgwM:
:
getId
,
gw
).
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
.
select
(
ZzglBmgwM:
:
getUpId
,
ZzglBmgwM:
:
getName
).
eq
(
ZzglBmgwM:
:
getId
,
gw
)
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
if
(
gwObj
!=
null
)
{
if
(
gwObj
!=
null
)
{
ZzglBmgwM
bmObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
select
(
ZzglBmgwM:
:
getId
,
ZzglBmgwM:
:
getName
)
ZzglBmgwM
bmObj
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
)
.
eq
(
ZzglBmgwM:
:
getId
,
gwObj
.
getUpId
()).
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
.
select
(
ZzglBmgwM:
:
getId
,
ZzglBmgwM:
:
getName
).
eq
(
ZzglBmgwM:
:
getId
,
gwObj
.
getUpId
())
.
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
one
();
loginInfo
.
setBmId
(
bmObj
!=
null
?
bmObj
.
getId
()
:
null
);
loginInfo
.
setBmId
(
bmObj
!=
null
?
bmObj
.
getId
()
:
null
);
loginInfo
.
setBmName
(
bmObj
!=
null
?
bmObj
.
getName
()
:
null
);
loginInfo
.
setBmName
(
bmObj
!=
null
?
bmObj
.
getName
()
:
null
);
}
}
...
@@ -350,6 +353,7 @@ public class YgglController {
...
@@ -350,6 +353,7 @@ public class YgglController {
/**
/**
* 添加员工档案
* 添加员工档案
*
* @param userBean
* @param userBean
* @param addygdaDto
* @param addygdaDto
* @return
* @return
...
@@ -357,28 +361,36 @@ public class YgglController {
...
@@ -357,28 +361,36 @@ public class YgglController {
@PostMapping
(
value
=
"/addygda"
)
@PostMapping
(
value
=
"/addygda"
)
@ApiOperation
(
value
=
"添加员工档案"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"添加员工档案"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
4
)
@ApiOperationSupport
(
order
=
4
)
public
Result
<
Object
>
addygda
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AddygdaDto
addygdaDto
)
throws
Exception
{
public
Result
<
Object
>
addygda
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AddygdaDto
addygdaDto
)
throws
Exception
{
Integer
orgCode
=
userBean
.
getOrgCode
();
Integer
orgCode
=
userBean
.
getOrgCode
();
String
name
=
addygdaDto
.
getName
();
String
name
=
addygdaDto
.
getName
();
String
phone
=
addygdaDto
.
getPhone
();
String
phone
=
addygdaDto
.
getPhone
();
Integer
zjType
=
addygdaDto
.
getZjType
();
Integer
zjType
=
addygdaDto
.
getZjType
();
String
zjNum
=
addygdaDto
.
getZjNum
();
String
zjNum
=
addygdaDto
.
getZjNum
();
Integer
jobType
=
addygdaDto
.
getJobType
();
Integer
jobType
=
addygdaDto
.
getJobType
();
Date
rzTime
=
addygdaDto
.
getRzTime
();
Date
rzTime
=
null
;
if
(
addygdaDto
.
getRzTime
()
==
null
)
rzTime
=
new
Date
();
else
rzTime
=
addygdaDto
.
getRzTime
();
Integer
syq
=
addygdaDto
.
getSyq
();
Integer
syq
=
addygdaDto
.
getSyq
();
Integer
sex
=
addygdaDto
.
getSex
();
Integer
sex
=
addygdaDto
.
getSex
();
Integer
bmgwId
=
addygdaDto
.
getBmgwId
();
Integer
bmgwId
=
addygdaDto
.
getBmgwId
();
if
(
StrUtil
.
hasBlank
(
phone
)
||
StrUtil
.
hasBlank
(
name
)
||
StrUtil
.
hasBlank
(
zjNum
))
{
if
(
StrUtil
.
hasBlank
(
phone
)
||
StrUtil
.
hasBlank
(
name
)
||
StrUtil
.
hasBlank
(
zjNum
))
{
return
ResultUtil
.
error
(
"请输入员工姓名,手机号和身份证号"
);
return
ResultUtil
.
error
(
"请输入员工姓名,手机号和身份证号"
);
}
}
if
(!
ObjectUtil
.
isAllNotEmpty
(
name
,
phone
,
zjType
,
zjNum
,
jobType
,
rzTime
,
syq
,
bmgwId
,
sex
))
{
if
(!
ObjectUtil
.
isAllNotEmpty
(
name
,
phone
,
zjType
,
zjNum
,
jobType
,
rzTime
,
syq
,
bmgwId
,
sex
))
{
return
ResultUtil
.
error
(
"请完善员工信息!"
);
return
ResultUtil
.
error
(
"请完善员工信息!"
);
}
}
if
(!
IdcardUtil
.
isValidCard
(
zjNum
))
{
return
ResultUtil
.
error
(
"请输入有效的证件信息!"
);
}
QyzxEmpLogin
login
=
new
LambdaQueryChainWrapper
<
QyzxEmpLogin
>(
qyzxEmpLoginMapper
)
QyzxEmpLogin
login
=
new
LambdaQueryChainWrapper
<
QyzxEmpLogin
>(
qyzxEmpLoginMapper
)
.
eq
(!
StrUtil
.
hasBlank
(
phone
),
QyzxEmpLogin:
:
getPhone
,
phone
).
one
();
.
eq
(!
StrUtil
.
hasBlank
(
phone
),
QyzxEmpLogin:
:
getPhone
,
phone
).
one
();
if
(
login
==
null
)
{
if
(
login
==
null
)
{
// 初始化密码
pwd
// 初始化密码 pwd
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
phone
).
pw
(
Md5
.
md5
(
pwd
))
QyzxEmpLogin
qyzxEmpLogin
=
QyzxEmpLogin
.
builder
().
phone
(
phone
).
pw
(
Md5
.
md5
(
pwd
))
.
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
orgId
(
userBean
.
getOrgCode
()).
username
(
name
).
build
();
.
sts
(
CommonEnum
.
U_STS_ON
.
getType
()).
orgId
(
userBean
.
getOrgCode
()).
username
(
name
).
build
();
if
(!
qyzxEmpLogin
.
insert
())
{
if
(!
qyzxEmpLogin
.
insert
())
{
...
@@ -388,71 +400,39 @@ public class YgglController {
...
@@ -388,71 +400,39 @@ public class YgglController {
// 添加三张表
// 添加三张表
// 员工权限表(未定)
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
QyzxEmpEntAsso
.
builder
()
QyzxEmpEntAsso
.
builder
().
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
orgCode
)
.
empNum
(
qyzxEmpLogin
.
getId
())
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
()).
status
(
1
).
build
().
insert
();
// usertype2普通员工 status1正常
.
orgCode
(
orgCode
)
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
name
(
name
).
phone
(
phone
).
zjType
(
zjType
).
zjNum
(
zjNum
)
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
())
.
jobType
(
jobType
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
SHIYONG
.
getType
()).
rzTime
(
rzTime
).
syq
(
syq
)
.
status
(
1
)
.
sex
(
sex
).
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
orgCode
).
build
();
.
build
()
.
insert
();
// usertype2普通员工 status1正常
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
()
.
name
(
name
)
.
phone
(
phone
)
.
zjType
(
zjType
)
.
zjNum
(
zjNum
)
.
jobType
(
jobType
)
.
jobStatus
(
YgEnumInterface
.
jobStatus
.
SHIYONG
.
getType
())
.
rzTime
(
rzTime
)
.
syq
(
syq
)
.
sex
(
sex
)
.
empNum
(
qyzxEmpLogin
.
getId
())
.
orgCode
(
orgCode
)
.
build
();
ygglMainEmp
.
insert
();
ygglMainEmp
.
insert
();
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
set
(
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
set
(
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
)
.
eq
(
YgglMainEmp:
:
get
OrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
get
Id
,
ygglMainEmp
.
getId
()).
update
();
.
eq
(
YgglMainEmp:
:
getId
,
ygglMainEmp
.
getId
()).
update
();
}
}
return
ResultUtil
.
data
(
ygglMainEmp
,
"新添加员工档案成功!"
);
return
ResultUtil
.
data
(
ygglMainEmp
,
"新添加员工档案成功!"
);
}
else
{
}
else
{
YgglMainEmp
ishad
=
ygglMainEmpMapper
.
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
YgglMainEmp
ishad
=
ygglMainEmpMapper
.
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
()
.
lambda
()
.
eq
(
YgglMainEmp:
:
getPhone
,
phone
).
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
));
.
eq
(
YgglMainEmp:
:
getPhone
,
phone
)
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
));
if
(
ishad
==
null
)
{
if
(
ishad
==
null
)
{
// 添加三张表
// 添加三张表
// 员工权限表(未定)
// 员工权限表(未定)
QyzxEmpEntAsso
.
builder
()
QyzxEmpEntAsso
.
builder
().
empNum
(
login
.
getId
()).
orgCode
(
orgCode
)
.
empNum
(
login
.
getId
())
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
()).
status
(
1
).
build
().
insert
();
// usertype2普通员工
.
orgCode
(
orgCode
)
// status1正常
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
())
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
name
(
name
).
phone
(
phone
).
zjType
(
zjType
).
zjNum
(
zjNum
)
.
status
(
1
)
.
jobType
(
jobType
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
SHIYONG
.
getType
()).
rzTime
(
rzTime
).
syq
(
syq
)
.
build
()
.
sex
(
sex
).
empNum
(
login
.
getId
()).
orgCode
(
orgCode
).
build
();
.
insert
();
// usertype2普通员工
// status1正常
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
()
.
name
(
name
)
.
phone
(
phone
)
.
zjType
(
zjType
)
.
zjNum
(
zjNum
)
.
jobType
(
jobType
)
.
jobStatus
(
YgEnumInterface
.
jobStatus
.
SHIYONG
.
getType
())
.
rzTime
(
rzTime
)
.
syq
(
syq
)
.
sex
(
sex
)
.
empNum
(
login
.
getId
())
.
orgCode
(
orgCode
)
.
build
();
ygglMainEmp
.
insert
();
ygglMainEmp
.
insert
();
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
if
(
addygdaDto
.
getBmgwId
()
!=
null
)
{
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
new
LambdaUpdateChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
)
.
set
(
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
set
(
YgglMainEmp:
:
getBmgwId
,
addygdaDto
.
getBmgwId
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
)
.
eq
(
YgglMainEmp:
:
get
OrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
get
Id
,
ygglMainEmp
.
getId
()).
update
();
.
eq
(
YgglMainEmp:
:
getId
,
ygglMainEmp
.
getId
()).
update
();
}
}
return
ResultUtil
.
data
(
ygglMainEmp
,
"添加员工档案成功!"
);
return
ResultUtil
.
data
(
ygglMainEmp
,
"添加员工档案成功!"
);
}
else
{
}
else
{
...
@@ -526,7 +506,7 @@ public class YgglController {
...
@@ -526,7 +506,7 @@ public class YgglController {
return
ResultUtil
.
data
(
ygglMainEmpPage
,
"员工搜索成功"
);
return
ResultUtil
.
data
(
ygglMainEmpPage
,
"员工搜索成功"
);
// return ResultUtil.data(ygglMainEmpPage, ygglMainEmps, "员工搜索成功");
// return ResultUtil.data(ygglMainEmpPage, ygglMainEmps, "员工搜索成功");
}
}
/**
/**
* 导入员工档案
* 导入员工档案
*/
*/
...
@@ -535,32 +515,27 @@ public class YgglController {
...
@@ -535,32 +515,27 @@ public class YgglController {
@ApiOperationSupport
(
order
=
7
)
@ApiOperationSupport
(
order
=
7
)
public
Result
<
List
<
YgDrjqbDto
>>
importEmpRecord
(
public
Result
<
List
<
YgDrjqbDto
>>
importEmpRecord
(
@CurrentUser
UserBean
userBean
/* ,@Validated @RequestBody List<AddygdaDto> listAddygdaDto */
)
{
@CurrentUser
UserBean
userBean
/* ,@Validated @RequestBody List<AddygdaDto> listAddygdaDto */
)
{
List
<
QyzxEmpLogin
>
listEl
=
qyzxEmpLoginMapper
List
<
QyzxEmpLogin
>
listEl
=
qyzxEmpLoginMapper
.
selectList
(
new
QueryWrapper
<
QyzxEmpLogin
>().
lambda
()
.
selectList
(
new
QueryWrapper
<
QyzxEmpLogin
>().
lambda
().
select
(
QyzxEmpLogin:
:
getPhone
));
.
select
(
QyzxEmpLogin:
:
getPhone
));
listEl
=
listEl
!=
null
?
listEl
.
stream
()
listEl
=
listEl
!=
null
?
listEl
.
stream
()
.
filter
(
o
->
o
!=
null
&&
o
.
getPhone
()
!=
null
).
collect
(
Collectors
.
toList
())
:
null
;
.
filter
(
o
->
o
!=
null
&&
o
.
getPhone
()
!=
null
)
.
collect
(
Collectors
.
toList
())
:
null
;
System
.
out
.
println
(
JSONUtil
.
parseObj
(
listEl
));
System
.
out
.
println
(
JSONUtil
.
parseObj
(
listEl
));
// listEl.stream().filter(predicate)
// listEl.stream().filter(predicate)
// listEl.stream().filter(item -> objId.equals(item.getUpId())).forEach(zzglBmgwM -> {
// listEl.stream().filter(item -> objId.equals(item.getUpId())).forEach(zzglBmgwM -> {
// list.add(zzglBmgwM.getId());
// list.add(zzglBmgwM.getId());
// getDepts(list, zzglBmgwM.getId(), objs);
// getDepts(list, zzglBmgwM.getId(), objs);
// });
// });
//抽取 登录表 的phone的集合
// 抽取 登录表 的phone的集合
List
<
String
>
listPhone
=
listEl
.
stream
()
List
<
String
>
listPhone
=
listEl
.
stream
().
map
(
QyzxEmpLogin:
:
getPhone
).
collect
(
Collectors
.
toList
());
.
map
(
QyzxEmpLogin:
:
getPhone
)
.
collect
(
Collectors
.
toList
());
System
.
out
.
println
(
JSONUtil
.
parseObj
(
listPhone
));
System
.
out
.
println
(
JSONUtil
.
parseObj
(
listPhone
));
listEl
.
stream
().
filter
(
i
->
i
!=
null
).
collect
(
Collectors
.<
QyzxEmpLogin
>
toList
());
listEl
.
stream
().
filter
(
i
->
i
!=
null
).
collect
(
Collectors
.<
QyzxEmpLogin
>
toList
());
return
null
;
return
null
;
}
}
/**
/**
* 导入威力加强版
* 导入威力加强版
*
*
...
@@ -616,8 +591,8 @@ public class YgglController {
...
@@ -616,8 +591,8 @@ public class YgglController {
}
}
// 员工权限表(未定)
// 员工权限表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
// 员工企业关联表和员工档案,员工成长表(未定)
QyzxEmpEntAsso
.
builder
().
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
userBean
.
getOrgCode
())
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
())
QyzxEmpEntAsso
.
builder
().
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
userBean
.
getOrgCode
())
.
status
(
1
).
build
().
insert
();
// userType2普通员工,status1正常
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
()).
status
(
1
).
build
().
insert
();
// userType2普通员工,status1正常
YgglMainEmp
emp
=
YgglMainEmp
.
builder
().
name
(
e
.
getName
()).
phone
(
e
.
getPhone
()).
zjType
(
0
).
zjNum
(
e
.
getZj
())
YgglMainEmp
emp
=
YgglMainEmp
.
builder
().
name
(
e
.
getName
()).
phone
(
e
.
getPhone
()).
zjType
(
0
).
zjNum
(
e
.
getZj
())
.
jobType
(
jobType
).
rzTime
(
rzdate
).
updateTime
(
new
Date
()).
updateMan
(
userBean
.
getEmpNum
()).
syq
(
syq
)
.
jobType
(
jobType
).
rzTime
(
rzdate
).
updateTime
(
new
Date
()).
updateMan
(
userBean
.
getEmpNum
()).
syq
(
syq
)
.
sex
(
sex
).
jobNum
(
jobNum
).
bmgwId
(
gw
).
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
userBean
.
getOrgCode
())
.
sex
(
sex
).
jobNum
(
jobNum
).
bmgwId
(
gw
).
empNum
(
qyzxEmpLogin
.
getId
()).
orgCode
(
userBean
.
getOrgCode
())
...
@@ -635,8 +610,8 @@ public class YgglController {
...
@@ -635,8 +610,8 @@ public class YgglController {
.
eq
(
"phone"
,
e
.
getPhone
()).
eq
(
"org_code"
,
userBean
.
getOrgCode
()));
.
eq
(
"phone"
,
e
.
getPhone
()).
eq
(
"org_code"
,
userBean
.
getOrgCode
()));
if
(
ishad
==
null
)
{
if
(
ishad
==
null
)
{
// 员工权限表(未定)
// 员工权限表(未定)
QyzxEmpEntAsso
.
builder
().
empNum
(
login
.
getId
()).
orgCode
(
userBean
.
getOrgCode
())
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
()).
status
(
1
)
QyzxEmpEntAsso
.
builder
().
empNum
(
login
.
getId
()).
orgCode
(
userBean
.
getOrgCode
())
.
build
().
insert
();
// userType2普通员工,status1正常
.
userType
(
CommonEnum
.
U_TYPE_EMP
.
getType
()).
status
(
1
).
build
().
insert
();
// userType2普通员工,status1正常
YgglMainEmp
emp
=
YgglMainEmp
.
builder
().
name
(
e
.
getName
()).
phone
(
e
.
getPhone
()).
zjType
(
0
)
YgglMainEmp
emp
=
YgglMainEmp
.
builder
().
name
(
e
.
getName
()).
phone
(
e
.
getPhone
()).
zjType
(
0
)
.
zjNum
(
e
.
getZj
()).
jobType
(
jobType
).
rzTime
(
rzdate
).
updateTime
(
new
Date
())
.
zjNum
(
e
.
getZj
()).
jobType
(
jobType
).
rzTime
(
rzdate
).
updateTime
(
new
Date
())
.
updateMan
(
userBean
.
getEmpNum
()).
syq
(
syq
).
sex
(
sex
).
jobNum
(
jobNum
).
empNum
(
login
.
getId
())
.
updateMan
(
userBean
.
getEmpNum
()).
syq
(
syq
).
sex
(
sex
).
jobNum
(
jobNum
).
empNum
(
login
.
getId
())
...
@@ -1625,7 +1600,8 @@ public class YgglController {
...
@@ -1625,7 +1600,8 @@ public class YgglController {
updateWrapper
.
eq
(
"emp_num"
,
empNum
);
updateWrapper
.
eq
(
"emp_num"
,
empNum
);
UpdateWrapper
<
YgglMainLzb
>
updateWrapper1
=
new
UpdateWrapper
<
YgglMainLzb
>();
UpdateWrapper
<
YgglMainLzb
>
updateWrapper1
=
new
UpdateWrapper
<
YgglMainLzb
>();
updateWrapper1
.
eq
(
"emp_num"
,
empNum
);
updateWrapper1
.
eq
(
"emp_num"
,
empNum
);
YgglMainEmp
.
builder
().
empNum
(
lzygQueryDto
.
getEmpNum
()).
jobStatus
(
YgEnumInterface
.
jobStatus
.
LIZHIZHONG
.
getType
()).
build
().
update
(
updateWrapper
);
YgglMainEmp
.
builder
().
empNum
(
lzygQueryDto
.
getEmpNum
()).
jobStatus
(
YgEnumInterface
.
jobStatus
.
LIZHIZHONG
.
getType
())
.
build
().
update
(
updateWrapper
);
YgglMainLzb
.
builder
().
jobStatus
(
YgEnumInterface
.
jobStatus
.
LIZHIZHONG
.
getType
()).
lzTime
(
lzygQueryDto
.
getLzTime
())
YgglMainLzb
.
builder
().
jobStatus
(
YgEnumInterface
.
jobStatus
.
LIZHIZHONG
.
getType
()).
lzTime
(
lzygQueryDto
.
getLzTime
())
.
lzyy
(
lzygQueryDto
.
getLzyy
()).
lzbz
(
lzygQueryDto
.
getLzbz
()).
build
().
update
(
updateWrapper1
);
.
lzyy
(
lzygQueryDto
.
getLzyy
()).
lzbz
(
lzygQueryDto
.
getLzbz
()).
build
().
update
(
updateWrapper1
);
...
@@ -1645,13 +1621,13 @@ public class YgglController {
...
@@ -1645,13 +1621,13 @@ public class YgglController {
Integer
empNum
=
lzygQueryDto
.
getEmpNum
();
Integer
empNum
=
lzygQueryDto
.
getEmpNum
();
// 删除员工档案表
// 删除员工档案表
ygglMainEmpMapper
.
delete
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
));
ygglMainEmpMapper
.
delete
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
));
YgglMainLzb
.
builder
().
empNum
(
empNum
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
()).
sjlzTime
(
new
Date
())
YgglMainLzb
.
builder
().
empNum
(
empNum
).
jobStatus
(
YgEnumInterface
.
jobStatus
.
YILIZHI
.
getType
()).
sjlzTime
(
new
Date
())
.
build
().
update
(
new
UpdateWrapper
<
YgglMainLzb
>().
lambda
().
eq
(
YgglMainLzb:
:
getEmpNum
,
empNum
));
.
build
().
update
(
new
UpdateWrapper
<
YgglMainLzb
>().
lambda
().
eq
(
YgglMainLzb:
:
getEmpNum
,
empNum
));
// 确认离职 删除员工关联表
// 确认离职 删除员工关联表
QyzxEmpEntAsso
.
builder
().
empNum
(
lzygQueryDto
.
getEmpNum
()).
build
()
QyzxEmpEntAsso
.
builder
().
empNum
(
lzygQueryDto
.
getEmpNum
()).
build
()
.
delete
(
new
QueryWrapper
<
QyzxEmpEntAsso
>().
lambda
().
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
empNum
));
.
delete
(
new
QueryWrapper
<
QyzxEmpEntAsso
>().
lambda
().
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
empNum
));
// 初始化 部门主管
// 初始化 部门主管
zzglBmgwMMapper
.
update
(
ZzglBmgwM
.
builder
().
leader
(
null
).
build
(),
zzglBmgwMMapper
.
update
(
ZzglBmgwM
.
builder
().
leader
(
null
).
build
(),
...
...
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
View file @
2ae17a30
package
cn
.
timer
.
api
.
controller
.
zzgl
;
package
cn
.
timer
.
api
.
controller
.
zzgl
;
import
java.lang.reflect.Type
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.transaction.Transactional
;
import
javax.transaction.Transactional
;
...
@@ -27,11 +22,7 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp
...
@@ -27,11 +22,7 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.ValueProvider
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeNode
;
...
@@ -114,14 +105,14 @@ public class ZzglController {
...
@@ -114,14 +105,14 @@ public class ZzglController {
// treeNodeConfig.setDeep(10);
// treeNodeConfig.setDeep(10);
//转换器
//转换器
List
<
Tree
<
String
>>
treeNodes
=
TreeUtil
.
build
(
nodeList
,
"0"
,
treeNodeConfig
,
List
<
Tree
<
String
>>
treeNodes
=
TreeUtil
.
build
(
zzglBmgwMs
,
"0"
,
treeNodeConfig
,
(
treeNode
,
tree
)
->
{
(
treeNode
,
tree
)
->
{
tree
.
setId
(
treeNode
.
getId
(
));
tree
.
setId
(
Convert
.
toStr
(
treeNode
.
getId
()
));
tree
.
setParentId
(
treeNode
.
getParentId
(
));
tree
.
setParentId
(
Convert
.
toStr
(
treeNode
.
getUpId
()
));
tree
.
setWeight
(
treeNode
.
getWeight
());
//
tree.setWeight(treeNode.getWeight());
tree
.
setName
(
treeNode
.
getName
());
tree
.
setName
(
treeNode
.
getName
());
// 扩展属性 ...
// 扩展属性 ...
// tree.putExtra("extraField", 666
);
tree
.
putExtra
(
"leader"
,
treeNode
.
getLeader
()
);
// tree.putExtra("other", new Object());
// tree.putExtra("other", new Object());
});
});
...
...
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