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
b9902faf
Commit
b9902faf
authored
Feb 26, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
d5b09a95
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
10 deletions
+14
-10
WorkTypeService.java
...e/src/main/java/cn/wisenergy/service/WorkTypeService.java
+1
-1
WorkHolidayServiceImpl.java
...ava/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
+1
-1
WorkTimeOrderServiceImpl.java
...a/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
+8
-6
WorkTypeServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
+4
-2
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/WorkTypeService.java
View file @
b9902faf
...
...
@@ -10,7 +10,7 @@ import java.util.List;
*/
public
interface
WorkTypeService
{
List
<
WorkType
>
getAll
();
List
<
WorkType
>
getAll
(
Integer
isSort
);
List
<
Integer
>
getIdByReviewer
(
Integer
reviewer
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkHolidayServiceImpl.java
View file @
b9902faf
...
...
@@ -153,7 +153,7 @@ public class WorkHolidayServiceImpl implements WorkHolidayService {
List
<
WorkHoliday
>
workHolidays
=
workHolidayMapper
.
getByTypeAndStartDate
(
new
Date
());
WorkSubmitAdopt
submitAdopt
=
workSubmitAdoptService
.
getById
(
1
);
holidayAndAutoDto
.
setWorkHolidays
(
workHolidays
).
setWorkSubmitAdopt
(
submitAdopt
);
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
(
null
);
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
holidayAndAutoDto
.
setWorkTypes
(
workTypes
);
}
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTimeOrderServiceImpl.java
View file @
b9902faf
...
...
@@ -30,6 +30,8 @@ import org.springframework.util.StringUtils;
import
java.util.*
;
import
static
java
.
util
.
Collections
.*;
/**
* <p>
* 服务实现类
...
...
@@ -146,7 +148,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
reason
.
append
(
workProjectService
.
getById
(
wto
.
getProjectId
()).
getProjectName
()).
append
(
":"
).
append
(
wto
.
getReason
()).
append
(
";"
);
}
if
(!
typeIds
.
contains
(
wto
.
getType
()))
{
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
(
null
);
if
(!
CollectionUtils
.
isEmpty
(
workTimeOrders
))
{
for
(
WorkType
value
:
workTypes
)
{
if
(
value
.
getId
().
equals
(
wto
.
getType
()))
{
...
...
@@ -526,7 +528,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
ProjectsDto
projectsDto
=
new
ProjectsDto
();
WorkUser
user
=
workUserService
.
getById
(
userId
);
// 1.获取可填报的类型
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
(
1
);
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
projectsDto
.
setWorkTypes
(
workTypes
);
}
...
...
@@ -599,7 +601,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
}
}
}
Collections
.
sort
(
projectManagerDtos
);
sort
(
projectManagerDtos
);
projectsDto
.
setProjectManagerDto
(
projectManagerDtos
);
return
projectsDto
;
}
...
...
@@ -622,7 +624,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
List
<
WorkProject
>
projects
=
workProjectService
.
getNameByIds
(
projectIds
,
1
);
ProjectInfoDto
projectInfoDto
;
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
(
null
);
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
for
(
WorkType
value
:
workTypes
)
{
projectInfoDto
=
new
ProjectInfoDto
().
setType
(
value
.
getId
()).
setTypeName
(
value
.
getName
()).
setDeptManagerName
(
deptManagerName
);
...
...
@@ -719,7 +721,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
NO_JOIN_EVERY_PROJECT_PLASE_JION
);
}
}
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
(
null
);
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
for
(
WorkType
value
:
workTypes
)
{
if
(
value
.
getReviewer
()
==
2
)
{
...
...
@@ -827,7 +829,7 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
}
private
String
getTypeName
(
Integer
type
)
{
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
();
List
<
WorkType
>
workTypes
=
workTypeService
.
getAll
(
null
);
if
(!
CollectionUtils
.
isEmpty
(
workTypes
))
{
for
(
WorkType
value
:
workTypes
)
{
if
(
value
.
getId
().
equals
(
type
))
{
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkTypeServiceImpl.java
View file @
b9902faf
...
...
@@ -33,13 +33,15 @@ public class WorkTypeServiceImpl implements WorkTypeService {
@Override
public
List
<
WorkType
>
getAll
()
{
public
List
<
WorkType
>
getAll
(
Integer
isSort
)
{
log
.
info
(
"WorkTypeServiceImpl[]getAll[]"
);
List
<
WorkType
>
workTypes
=
workTypeMapper
.
getAll
();
if
(
CollectionUtils
.
isEmpty
(
workTypes
))
{
return
null
;
}
if
(
null
!=
isSort
&&
1
==
isSort
)
{
Collections
.
sort
(
workTypes
);
}
return
workTypes
;
}
...
...
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