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
86fdf3e2
Commit
86fdf3e2
authored
Apr 27, 2020
by
东州 翁
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加获取登录人和上级主管的empNum和名称
parent
bbdafffe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
13 deletions
+87
-13
src/main/java/cn/timer/api/bean/yggl/YgglMainEmp.java
+4
-0
src/main/java/cn/timer/api/bean/zzgl/ZzglBmgwM.java
+20
-0
src/main/java/cn/timer/api/controller/yggl/YgglController.java
+60
-6
src/main/java/cn/timer/api/dto/yggl/LoginerChargeDto.java
+3
-7
No files found.
src/main/java/cn/timer/api/bean/yggl/YgglMainEmp.java
View file @
86fdf3e2
...
...
@@ -194,4 +194,7 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@Transient
@TableField
(
exist
=
false
)
private
String
error
;
//错误信息提示
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/zzgl/ZzglBmgwM.java
View file @
86fdf3e2
...
...
@@ -10,6 +10,7 @@ import javax.persistence.GeneratedValue;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.alibaba.druid.sql.ast.expr.SQLCaseExpr.Item
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
...
...
@@ -99,4 +100,22 @@ public class ZzglBmgwM extends Model<ZzglBmgwM> {
});
}
}
// 遍历,获取该员工所有上级部门(weng)
public
static
void
getUpDepts
(
ArrayList
<
Integer
>
list
,
Integer
objId
,
List
<
ZzglBmgwM
>
objs
)
{
//7290
if
(
objId
!=
null
)
{
for
(
ZzglBmgwM
bmgw
:
objs
)
{
Integer
bmgwId
=
bmgw
.
getId
();
Integer
upId
=
bmgw
.
getUpId
();
if
(
bmgwId
.
equals
(
objId
))
{
list
.
add
(
bmgwId
);
if
(
upId
!=
null
)
{
getUpDepts
(
list
,
upId
,
objs
);
}
}
}
}
}
}
\ No newline at end of file
src/main/java/cn/timer/api/controller/yggl/YgglController.java
View file @
86fdf3e2
...
...
@@ -8,7 +8,8 @@ package cn.timer.api.controller.yggl;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Iterator
;
...
...
@@ -162,14 +163,67 @@ public class YgglController {
*/
@GetMapping
(
value
=
"/loginerChargers"
)
@ApiOperation
(
value
=
" 获取登录人和上级主管的empNum和名称"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
68
)
public
Result
<
LoginerChargeDto
>
loginerChargers
(
@CurrentUser
UserBean
userBean
)
{
@ApiOperationSupport
(
order
=
69
)
public
Result
<
List
<
LoginerChargeDto
>>
loginerChargers
(
@CurrentUser
UserBean
userBean
)
{
Integer
orgCode
=
userBean
.
getOrgCode
();
ArrayList
<
Integer
>
list
=
new
ArrayList
<
Integer
>();
Integer
empNum
=
userBean
.
getEmpNum
();
List
<
LoginerChargeDto
>
loginerCharges
=
new
ArrayList
<
LoginerChargeDto
>();
Integer
gw
=
empNumConfirm
(
orgCode
,
empNum
).
getBmgwId
();
List
<
ZzglBmgwM
>
zzglBmgwMs
=
new
LambdaQueryChainWrapper
<
ZzglBmgwM
>(
zzglBmgwMMapper
).
eq
(
ZzglBmgwM:
:
getOrgCode
,
orgCode
).
list
();
//获取该员工的上级部门id 的数组list
ZzglBmgwM
.
getUpDepts
(
list
,
gw
,
zzglBmgwMs
);
List
<
Integer
>
leaderList
=
new
ArrayList
<
Integer
>();
for
(
Integer
zzglId
:
list
)
{
for
(
ZzglBmgwM
zzglBmgwM
:
zzglBmgwMs
)
{
if
(
zzglId
.
equals
(
zzglBmgwM
.
getId
())
&&
zzglBmgwM
.
getLeader
()!=
null
)
{
leaderList
.
add
(
zzglBmgwM
.
getLeader
());
}
}
}
List
<
YgglMainEmp
>
ygglMainEmps
=
empNumsConfirm
(
orgCode
,
leaderList
);
List
<
LoginerChargeDto
>
loginerChargeDtos
=
new
ArrayList
<
LoginerChargeDto
>();
for
(
YgglMainEmp
m
:
ygglMainEmps
)
{
loginerChargeDtos
.
add
(
new
LoginerChargeDto
(
m
.
getEmpNum
(),
m
.
getName
()));
}
Collections
.
reverse
(
loginerChargeDtos
);
return
ResultUtil
.
data
(
loginerChargeDtos
,
"获取上级部门的部门id"
);
}
//根据传来的empNum获取该人员信息,没有则传全部
public
List
<
YgglMainEmp
>
empNumsConfirm
(
Integer
orgCode
,
List
<
Integer
>
empNumList
)
{
List
<
YgglMainEmp
>
all
=
new
LambdaQueryChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
).
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
list
();
List
<
YgglMainEmp
>
ygglMainEmps
=
new
ArrayList
<
YgglMainEmp
>();
if
(
empNumList
.
size
()!=
0
)
{
for
(
Integer
empNum
:
empNumList
)
{
all
.
stream
().
filter
(
item
->
empNum
.
equals
(
item
.
getEmpNum
())).
forEach
(
action
->{
ygglMainEmps
.
add
(
action
);
});
}
}
else
{
ygglMainEmps
.
addAll
(
all
);
}
return
ResultUtil
.
error
(
"获取登录人和上级主管的empNum和名称失败"
);
return
ygglMainEmps
;
}
//根据传来的empNum获取该人员信息
public
YgglMainEmp
empNumConfirm
(
Integer
orgCode
,
Integer
empNum
)
{
YgglMainEmp
one
=
new
LambdaQueryChainWrapper
<
YgglMainEmp
>(
ygglMainEmpMapper
).
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
).
one
();
return
one
;
}
/**
* 获取企业到期时间和版本
*
* @param
* @return
*/
@GetMapping
(
value
=
"/endtimeVersion"
)
@ApiOperation
(
value
=
"获取企业到期时间和版本"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
70
)
public
Result
<
YgglMainEmp
>
endtimeVersion
(
@CurrentUser
UserBean
userBean
)
{
return
ResultUtil
.
error
();
}
/**
* 获取员工档案
*
...
...
src/main/java/cn/timer/api/dto/yggl/LoginerChargeDto.java
View file @
86fdf3e2
...
...
@@ -32,15 +32,11 @@ public class LoginerChargeDto implements Serializable{
*/
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"员工empNum"
,
example
=
"9688"
)
private
Integer
empNum
;
@ApiModelProperty
(
value
=
"上级主管empNum"
,
example
=
"000"
)
private
Integer
upEmpNum
;
@ApiModelProperty
(
value
=
"主管empNum"
,
example
=
"9688"
)
private
Integer
leaderEmpNum
;
@ApiModelProperty
(
value
=
"主管名称"
,
example
=
"李大力"
)
private
String
charge
;
@ApiModelProperty
(
value
=
"上级主管"
,
example
=
""
)
private
LoginerChargeDto
loginerChargeDto
;
}
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