Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
7824150b
Commit
7824150b
authored
Jan 29, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
2d1c60c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
36 deletions
+11
-36
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+11
-36
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
7824150b
...
...
@@ -283,16 +283,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
2
==
dto
.
getStatus
()
||
5
==
dto
.
getStatus
())
{
continue
;
}
/*// 修改
if (null != dto.getWorkId()) {
workTimeOrderMapper.updateToNull(dto.getWorkId());
workTimeOrderMapper.updateById(workTimeOrder);
}
// 插入
if (null == dto.getWorkId() || 0 == dto.getWorkId()) {
workTimeOrderMapper.save(workTimeOrder);
dto.setWorkId(workTimeOrder.getWorkId());
}*/
BeanUtils
.
copyProperties
(
workTimeOrder
,
dto
);
addList
.
add
(
workTimeOrder
);
}
...
...
@@ -675,14 +666,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
return
projectList
;
}
// project转ProjectDto
private
ProjectDto
projectToProjectDto
(
WorkProject
workProject
)
{
ProjectDto
projectDto
=
new
ProjectDto
();
BeanUtils
.
copyProperties
(
workProject
,
projectDto
);
// 获取项目管理
projectDto
.
setManagerName
(
workUserService
.
getById
(
workProject
.
getManagerId
()).
getName
());
return
projectDto
;
}
// workTimeOrder TO WorkTimeOrderDto
public
List
<
WorkTimeOrderDto
>
wtoToWtod
(
List
<
WorkTimeOrder
>
workTimeOrders
)
{
...
...
@@ -740,8 +724,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
null
==
dto
.
getWorkTime
()
||
0
==
dto
.
getWorkTime
())
{
size
++;
}
if
(
1
==
dto
.
getType
()
||
2
==
dto
.
getType
()
&&
null
==
dto
.
getProjectId
())
{
size
++;
if
(
1
==
dto
.
getType
()
||
2
==
dto
.
getType
())
{
if
(
null
==
dto
.
getProjectId
())
size
++;
}
if
(
null
==
dto
.
getDes
()
||
""
.
equals
(
dto
.
getDes
()))
{
size
++;
...
...
@@ -762,8 +747,9 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if
(
thanDate
(
dto
.
getWorkDay
()))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_TIME_OVER_NOW_DAY
);
}
if
(
1
==
dto
.
getType
()
||
2
==
dto
.
getType
()
&&
null
==
dto
.
getProjectId
())
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
NO_JOIN_EVERY_PROJECT_PLASE_JION
);
if
(
1
==
dto
.
getType
()
||
2
==
dto
.
getType
())
{
if
(
null
==
dto
.
getProjectId
())
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
WORK_TIME_OVER_NOW_DAY
);
}
for
(
ProjectTypeEnum
value
:
ProjectTypeEnum
.
values
())
{
if
(
value
.
getReviewer
()
==
2
)
{
...
...
@@ -853,7 +839,8 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
// 获取用户名
dto
.
setUserName
(
workUserService
.
getById
(
dto
.
getUserId
()).
getName
());
// 获取项目名
if
((
PROJECT
.
equals
(
dto
.
getType
())
||
BUSINESS_OPPORTUNITY
.
equals
(
dto
.
getType
()))
&&
null
==
dto
.
getProjectId
())
{
if
((
PROJECT
.
equals
(
dto
.
getType
())
||
BUSINESS_OPPORTUNITY
.
equals
(
dto
.
getType
()))
)
{
if
(
null
==
dto
.
getProjectId
())
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
NO_JOIN_EVERY_PROJECT_PLASE_JION
);
}
dto
.
setProjectName
(
null
!=
dto
.
getProjectId
()
?
workProjectService
.
getById
(
dto
.
getProjectId
()).
getProjectName
()
:
getTypeName
(
dto
.
getType
()));
...
...
@@ -937,25 +924,13 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
}
}
for
(
WorkProject
workProject
:
workProjects
)
{
if
(
null
!=
workTimeOrderDto
.
getProjectId
()&&
workTimeOrderDto
.
getProjectId
().
equals
(
workProject
.
getId
()))
{
if
(
null
!=
workTimeOrderDto
.
getProjectId
()
&&
workTimeOrderDto
.
getProjectId
().
equals
(
workProject
.
getId
()))
{
workTimeOrderDto
.
setProjectName
(
workProject
.
getProjectName
());
}
}
workTimeOrderDto
.
setTypeName
(
getTypeName
(
workTimeOrderDto
.
getType
()));
workTimeOrderDtos
.
add
(
workTimeOrderDto
);
}
/* for (WorkTimeOrder workTimeOrder : workTimeOrders) {
WorkTimeOrderDto workTimeOrderDto = new WorkTimeOrderDto();
BeanUtils.copyProperties(workTimeOrder, workTimeOrderDto);
workTimeOrderDto.setUserName(workUserService.getById(workTimeOrder.getUserId()).getName());
if (null != workTimeOrder.getProjectId()) {
workTimeOrderDto.setProjectName(workProjectService.getById(workTimeOrder.getProjectId()).getProjectName());
}
workTimeOrderDto.setTypeName(getTypeName(workTimeOrderDto.getType()));
workTimeOrderDtos.add(workTimeOrderDto);
}*/
return
new
PageInfo
<>(
workTimeOrderDtos
);
}
...
...
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