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
5d7e19ff
Commit
5d7e19ff
authored
Mar 06, 2021
by
nie'hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善工时统计
parent
71731c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
StatisticsServiceImpl.java
...java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
+10
-11
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/impl/StatisticsServiceImpl.java
View file @
5d7e19ff
...
...
@@ -572,11 +572,13 @@ public class StatisticsServiceImpl implements StatisticsService {
// 所有项目的统计
map
.
put
(
"isAll"
,
false
);
userProjectWorkTimeStatistics
=
workTimeOrderMapper
.
getUserProjectWorkTimeStatistics
(
map
);
// 给返回前端的数据补全所有项目
if
(
CollectionUtil
.
isNotEmpty
(
projects
))
{
// 如果查询所有项目的统计为空,给集合里添加个元素
if
(
CollectionUtil
.
isEmpty
(
userProjectWorkTimeStatistics
))
{
UserWorkTimeStatisticsByProject
userWorkTimeStatisticsByProject
=
new
UserWorkTimeStatisticsByProject
();
userWorkTimeStatisticsByProject
.
setUserName
(
"合计"
);
List
<
ProjectWorkTimeAndType
>
projectWorkTimeAndTypes
=
new
ArrayList
<>();
userWorkTimeStatisticsByProject
.
setProjectWorkTimeAndType
(
projectWorkTimeAndTypes
);
userProjectWorkTimeStatistics
.
add
(
userWorkTimeStatisticsByProject
);
...
...
@@ -636,9 +638,6 @@ public class StatisticsServiceImpl implements StatisticsService {
}
// 缺少类型,造对象传前端
UserWorkTimeStatisticsByProject
userWorkTimeStatisticsByProject1
=
new
UserWorkTimeStatisticsByProject
();
List
<
ProjectWorkTimeAndType
>
projectWorkTimeAndTypes
=
new
ArrayList
<>();
...
...
@@ -803,12 +802,9 @@ public class StatisticsServiceImpl implements StatisticsService {
}
}
// 将查询结果封装在一起,部门主键为空,项目总计在前,否则在后
if
(
deptId
==
null
)
{
projectStatisticsByMonths
.
addAll
(
projectStatisticsByMonths1
);
}
else
{
projectStatisticsByMonths
.
addAll
(
0
,
projectStatisticsByMonths1
);
}
// 将查询结果封装在一起
projectStatisticsByMonths
.
addAll
(
0
,
projectStatisticsByMonths1
);
List
<
String
>
yearMonthList
=
new
ArrayList
<>();
if
(
projectId
!=
null
)
{
// 整个项目所占时间,未结项目截止时间为当月,已结项目截止时间为最后一次统计的时间
...
...
@@ -946,7 +942,10 @@ public class StatisticsServiceImpl implements StatisticsService {
for
(
int
i
=
0
;
i
<
yearMonthList
.
size
();
i
++)
{
String
s
=
yearMonthList
.
get
(
i
);
String
date
=
statisticsDateAndWorkTimes
.
get
(
i
).
getDate
();
String
date
=
""
;
if
(
i
<
statisticsDateAndWorkTimes
.
size
())
{
date
=
statisticsDateAndWorkTimes
.
get
(
i
).
getDate
();
}
if
(!
s
.
equals
(
date
))
{
ProjectStatisticsByMonth
.
StatisticsDateAndWorkTime
statisticsDateAndWorkTime
=
new
ProjectStatisticsByMonth
.
StatisticsDateAndWorkTime
();
statisticsDateAndWorkTime
.
setDate
(
s
);
...
...
@@ -959,7 +958,7 @@ public class StatisticsServiceImpl implements StatisticsService {
try
{
parse
=
format
.
parse
(
s
);
if
(
DateUtil
.
getMonth
(
parse
)
!=
1
&&
i
!=
0
)
{
String
s1
=
yearMonthList
.
get
(
i
);
String
s1
=
yearMonthList
.
get
(
i
-
1
);
String
substring
=
s1
.
substring
(
5
);
statisticsDateAndWorkTimes
.
get
(
i
).
setDate
(
substring
);
}
...
...
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