Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
work_service
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
licc
work_service
Commits
42b3925f
Commit
42b3925f
authored
Mar 08, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
12d60b59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+23
-11
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
42b3925f
...
...
@@ -226,8 +226,11 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
dto
.
setManagerName
(
workUserService
.
getById
(
workProjectService
.
getById
(
dto
.
getProjectId
()).
getManagerId
()).
getName
());
}
if
(!
typeIds
.
contains
(
type
))
{
/* dto.setManagerName(workUserService.getById(workTypeManagerService.getByDeptId(workUserService.getById(dto.getUserId()).getDeptId()).get(0).getManagerId()).getName());*/
dto
.
setManagerName
(
workUserService
.
getById
(
workDeptService
.
getById
(
user
.
getDeptId
()).
getDeptManagerId
()).
getName
());
Integer
deptManagerId
=
workDeptService
.
getById
(
user
.
getDeptId
()).
getDeptManagerId
();
if
(
null
!=
deptManagerId
)
{
dto
.
setManagerName
(
workUserService
.
getById
(
deptManagerId
).
getName
());
}
}
}
// 设置状态
...
...
@@ -420,8 +423,10 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
approvalDto
.
getWorkDay
().
compareTo
(
workTimeOrder
.
getWorkDay
())
==
0
)
{
WorkTimeOrderDto
workTimeOrderDto
=
new
WorkTimeOrderDto
();
BeanUtils
.
copyProperties
(
workTimeOrder
,
workTimeOrderDto
);
/* workTimeOrderDto.setManagerName(workUserService.getById(workTypeManagerService.getByDeptId(workTimeOrder.getDeptId()).get(0).getManagerId()).getName());*/
workTimeOrderDto
.
setManagerName
(
workUserService
.
getById
(
workDeptService
.
getById
(
user
.
getDeptId
()).
getDeptManagerId
()).
getName
());
Integer
deptManagerId
=
workDeptService
.
getById
(
user
.
getDeptId
()).
getDeptManagerId
();
if
(
null
!=
deptManagerId
)
{
workTimeOrderDto
.
setManagerName
(
workUserService
.
getById
(
deptManagerId
).
getName
());
}
workTimeOrderDto
.
setUserName
(
workUserService
.
getById
(
workTimeOrderDto
.
getUserId
()).
getName
());
if
(!
CollectionUtils
.
isEmpty
(
typeIds
))
{
if
(
typeIds
.
contains
(
workTimeOrder
.
getType
()))
{
...
...
@@ -643,8 +648,11 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
// 1.获取当前用户的部门管理
Integer
deptId
=
workUserService
.
getById
(
userId
).
getDeptId
();
String
deptManagerName
=
workUserService
.
getById
(
workDeptService
.
getById
(
deptId
).
getDeptManagerId
()).
getName
();
Integer
deptManagerId
=
workDeptService
.
getById
(
deptId
).
getDeptManagerId
();
String
deptManagerName
=
null
;
if
(
null
!=
deptManagerId
)
{
deptManagerName
=
workUserService
.
getById
(
workDeptService
.
getById
(
deptId
).
getDeptManagerId
()).
getName
();
}
// 2.获取可填报的类型
List
<
ProjectInfoDto
>
projectList
=
new
ArrayList
<>();
// 3.获取正在进行中的项目/商机
...
...
@@ -689,8 +697,11 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
WorkTimeOrderDto
dto
=
new
WorkTimeOrderDto
();
BeanUtils
.
copyProperties
(
workTimeOrder
,
dto
);
dto
.
setUserName
(
workUserService
.
getById
(
workTimeOrder
.
getUserId
()).
getName
());
/*dto.setManagerName(workUserService.getById(workTypeManagerService.getByDeptId(workTimeOrder.getDeptId()).get(0).getManagerId()).getName());*/
dto
.
setManagerName
(
workUserService
.
getById
(
workDeptService
.
getById
(
user
.
getDeptId
()).
getDeptManagerId
()).
getName
());
Integer
deptManagerId
=
workDeptService
.
getById
(
user
.
getDeptId
()).
getDeptManagerId
();
if
(
null
!=
deptManagerId
)
{
dto
.
setManagerName
(
workUserService
.
getById
(
deptManagerId
).
getName
());
}
if
(!
CollectionUtils
.
isEmpty
(
typeIds
))
{
if
(
typeIds
.
contains
(
workTimeOrder
.
getType
()))
{
dto
.
setProjectName
(
workProjectService
.
getById
(
workTimeOrder
.
getProjectId
()).
getProjectName
());
...
...
@@ -839,9 +850,10 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
WorkProject
workProject
=
workProjectService
.
getById
(
wto
.
getProjectId
());
return
workProject
!=
null
?
workUserService
.
getById
(
workProject
.
getManagerId
()).
getName
()
:
""
;
}
else
{
return
workUserService
.
getById
(
workDeptService
.
getById
(
wto
.
getDeptId
()).
getDeptManagerId
())
.
getName
();
Integer
deptManagerId
=
workDeptService
.
getById
(
wto
.
getDeptId
()).
getDeptManagerId
();
if
(
null
!=
deptManagerId
)
{
return
workUserService
.
getById
(
deptManagerId
).
getName
();
}
}
}
return
null
;
...
...
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